/* ==========================================================================
   Wisdom Quotes 4 U — Ghost theme
   Palette measured from the WQ4U owl badge (see brand notes).
   Contrast ratios are stated where they constrain usage.
   ========================================================================== */

:root {
    /* --- measured brand colours --- */
    --wq-ink:        #220101;  /* 19.58:1 on white — body copy            */
    --wq-brown:      #582615;  /* 12.33:1 on white — headings, links      */
    --wq-brown-soft: #7A4A33;  /* hover / borders                         */
    --wq-green:      #454D1E;  /*  9.00:1 on white — accents, tags        */
    --wq-gold:       #A37508;  /*  4.11:1 — DECORATIVE ONLY, never text   */
    --wq-gold-ink:   #996E08;  /*  4.58:1 — the gold that is text-safe    */
    --wq-cream:      #EAE8DC;  /* surface                                 */
    --wq-cream-lt:   #F8F6F1;  /* page background                         */
    --wq-white:      #FFFFFF;

    --wq-text:       var(--wq-ink);
    --wq-muted:      #5A4A44;  /* 8.2:1 on white — meta text              */
    --wq-accent:     var(--wq-brown);

    --wrap:      1180px;
    --wrap-narrow: 720px;
    --radius:    10px;
    --gap:       clamp(1rem, 2.5vw, 1.75rem);
    --tap:       44px;         /* WCAG 2.5.8 target size                  */

    /* Ghost injects --gh-font-heading / --gh-font-body when custom fonts are
       chosen in admin; fall back to a fast system stack when they are not. */
    --font-body: var(--gh-font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
    --font-head: var(--gh-font-heading, Georgia, "Iowan Old Style", "Times New Roman", serif);

    --shadow-sm: 0 1px 2px rgba(34,1,1,.06), 0 2px 8px rgba(34,1,1,.05);
    --shadow-md: 0 4px 16px rgba(34,1,1,.10);
}

body.accent-green { --wq-accent: var(--wq-green); }

/* --- reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--wq-cream-lt);
    color: var(--wq-text);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--wq-accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--wq-brown-soft); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.22; color: var(--wq-ink); margin: 0 0 .5em; }

:focus-visible {
    outline: 3px solid var(--wq-gold-ink);
    outline-offset: 2px;
    border-radius: 3px;
}

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

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2rem, var(--wrap-narrow)); }

/* --- header ------------------------------------------------------------- */
.site-head {
    background: var(--wq-white);
    border-bottom: 3px solid var(--wq-cream);
    position: sticky; top: 0; z-index: 40;
}
.site-head-inner {
    display: flex; align-items: center; gap: 1rem;
    min-height: 68px; padding-block: .5rem;
    flex-wrap: wrap;
}
.site-brand {
    display: flex; align-items: center; gap: .7rem;
    text-decoration: none; color: inherit; margin-right: auto;
    min-height: var(--tap);
}
.site-logo { width: 46px; height: 46px; object-fit: contain; border-radius: 50%; }
.site-brand-text { display: flex; flex-direction: column; }
.site-title {
    font-family: var(--font-head); font-size: 1.2rem; font-weight: 700;
    color: var(--wq-brown); line-height: 1.1;
}
.site-tagline { font-size: .78rem; color: var(--wq-muted); line-height: 1.25; }

.nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: var(--tap); height: var(--tap);
    background: none; border: 1px solid var(--wq-cream); border-radius: 8px;
    cursor: pointer; padding: 0 10px;
}
.nav-toggle-bar { display: block; height: 2px; background: var(--wq-brown); border-radius: 2px; }

/* {{navigation}} emits its own <ul class="nav"> — style that, never wrap it
   in another <ul> or you get nested lists and stray bullet markers. */
.site-nav { flex-basis: 100%; display: none; }
.site-nav.is-open { display: block; }
.site-nav ul {
    list-style: none; margin: .5rem 0 0; padding: 0;
    display: flex; flex-direction: column;
}
.site-nav li { list-style: none; }
.site-nav li a {
    display: flex; align-items: center; min-height: var(--tap);
    padding: 0 .25rem; text-decoration: none; font-weight: 600;
    color: var(--wq-ink); border-bottom: 1px solid var(--wq-cream);
}
.site-nav li a:hover { color: var(--wq-brown); }

@media (min-width: 800px) {
    .nav-toggle { display: none; }
    .site-nav { display: block; flex-basis: auto; }
    .site-nav ul { flex-direction: row; gap: .35rem; margin: 0; }
    .site-nav li a { border-bottom: 0; padding-inline: .85rem; border-radius: 8px; }
    .site-nav li a:hover { background: var(--wq-cream); }
}

