/* ============================================================
   S.A.A.Z. — Seoul Area Amateur Zymurgists
   Club website design system (static, framework-free)
   ============================================================ */

:root {
  /* Palette — warm craft-brewery base, monochrome logo, hop-green + amber accents */
  --bg:          #f7f2e7;   /* warm cream */
  --bg-alt:      #efe6d4;   /* deeper cream */
  --bg-card:     #fffdf7;   /* card surface */
  --ink:         #201d17;   /* near-black warm ink */
  --ink-soft:    #5c5543;   /* muted ink */
  --ink-faint:   #8a8270;
  --green:       #4a7a3a;   /* hop green */
  --green-dark:  #38612c;
  --green-pale:  #e6eedf;
  --amber:       #c08a2e;   /* amber / gold */
  --amber-dark:  #9a6d1f;
  --line:        rgba(32, 29, 23, 0.14);
  --line-soft:   rgba(32, 29, 23, 0.08);
  --white:       #ffffff;

  /* Type */
  --font-body:   system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR",
                 "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-display: Georgia, "Times New Roman", "Noto Serif KR", serif;

  /* Layout */
  --wrap:        76rem;
  --nav-h:       4.25rem;
  --radius:      0.9rem;
  --shadow:      0 12px 40px -18px rgba(32, 29, 23, 0.35);
  --maxw-text:   46rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin: 0 0 1.2rem; }
h3 { font-size: 1.3rem; margin: 0 0 0.5rem; }
p  { margin: 0 0 1.1rem; }
a  { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--green); }
img { max-width: 100%; height: auto; display: block; }
ul { padding-left: 1.15rem; }

.container { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--alt { background: var(--bg-alt); }
.section--card { background: var(--bg); }

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.8rem;
  color: var(--green); font-weight: 700; margin-bottom: 0.6rem;
}
.lead { font-size: 1.22rem; color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.8rem 1.5rem; border-radius: 999px;
  font-weight: 700; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn--primary { background: var(--green); color: var(--white); }
.btn--primary:hover { background: var(--green-dark); color: var(--white); transform: translateY(-2px); }
.btn--ghost  { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--ink); color: var(--bg); }
.btn--amber  { background: var(--amber); color: var(--white); }
.btn--amber:hover { background: var(--amber-dark); color: var(--white); transform: translateY(-2px); }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(247, 242, 231, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 2.5rem; height: 2.5rem; border-radius: 50%; object-fit: cover; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: 0.03em; line-height: 1.05; }
.brand__sub { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }

.nav__links { display: flex; align-items: center; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  display: block; padding: 0.5rem 0.75rem; border-radius: 0.6rem;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 0.95rem;
}
.nav__links a:hover { background: var(--bg-alt); color: var(--green-dark); }

.nav__actions { display: flex; align-items: center; gap: 0.6rem; }
.nav__social { display:inline-flex; align-items:center; justify-content:center; width:2.5rem; height:2.5rem; border-radius:50%; color:var(--ink); flex-shrink:0; text-decoration:none; }
.nav__social:hover { color:var(--green-dark); background:var(--bg-alt); }

/* Language toggle */
.lang-toggle {
  border: 1px solid var(--line); background: var(--white);
  color: var(--ink); border-radius: 999px; padding: 0.4rem 0.75rem;
  font-size: 0.82rem; font-weight: 700; cursor: pointer; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 0.35rem;
  white-space: nowrap;           /* keep '한국어' on one horizontal line */
  flex-shrink: 0;                /* don't let the toggle compress on mobile */
}
.lang-toggle:hover { border-color: var(--green); color: var(--green-dark); }
.lang-toggle .globe { font-size: 1rem; line-height: 1; flex-shrink: 0; }

/* Hamburger */
.nav__burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 2.5rem; height: 2.5rem; padding: 0.55rem; border: 0; background: transparent;
  cursor: pointer; border-radius: 0.5rem;
}
.nav__burger span { display: block; height: 2.5px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: clamp(32rem, 70vh, 44rem);   /* fixed height so the bg doesn't grow/shrink on lang toggle */
  display: flex; align-items: center;
  color: var(--white); text-align: center;
  padding: clamp(4rem, 10vh, 6rem) 1.5rem;
  background-size: cover; background-position: center;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(18,16,12,0.55), rgba(18,16,12,0.72));
}
.hero__inner { max-width: var(--maxw-text); margin: 0 auto; }
.hero__logo { width: 7.5rem; height: 7.5rem; border-radius: 50%; margin: 0 auto 1.4rem; object-fit: cover; border: 3px solid rgba(255,255,255,0.85); box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); letter-spacing: 0.01em; }
.hero .hero__tagline { font-family: var(--font-display); font-size: clamp(1.4rem, 3.4vw, 2.1rem); color: var(--amber); font-weight: 700; margin-bottom: 1rem; }
.hero p { color: rgba(255,255,255,0.92); font-size: 1.15rem; }
.hero__cta { margin-top: 1.8rem; display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about__text p { color: var(--ink-soft); }
.pillars { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 0.9rem; }
.pillars li { display: flex; gap: 0.8rem; align-items: flex-start; background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 0.9rem 1rem; }
.pillars .pillar-ico { font-size: 1.3rem; line-height: 1.4; }
.pillars strong { display: block; color: var(--ink); }
.pillars span { color: var(--ink-soft); font-size: 0.96rem; }

.about__media img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Cards (competition / resources) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; margin-top: 1.5rem; }
.card { background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.6rem; display: flex; flex-direction: column; }
.card h3 { font-size: 1.25rem; }
.card p { color: var(--ink-soft); flex: 1; }
.card .btn { align-self: flex-start; margin-top: 0.4rem; }

