/* ============================================
   honesthousingadvice.com — style.css v1.0
   ============================================ */

/* --- Reset & Variables --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #1a3a5c;
    --navy-dark:  #122a44;
    --teal:       #2a7f6f;
    --teal-light: #e8f5f2;
    --gold:       #c8922a;
    --gold-light: #fdf5e6;
    --gray-50:    #f9fafb;
    --gray-100:   #f3f4f6;
    --gray-200:   #e5e7eb;
    --gray-400:   #9ca3af;
    --gray-600:   #4b5563;
    --gray-700:   #374151;
    --gray-900:   #111827;
    --white:      #ffffff;
    --red:        #dc2626;

    --font-sans:  'Inter', system-ui, sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;

    --radius:     8px;
    --radius-lg:  12px;
    --shadow:     0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg:  0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);

    --max-width:  1200px;
    --content-width: 780px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    color: var(--gray-700);
    background: var(--white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.content-wrap { max-width: var(--content-width); margin: 0 auto; }

/* --- Header --- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
    gap: 2rem;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon { font-size: 1.75rem; }
.logo-text { display: flex; flex-direction: column; }
.logo-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
}
.logo-tagline {
    font-size: .7rem;
    color: var(--gray-400);
    line-height: 1.2;
}
.site-nav { display: flex; align-items: center; gap: .25rem; }
.nav-link {
    padding: .5rem .9rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active {
    background: var(--gray-100);
    color: var(--navy);
}
.nav-cta {
    padding: .5rem 1.1rem;
    background: var(--teal);
    color: var(--white) !important;
    text-decoration: none;
    font-size: .875rem;
    font-weight: 600;
    border-radius: var(--radius);
    transition: background .15s;
    margin-left: .5rem;
}
.nav-cta:hover { background: var(--navy); }

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .5rem;
}
.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: .3s;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: .6rem 0;
    font-size: .8rem;
}
.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: .25rem;
    align-items: center;
}
.breadcrumb-item a { color: var(--teal); text-decoration: none; }
.breadcrumb-item a:hover { text-decoration: underline; }
.breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    margin-right: .25rem;
    color: var(--gray-400);
}
.breadcrumb-item.current { color: var(--gray-400); }

/* --- Hero / Page Header --- */
.page-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: var(--white);
    padding: 3rem 0;
}
.page-hero .category-badge {
    display: inline-block;
    background: var(--teal);
    color: var(--white);
    font-size: .75rem;
    font-weight: 600;
    padding: .3rem .8rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 1rem;
}
.page-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    max-width: 780px;
}
.page-hero .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .85rem;
    color: rgba(255,255,255,.75);
    align-items: center;
}
.page-hero .article-meta strong { color: var(--white); }

/* --- Article Layout --- */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    padding: 2.5rem 0 4rem;
    align-items: start;
}
.article-main { min-width: 0; }
.article-sidebar { position: sticky; top: 5rem; }

/* --- Article Content --- */
.article-answer {
    background: var(--teal-light);
    border-left: 4px solid var(--teal);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    font-size: 1.05rem;
    line-height: 1.7;
}
.article-answer p:last-child { margin-bottom: 0; }

.article-body { font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.85; }
.article-body h2 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin: 2.5rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}
.article-body h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.article-body h3 {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 1.75rem 0 .75rem;
}
.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { margin: 1rem 0 1.25rem 1.5rem; }
.article-body li { margin-bottom: .5rem; }
.article-body a { color: var(--teal); }
.article-body a:hover { text-decoration: none; }
.article-body strong { font-weight: 700; color: var(--gray-900); }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-family: var(--font-sans); font-size: .9rem; }
.article-body th { background: var(--navy); color: var(--white); padding: .75rem 1rem; text-align: left; }
.article-body td { padding: .7rem 1rem; border-bottom: 1px solid var(--gray-200); }
.article-body tr:nth-child(even) td { background: var(--gray-50); }
.article-body blockquote {
    border-left: 4px solid var(--gold);
    background: var(--gold-light);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
}