/* --- hero --------------------------------------------------------------- */
.hero {
    background: linear-gradient(180deg, var(--wq-cream) 0%, var(--wq-cream-lt) 100%);
    padding-block: clamp(2rem, 6vw, 3.5rem);
    text-align: center;
    border-bottom: 1px solid rgba(88,38,21,.10);
}
.hero-title {
    font-size: clamp(1.9rem, 5vw, 3rem);
    color: var(--wq-brown); margin-bottom: .3em;
}
.hero-sub {
    margin: 0 auto; max-width: 46ch; color: var(--wq-muted);
    font-size: clamp(1rem, 2.2vw, 1.15rem);
}

/* --- grid of quote cards ------------------------------------------------ */
.quote-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
    align-items: start;          /* size cards to content, not to tallest sibling */
    padding-block: clamp(1.5rem, 4vw, 2.75rem);
}
@media (min-width: 560px) { .quote-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .quote-grid { grid-template-columns: repeat(3, 1fr); } }

.quote-card {
    background: var(--wq-white);
    border: 1px solid rgba(88,38,21,.10);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform .18s ease, box-shadow .18s ease;
}
.quote-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.quote-card-link { text-decoration: none; color: inherit; display: block; }
.quote-card-media { aspect-ratio: 1 / 1; background: var(--wq-cream); }
.quote-card-img { width: 100%; height: 100%; object-fit: cover; }

.quote-card-title {
    font-size: 1.02rem; line-height: 1.4; margin: 0;
    padding: .85rem 1rem 1rem;
    color: var(--wq-ink); font-family: var(--font-body); font-weight: 600;
}
.quote-card-link:hover .quote-card-title { color: var(--wq-brown); }

.quote-card-tag {
    align-self: flex-start;
    margin: 0 1rem 1rem;
    font-size: .74rem; letter-spacing: .04em; text-transform: uppercase;
    font-weight: 700; color: var(--wq-green); text-decoration: none;
    display: inline-flex; align-items: center; min-height: 28px;
}
.quote-card-tag:hover { text-decoration: underline; }

/* --- archive heads ------------------------------------------------------ */
.archive-head {
    background: var(--wq-cream);
    padding-block: clamp(1.75rem, 5vw, 2.75rem);
    border-bottom: 1px solid rgba(88,38,21,.12);
    text-align: center;
}
.archive-kicker,
.post-kicker {
    display: inline-block;
    font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
    font-weight: 700; color: var(--wq-green); text-decoration: none;
    margin-bottom: .4rem;
}
.post-kicker { min-height: 28px; }
.archive-title { font-size: clamp(1.7rem, 4.5vw, 2.5rem); color: var(--wq-brown); }
.archive-desc { max-width: 55ch; margin-inline: auto; color: var(--wq-muted); }
.archive-count { font-size: .9rem; color: var(--wq-muted); margin: .25rem 0 0; }

/* --- single post -------------------------------------------------------- */
/* NB: must NOT be `.post` — Ghost's {{post_class}} stamps `post` onto every
   card in the grid, so a `.post` rule leaks padding into every card. */
.single { padding-block: clamp(1.75rem, 5vw, 3rem); }
.post-head { text-align: center; margin-bottom: 1.75rem; }
.post-title { font-size: clamp(1.6rem, 4.5vw, 2.4rem); color: var(--wq-brown); }
.post-meta { color: var(--wq-muted); font-size: .9rem; margin: 0; }

.post-media { margin: 0 0 1.75rem; }
.post-media img {
    margin-inline: auto; border-radius: var(--radius);
    box-shadow: var(--shadow-md); background: var(--wq-cream);
}
.post-media figcaption {
    text-align: center; font-size: .85rem; color: var(--wq-muted); margin-top: .6rem;
}

.post-content { font-size: 1.09rem; }
/* Reset via the child combinator only. A plain `.post-content p { margin: 0 }`
   out-specifies `> * + *` and silently removes every paragraph gap. */
.post-content > * { margin: 0; }
.post-content > * + * { margin-top: 1.15em; }
/* The imported WordPress content wraps whole paragraphs in <strong>, so this
   must NOT recolour — tinting it turned every post body into bold brown. */
.post-content strong { color: inherit; }
.post-content h2, .post-content h3 { margin-top: 1.8em; color: var(--wq-brown); }
.post-content img { border-radius: var(--radius); margin-inline: auto; }
.post-content blockquote {
    margin: 1.6em 0; padding: .6em 0 .6em 1.25em;
    border-left: 4px solid var(--wq-gold);   /* decorative use of gold — not text */
    color: var(--wq-ink); font-style: italic;
}
.post-content a { color: var(--wq-brown); }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content hr { border: 0; border-top: 1px solid var(--wq-cream); margin: 2em 0; }

/* --- Koenig editor cards ------------------------------------------------ */
/* Ghost's editor emits these widths; they must be styled or content breaks
   out of, or is trapped inside, the narrow column. */
.post-content .kg-card { margin-block: 1.6em; }

