/**
 * Stone Soup — Resource Page Design System
 * Extracted from style.css Section 20f
 * Loaded conditionally on resource pages only
 *
 * COLORS: Orphist palette values reference style.css :root variables
 * with hardcoded fallbacks. Last synced: v5.1.1
 *
 * @version 5.5.1
 */

/* ══════════════════════════════════════════════
   Section 20f: Resource Page Design System
   ══════════════════════════════════════════════
   Activated by: Template → "Resource" in Page Attributes.
   Adds body.resource-page → all rules below scope to that class.
   Shares Fira Sans typography and paper-on-linen layout with curriculum.
   Used for annotated bibliographies, annotated link pages, and reference material.
   ══════════════════════════════════════════════ */

/* ── Resource page title — two-tone split on colon ── */
body.resource-page .stonesoup-page-title {
    text-align: left;
    color: var(--stonesoup-text-dark, #2a2520) !important;
}

/* "RESOURCES:" — small, uppercase, Fira Sans, blue accent */
.resource-title-prefix {
    display: block;
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--stonesoup-color-poetry, #2560a0);
    margin-bottom: 0.2rem;
}

/* Topic name — large, light weight, poetry blue (strong title color) */
.resource-title-name {
    display: block;
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif);
    font-size: 2.6rem;
    font-weight: 300;
    color: var(--stonesoup-color-poetry, #2560a0);
    line-height: 1.15;
}

/* ── Base typography for resource pages ── */
body.resource-page .stonesoup-page-content {
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif);
    font-size: 1.05rem;
    line-height: 1.78;
}

body.resource-page .stonesoup-page-content p {
    margin-bottom: 0.8em;
    text-indent: 0;
}

body.resource-page .stonesoup-page-content h2 {
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif) !important;
    color: var(--stonesoup-text-dark, #2a2520) !important;
    font-size: 1.6rem;
    font-weight: 400;
    margin: 2.5rem 0 1rem;
}

body.resource-page .stonesoup-page-content h3 {
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif) !important;
    color: var(--stonesoup-text-dark, #2a2520) !important;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 0.8rem;
}

