:root {
  --primary: #16233F;   /* deep navy ink */
  --accent: #a67b1e;    /* antique gold */
  --band: #f0ece4;      /* warm cream band */
  --paper: #f7f3f0;     /* page background (paper) */
  --ink: #16233F;
  --text: #23272e;
  --muted: #7c7468;
  --border: #e0d9cd;    /* warm hairline */
  --serif: "Source Serif 4", "Noto Serif KR", Georgia, serif;
  --sans: "Public Sans", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  line-height: 1.65;
}

h1, h2, h3, h4 { font-family: var(--serif); color: var(--primary); font-weight: 600; letter-spacing: -0.01em; }

/* Small uppercase gold eyebrow label */
.eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.container { max-width: 1040px; margin: 0 auto; padding: 8px 32px 64px; }

.hero h1 { color: var(--primary); }
.muted { color: var(--muted); }

.button {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--primary);
  border-radius: 2px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.button:hover { background: var(--primary); color: #fff; }

/* Filled gold call-to-action */
.button.apply-cta, .site-nav a.apply, .button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #23180a;
}
.button.apply-cta:hover, .site-nav a.apply:hover, .button.primary:hover {
  background: #8f6817; border-color: #8f6817; color: #fff;
}

/* --- Flash messages ------------------------------------------------------ */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.messages .msg {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 8px;
  border: 1px solid var(--border);
}
.messages .msg-success { background: #e6f4ea; border-color: #97c9a9; }
.messages .msg-error { background: #fdeaea; border-color: #e0a3a3; }
.messages .msg-info, .messages .msg-warning { background: var(--band); }

/* --- Language toggle ----------------------------------------------------- */
.lang-toggle { display: inline-flex; align-items: center; gap: 4px; }
.lang-toggle .lang-opt {
  background: none; border: 0; cursor: pointer; padding: 2px 4px;
  font-size: 13px; color: var(--muted);
}
.lang-toggle .lang-opt.active { color: var(--primary); font-weight: 600; }
.lang-toggle .lang-sep { color: var(--border); }

/* --- Nav dropdown (Past Recipients) -------------------------------------- */
.nav-dropdown { position: relative; }
.nav-dropdown .nav-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 0; min-width: 160px; z-index: 20;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.nav-dropdown:hover .nav-menu { display: block; }
.nav-dropdown .nav-menu a { display: block; padding: 8px 16px; }

/* --- How-to steps / FAQ / recipients ------------------------------------- */
.steps { padding-left: 0; counter-reset: step; list-style: none; }
.steps .step {
  position: relative; padding: 12px 0 12px 48px;
  border-bottom: 1px solid var(--border);
}
.steps .step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.faq-item {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; margin: 8px 0;
}
.faq-item summary { cursor: pointer; font-weight: 600; }
/* Photo Gallery — album cards (shares the recipient year-card look) */
.album-grid {
  display: grid; gap: 16px; margin: 16px 0 24px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.album-card {
  display: block; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.album-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.album-thumb {
  height: 160px; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.album-thumb img { width: 100%; height: 100%; object-fit: cover; }
.album-thumb .album-num { color: #fff; font-size: 30px; font-weight: 700; }
.album-meta { padding: 12px 16px; }
.album-meta h3 { margin: 0 0 4px; color: var(--primary); font-size: 15px; }

/* Past Recipients — year index cards */
.year-grid {
  display: grid; gap: 16px; margin: 16px 0 24px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.year-card {
  display: block; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; text-decoration: none; color: inherit;
  transition: box-shadow .15s, transform .15s;
}
.year-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.year-thumb {
  height: 150px; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.year-thumb img { width: 100%; height: 100%; object-fit: cover; }
.year-thumb .year-num { color: #fff; font-size: 34px; font-weight: 700; letter-spacing: 1px; }
.year-meta { padding: 12px 16px; }
.year-meta h3 { margin: 0 0 4px; color: var(--primary); font-size: 15px; }
.recipient-hero {
  width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin: 8px 0 16px;
}

.recipient-year { margin-bottom: 28px; }
.recip-cat {
  margin: 16px 0 4px; padding: 6px 10px;
  background: var(--band); border-left: 4px solid var(--accent);
  font-size: 15px; color: var(--primary);
}
table.recipients { width: 100%; border-collapse: collapse; margin: 0 0 10px; }
table.recipients thead th {
  background: var(--primary); color: #fff; font-size: 13px;
}
table.recipients th, table.recipients td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
table.recipients th:last-child, table.recipients td:last-child { width: 62%; }
table.recipients tbody tr:nth-child(even) { background: #f7f9fc; }

/* Recipient cards (photo + text) */
.recipient-grid {
  display: grid; gap: 16px; margin-bottom: 24px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.recipient-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 16px; text-align: center;
}
.recipient-card img {
  width: 120px; height: 120px; object-fit: cover; border-radius: 50%; margin-bottom: 8px;
}
.recipient-card h3 { margin: 4px 0; }

/* Category / step photos */
.category-image {
  width: 100%; max-width: 300px; height: auto; border-radius: 8px; margin: 8px 0 16px;
}
.step-image {
  max-width: 240px; border-radius: 6px; margin: 6px 0; display: block;
}

/* --- Tabs (Categories page; also reused for the application form) -------- */
.tab-bar {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 2px solid var(--border); margin-bottom: 20px;
}
.tab-bar .tab {
  background: none; border: 0; cursor: pointer;
  padding: 12px 20px; font-size: 15px; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tab-bar .tab.active {
  color: var(--primary); font-weight: 600;
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel .award { color: var(--primary); font-weight: 600; }
.tab-bar .tab.has-error { color: #b00; }
.tab-error-dot { color: #b00; font-weight: 700; }

/* Application form fields */
.field { margin: 14px 0; }
.field-label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
.field-label .req { color: #b00; }
.field-label .opt { color: var(--muted); font-size: 12px; }
.field-prompt { font-size: 13px; color: #333; margin-bottom: 6px; white-space: pre-wrap; }
.field-error { color: #b00; font-size: 12px; margin-top: 4px; }
.field input[type=text], .field input[type=email], .field input[type=number],
.field input[type=date], .field select { padding: 6px 8px; min-width: 260px; }

/* --- Hero banner carousel (slides sideways) ------------------------------ */
.carousel {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: -32px;            /* flush to header */
  overflow: hidden;
}
.carousel-track {
  display: flex;
  transition: transform 0.6s ease;
}
.carousel-slide {
  position: relative;
  min-width: 100%;
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), #25508f);
  color: #fff;
}
.carousel-slide .slide-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; opacity: 0.4;
}
.carousel-slide .slide-caption { position: relative; z-index: 1; padding: 0 24px; }
.carousel-slide h1 { color: #fff; font-size: 2.8rem; letter-spacing: 2px; margin: 0 0 10px; }
.carousel-slide p { font-size: 1.4rem; font-style: italic; color: var(--accent); margin: 0 0 18px; }
.apply-cta {
  background: var(--accent) !important; border-color: var(--accent) !important;
  color: #1a1a1a !important; font-weight: 600; padding: 12px 28px;
}
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.3); color: #fff; border: 0;
  width: 44px; height: 44px; font-size: 28px; cursor: pointer; z-index: 2;
}
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.next { right: 12px; }
.carousel-dots {
  position: absolute; bottom: 16px; left: 0; right: 0;
  display: flex; gap: 8px; justify-content: center; z-index: 2;
}
.carousel-dots .dot {
  width: 11px; height: 11px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,0.5); cursor: pointer;
}
.carousel-dots .dot.active { background: var(--accent); }

/* --- Public home: full-width bands, alternating backgrounds --------------- */
.home-section {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 64px 24px;
}
.home-section > * {
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}
.home-section:nth-of-type(even) { background: var(--band); }
.home-section:first-child { margin-top: -32px; }   /* flush to header */
.home-section h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 8px;
}

/* Hero */
.home-hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary), #25508f);
  color: #fff;
  text-align: center;
  padding: 120px 24px;
}
.home-hero h1 {
  color: #fff;
  font-size: 2.8rem;
  letter-spacing: 2px;
  margin: 0 0 8px;
}
.home-hero .hero-subtitle {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent);
  margin: 0 0 16px;
}
.home-hero .hero-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%; max-width: none;
  object-fit: cover; opacity: 0.35; z-index: 0;
}
.home-hero > *:not(.hero-image) { position: relative; z-index: 1; }
.home-hero .button {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #1a1a1a !important;
  font-weight: 600;
  padding: 12px 28px;
}

/* Dates list (legacy; schedule grid replaces it on the home page) */
.home-section .dates { list-style: none; padding: 0; }
.home-section .dates li { margin: 4px 0; }
/* Categories: ruled list (editorial), left-aligned */
.home-section .categories {
  list-style: none; padding: 0; text-align: left; margin: 24px 0 0; max-width: 720px;
}
.home-section .categories li {
  display: flex; align-items: baseline; gap: 18px;
  margin: 0; padding: 16px 4px; border: 0; border-top: 1px solid var(--border);
}
.home-section .categories li:last-child { border-bottom: 1px solid var(--border); }

/* Gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.gallery-grid img {
  width: 100%; height: 150px; object-fit: cover; border-radius: 6px;
}
.gallery-grid figcaption { font-size: 12px; color: var(--muted); }

/* Announcement cards */
.announcement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.announcement {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 0;
  overflow: hidden;
}
.announcement img {
  display: block;
  width: calc(100% + 40px);   /* bleed to the card edges */
  height: auto;               /* keep each image's natural aspect (like live) */
  margin: -16px -20px 12px;
}
.announcement h3 { margin: 0 0 4px; }

/* Top navigation menu */
.site-nav { display: flex; gap: 18px; align-items: center; }
.site-nav a { color: var(--text); text-decoration: none; font-size: 14px; }
.site-nav a.apply {
  background: var(--accent); color: #1a1a1a;
  padding: 6px 14px; border-radius: 6px; font-weight: 600;
}

/* ======================================================================
   EDITORIAL THEME — Source Serif + navy ink + antique gold on warm paper.
   Appended last so it refines the base component styles above.
   ====================================================================== */

/* Navigation */
.site-nav a { color: var(--primary); font-size: 14.5px; font-weight: 500; }
.site-nav a:hover { color: var(--accent); }
.site-nav a.apply { border-radius: 2px; padding: 9px 18px; }
.lang-toggle .lang-opt.active { color: var(--accent); }

/* Hero carousel — navy scrim over the photo, serif headline, gold CTA */
.carousel { margin-top: 0; border-bottom: 1px solid var(--border); }
.carousel-slide { height: 540px; background: var(--primary); text-align: left; }
.carousel-slide .slide-image { opacity: .5; }
.carousel-slide::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(90deg, rgba(16,22,40,.85), rgba(16,22,40,.5) 60%, rgba(16,22,40,.2));
}
.carousel-slide .slide-caption {
  z-index: 2; width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 32px;
}
.carousel-slide h1 {
  font-family: var(--serif); color: #fff; font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -.02em; line-height: 1.05;
  margin: 0 0 14px; max-width: 13ch;
}
.carousel-slide p {
  font-family: var(--sans); font-style: normal; color: #e9e2d4;
  font-size: 1.15rem; margin: 0 0 24px; max-width: 42ch;
}
.carousel-dots { justify-content: flex-start; padding-left: max(32px, calc(50% - 520px)); }

/* Sections — alternating paper / cream, left-aligned, gold-eyebrow serif heads */
.home-section { padding: 76px 32px; }
.home-section:nth-of-type(even) { background: var(--band); }
.home-section > * { max-width: 1040px; text-align: left; }
.home-section h2 {
  text-align: left; font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 4px 0 14px; line-height: 1.12;
}
.home-section .eyebrow { display: block; margin-bottom: 2px; }
.home-section p { max-width: 64ch; font-size: 1.05rem; }
.home-section .section-lead { margin-top: 0; }

/* Printed schedule grid */
.schedule {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border: 1px solid var(--primary); background: #fff; margin: 18px 0 4px;
}
.schedule-cell {
  padding: 22px 24px; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.schedule-cell:last-child { border-right: 0; }
.schedule-cell .sched-date { font-family: var(--serif); font-size: 1.5rem; color: var(--primary); }
.schedule-cell.due { background: #fbf6ea; }
.schedule-cell.due .sched-date { color: var(--accent); }

/* Categories as a ruled list */
.categories { list-style: none; padding: 0; margin: 24px 0 0; max-width: 720px; }
.categories li {
  display: flex; align-items: baseline; gap: 18px;
  padding: 16px 4px; border-top: 1px solid var(--border);
}
.categories li:last-child { border-bottom: 1px solid var(--border); }
.categories .cat-index {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  color: var(--accent); letter-spacing: .1em; min-width: 2ch;
}
.categories .cat-name { font-family: var(--serif); font-size: 1.25rem; color: var(--primary); }

/* Announcements / gallery / cards — squared, hairline, editorial */
.announcement, .gallery-grid img, .year-card, .album-card,
.recipient-hero, .category-image, .button { border-radius: 2px; }
.announcement { border-color: var(--border); background: #fff; }
.announcement h3 { font-size: 1.15rem; }
.home-section .announcement-grid, .home-section .gallery-grid { margin-top: 20px; }
.home-section .button { margin-top: 6px; }
.home-section .button + .button { margin-left: 10px; }

@media (max-width: 700px) {
  .site-header { flex-wrap: wrap; padding: 14px 20px; }
  .carousel-slide { height: 440px; }
  .home-section { padding: 52px 20px; }
}

/* Editorial: hero uses dots + auto-advance; hide the overlapping side arrows */
.carousel-arrow { display: none; }
.carousel-dots .dot { background: rgba(255,255,255,.45); }
.carousel-dots .dot.active { background: var(--accent); }

/* Editorial link colors (navy with gold hover) — public content only */
.container a:not(.button):not(.apply) { color: var(--primary); text-underline-offset: 2px; }
.container a:not(.button):not(.apply):hover { color: var(--accent); }
.announcement h3 a, .year-card, .album-card { text-decoration: none; }
.announcement h3 a { color: var(--primary); }
.announcement h3 a:hover { color: var(--accent); }

/* ======================================================================
   EDITORIAL — inner public pages (categories, how-to, faq, recipients, gallery)
   Selectors scoped so the home page bands above are untouched.
   ====================================================================== */

/* Page title + intro */
.container > h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 10px 0 6px; line-height: 1.08; }
.container > h1 + .muted { margin-top: 0; }
.container > h2 { font-size: 1.5rem; margin: 34px 0 10px; }   /* FAQ section heads */

/* How to Apply — large gold serif numerals, hairline rows */
.steps .step { padding: 22px 0 22px 66px; border-bottom: 1px solid var(--border); }
.steps .step:first-child { border-top: 1px solid var(--border); }
.steps .step::before {
  content: counter(step); counter-increment: step;
  width: auto; height: auto; border-radius: 0; background: none;
  color: var(--accent); font-family: var(--serif); font-weight: 700; font-size: 30px;
  top: 18px; left: 6px;
}
.steps .step h3 { font-size: 1.3rem; margin: 0 0 6px; }
.steps .step p { max-width: 64ch; }
.steps + p { margin-top: 24px; }

/* FAQ — hairline accordion, serif questions, gold +/- marker */
.faq-item {
  border: 0; border-top: 1px solid var(--border); border-radius: 0;
  padding: 16px 0; margin: 0;
}
.faq-item:last-of-type { border-bottom: 1px solid var(--border); }
.faq-item summary {
  font-family: var(--serif); font-size: 1.15rem; color: var(--primary);
  list-style: none; position: relative; padding-right: 30px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 2px; top: -3px;
  color: var(--accent); font-size: 1.5rem; line-height: 1;
}
.faq-item[open] summary::after { content: "\2013"; }
.faq-item p { margin: 10px 0 2px; max-width: 70ch; }

/* Recipient / album cards — serif meta, squared, taller thumb */
.year-meta h3, .album-meta h3 { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; }
.year-thumb, .album-thumb { height: 172px; }
.recip-cat { font-family: var(--serif); }
.recipient-year { margin-bottom: 40px; }

/* Categories page — serif panel title */
.tab-panel h2, .tab-panel h3 { font-size: 1.8rem; margin: 10px 0 12px; }
.tab-panel .award { color: var(--accent); }

/* ======================================================================
   EDITORIAL — forms (login / magic-link / application)
   ====================================================================== */
input[type=text], input[type=email], input[type=number], input[type=date],
input[type=password], input[type=url], input[type=tel], textarea, select {
  font-family: var(--sans); font-size: 15px; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 2px;
  padding: 10px 12px; max-width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(166,123,30,.16);
}
textarea { width: 100%; min-height: 120px; }
.field { margin: 18px 0; }
.field-label { color: var(--primary); font-weight: 600; font-size: 13.5px; }
.field-prompt { color: var(--muted); font-size: 13.5px; }
.field input[type=text], .field input[type=email], .field input[type=number],
.field input[type=date], .field select { min-width: 320px; padding: 10px 12px; }

/* Application form: heading + action bar */
#appform .tab-bar { border-bottom-width: 1px; }
#appform > p:first-of-type label { color: var(--primary); font-weight: 600; }
#appform button[value="submit"] { background: var(--accent) !important; border-color: var(--accent) !important; color: #23180a !important; }

/* Auth card (sign-in / magic-link screens) */
.auth-card {
  max-width: 460px; margin: 20px auto; background: #fff;
  border: 1px solid var(--border); border-radius: 3px; padding: 34px 34px 38px;
}
.auth-card .eyebrow { display: block; margin-bottom: 6px; }
.auth-card h1 { font-size: 1.9rem; margin: 2px 0 8px; }
.auth-card label { color: var(--primary); font-weight: 600; font-size: 13.5px; }
.auth-card input[type=email] { width: 100%; min-width: 0; margin: 6px 0 18px; }
.auth-card .button { width: 100%; text-align: center; }
.auth-note { max-width: 460px; margin: 16px auto 0; color: var(--muted); font-size: 14px; }

/* Auth card — wide variant (setup) + generic fields */
.auth-card-wide { max-width: 560px; }
.auth-card p { margin: 0 0 14px; }
.auth-card label { display: block; }
.auth-card input, .auth-card select { width: 100%; min-width: 0; margin-top: 4px; }
.auth-card .button { margin-top: 8px; }

/* Primary submit buttons that use Django's .default class (RSVP, etc.) */
button.default, input[type=submit].default {
  font-family: var(--sans); font-weight: 600; cursor: pointer;
  background: var(--accent); border: 1px solid var(--accent); color: #23180a;
  padding: 12px 22px; border-radius: 2px;
}
button.default:hover { background: #8f6817; border-color: #8f6817; color: #fff; }

/* Neutral content panel (evaluator screens, etc.) */
.panel {
  background: var(--band); border: 1px solid var(--border); border-radius: 2px;
  padding: 16px 18px; margin: 16px 0;
}
.panel h3, .panel h4 { margin-top: 0; }