/* --- Table of Contents --- */
.toc-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}
.toc-box h3 {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-400);
    margin-bottom: .75rem;
}
.toc-list { list-style: none; }
.toc-list li { padding: .2rem 0; }
.toc-list a {
    color: var(--teal);
    text-decoration: none;
    font-size: .9rem;
    line-height: 1.5;
    display: block;
}
.toc-list a:hover { text-decoration: underline; }
.toc-list .toc-sub { padding-left: 1rem; }

/* Sidebar TOC */
.sidebar-toc {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.sidebar-toc h3 {
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gray-400);
    margin-bottom: .75rem;
}

/* --- Ad Units --- */
.ad-unit {
    background: var(--gray-100);
    border: 1px dashed var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    color: var(--gray-400);
    font-size: .75rem;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
}
.ad-unit::after { content: 'Advertisement'; }
.ad-in-content { min-height: 280px; }
.ad-sidebar { min-height: 250px; position: sticky; top: 5rem; }
.ad-below-toc { min-height: 90px; }

/* --- Newsletter Insert --- */
.newsletter-insert {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin: 2rem 0;
    color: var(--white);
}
.newsletter-inner { display: flex; flex-direction: column; gap: 1rem; }
.newsletter-icon { font-size: 2rem; }
.newsletter-content h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .35rem; }
.newsletter-content p { font-size: .875rem; opacity: .85; }
.newsletter-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.newsletter-form input[type="email"] {
    flex: 1;
    min-width: 200px;
    padding: .65rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    outline: none;
}
.newsletter-form button {
    padding: .65rem 1.25rem;
    background: var(--teal);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    white-space: nowrap;
}
.newsletter-form button:hover { background: var(--gold); }

/* --- Author Box --- */
.author-box {
    display: flex;
    gap: 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin: 1.5rem 0;
    align-items: flex-start;
}
.author-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--white);
    box-shadow: var(--shadow);
}
.author-info { flex: 1; min-width: 0; }
.author-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--gray-400); display: block; margin-bottom: .15rem; }
.author-name { font-weight: 700; color: var(--navy); text-decoration: none; font-size: 1rem; }
.author-name:hover { text-decoration: underline; }
.author-title { font-size: .82rem; color: var(--teal); font-weight: 500; margin-top: .15rem; }
.author-credentials { font-size: .78rem; color: var(--gray-400); margin-top: .2rem; }
.author-bio { font-size: .88rem; color: var(--gray-600); margin-top: .75rem; line-height: 1.6; }
.author-links { display: flex; gap: .75rem; margin-top: .75rem; flex-wrap: wrap; }
.author-social {
    font-size: .8rem;
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
}
.author-social:hover { text-decoration: underline; }

/* Date meta */
.article-dates {
    display: flex;
    gap: 1.5rem;
    font-size: .8rem;
    color: var(--gray-400);
    margin: 1rem 0 1.5rem;
    flex-wrap: wrap;
}
.article-dates span strong { color: var(--gray-600); }

/* --- FAQ Section --- */
.faq-section { margin: 2.5rem 0; }
.faq-section h2 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1.25rem;
}
.faq-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    overflow: hidden;
}
.faq-question {
    width: 100%;
    background: var(--gray-50);
    border: none;
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: .95rem;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: background .15s;
}
.faq-question:hover { background: var(--gray-100); }
.faq-question::after { content: '+'; font-size: 1.25rem; font-weight: 400; color: var(--teal); flex-shrink: 0; }
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer {
    display: none;
    padding: 1rem 1.25rem;
    font-size: .9rem;
    line-height: 1.7;
    border-top: 1px solid var(--gray-200);
    color: var(--gray-700);
}
.faq-item.open .faq-answer { display: block; }

/* --- Disclaimer --- */
.disclaimer {
    background: var(--gold-light);
    border: 1px solid #e8c87a;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-size: .82rem;
    color: var(--gray-700);
    line-height: 1.6;
    margin: 2rem 0;
}

/* --- Related Articles --- */
.related-articles { margin: 3rem 0; }
.related-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid var(--gray-200);
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.related-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.related-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.related-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.related-card-body { padding: 1rem; }
.related-category {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--teal);
    display: block;
    margin-bottom: .35rem;
}
.related-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; line-height: 1.4; }
.related-card h3 a { color: var(--gray-900); text-decoration: none; }
.related-card h3 a:hover { color: var(--teal); }
.related-card p { font-size: .8rem; color: var(--gray-600); line-height: 1.5; }