.competition__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.competition__media img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Winners ---------- */
.winners__intro { max-width: var(--maxw-text); margin-bottom: 2rem; }
.winner-table { width: 100%; border-collapse: collapse; background: var(--bg-card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); }
.winner-table caption { caption-side: top; text-align: left; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; padding: 0 0 0.8rem; color: var(--ink); }
.winner-table th, .winner-table td { text-align: left; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.winner-table thead th { background: var(--green-pale); color: var(--green-dark); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }
.winner-table tbody tr:last-child td { border-bottom: 0; }
.winner-table tbody tr:hover { background: var(--bg-alt); }
.winner-table .year { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.badge { display: inline-block; background: var(--amber); color: var(--white); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; padding: 0.18rem 0.55rem; border-radius: 999px; margin-right: 0.4rem; vertical-align: middle; }

/* ---------- Resources ---------- */
.resources__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.4rem; margin-top: 1.5rem; }
.resource { display: flex; gap: 1rem; align-items: flex-start; background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.4rem 1.5rem; text-decoration: none; color: var(--ink); transition: border-color .2s ease, transform .15s ease; }
.resource:hover { border-color: var(--green); transform: translateY(-2px); color: var(--ink); }
.resource__ico { font-size: 1.6rem; line-height: 1.3; }
.resource h3 { font-size: 1.12rem; margin-bottom: 0.25rem; color: var(--green-dark); }
.resource p { margin: 0; color: var(--ink-soft); font-size: 0.96rem; }

/* ---------- Register ---------- */
.register__box { max-width: 46rem; margin: 0 auto; background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.8rem, 4vw, 3rem); text-align: center; }
.register__box h2 { margin-top: 0; }
.register__box p { color: var(--ink-soft); max-width: 38rem; margin-left: auto; margin-right: auto; }
.register__cta { margin: 1.4rem 0 1rem; display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.register__note { font-size: 0.9rem; color: var(--ink-faint); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.85); margin-top: 0; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
.footer__brand img { width: 3.2rem; height: 3.2rem; border-radius: 50%; margin-bottom: 0.8rem; }
.footer h4 { color: var(--white); font-family: var(--font-body); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 0.8rem; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer ul li { margin-bottom: 0.45rem; }
.footer a { color: rgba(255,255,255,0.8); text-decoration: none; }
.footer a:hover { color: var(--amber); }
.footer__bottom { border-top: 1px solid rgba(255,255,255,0.15); padding: 1.1rem 0; font-size: 0.85rem; color: rgba(255,255,255,0.6); text-align: center; }

/* ---------- Privacy page ---------- */
.privacy { max-width: var(--maxw-text); margin: 0 auto; }
.privacy__meta { color: var(--ink-faint); font-size: 0.9rem; margin-bottom: 1.5rem; }
.privacy h3 { margin-top: 2rem; color: var(--green-dark); }
.privacy ul { color: var(--ink-soft); }
.privacy .privacy__lead { color: var(--ink-soft); }

.page-hero { padding: clamp(3rem, 8vw, 5rem) 0 1.5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav__burger { display: flex; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0.2rem;
    background: var(--bg); border-bottom: 1px solid var(--line-soft);
    padding: 0.6rem 1rem 1rem; display: none;
    box-shadow: var(--shadow);
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.85rem 0.75rem; }
  .about__grid, .competition__grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: 1.5rem; }

  /* Past Winners table → stacked card layout (no horizontal scroll) */
  .winner-table thead { display: none; }
  .winner-table, .winner-table tbody, .winner-table tr, .winner-table td { display: block; width: 100%; }
  .winner-table caption {
    display: block;
    text-align: center;
    white-space: nowrap;
  }
  .winner-table tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 0.2rem 1rem;
    margin-bottom: 0.9rem;
  }
  .winner-table tbody tr:last-child { margin-bottom: 0; }
  .winner-table td {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--line-soft);
    text-align: right;
  }
  .winner-table td:last-child { border-bottom: 0; }
  .winner-table td::before {
    content: attr(data-label);
    flex-shrink: 0;
    margin-right: auto;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--green-dark);
  }
  .winner-table .year { white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Focus visibility (a11y) */
a:focus-visible, button:focus-visible, .resource:focus-visible {
  outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 0.3rem;
}

/* ---------- Korean stores page ---------- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.2rem; margin: 1.6rem 0; }
.store-card { display: flex; flex-direction: column; gap: 0.2rem; background: var(--bg-card); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 1.2rem 1.4rem; text-decoration: none; color: var(--ink); transition: border-color .2s ease, transform .15s ease; }
.store-card:hover { border-color: var(--green); transform: translateY(-2px); color: var(--ink); }
.store-card__name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--green-dark); }
.store-card__city { font-size: 0.9rem; color: var(--ink-soft); }
.store-card__note { font-size: 0.9rem; color: var(--ink-soft); line-height: 1.45; }
.store-card__url { font-size: 0.85rem; color: var(--green); word-break: break-all; }
.store-disclaimer { font-size: 0.9rem; color: var(--ink-faint); margin-top: 1.6rem; border-top: 1px solid var(--line-soft); padding-top: 1rem; }

/* ---------- Bilingual prose blocks ----------
   Long text is provided twice (lang="ko" and lang="en").
   The visible one follows the <html lang> set by the EN/KO toggle.
   Default lang="ko" on <html> means Korean shows even without JS. */
.i18n { display: none; }
html[lang="ko"] .i18n[lang="ko"] { display: block; }
html[lang="en"] .i18n[lang="en"] { display: block; }