/* ── Section intro paragraph ── */
body.resource-page .section-intro {
    font-size: 2rem;
    line-height: 1.78;
    color: var(--stonesoup-text-dark, #2a2520);
    margin-bottom: 2.5rem;
    max-width: 62rem;
}

/* ── Subsection headings (country/region dividers) ── */
body.resource-page .subsection-heading {
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--stonesoup-text-medium, #5a5148);
    margin-bottom: 1.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e0dbd4;
}

/* ── Section divider ── */
body.resource-page .section-divider {
    border: none;
    height: 1px;
    background: #e0dbd4;
    margin: 3rem 0;
}

/* ── Resource entry — annotated bibliography item ── */
body.resource-page .resource-entry {
    margin-bottom: 2.5rem;
    padding-left: 1.25rem;
    border-left: 4px solid var(--stonesoup-color-poetry, #2560a0);
}

/* Cycling Orphist border colors by position */
body.resource-page .resource-entry:nth-child(6n+1) { border-left-color: var(--stonesoup-color-story, #c04a25); }
body.resource-page .resource-entry:nth-child(6n+2) { border-left-color: var(--stonesoup-color-poetry, #2560a0); }
body.resource-page .resource-entry:nth-child(6n+3) { border-left-color: var(--stonesoup-color-art, #5c3db8); }
body.resource-page .resource-entry:nth-child(6n+4) { border-left-color: var(--stonesoup-color-review, #9a6b1e); }
body.resource-page .resource-entry:nth-child(6n+5) { border-left-color: var(--stonesoup-color-memoir, #1a826a); }
body.resource-page .resource-entry:nth-child(6n+6) { border-left-color: var(--stonesoup-color-editorial, #a03058); }

/* Resource name (title of competition/organization) */
body.resource-page .resource-name {
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--stonesoup-text-dark, #2a2520);
    line-height: 1.35;
    margin-bottom: 0.15rem;
}

/* Organization line */
body.resource-page .resource-org {
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif);
    font-size: 0.82rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--stonesoup-text-medium, #5a5148);
    margin-bottom: 0.6rem;
}

/* ── Meta tags row ── */
body.resource-page .resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

body.resource-page .meta-tag {
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2em 0.7em;
    border-radius: 3px;
    background: #f4f2ee;
    color: var(--stonesoup-text-medium, #5a5148);
}

body.resource-page .meta-tag.eligibility {
    background: #fef9f0;
    color: var(--stonesoup-color-review, #9a6b1e);
    border: 1px solid #e8d9b8;
}

body.resource-page .meta-tag.ages {
    background: #eef4fb;
    color: var(--stonesoup-color-poetry, #2560a0);
}

body.resource-page .meta-tag.free {
    background: #eef8f4;
    color: var(--stonesoup-color-memoir, #1a826a);
}

body.resource-page .meta-tag.deadline {
    background: #fdf5ec;
    color: var(--stonesoup-color-review, #9a6b1e);
}

/* ── Annotation text ── */
body.resource-page .resource-annotation {
    font-size: 1rem;
    line-height: 1.78;
    color: var(--stonesoup-text-dark, #2a2520);
    margin-bottom: 0.6rem;
}

body.resource-page .resource-annotation strong {
    font-weight: 600;
    color: var(--stonesoup-text-dark, #2a2520);
}

/* ── Alumni / notable callout ── */
body.resource-page .alumni-note {
    font-size: 0.88rem;
    color: var(--stonesoup-text-medium, #5a5148);
    font-style: italic;
    margin-top: 0.3rem;
}

/* ── Resource links ── */
body.resource-page .resource-links {
    list-style: none;
    padding: 0;
    margin: 0.4rem 0 0;
}

body.resource-page .resource-links li {
    display: inline;
}

body.resource-page .resource-links li + li::before {
    content: " \00b7  ";
    color: var(--stonesoup-text-medium, #5a5148);
    margin: 0 0.15rem;
}

body.resource-page .resource-links a {
    font-family: var(--stonesoup-font-curriculum, 'Fira Sans', sans-serif);
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--stonesoup-color-poetry, #2560a0);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

body.resource-page .resource-links a:hover {
    border-bottom-color: var(--stonesoup-color-poetry, #2560a0);
}

/* ── Responsive ── */
@media (max-width: 900px) {
    body.resource-page .resource-title-name {
        font-size: 2rem;
    }

    body.resource-page .resource-meta {
        gap: 0.35rem;
    }
}

/* ── Poet profiles (future resource pages: poet directories, era guides) ── */

body.resource-page .poet-era-title {
    font-family: var(--stonesoup-font-reading-display, 'Cormorant Garamond', serif);
    font-weight: 400;
    font-size: 1.4rem;
    font-variant: small-caps;
    text-transform: lowercase;
    letter-spacing: 0.06em;
    color: var(--stonesoup-text-dark, #2a2520);
    margin-top: 2.5rem;
    margin-bottom: 0.8em;
}

body.resource-page .era-intro {
    font-style: italic;
    color: var(--stonesoup-text-medium, #5a5148);
    margin-bottom: 1.5em;
    text-indent: 0;
}

body.resource-page .poet-entry {
    margin-bottom: 2em;
    padding-bottom: 1.5em;
    border-bottom: 0.5px solid rgba(196, 181, 160, 0.4);
}

body.resource-page .poet-entry:last-child {
    border-bottom: none;
}

body.resource-page .poet-name {
    font-family: var(--stonesoup-font-reading-display, 'Cormorant Garamond', serif);
    font-weight: 500;
    font-size: 1.2rem;
    color: var(--stonesoup-text-dark, #2a2520);
    margin-bottom: 0.4em;
}

body.resource-page .poet-dates {
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--stonesoup-text-medium, #5a5148);
}

body.resource-page .poet-entry p {
    text-indent: 0;
    margin-bottom: 0.3em;
}

body.resource-page .poet-works,
body.resource-page .poet-poems {
    font-size: 0.92rem;
    color: var(--stonesoup-text-medium, #5a5148);
}

body.resource-page .poet-brief {
    margin-bottom: 1em;
    padding-left: 1em;
    border-left: 2px solid var(--stonesoup-text-rule, #c4b5a0);
}

body.resource-page .poet-brief p {
    text-indent: 0;
    margin-bottom: 0;
}

body.resource-page .poet-brief a {
    color: var(--stonesoup-color-poetry, #2560a0);
    text-decoration: none;
    border-bottom: none;
}

body.resource-page .poet-brief a:hover {
    color: var(--stonesoup-color-story, #c04a25);
}


/* ══════════════════════════════════════════════
   Essay-style resource pages
   ══════════════════════════════════════════════
   For long-form scholarly essays (juvenilia guide, literary history,
   curriculum-adjacent material). Complements the bibliography-style
   classes above. Both flavors share page-resource.php template.
   ══════════════════════════════════════════════ */

/* ── Essay intro paragraph ── */
body.resource-page .essay-intro {
    font-size: 1.08rem;
    line-height: 1.78;
    color: var(--stonesoup-text-medium, #5a5148);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid var(--stonesoup-color-review, #9a6b1e);
}

/* ── Jump-to-section navigation ── */
body.resource-page .essay-nav {
    margin: 0 0 2.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 2px solid var(--stonesoup-text-rule, #c4b5a0);
    border-radius: 6px;
}

body.resource-page .essay-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

body.resource-page .essay-nav a {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    font-family: var(--stonesoup-font-ui, 'Source Sans 3', sans-serif);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--stonesoup-text-dark, #2a2520);
    text-decoration: none;
    background: var(--stonesoup-linen, #ede8df);
    border: 2px solid var(--stonesoup-text-rule, #c4b5a0);
    border-radius: 4px;
    transition: border-color 0.2s, background 0.2s;
}

body.resource-page .essay-nav a:hover {
    border-color: var(--stonesoup-color-poetry, #2560a0);
    background: #eef4fb;
}

/* ── "Try this" writing prompt boxes ── */
body.resource-page .try-this {
    margin: 1rem 0 1.5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 2px solid var(--stonesoup-text-rule, #c4b5a0);
    border-left: 5px solid var(--stonesoup-color-memoir, #1a826a);
    border-radius: 4px;
    font-style: italic;
}

body.resource-page .try-this strong {
    font-style: normal;
    color: var(--stonesoup-color-memoir, #1a826a);
}

/* ── Writer/subject info boxes ── */
body.resource-page .writer-box {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #fff;
    border: 2px solid var(--stonesoup-text-rule, #c4b5a0);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

body.resource-page .writer-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
}

body.resource-page .writer-box h3 {
    margin-top: 0;
}

/* Cycling Orphist accent bars on writer boxes */
body.resource-page .wb1::before { background: var(--stonesoup-color-story, #c04a25); }
body.resource-page .wb2::before { background: var(--stonesoup-color-poetry, #2560a0); }
body.resource-page .wb3::before { background: var(--stonesoup-color-art, #5c3db8); }
body.resource-page .wb4::before { background: var(--stonesoup-color-memoir, #1a826a); }
body.resource-page .wb5::before { background: var(--stonesoup-color-review, #9a6b1e); }
body.resource-page .wb6::before { background: var(--stonesoup-color-editorial, #a03058); }

/* ── Essay resource lists (bullet lists within writer boxes) ── */
body.resource-page .essay-resources {
    list-style: none;
    margin: 1rem 0;
    padding: 0;
}

body.resource-page .essay-resources li {
    margin-bottom: 0.7rem;
    padding-left: 1.2rem;
    position: relative;
    line-height: 1.6;
}

body.resource-page .essay-resources li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--stonesoup-color-memoir, #1a826a);
    font-weight: bold;
}

/* ── Essay section h2 with colored bottom border ── */
body.resource-page h2.essay-section {
    padding-bottom: 0.4rem;
    margin-top: 2.5rem;
}

/* Cycling border colors on essay sections */
body.resource-page h2.essay-section:nth-of-type(6n+1) { border-bottom: 3px solid var(--stonesoup-color-story, #c04a25); }
body.resource-page h2.essay-section:nth-of-type(6n+2) { border-bottom: 3px solid var(--stonesoup-color-poetry, #2560a0); }
body.resource-page h2.essay-section:nth-of-type(6n+3) { border-bottom: 3px solid var(--stonesoup-color-art, #5c3db8); }
body.resource-page h2.essay-section:nth-of-type(6n+4) { border-bottom: 3px solid var(--stonesoup-color-review, #9a6b1e); }
body.resource-page h2.essay-section:nth-of-type(6n+5) { border-bottom: 3px solid var(--stonesoup-color-memoir, #1a826a); }
body.resource-page h2.essay-section:nth-of-type(6n+6) { border-bottom: 3px solid var(--stonesoup-color-editorial, #a03058); }

/* ── Footer note box ── */
body.resource-page .essay-note {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border: 2px solid var(--stonesoup-text-rule, #c4b5a0);
    border-left: 5px solid var(--stonesoup-color-memoir, #1a826a);
    border-radius: 4px;
    font-size: 0.95rem;
}

body.resource-page .essay-note p {
    margin: 0 0 0.5rem;
}

body.resource-page .essay-note p:last-child {
    margin-bottom: 0;
}

/* ── Essay responsive ── */
@media (max-width: 768px) {
    body.resource-page .essay-nav ul {
        flex-direction: column;
        gap: 0.3rem;
    }

    body.resource-page .essay-nav a {
        display: block;
        text-align: center;
    }
}

/* ── Print ── */
@media print {
    body.resource-page .resource-links a {
        color: var(--stonesoup-text-dark, #2a2520);
    }

    body.resource-page .resource-links a::after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
        color: #666;
    }

    body.resource-page .essay-nav {
        display: none;
    }

    body.resource-page .try-this {
        border-left-color: #999;
        background: #f9f9f9;
    }

    body.resource-page .writer-box {
        break-inside: avoid;
    }

    body.resource-page .essay-resources a::after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
        color: #666;
    }
}