/* --- Homepage --- */
.home-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: var(--white);
    padding: 5rem 0;
    text-align: center;
}
.home-hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}
.home-hero p {
    font-size: 1.1rem;
    opacity: .85;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}
.home-hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-primary {
    display: inline-block;
    padding: .875rem 2rem;
    background: var(--teal);
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius);
    transition: background .15s;
}
.btn-primary:hover { background: #1f6357; }
.btn-secondary {
    display: inline-block;
    padding: .875rem 2rem;
    background: rgba(255,255,255,.15);
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.3);
    transition: background .15s;
}
.btn-secondary:hover { background: rgba(255,255,255,.25); }

.home-categories { padding: 4rem 0; background: var(--gray-50); }
.home-categories h2 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 2rem;
}
.category-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.category-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-decoration: none;
    transition: box-shadow .2s, transform .2s;
    display: block;
}
.category-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.category-card-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.category-card h3 { font-size: 1.25rem; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.category-card p { font-size: .875rem; color: var(--gray-600); line-height: 1.6; }
.category-card .card-cta { color: var(--teal); font-weight: 600; font-size: .875rem; margin-top: 1rem; display: block; }

/* Article grid */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.article-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.article-card img { width: 100%; height: 200px; object-fit: cover; }
.article-card-body { padding: 1.25rem; }
.article-card-cat { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--teal); display: block; margin-bottom: .4rem; }
.article-card h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: .5rem; line-height: 1.4; }
.article-card h3 a { text-decoration: none; color: inherit; }
.article-card h3 a:hover { color: var(--teal); }
.article-card p { font-size: .82rem; color: var(--gray-600); line-height: 1.55; }
.article-card-meta { font-size: .75rem; color: var(--gray-400); margin-top: .75rem; }

/* --- Hub / Pillar Pages --- */
.hub-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
    color: var(--white);
    padding: 3.5rem 0;
}
.hub-header h1 { font-family: var(--font-serif); font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 700; margin-bottom: .75rem; }
.hub-header p { font-size: 1.05rem; opacity: .85; max-width: 650px; line-height: 1.7; }

/* --- Footer --- */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,.75); margin-top: 4rem; }
.footer-inner { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 3rem; padding: 3rem 0; }
.footer-logo { color: var(--white); text-decoration: none; font-size: 1.1rem; font-weight: 700; display: block; margin-bottom: .75rem; }
.footer-tagline { font-size: .82rem; line-height: 1.6; margin-bottom: .5rem; }
.footer-disclaimer-short { font-size: .75rem; opacity: .6; }
.footer-col h4 { color: var(--white); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .75rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: rgba(255,255,255,.65); text-decoration: none; font-size: .82rem; transition: color .15s; }
.footer-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.25rem 0; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; }
.footer-bottom p { font-size: .78rem; opacity: .6; }
.footer-legal { font-size: .72rem !important; }

/* --- Reading Progress Bar --- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--teal);
    z-index: 9999;
    transition: width .1s linear;
}

/* --- Utility --- */
.section { padding: 3rem 0; }
.section-title { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .article-layout { grid-template-columns: 1fr; }
    .article-sidebar { position: static; }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
    .articles-grid { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .site-nav { display: none; }
    .mobile-menu-toggle { display: flex; }
    .site-nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 1rem;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
    }
    .header-inner { position: relative; }
    .category-cards { grid-template-columns: 1fr; }
    .articles-grid { grid-template-columns: 1fr; }
    .related-grid { grid-template-columns: 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom .container { flex-direction: column; text-align: center; }
    .home-hero { padding: 3rem 0; }
    .newsletter-form { flex-direction: column; }
    .newsletter-form input[type="email"] { min-width: unset; }
    .author-box { flex-direction: column; }
}

@media (max-width: 480px) {
    .page-hero h1 { font-size: 1.5rem; }
    .toc-box { display: none; } /* hide inline TOC on mobile, sidebar handles it */
}
