/* Le Nouveau Troubadour — Classic literary design */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=EB+Garamond:ital,wght@0,400;0,500;1,400;1,500&display=swap');

:root {
    --cream: #FDF8F0;
    --ivory: #FAF5EB;
    --ink: #2C2416;
    --ink-light: #5C4F3A;
    --ink-faint: #9B8E78;
    --accent: #8B4513;
    --rule: #D4C5A9;
    --max-width: 640px;
}

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

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    background-color: var(--cream);
    color: var(--ink);
    line-height: 1.8;
    min-height: 100vh;
}

/* Header */
header {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 2rem;
}

header h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 2.4rem;
    letter-spacing: 0.05em;
    color: var(--ink);
    margin-bottom: 0.3rem;
}

header .subtitle {
    font-style: italic;
    color: var(--ink-light);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

header .author {
    margin-top: 0.8rem;
    font-variant: small-caps;
    font-size: 1rem;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
}

/* Navigation */
nav {
    text-align: center;
    padding: 0.8rem 1rem;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
}

nav a {
    color: var(--ink-light);
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--accent);
}

/* Main content */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* Common page blocks */
.page-intro {
    text-align: center;
    margin-bottom: 1.8rem;
}

.page-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.page-subtitle {
    color: var(--ink-light);
    font-style: italic;
}

.empty-note {
    text-align: center;
    font-style: italic;
    color: var(--ink-faint);
    padding: 2rem 0;
}

/* Theme filter bar */
.theme-filter {
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--rule);
}

.filter-label {
    font-variant: small-caps;
    letter-spacing: 0.08em;
    color: var(--ink-light);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.theme-filter-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scrollbar-width: thin;
}

.theme-filter-btn {
    border: 1px solid var(--rule);
    background: var(--ivory);
    color: var(--ink-light);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.theme-filter-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.theme-filter-btn.is-active {
    color: var(--cream);
    background: var(--accent);
    border-color: var(--accent);
}

/* Poem cards on index */
.poem-card {
    padding: 2rem 0;
    border-bottom: 1px solid var(--rule);
}

.poem-card:last-child {
    border-bottom: none;
}

.poem-card h2 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.poem-card h2 a {
    color: var(--ink);
    text-decoration: none;
    transition: color 0.2s;
}

.poem-card h2 a:hover {
    color: var(--accent);
}

.poem-card .date {
    font-style: italic;
    color: var(--ink-faint);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.poem-card .excerpt {
    color: var(--ink-light);
    font-size: 1rem;
    line-height: 1.9;
}

.theme-tags {
    margin-top: 0.8rem;
    font-size: 0.85rem;
    font-style: italic;
    color: var(--accent);
}

.theme-tag {
    color: var(--accent);
    text-decoration: none;
}

.theme-tag:hover {
    text-decoration: underline;
}

.theme-separator {
    margin: 0 0.35rem;
    color: var(--ink-faint);
}

/* Theme index page */
.theme-index {
    list-style: none;
    border-top: 1px solid var(--rule);
}

.theme-index li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
}

.theme-index a {
    color: var(--ink);
    text-decoration: none;
    font-size: 1.2rem;
}

.theme-index a:hover {
    color: var(--accent);
}

.theme-count {
    color: var(--ink-faint);
    font-style: italic;
    white-space: nowrap;
}

/* Selection page */
.selection-stars {
    color: var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

/* Full poem page */
.poem-full {
    padding: 2rem 0;
}

.poem-full h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 0.3rem;
}

.poem-full .date {
    text-align: center;
    font-style: italic;
    color: var(--ink-faint);
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
}

.poem-full .theme-tags {
    text-align: center;
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.poem-full .ornament {
    margin: 0.45rem 0 1rem;
}

.poem-full .poem-text {
    text-align: center;
    font-size: 1.1rem;
    line-height: 2;
    white-space: pre-line;
}

.poem-full .poem-text .stanza {
    margin-bottom: 1.5rem;
}

/* Back link */
.back {
    display: block;
    text-align: center;
    margin-top: 3rem;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
}

.back a {
    color: var(--ink-faint);
    text-decoration: none;
    transition: color 0.2s;
}

.back a:hover {
    color: var(--accent);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    border-top: 1px solid var(--rule);
    color: var(--ink-faint);
    font-size: 0.85rem;
    font-style: italic;
}

/* Ornamental divider */
.ornament {
    text-align: center;
    color: var(--rule);
    font-size: 1.5rem;
    margin: 1.5rem 0;
    letter-spacing: 0.5em;
}

/* Responsive */
@media (max-width: 600px) {
    html { font-size: 16px; }
    header h1 { font-size: 1.8rem; }
    nav a { margin: 0 0.55rem; }
    .theme-filter { margin-bottom: 0.8rem; }
    .theme-index li { align-items: flex-start; flex-direction: column; gap: 0.1rem; }
    .poem-full .poem-text { font-size: 1rem; }
}


/* Size toggle — elegant button in header */
.size-toggle {
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
    margin-top: 0.8rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--rule);
    border-radius: 2rem;
    background: transparent;
    color: var(--ink-faint);
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.02em;
    -webkit-tap-highlight-color: transparent;
}
.size-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.size-icon {
    font-weight: 400;
}
.size-icon-big {
    font-size: 1.15em;
    font-weight: 600;
}
.size-toggle[data-level="large"] {
    border-color: var(--accent);
    color: var(--accent);
}
.size-toggle[data-level="xlarge"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--cream);
}

/* Size: large */
body.size-large {
    font-size: 1.2rem;
    line-height: 2.1;
}
body.size-large .poem-full .poem-text {
    font-size: 1.35rem;
    line-height: 2.4;
}
body.size-large .poem-card .excerpt {
    font-size: 1.1rem;
}
body.size-large .poem-card h2 {
    font-size: 1.7rem;
}

/* Size: xlarge — for dad */
body.size-xlarge {
    font-size: 1.55rem;
    line-height: 2.4;
    font-weight: 500;
}
body.size-xlarge main {
    max-width: 100%;
    padding: 0 1rem 3rem;
}
body.size-xlarge .poem-full .poem-text {
    font-size: 1.75rem;
    line-height: 2.7;
    font-weight: 500;
}
body.size-xlarge .poem-full h1 {
    font-size: 2rem;
}
body.size-xlarge .poem-card .excerpt {
    font-size: 1.4rem;
    line-height: 2.4;
    font-weight: 500;
}
body.size-xlarge .poem-card h2 {
    font-size: 1.8rem;
}
body.size-xlarge .poem-card .date {
    font-size: 1rem;
}
body.size-xlarge header h1 {
    font-size: 2rem;
}
body.size-xlarge nav a {
    font-size: 1.1rem;
}
body.size-xlarge .theme-tags {
    font-size: 0.95rem;
}

@media (max-width: 600px) {
    body.size-large {
        font-size: 1.15rem;
    }
    body.size-large .poem-full .poem-text {
        font-size: 1.25rem;
    }
    body.size-xlarge {
        font-size: 1.35rem;
    }
    body.size-xlarge .poem-full .poem-text {
        font-size: 1.6rem;
        line-height: 2.5;
        font-weight: 500;
    }
    body.size-xlarge .poem-full h1 {
        font-size: 1.7rem;
    }
}
