/* ============================================================
   common.css — base styles shared across all themed pages.
   Theme-specific files (library/cinema/disco) override colors,
   fonts, and decorative flourishes.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #f4f1ea;
}

a { color: inherit; }

/* --- Site nav --- */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2.5rem;
    background: rgba(20, 20, 20, 0.92);
    backdrop-filter: blur(8px);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-nav .brand {
    font-family: 'DM Mono', monospace;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-decoration: none;
    color: #ffbe0b;
}
.site-nav .nav-links { display: flex; gap: 1.5rem; align-items: center; }
.site-nav .nav-links a {
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
    transition: opacity 0.2s;
}
.site-nav .nav-links a:hover { opacity: 1; }
.site-nav .nav-cta {
    background: #ffbe0b;
    color: #1a0033;
    border: 1px solid #ffbe0b;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    opacity: 1 !important;
    transition: background 0.15s, transform 0.15s;
}
.site-nav .nav-cta:hover {
    background: #ffd13f;
    transform: translateY(-1px);
}

/* --- Flash message --- */
.flash {
    max-width: 1100px;
    margin: 1.5rem auto -0.5rem;
    padding: 0.85rem 1.25rem;
    background: #1a1a1a;
    color: #f4f1ea;
    border-radius: 4px;
    font-size: 0.92rem;
    animation: flashIn 0.4s ease-out;
}
@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Generic page container --- */
.page-container { max-width: 1200px; margin: 0 auto; padding: 3rem 2rem; }

/* --- Generic item card list (used inside each theme) --- */
.item-list { display: grid; gap: 1rem; }
.item-card {
    padding: 1.25rem 1.5rem;
    border-radius: 6px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
    transition: transform 0.15s ease;
}
.item-card:hover { transform: translateY(-2px); }
.item-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 0.25rem; }
.item-creator { font-size: 0.9rem; opacity: 0.75; margin: 0 0 0.5rem; }
.item-notes { font-size: 0.88rem; opacity: 0.85; margin: 0.5rem 0 0; font-style: italic; }
.item-meta { font-size: 0.75rem; opacity: 0.6; letter-spacing: 0.05em; text-transform: uppercase; margin-top: 0.5rem; }
.item-card.completed { opacity: 0.55; }
.item-card.completed .item-title { text-decoration: line-through; }