.post-content .kg-width-wide {
    width: min(100vw - 2rem, 1000px);
    max-width: none;
    margin-inline: calc(50% - min(50vw - 1rem, 500px));
}
.post-content .kg-width-full {
    width: 100vw;
    max-width: none;
    margin-inline: calc(50% - 50vw);
}
.post-content .kg-width-full img,
.post-content .kg-width-wide img { width: 100%; border-radius: 0; }
.post-content .kg-width-wide img { border-radius: var(--radius); }

.post-content .kg-image-card figcaption,
.post-content .kg-embed-card figcaption {
    text-align: center; font-size: .85rem; color: var(--wq-muted); margin-top: .6rem;
}
.post-content .kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.post-content .kg-gallery-row { display: flex; gap: .6rem; }
.post-content .kg-gallery-image img { width: 100%; }
.post-content .kg-bookmark-card a {
    display: flex; flex-direction: column; border: 1px solid var(--wq-cream);
    border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit;
}
.post-content .kg-bookmark-content { padding: 1rem; }
.post-content .kg-bookmark-title { font-weight: 700; color: var(--wq-brown); }
.post-content .kg-bookmark-description { color: var(--wq-muted); font-size: .92rem; }
.post-content .kg-button-card { display: flex; justify-content: center; }
.post-content .kg-btn {
    display: inline-flex; align-items: center; min-height: var(--tap);
    padding: 0 1.5rem; background: var(--wq-brown); color: var(--wq-white);
    border-radius: 999px; text-decoration: none; font-weight: 600;
}

.post-tags { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .5rem; }

.tag-pill {
    display: inline-flex; align-items: center;
    min-height: 36px; padding: 0 .85rem;
    background: var(--wq-cream); color: var(--wq-brown);
    border-radius: 999px; text-decoration: none;
    font-size: .85rem; font-weight: 600;
}
.tag-pill:hover { background: var(--wq-brown); color: var(--wq-white); }

/* --- ads ---------------------------------------------------------------- */
/* Fixed IAB sizes. data-ad-format="auto" stamps height:auto on the wrapper
   and leaves an unfilled gap — see the Delightful Quotes theme notes. */
.ad-slot {
    margin: 2rem auto; text-align: center;
    min-height: 280px; display: flex; align-items: center; justify-content: center;
}
.ad-slot-inarticle { width: 336px; height: 280px; max-width: 100%; }

/* --- related / sections ------------------------------------------------- */
.related { background: var(--wq-cream); border-top: 1px solid rgba(88,38,21,.10); }
.section-title {
    font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--wq-brown);
    text-align: center; padding-top: clamp(1.5rem, 4vw, 2.25rem); margin-bottom: 0;
}

/* --- pagination --------------------------------------------------------- */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    padding-block: 2rem 3rem; font-size: .95rem;
}
.pagination a {
    display: inline-flex; align-items: center; min-height: var(--tap);
    padding: 0 1.1rem; background: var(--wq-white);
    border: 1px solid var(--wq-brown); border-radius: 999px;
    color: var(--wq-brown); text-decoration: none; font-weight: 600;
}
.pagination a:hover { background: var(--wq-brown); color: var(--wq-white); }
.page-number { color: var(--wq-muted); }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: var(--tap); padding: 0 1.5rem;
    background: var(--wq-brown); color: var(--wq-white);
    border-radius: 999px; text-decoration: none; font-weight: 600;
}
.btn:hover { background: var(--wq-ink); color: var(--wq-white); }

/* --- error -------------------------------------------------------------- */
.error-page { text-align: center; padding-block: clamp(2.5rem, 8vw, 5rem); }
.error-code { font-family: var(--font-head); font-size: 4rem; color: var(--wq-gold-ink); margin: 0; }
.error-title { font-size: clamp(1.4rem, 4vw, 2rem); color: var(--wq-brown); }
.error-help { color: var(--wq-muted); }

/* --- footer ------------------------------------------------------------- */
.site-foot {
    background: var(--wq-ink); color: #E8DED8;
    margin-top: 3rem; padding-block: clamp(2rem, 5vw, 3rem);
}
.site-foot a { color: #F0E4D2; }
.foot-heading { color: var(--wq-white); font-size: 1.05rem; margin-bottom: .9rem; }
.tag-cloud { list-style: none; margin: 0 0 2rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.site-foot .tag-pill {
    background: rgba(255,255,255,.10); color: #F3E9DD;
}
.site-foot .tag-pill:hover { background: var(--wq-gold-ink); color: var(--wq-white); }
.foot-meta {
    border-top: 1px solid rgba(255,255,255,.14); padding-top: 1.25rem;
    display: flex; flex-wrap: wrap; gap: .75rem 1.5rem;
    align-items: center; justify-content: space-between;
}
.foot-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: 0; padding: 0; }
.foot-nav li { list-style: none; }
.foot-nav li a { display: inline-flex; align-items: center; min-height: 36px; }
.foot-copy { margin: 0; font-size: .88rem; color: #C9BAB2; }

/* --- motion ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
    .quote-card:hover { transform: none; }
}
