/* ==========================================================================
   Public site stylesheet (Phase 1)
   --------------------------------------------------------------------------
   Covers the header, footer, homepage shell and the legal pages. The full
   magazine-style article layout is delivered in Phase 3.

   --primary / --secondary are injected from the promoted-site settings by
   public/includes/header.php, so branding follows configuration.
   ========================================================================== */

:root {
    --primary: #2563EB;
    --secondary: #10B981;
    --accent: #F59E0B;
    --ink: #0F172A;
    --text: #334155;
    --muted: #64748B;
    --line: #E2E8F0;
    --surface: #F8FAFC;
    --radius: 12px;
    --wrap: 1120px;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); }
a:hover { text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1.1rem; }
ul, ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
li { margin-bottom: .4rem; }
blockquote { margin: 0 0 1.2rem; padding: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }

.skip-link {
    position: absolute;
    left: -9999px; top: 0;
    background: var(--ink);
    color: #fff;
    padding: .6rem 1rem;
    z-index: 100;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------- header --- */
.site-header {
    border-bottom: 1px solid var(--line);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 40;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding-top: .9rem;
    padding-bottom: .9rem;
}
.site-brand { text-decoration: none; min-width: 0; }
.site-brand-name {
    display: block;
    font-family: var(--serif);
    font-size: 1.32rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
}
.site-brand-tagline {
    display: block;
    font-size: .82rem;
    color: var(--muted);
    margin-top: .1rem;
    max-width: 46ch;
}
.site-nav { margin-left: auto; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.site-nav a {
    font-size: .9rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
}
.site-nav a:hover { color: var(--primary); }

/* ----------------------------------------------------------------- hero --- */
.hero {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 3rem 0 2.6rem;
    text-align: center;
}
.hero h1 { margin-bottom: .4rem; }
.hero-tagline {
    max-width: 62ch;
    margin: 0 auto;
    color: var(--muted);
    font-size: 1.05rem;
}

.section-heading { margin: 2.2rem 0 1.1rem; }

.notice {
    max-width: 62ch;
    margin: 3rem auto;
    padding: 1.6rem 1.5rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}
.notice h2 { font-size: 1.25rem; }
.notice p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- card grid --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
    gap: 1.6rem;
    margin-bottom: 3rem;
}
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow .18s, transform .18s;
}
.card:hover { box-shadow: 0 12px 28px rgba(15, 23, 42, .1); transform: translateY(-2px); }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1 1 auto; }
.card-title { font-size: 1.14rem; margin: .5rem 0 .45rem; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--primary); }
.card-excerpt { font-size: .93rem; color: var(--muted); margin-bottom: .9rem; }
.card-meta { font-size: .8rem; color: var(--muted); margin: auto 0 0; }

.badge {
    display: inline-block;
    align-self: flex-start;
    padding: .16rem .6rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    background: #F1F5F9;
    color: #475569;
}
.badge-cautionary    { background: #FEF3C7; color: #92400E; }
.badge-success       { background: #D1FAE5; color: #065F46; }
.badge-educational   { background: #DBEAFE; color: #1E40AF; }
.badge-heartwarming  { background: #FCE7F3; color: #9D174D; }
.badge-wish_id_known { background: #EDE9FE; color: #5B21B6; }

/* --------------------------------------------------------------- buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .7rem 1.3rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff !important;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    border: 0;
    cursor: pointer;
}
.btn:hover { filter: brightness(.93); }
.btn-secondary { background: var(--secondary); }

/* ----------------------------------------------------------- legal pages --- */
.legal { max-width: 800px; padding-top: 2.4rem; padding-bottom: 3.5rem; }
.legal-head { margin-bottom: 2rem; }
.legal-meta { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.legal-intro { font-size: 1.04rem; }
.legal section { margin-bottom: 2.2rem; scroll-margin-top: 5rem; }
.legal h2 { font-size: 1.34rem; margin-top: 0; }
.legal h3 { font-size: 1.05rem; font-family: var(--sans); font-weight: 700; margin: 1.3rem 0 .5rem; }
.legal p, .legal li { font-size: .98rem; }

.legal-toc {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1.1rem 1.3rem .9rem;
    margin-bottom: 2.4rem;
}
.legal-toc h2 { font-size: .8rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-family: var(--sans); }
.legal-toc ol { columns: 2; column-gap: 2rem; margin-bottom: 0; }
.legal-toc li { font-size: .9rem; }

/* Prominent affiliate disclosure block */
.legal-disclosure {
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    background: #FFFBEB;
    padding: 1.2rem 1.35rem;
    margin: 0 0 2.2rem;
}
.legal-disclosure h2 {
    font-family: var(--sans);
    font-size: .86rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #92400E;
    margin-bottom: .5rem;
}
.legal-disclosure .disclosure-text {
    margin: 0;
    font-size: 1rem;
    color: #78350F;
    font-weight: 500;
}

.disclosure-quote {
    border-left: 4px solid var(--accent);
    background: #FFFBEB;
    padding: .9rem 1.1rem;
    margin: 0 0 1.2rem;
    font-size: 1rem;
    color: #78350F;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.legal-cta { margin: 1.2rem 0; }
.legal-foot {
    border-top: 1px solid var(--line);
    padding-top: 1.1rem;
    font-size: .9rem;
    color: var(--muted);
}
.legal-foot a { color: var(--muted); }

/* ---------------------------------------------------------------- footer --- */
.site-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 2.2rem 0 1.6rem;
    margin-top: 3rem;
}
.footer-inner {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 1.3rem;
}
.footer-site-name { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; color: var(--ink); margin: 0 0 .2rem; }
.footer-tagline { font-size: .88rem; color: var(--muted); margin: 0; max-width: 44ch; }
.footer-links { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.footer-links a { font-size: .9rem; font-weight: 600; color: var(--text); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }

.footer-legal {
    border-top: 1px solid var(--line);
    padding-top: 1.1rem;
}
.footer-legal p { font-size: .8rem; color: var(--muted); margin: 0 0 .4rem; }
.footer-disclosure { max-width: 90ch; }

/* ------------------------------------------------------------ responsive --- */
@media (max-width: 720px) {
    body { font-size: 16px; }
    .site-nav { gap: .85rem; width: 100%; margin-left: 0; }
    .legal-toc ol { columns: 1; }
    .hero { padding: 2.2rem 0 2rem; }
}