.item-actions { display: flex; flex-direction: column; gap: 0.4rem; }
.item-actions form { margin: 0; }
.btn-icon {
    background: none;
    border: 1px solid currentColor;
    color: inherit;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 3px;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-icon:hover { background: currentColor; color: var(--bg, #fff); }

/* --- Add/Edit form --- */
.form-card {
    max-width: 640px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.form-card h1 {
    margin: 0 0 1.5rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 500;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.7;
}
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: 1px solid #d1cfc8;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    background: #fafaf7;
    transition: border-color 0.15s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #1a1a1a;
}
.form-group textarea { resize: vertical; min-height: 90px; }

.radio-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.radio-group label {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border: 2px solid #d1cfc8;
    border-radius: 4px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.95rem;
    opacity: 1;
    transition: border-color 0.15s, background 0.15s;
}
.radio-group label:has(input:checked) {
    border-color: #1a1a1a;
    background: #1a1a1a;
    color: #fff;
}
.radio-group input[type="radio"] { accent-color: #fff; }

.btn-primary {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
    transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.85; }
.btn-secondary {
    background: transparent;
    color: #1a1a1a;
    border: 1px solid #1a1a1a;
    padding: 0.85rem 2rem;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    text-decoration: none;
    font-family: inherit;
    display: inline-block;
}

.field-error { color: #b00020; font-size: 0.85rem; margin-top: 0.3rem; }

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    opacity: 0.6;
}

/* --- Footer --- */
.site-footer {
    margin-top: 5rem;
    padding: 3rem 2.5rem 1.5rem;
    background: #0f0f0f;
    color: #d6d6d6;
    border-top: 3px solid #ffbe0b;
}
.site-footer a {
    color: #d6d6d6;
    text-decoration: none;
    transition: color 0.15s;
}
.site-footer a:hover {
    color: #ffbe0b;
}

.footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand-name {
    font-family: 'DM Mono', monospace;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: #ffbe0b;
    margin-bottom: 0.75rem;
}
.footer-brand-blurb {
    font-size: 0.9rem;
    line-height: 1.55;
    opacity: 0.7;
    max-width: 28ch;
    margin: 0;
}

.footer-col-heading {
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #ffbe0b;
    margin: 0 0 1rem;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.footer-col li a {
    font-size: 0.92rem;
    line-height: 1.4;
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 1.25rem;
    font-size: 0.78rem;
    opacity: 0.55;
    text-align: center;
}
.footer-bottom .footer-sep {
    margin: 0 0.6em;
    opacity: 0.5;
}

@media (max-width: 720px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        text-align: left;
    }
    .footer-bottom .footer-sep {
        display: block;
        height: 0.4rem;
        margin: 0;
        font-size: 0;
    }
}

/* --- Homepage three-section grid --- */
.home-hero {
    text-align: center;
    padding: 4.5rem 2rem 3rem;
    max-width: 900px;
    margin: 0 auto;
}
.home-hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 500;
    margin: 0 0 0.75rem;
    letter-spacing: -0.01em;
}

/* Three-line themed hero — each line uses its category's signature font */
.home-hero h1.hero-poem {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    line-height: 1.05;
    margin: 0 0 1.25rem;
}
.hero-poem .line { display: block; }
.hero-poem .line-books {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: 1.18em;
    text-decoration: underline;
    text-decoration-color: #000;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}
.hero-poem .line-movies {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.04em;
    font-weight: 400;
}
.hero-poem .line-music {
    font-family: 'Audiowide', sans-serif;
    /* Audiowide reads wider per character — scale down for visual balance */
    font-size: 0.78em;
    letter-spacing: 0.01em;
}
.home-hero .tagline {
    font-size: 1.1rem;
    opacity: 0.7;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.5;
}
.home-hero .count {
    margin-top: 1.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.55;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem;
}
.home-section {
    border-radius: 12px;
    overflow: hidden;
    min-height: 460px;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    color: inherit;
}
.home-section:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.12);
}
.home-section-header {
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.home-section-header h2 {
    margin: 0;
    font-size: 2rem;
    letter-spacing: 0.02em;
}
.home-section-header .label {
    display: block;
    margin-bottom: 0.5rem;
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.7;
}
.home-section-list {
    list-style: none;
    padding: 1.5rem 2rem;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}
.home-section-list li {
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
}
.home-section-list li:last-child { border-bottom: none; }
.home-section-list li.completed { opacity: 0.45; text-decoration: line-through; }
.home-section-cta {
    padding: 1rem 2rem;
    text-align: center;
    font-family: 'DM Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* Homepage section variants — color shifts only; theme pages do the heavy lifting */
.home-section.books {
    background: linear-gradient(180deg, #f5e9d4 0%, #ead7b1 100%);
    color: #3d2817;
}
.home-section.books .home-section-header { background: #3d2817; color: #f5e9d4; }
.home-section.books .home-section-cta { background: #ffbe0b; color: #000; }

.home-section.movies {
    background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    color: #e8e8e8;
}
.home-section.movies .home-section-header { background: #dc143c; color: #fff; }
.home-section.movies .home-section-list li { border-bottom-color: rgba(255,255,255,0.08); }
.home-section.movies .home-section-cta { background: #ffbe0b; color: #0a0a0a; }

.home-section.music {
    background: linear-gradient(135deg, #ff006e 0%, #8338ec 50%, #3a86ff 100%);
    color: #fff;
}
.home-section.music .home-section-header { background: rgba(0,0,0,0.4); }
.home-section.music .home-section-list li { border-bottom-color: rgba(255,255,255,0.18); }
.home-section.music .home-section-cta { background: #ffbe0b; color: #1a0033; }
