/* ============================================================
   InfoNest — Public Site Stylesheet
   Mobile-first, AdSense-compliant, clean layout
   ============================================================ */

:root {
    --primary:    #2563eb;
    --text:       #1e293b;
    --text-light: #64748b;
    --bg:         #f8fafc;
    --white:      #ffffff;
    --border:     #e2e8f0;
    --radius:     8px;
    --shadow:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --font-sans:  'Inter', system-ui, sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;
    --max-w:      1140px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1rem; }

/* ===== AD LEADERBOARD (top of page) ===== */
.ad-leaderboard {
    background: #f1f5f9;
    text-align: center;
    padding: .5rem;
    min-height: 50px;    /* reserve space so page doesn't jump */
    border-bottom: 1px solid var(--border);
}
.ad-leaderboard:empty { display: none; }

/* ===== HEADER ===== */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: none;
    transition: box-shadow .6s ease;
}
.site-header.scrolled {
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 74px;
    gap: 1rem;
}

.logo {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    text-decoration: none;
    flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo img     { height: 64px; width: auto; display: block; transition: height .6s ease; }
.scrolled .logo img { height: 52px; }
.logo-text    { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.logo-tagline { font-size: .7rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }

.main-nav ul  { list-style: none; display: flex; gap: .25rem; flex-wrap: wrap; }
.main-nav a   { padding: .4rem .75rem; border-radius: var(--radius); font-size: .9rem; color: var(--text); font-weight: 500; }
.main-nav a:hover { background: #f1f5f9; text-decoration: none; }

.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: .25rem; }

/* ===== MAIN CONTENT AREA ===== */
.site-main { padding: 2rem 1rem; }

/* ===== FEATURED / HERO POST ===== */
.featured-post {
    margin-bottom: 2.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow);
}
.featured-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.featured-link:hover { text-decoration: none; }
.featured-img-wrap img { width: 100%; height: 380px; object-fit: cover; border-radius: 0; }
.featured-meta { padding: 1.5rem 2rem 2rem; }
.featured-title {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.3;
    margin: .75rem 0 .5rem;
    color: var(--text);
}
.featured-excerpt { color: var(--text-light); margin-bottom: .75rem; }
.featured-date    { font-size: .8rem; color: var(--text-light); }

/* ===== CATEGORY BADGE ===== */
.cat-badge {
    display: inline-block;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .2rem .6rem;
    border-radius: 4px;
    text-decoration: none;
}

/* ===== SECTION HEADING ===== */
.section-heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

/* ===== POST CARDS GRID ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s;
}
.post-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }

.card-img-link img { width: 100%; height: 200px; object-fit: cover; border-radius: 0; }

.card-body      { padding: 1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.card-title     { font-size: 1rem; font-weight: 600; line-height: 1.4; }
.card-title a   { color: var(--text); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-excerpt   { font-size: .875rem; color: var(--text-light); flex: 1; }
.card-meta      { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-date      { font-size: .75rem; color: var(--text-light); }
.card-views     { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; color: var(--text-light); }

/* ===== AD IN-FEED ===== */
.ad-in-feed, .ad-in-grid {
    text-align: center;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}
.ad-in-feed:empty, .ad-in-grid:empty { display: none; }

/* ===== SINGLE POST LAYOUT ===== */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.post-full        { background: var(--white); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.post-title       { font-family: var(--font-serif); font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.3; margin: .75rem 0 .5rem; }
.post-date        { font-size: .8rem; color: var(--text-light); margin-bottom: 1.5rem; }
.post-image       { margin: 1.5rem 0; }
.post-image img   { width: 100%; max-height: 450px; object-fit: cover; }
.post-image figcaption { font-size: .75rem; color: var(--text-light); margin-top: .5rem; text-align: center; }

.post-body        { font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.8; overflow-x: hidden; }
.post-body h2, .post-body h3 { font-family: var(--font-sans); margin: 1.5rem 0 .5rem; }
.post-body p      { margin-bottom: 1rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.post-body a      { color: var(--primary); }
.post-body table  { max-width: 100%; display: block; overflow-x: auto; }
.post-body img    { max-width: 100%; height: auto; }
/* Prevent pasted outer wrappers from overflowing the grid column */
.post-body > article,
.post-body > section,
.post-body > div   { max-width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; box-sizing: border-box; }

.ad-in-article { text-align: center; padding: 1rem; background: #f1f5f9; border-radius: var(--radius); margin: 2rem 0; }
.ad-in-article:empty { display: none; }

/* ===== POST SHARE BAR ===== */
.post-share-bar {
    margin: 1.25rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
}
.post-share-excerpt {
    margin: 0 0 1rem;
    font-size: .88rem;
    color: #475569;
    line-height: 1.6;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.share-btns-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}
.share-label {
    font-size: .72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-right: .25rem;
    white-space: nowrap;
}
.fb-share-btn {
    display: inline-flex;
    align-items: stretch;
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: .83rem;
    font-weight: 700;
    letter-spacing: .02em;
    transition: opacity .15s, transform .15s, box-shadow .15s;
}
.fb-share-btn:hover {
    opacity: .92;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    text-decoration: none;
}
.share-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .55rem .75rem;
}
.share-text-wrap {
    display: flex;
    align-items: center;
    padding: .55rem 1rem .55rem .85rem;
    color: #fff;
}
/* Facebook two-tone */
.fb-share-btn .share-icon-wrap { background: #1461c0; }
.fb-share-btn .share-text-wrap { background: #1877f2; }


/* ===== SIDEBAR ===== */
.sidebar         { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget  { background: var(--white); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.sidebar-widget h3 { font-size: .95rem; font-weight: 700; margin-bottom: .75rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.sidebar-widget p  { font-size: .85rem; margin-bottom: .4rem; }
.sticky-ad       { position: sticky; top: 80px; }
.ad-sidebar:empty { display: none; }

/* ===== RELATED ARTICLES CARDS ===== */
.rc {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .75rem 0;
    border-bottom: 1px solid #f0f4f8;
    text-decoration: none !important;
    color: inherit;
}
.rc:last-of-type { border-bottom: none; }
.rc:hover { text-decoration: none !important; }

.rc-body {
    flex: 1;
    min-width: 0;
}
.rc-title {
    font-size: .82rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.45;
    margin: 0;
    transition: color .15s;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rc:hover .rc-title { color: var(--primary); }

.rc-thumb {
    width: 82px;
    min-width: 82px;
    height: 66px;
    border-radius: 7px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: #e2e8f0;
}
.rc-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    max-width: unset;
}
.rc-color {
    position: absolute;
    inset: 0;
}

/* "More from Health" subtitle under Related Articles heading */
.rc-widget-label {
    font-size: .75rem;
    color: #94a3b8;
    margin: -.4rem 0 .6rem;
    font-weight: 500;
}

/* Visually hidden — stays in DOM for SEO crawlers */
.rc-seo-domain {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ===== AD FOOTER BANNER ===== */
.ad-footer-banner { text-align: center; padding: 1rem; background: #f1f5f9; margin: 1.5rem auto; }
.ad-footer-banner:empty { display: none; }

/* ===== FOOTER ===== */
.site-footer   { background: #1e293b; color: #94a3b8; margin-top: 3rem; padding: 2.5rem 0 0; }
.footer-inner  { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; }
.footer-col h3, .footer-col h4 { color: #f1f5f9; margin-bottom: .75rem; font-size: .9rem; }
.footer-col p  { font-size: .85rem; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a  { color: #94a3b8; font-size: .85rem; }
.footer-col a:hover { color: #f1f5f9; }
.footer-bottom { border-top: 1px solid #334155; margin-top: 2rem; padding: 1rem 0; font-size: .8rem; text-align: center; }

/* ===== CATEGORY PAGE HEADING ===== */
.page-heading { margin-bottom: 1.5rem; }
.page-heading h1 { font-size: 1.75rem; margin-top: .5rem; }

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: .5rem; justify-content: center; margin: 2rem 0; }
.pagination a { padding: .4rem .85rem; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: .9rem; }
.pagination a.active, .pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* ===== 404 / EMPTY STATES ===== */
.no-posts { padding: 2rem; text-align: center; color: var(--text-light); }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .main-nav   { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--white); border-top: 1px solid var(--border); padding: 1rem; box-shadow: 0 4px 8px rgba(0,0,0,.1); }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; }
    .post-layout { grid-template-columns: 1fr; }
    .featured-img-wrap img { height: 220px; }
    .posts-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .footer-inner { grid-template-columns: 1fr; }
}

/* ============================================================
   STAR RATING WIDGET
   ============================================================ */
.rating-widget {
    margin: 2.5rem 0 1rem;
    background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
    border: 1px solid #fde68a;
    border-radius: 14px;
    overflow: hidden;
}

.rating-inner { padding: 1.75rem 2rem; }

.rating-header {
    display: flex;
    align-items: center;
    gap: .85rem;
    margin-bottom: 1.25rem;
}

.rating-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    box-shadow: 0 3px 10px rgba(245,158,11,.35);
}

.rating-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .15rem;
}

.rating-subtitle {
    font-size: .82rem;
    color: #78716c;
}

/* ===== Interactive stars ===== */
.stars-wrap {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-bottom: 1.1rem;
    transition: opacity .2s;
}
.stars-wrap.voted { pointer-events: none; }
.stars-wrap.submitting { opacity: .5; }

.star-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #d1d5db;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    transition: color .15s, transform .15s;
    border-radius: 6px;
}
.star-btn svg { width: 32px; height: 32px; transition: transform .15s; }
.star-btn:hover svg,
.star-btn.hover svg  { transform: scale(1.2); }
.star-btn.hover,
.star-btn.active     { color: #f59e0b; }
.star-btn:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; }
.star-btn:disabled   { cursor: default; }

.stars-hint {
    font-size: .78rem;
    color: #a8a29e;
    margin-left: .35rem;
    font-style: italic;
}

/* ===== Thank-you message ===== */
.rating-thanks {
    display: none;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    padding: .6rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: fadeSlideIn .3s ease;
}
.rating-thanks.visible { display: flex; }
.thanks-check { flex-shrink: 0; color: #16a34a; }

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* ===== Average score display ===== */
.rating-score {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-top: .85rem;
    border-top: 1px solid #fde68a;
}

.score-stars {
    display: flex;
    gap: 2px;
}
.score-star { color: #d1d5db; width: 18px; height: 18px; display: inline-flex; }
.score-star svg { width: 18px; height: 18px; }
.score-star.filled { color: #f59e0b; }
.score-star.half   { color: #f59e0b; }
.score-star.empty  { color: #d1d5db; }

.score-num {
    font-size: .95rem;
    font-weight: 700;
    color: #1e293b;
}
.score-sep  { color: #d1d5db; font-size: .9rem; }
.score-count { font-size: .82rem; color: #78716c; }

/* ============================================================
   POST META ROW (author, date, updated-by)
   ============================================================ */
.post-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1.2rem;
    font-size: .8rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.post-date-item {
    display: flex;
    align-items: center;
    gap: .3rem;
}
.post-date-item svg { flex-shrink: 0; opacity: .7; }
.updated-by { color: #94a3b8; font-style: italic; font-size: .77rem; }

/* ============================================================
   INLINE RATING BADGE (near title)
   ============================================================ */
.rating-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 20px;
    padding: .2rem .75rem .2rem .5rem;
    margin-bottom: .6rem;
}
.rbi-stars { display: flex; gap: 1px; align-items: center; }
.rbi-score { font-size: .85rem; font-weight: 700; color: #92400e; }
.rbi-count { font-size: .75rem; color: #a8a29e; }

/* ============================================================
   POST SECTIONS (shared header style)
   ============================================================ */
.post-section {
    margin: 2.25rem 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.section-label {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--font-sans);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #475569;
    padding: .85rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
}
.section-label svg { flex-shrink: 0; opacity: .7; }

/* ============================================================
   AFFILIATE CARDS
   ============================================================ */
.affiliates-section .affiliates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}
.affiliate-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}
.affiliate-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.aff-img-wrap { background: #f8fafc; aspect-ratio: 1/1; width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.aff-img-wrap img { width: 100%; height: 100%; object-fit: contain; border-radius: 0; display: block; padding: 8px; }
.aff-body { padding: .9rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.aff-platform {
    display: inline-block;
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .15rem .5rem;
    border-radius: 4px;
    align-self: flex-start;
}
.aff-name { font-size: .9rem; font-weight: 600; color: #1e293b; line-height: 1.3; }
.aff-desc { font-size: .78rem; color: #64748b; flex: 1; }
.aff-price { font-size: 1.05rem; font-weight: 700; color: #1e293b; }
.aff-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .4rem;
    padding: .45rem .85rem;
    background: #1e293b;
    color: #fff;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
    transition: background .15s;
}
.aff-btn:hover { background: #2563eb; text-decoration: none; }
.affiliate-disclosure {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    color: #94a3b8;
    padding: .6rem 1.25rem .9rem;
    background: #fafbff;
    border-top: 1px dashed #e2e8f0;
    margin: 0;
}

/* ============================================================
   EXPERT CARDS
   ============================================================ */
.experts-section .experts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
}
.expert-card {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.expert-avatar {
    width: 60px; height: 60px; flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.expert-avatar-fallback {
    width: 60px; height: 60px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg,#6366f1,#8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700; color: #fff;
}
.expert-info { flex: 1; min-width: 0; }
.expert-name  { font-size: .92rem; font-weight: 700; color: #1e293b; }
.expert-title { font-size: .78rem; color: #6366f1; font-weight: 600; margin-top: .1rem; }
.expert-bio   { font-size: .8rem; color: #64748b; margin-top: .35rem; line-height: 1.5; }
.expert-link {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    margin-top: .55rem;
    font-size: .78rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}
.expert-link:hover { text-decoration: underline; }

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.faq-list { padding: .5rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.faq-item { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #fff; }
.faq-q {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-family: var(--font-sans);
    font-size: .9rem;
    font-weight: 600;
    color: #1e293b;
    cursor: pointer;
    transition: background .15s;
}
.faq-q:hover { background: #f8fafc; }
.faq-chevron { flex-shrink: 0; transition: transform .2s; }
.faq-a { padding: 0 1rem .85rem; border-top: 1px solid #f1f5f9; }
.faq-a p { font-size: .87rem; color: #475569; line-height: 1.7; margin-top: .6rem; }

/* ============================================================
   REFERENCES
   ============================================================ */
.references-list {
    padding: 1rem 1.25rem 1.25rem 2.25rem;
    display: flex;
    flex-direction: column;
    gap: .65rem;
    margin: 0;
}
.ref-item { line-height: 1.5; }
.ref-title { font-size: .875rem; font-weight: 600; color: #2563eb; }
a.ref-title:hover { text-decoration: underline; }
.ref-meta { display: block; font-size: .78rem; color: #94a3b8; margin-top: .1rem; }

/* ============================================================
   AUTHOR BOX
   ============================================================ */
.author-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1.25rem;
    margin: 2rem 0;
}
.author-avatar {
    width: 64px; height: 64px; flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.author-avatar-fallback {
    width: 64px; height: 64px; flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; color: #fff;
}
.author-label      { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #94a3b8; margin-bottom: .2rem; }
.author-name       { font-size: 1rem; font-weight: 700; color: #1e293b; }
.author-experience { font-size: .75rem; font-weight: 600; color: #6366f1; margin-top: .15rem; }
.author-bio        { font-size: .83rem; color: #64748b; margin-top: .4rem; line-height: 1.6; }
.author-expertise  { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.expertise-tag {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 20px;
}
.author-website {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin-top: .6rem;
    font-size: .78rem;
    font-weight: 600;
    color: #2563eb;
}
.author-website:hover { text-decoration: underline; }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-section { padding: 1.25rem; }
.comments-list { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.75rem; }
.comment-item {
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.comment-meta {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .5rem;
}
.comment-author { font-weight: 600; font-size: .9rem; color: var(--text); }
.comment-date   { font-size: .8rem; color: #94a3b8; }
.comment-body   { margin: 0; font-size: .9rem; color: #374151; line-height: 1.6; }

.comment-notice {
    padding: .75rem 1rem;
    border-radius: 7px;
    font-size: .9rem;
    margin-bottom: 1.25rem;
}
.comment-notice.success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.comment-notice.error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

.comment-form { margin-top: 1.25rem; }
.comment-form-title { margin: 0 0 1rem; font-size: 1rem; color: var(--text); }
.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-bottom: .75rem;
}
.comment-form label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: .75rem;
}
.comment-form label small { font-weight: 400; color: #94a3b8; margin-left: .25rem; }
.comment-form input,
.comment-form textarea {
    display: block;
    width: 100%;
    margin-top: .3rem;
    padding: .55rem .75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .9rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color .15s;
    box-sizing: border-box;
}
.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.comment-form .req { color: #ef4444; }
.comment-form-footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.comment-submit {
    padding: .55rem 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.comment-submit:hover { background: #1d4ed8; }
.comment-note { margin: 0; font-size: .78rem; color: #94a3b8; }
@media (max-width: 600px) {
    .comment-form-row { grid-template-columns: 1fr; }
}

/* Social login in comment form */
.social-login-wrap { margin-bottom: 1rem; }
.social-login-label { margin: 0 0 .6rem; font-size: .82rem; color: #64748b; font-weight: 500; }
.social-login-btns { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .45rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: .82rem;
    font-weight: 600;
    color: #374151;
    background: #fff;
    text-decoration: none;
    transition: border-color .15s, background .15s;
}
.social-btn:hover { background: #f8fafc; border-color: #94a3b8; text-decoration: none; color: #374151; }
.social-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1rem 0 .75rem;
    color: #94a3b8;
    font-size: .78rem;
}
.social-divider::before,
.social-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

.social-logged-in {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .9rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    font-size: .85rem;
    color: #166534;
    margin-bottom: .9rem;
    flex-wrap: wrap;
}
.social-logout-link {
    margin-left: auto;
    font-size: .78rem;
    color: #64748b;
    text-decoration: underline;
}
.social-logout-link:hover { color: #ef4444; }
.comment-form input[readonly] { background: #f1f5f9; color: #64748b; cursor: default; }

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 600px) {
    .affiliates-section .affiliates-grid { grid-template-columns: 1fr 1fr; padding: .75rem; }
    .experts-section .experts-grid { grid-template-columns: 1fr; padding: .75rem; }
    .author-box { flex-direction: column; align-items: center; text-align: center; }
}
