/* ============================================================
   DramaFind — Public pages stylesheet
   Tokens: ink background, warm parchment text, brick-red accent,
   gold reserved for ratings only. Fraunces for editorial display
   type, Inter for UI/body. See /mnt/skills design notes in commit
   message for rationale.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400..700&family=Inter:wght@400;500;600&display=swap');

:root {
    --ink: #15121c;
    --surface: #201c2b;
    --surface-2: #2a2438;
    --text: #f1ece4;
    --text-muted: #9c93a8;
    --accent: #c1443d;
    --accent-hover: #d85a52;
    --gold: #e3a94b;
    --border: rgba(255, 255, 255, 0.09);
    --radius: 10px;
    --content-max: 1140px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

h1, h2, h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; color: var(--text); max-width: 68ch; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 24px;
}

.muted { color: var(--text-muted); font-size: 0.9em; }

/* ---------- Header / nav ---------- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 24px;
    flex-wrap: wrap;
}

.brand {
    font-family: 'Fraunces', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.search-form {
    flex: 1 1 320px;
    display: flex;
    max-width: 480px;
}

.search-form input,
.hero-search input {
    flex: 1;
    background: var(--ink);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 14px;
    border-radius: var(--radius) 0 0 var(--radius);
    font-family: inherit;
    font-size: 0.95rem;
}

.search-form button,
.hero-search button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
}

.search-form button:hover,
.hero-search button:hover { background: var(--accent-hover); }

.site-nav { display: flex; gap: 20px; margin-left: auto; }
.site-nav a { color: var(--text-muted); font-size: 0.95rem; }
.site-nav a.is-active, .site-nav a:hover { color: var(--text); }

/* ---------- Hero ---------- */

.hero {
    padding: 64px 0 40px;
    max-width: 640px;
}

.hero p { color: var(--text-muted); }

.hero-search { display: flex; max-width: 480px; margin: 20px 0 10px; }
.hero-search input { padding: 12px 16px; font-size: 1rem; }
.hero-search button { padding: 12px 22px; }

.hero-search__alt {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 1px solid transparent;
}
.hero-search__alt:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Quick categories ---------- */

.quick-categories {
    display: grid;
    gap: 28px;
    padding: 20px 0 8px;
    border-top: 1px solid var(--border);
}

.quick-categories__group h2 { font-size: 1.1rem; margin: 0 0 12px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.88rem;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip--static { cursor: default; }
.chip--static:hover { border-color: var(--border); }

.chip__count { color: var(--text-muted); font-size: 0.82em; }

.chip-list--muted .chip { background: transparent; }

/* ---------- Home sections / drama grid ---------- */

.home-section { padding: 36px 0; border-top: 1px solid var(--border); }

.home-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}
.home-section__head h2 { margin: 0; }
.home-section__head a { font-size: 0.9rem; color: var(--text-muted); }
.home-section__head a:hover { color: var(--accent); }

.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 18px;
}

.drama-card {
    display: block;
    color: var(--text);
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.drama-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.drama-card__poster {
    position: relative;
    aspect-ratio: 2 / 3;
    background: var(--surface-2);
}
.drama-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.drama-card__rating {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(21, 18, 28, 0.85);
    color: var(--gold);
    font-size: 0.82rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
}

.drama-card__body { padding: 10px 12px 14px; }
.drama-card__title {
    font-size: 0.95rem;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta-inline {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.meta-inline li:not(:first-child)::before { content: '•'; margin-right: 6px; opacity: 0.6; }

.drama-detail__meta { font-size: 0.92rem; margin-bottom: 16px; }

.empty-state {
    padding: 48px 0;
    color: var(--text-muted);
    text-align: center;
}
.empty-state h1 { color: var(--text); }

.notice {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 16px 0;
    font-size: 0.9rem;
}
.notice--warning {
    background: rgba(227, 169, 75, 0.12);
    border: 1px solid rgba(227, 169, 75, 0.4);
    color: var(--gold);
}

/* ---------- Search filter bar ---------- */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0 28px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
}

.filter-bar input[type="search"],
.filter-bar select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
}

.filter-bar input[type="search"] { flex: 1 1 220px; }

.filter-bar button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
}
.filter-bar button:hover { background: var(--accent-hover); }

.filter-bar__reset {
    align-self: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.filter-bar__reset:hover { color: var(--accent); }

/* ---------- Listing pages ---------- */

.listing-head { padding: 32px 0 24px; }
.listing-head--platform,
.listing-head--actor {
    display: flex;
    align-items: center;
    gap: 20px;
}
.listing-head__logo { max-height: 48px; }
.listing-head__photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 32px 0;
}
.pagination__status { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Drama detail ---------- */

.drama-detail {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 36px;
    padding: 36px 0;
}
.drama-detail__poster img {
    width: 100%;
    border-radius: var(--radius);
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 1px solid var(--border);
}
.drama-detail__original-title { color: var(--text-muted); margin-top: -8px; }

.drama-detail__status {
    text-transform: capitalize;
}
.drama-detail__status--ongoing { color: var(--gold); }

.drama-detail__synopsis { max-width: 68ch; white-space: pre-line; }

.actor-list, .platform-list { display: flex; flex-wrap: wrap; gap: 12px; }

.actor-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    font-size: 0.85rem;
}
.actor-chip img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.platform-chip {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.platform-chip:hover { border-color: var(--accent); }

.episode-list { padding-left: 20px; color: var(--text-muted); }
.episode-list li { margin-bottom: 4px; }
.episode-list strong { color: var(--text); }

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 28px 0 40px;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.site-footer__inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-nav { display: flex; gap: 16px; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .drama-detail { grid-template-columns: 1fr; }
    .drama-detail__poster { max-width: 220px; }
    .site-header__inner { gap: 12px; }
    .site-nav { width: 100%; justify-content: flex-start; margin-left: 0; }
}
