/* ==========================================================================
   MediBloom - blog theme styles
   Loaded by functions.php: get_template_directory_uri() . '/css/style.css'

   Palette (from main /css/styles.css):
     #C09B7E - accent (sand)
     #3D5A61 - dark teal (headings)
     #6B8891 - muted teal (meta)
     #EDE2D8 - border
     #F6F1ED - card background
     #2C2D2D - body text
   ========================================================================== */

/* ---------- Reset browser default link styles ---------- */
.sidebar_blog a,
.mb-author a {
    text-decoration: none;
    color: inherit;
}


/* ==========================================================================
   RELATED POSTS - 2x2 GRID
   --------------------------------------------------------------------------
   High specificity (body .sidebar_blog ...) plus !important is intentional:
   the main /css/styles.css sets `.blog_page .sidebar_blog { width: 100% }`
   and legacy rules for .sidebar_article. Without the extra weight the grid
   loses and cards stretch full width.
   ========================================================================== */

body .blog_page .sidebar_blog,
body .sidebar_blog {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 100%;
}

/* Heading spans the full row */
body .sidebar_blog .article_sidebar_title {
    grid-column: 1 / -1;
    margin-bottom: 4px;
}

/* ---------- Card ---------- */
body .sidebar_blog .sidebar_article {
    display: flex !important;
    flex-direction: column;
    width: auto !important;
    height: 100%;
    margin: 0 !important;
    border: 1px solid #EDE2D8;
    border-radius: 12px;
    background: #FFFFFF;
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}

body .sidebar_blog .sidebar_article:hover {
    border-color: #C09B7E;
    box-shadow: 0 6px 22px rgba(44, 45, 45, .10);
    transform: translateY(-2px);
}

body .sidebar_blog .sidebar_article > a {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    text-decoration: none;
}

/* ---------- Image: compact, fixed 16:10 frame ---------- */
body .sidebar_blog .sidebar_article_image {
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: 190px;
    overflow: hidden;
    background: #F6F1ED;
    flex: 0 0 auto;
}

body .sidebar_blog .sidebar_article_image img {
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

body .sidebar_blog .sidebar_article:hover .sidebar_article_image img {
    transform: scale(1.05);
}

/* ---------- Card text ---------- */
body .sidebar_blog .sidebar_article_descr {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 16px;
}

body .sidebar_blog .sidebar_article_descr h4 {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 600;
    color: #3D5A61;
    transition: color .2s ease;
}

body .sidebar_blog .sidebar_article:hover .sidebar_article_descr h4 {
    color: #C09B7E;
}

/* ---------- Meta: category + date (pinned to card bottom) ---------- */
body .sidebar_blog .sidebar_info {
    margin-top: auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    line-height: 1.4;
}

body .sidebar_blog .sidebar_chapter,
body .sidebar_blog .sidebar_chapter a {
    color: #C09B7E;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s ease;
}

body .sidebar_blog .sidebar_chapter a:hover {
    opacity: .7;
}

/* Dot separator */
body .sidebar_blog .sidebar_date {
    position: relative;
    padding-left: 12px;
    color: #6B8891;
}

body .sidebar_blog .sidebar_date::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 50%;
    background: #C09B7E;
    opacity: .6;
}


/* ==========================================================================
   AUTHOR / MEDICAL REVIEWER BLOCK
   ========================================================================== */

.mb-author {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 44px;
    padding: 24px;
    border: 1px solid #EDE2D8;
    border-radius: 12px;
    background: #F6F1ED;
}

.mb-author__photo {
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #FFFFFF;
}

.mb-author__label {
    font-size: 12.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #C09B7E;
    font-weight: 600;
    margin-bottom: 6px;
}

.mb-author__name {
    font-size: 19px;
    font-weight: 600;
    color: #3D5A61;
    margin-bottom: 3px;
}

.mb-author__role {
    font-size: 14.5px;
    color: #6B8891;
    margin-bottom: 10px;
}

.mb-author__bio {
    font-size: 15px;
    line-height: 1.65;
    color: #2C2D2D;
    margin-bottom: 12px;
}

.mb-author__link {
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    color: #C09B7E;
    text-decoration: none;
    border-bottom: 1px solid rgba(192, 155, 126, .4);
    padding-bottom: 1px;
    transition: border-color .2s ease;
}

.mb-author__link:hover {
    border-bottom-color: #C09B7E;
}


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    body .blog_page .sidebar_blog,
    body .sidebar_blog {
        gap: 16px;
    }

    body .sidebar_blog .sidebar_article_image {
        max-height: 150px;
    }

    body .sidebar_blog .sidebar_article_descr {
        padding: 12px 14px 14px;
    }

    body .sidebar_blog .sidebar_article_descr h4 {
        font-size: 15px;
    }
}

/* Mobile: single column */
@media (max-width: 600px) {
    body .blog_page .sidebar_blog,
    body .sidebar_blog {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    body .sidebar_blog .sidebar_article_image {
        max-height: 200px;
    }

    body .sidebar_blog .sidebar_info {
        font-size: 12.5px;
    }
}

/* Author block */
@media (max-width: 768px) {
    .mb-author {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 22px 18px;
        gap: 14px;
    }

    .mb-author__photo {
        flex: 0 0 76px;
        width: 76px;
        height: 76px;
    }
}

/* ==========================================================================
   Контекстні посилання та телефони в тілі статті
   --------------------------------------------------------------------------
   Було: дефолтний браузерний <a> — синій, потім фіолетовий після відвідування.
   На бежево-сірій палітрі MediBloom це виглядало чужорідно.
   Стало: фірмовий колір #4a6169 + теракотове підкреслення, що потовщується
   при наведенні. Telephone-посилання — без підкреслення, пунктиром.
   ========================================================================== */
.blog_page_text p a,
.blog_page_text li a,
.blog_page_text td a {
    color: #4a6169;
    font-weight: 600;
    text-decoration: none;
    background-image: linear-gradient(#b98a6d, #b98a6d);
    background-repeat: no-repeat;
    background-size: 100% 1px;
    background-position: 0 100%;
    padding-bottom: 1px;
    transition: background-size .22s ease, color .22s ease;
}

.blog_page_text p a:hover,
.blog_page_text li a:hover,
.blog_page_text td a:hover {
    color: #b98a6d;
    background-size: 100% 2px;
}

/* Прибираємо фіолетовий "visited" */
.blog_page_text p a:visited,
.blog_page_text li a:visited,
.blog_page_text td a:visited { color: #4a6169; }

/* Телефон — не переносимо, пунктирне підкреслення */
.blog_page_text a[href^="tel:"] {
    background-image: none;
    border-bottom: 1px dashed rgba(185,138,109,.55);
    color: #4a6169;
    font-weight: 700;
    white-space: nowrap;
}

.blog_page_text a[href^="tel:"]:hover {
    color: #b98a6d;
    border-bottom-color: #b98a6d;
}
