/* WSWSS legal/utility pages + cookie consent. Scoped to avoid redesigning the landing page. */
:root {
  --wswss-mint: #dff5ee;
  --wswss-mint-2: #edf9f5;
  --wswss-ink: #17211f;
  --wswss-muted: #6d7875;
  --wswss-line: rgba(23, 33, 31, 0.12);
  --wswss-card: rgba(255, 255, 255, 0.9);
  --wswss-accent: #285e52;
}

.legal-page,
.not-found-page {
  margin: 0;
  color: var(--wswss-ink);
  background:
    radial-gradient(circle at 86% 8%, rgba(190, 238, 224, 0.52), transparent 25rem),
    linear-gradient(180deg, #fff 0%, #f8fcfb 58%, #eef8f4 100%);
  font-family: "Noto Sans Thai", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.legal-page *,
.not-found-page *,
.cookie-consent-root * { box-sizing: border-box; }

.legal-shell { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }

.legal-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(23, 33, 31, 0.08);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
}
.legal-header__inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.legal-brand { display: inline-flex; align-items: center; text-decoration: none; }
.legal-brand img { width: 150px; height: auto; display: block; }
.legal-nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.legal-nav a { color: var(--wswss-ink); text-decoration: none; opacity: .78; }
.legal-nav a:hover, .legal-nav a:focus-visible { opacity: 1; }
.legal-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--wswss-ink);
  color: #fff !important;
  opacity: 1 !important;
}

.legal-hero { padding: 84px 0 54px; }
.legal-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .18em;
  font-weight: 600;
  color: var(--wswss-accent);
}
.legal-hero h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 500;
}
.legal-deck {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--wswss-muted);
  font-size: 18px;
  line-height: 1.75;
}
.legal-summary {
  margin-top: 38px;
  padding: 28px 30px;
  border: 1px solid rgba(40, 94, 82, 0.16);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(223, 245, 238, .92), rgba(255,255,255,.9));
  box-shadow: 0 18px 60px rgba(38, 75, 67, 0.07);
}
.legal-summary strong { display: block; margin-bottom: 8px; font-size: 15px; }
.legal-summary p { margin: 0; max-width: 900px; font-size: 16px; line-height: 1.8; }

.legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 72px;
  padding: 22px 0 100px;
}
.legal-toc {
  align-self: start;
  position: sticky;
  top: 108px;
  padding: 22px;
  border: 1px solid var(--wswss-line);
  border-radius: 20px;
  background: rgba(255,255,255,.74);
}
.legal-toc__label { margin: 0 0 12px; color: var(--wswss-muted); font-size: 12px; letter-spacing: .1em; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  padding: 8px 0;
  color: var(--wswss-ink);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.45;
}
.legal-toc a::before { content: counter(toc, decimal-leading-zero); color: #8ba69f; font-size: 11px; padding-top: 2px; }
.legal-mobile-index { display: none; margin: 0 0 26px; border: 1px solid var(--wswss-line); border-radius: 18px; background: #fff; }
.legal-mobile-index summary { cursor: pointer; padding: 16px 18px; font-weight: 500; }
.legal-mobile-index nav { display: grid; gap: 4px; padding: 0 18px 16px; }
.legal-mobile-index a { color: var(--wswss-ink); text-decoration: none; padding: 7px 0; font-size: 14px; }

.legal-content { min-width: 0; }
.legal-section {
  scroll-margin-top: 110px;
  padding: 0 0 44px;
  margin: 0 0 44px;
  border-bottom: 1px solid var(--wswss-line);
}
.legal-section:last-child { border-bottom: 0; }
.legal-section__num { display: inline-block; margin-bottom: 10px; color: #87a29b; font-size: 12px; letter-spacing: .08em; }
.legal-section h2 { margin: 0 0 16px; font-size: clamp(25px, 3vw, 35px); line-height: 1.3; font-weight: 500; letter-spacing: -.02em; }
.legal-section h3 { margin: 26px 0 10px; font-size: 18px; font-weight: 600; }
.legal-section p, .legal-section li { font-size: 16px; line-height: 1.85; color: #394542; }
.legal-section p { margin: 0 0 15px; }
.legal-section ul { padding-left: 22px; margin: 12px 0 0; }
.legal-section a { color: var(--wswss-accent); }
.legal-note {
  margin-top: 18px;
  padding: 18px 20px;
  border-left: 3px solid #9bcdbf;
  background: var(--wswss-mint-2);
  border-radius: 0 14px 14px 0;
}
.legal-updated { margin: 18px 0 0; color: var(--wswss-muted); font-size: 13px; }

.policy-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 34px; }
.policy-card { padding: 24px; border-radius: 22px; border: 1px solid var(--wswss-line); background: rgba(255,255,255,.9); }
.policy-card small { display: block; margin-bottom: 14px; color: #78958e; letter-spacing: .08em; text-transform: uppercase; }
.policy-card h2, .policy-card h3 { margin: 0 0 10px; font-size: 21px; font-weight: 500; }
.policy-card p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--wswss-muted); }
.policy-card--mint { background: var(--wswss-mint-2); }
.policy-status { display: inline-flex; margin-top: 14px; padding: 6px 10px; border-radius: 999px; background: #edf2f0; color: #60706c; font-size: 12px; }

.legal-action {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--wswss-ink);
  color: #fff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.legal-action--soft { background: var(--wswss-mint); color: var(--wswss-ink); }

.legal-footer {
  border-top: 1px solid var(--wswss-line);
  background: rgba(255,255,255,.72);
  padding: 44px 0 34px;
}
.legal-footer__top { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; align-items: start; }
.legal-footer__brand img { width: 146px; height: auto; }
.legal-footer__brand p { margin: 14px 0 0; color: var(--wswss-muted); font-size: 13px; }
.legal-footer nav { display: grid; gap: 9px; }
.legal-footer nav strong { margin-bottom: 5px; font-size: 12px; letter-spacing: .08em; color: #78908a; }
.legal-footer a, .legal-footer button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  color: var(--wswss-ink);
  font: inherit;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}
.legal-footer__bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--wswss-line); color: var(--wswss-muted); font-size: 12px; }

/* Approved minimal additions to the existing landing footer */
.site-footer .footer-legal a,
.site-footer .footer-cookie-settings {
  color: inherit;
  text-decoration: none;
  font: inherit;
  opacity: .72;
}
.site-footer .footer-cookie-settings { border: 0; background: none; padding: 0; cursor: pointer; }
.site-footer .footer-legal a:hover,
.site-footer .footer-cookie-settings:hover { opacity: 1; }

/* Cookie consent */
.cookie-consent-root { position: relative; z-index: 9999; font-family: "Noto Sans Thai", system-ui, sans-serif; color: var(--wswss-ink); }
.cookie-consent-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 28px));
  padding: 20px;
  border: 1px solid rgba(40,94,82,.18);
  border-radius: 22px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(25, 55, 48, .18);
}
.cookie-consent-banner[hidden], .cookie-consent-dialog[hidden] { display: none !important; }
.cookie-consent-banner__head { display: flex; align-items: start; gap: 16px; justify-content: space-between; }
.cookie-consent-banner h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.cookie-consent-banner p { margin: 0; color: #596662; font-size: 13px; line-height: 1.65; }
.cookie-consent-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cookie-consent-button {
  appearance: none;
  border: 1px solid rgba(23,33,31,.14);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 16px;
  background: #fff;
  color: var(--wswss-ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.cookie-consent-button--primary { background: var(--wswss-ink); border-color: var(--wswss-ink); color: #fff; }
.cookie-consent-button--mint { background: var(--wswss-mint); border-color: transparent; }
.cookie-consent-button:focus-visible, .legal-action:focus-visible, .legal-footer button:focus-visible { outline: 3px solid rgba(40,94,82,.24); outline-offset: 2px; }
.cookie-consent-backdrop { position: fixed; inset: 0; background: rgba(18,29,26,.38); backdrop-filter: blur(4px); }
.cookie-consent-dialog {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}
.cookie-consent-panel {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 28px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 28px 100px rgba(14,31,27,.28);
}
.cookie-consent-panel__top { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.cookie-consent-panel h2 { margin: 0; font-size: 25px; font-weight: 500; }
.cookie-consent-panel__intro { margin: 9px 0 22px; color: var(--wswss-muted); font-size: 14px; line-height: 1.7; }
.cookie-consent-close { appearance: none; border: 0; background: #f1f5f3; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 20px; }
.cookie-preference { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 18px 0; border-top: 1px solid var(--wswss-line); }
.cookie-preference strong { display: block; margin-bottom: 4px; font-size: 15px; }
.cookie-preference span { display: block; color: var(--wswss-muted); font-size: 12px; line-height: 1.55; }
.cookie-toggle { width: 46px; height: 27px; position: relative; display: inline-flex; }
.cookie-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.cookie-toggle i { width: 46px; height: 27px; border-radius: 999px; background: #d7dfdc; transition: .2s ease; }
.cookie-toggle i::after { content: ""; display: block; width: 21px; height: 21px; margin: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.16); transition: .2s ease; }
.cookie-toggle input:checked + i { background: #5c9487; }
.cookie-toggle input:checked + i::after { transform: translateX(19px); }
.cookie-toggle input:focus-visible + i { outline: 3px solid rgba(40,94,82,.24); outline-offset: 2px; }
.cookie-toggle--locked { opacity: .7; }
.cookie-consent-panel__actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 22px; }

/* 404 */
.not-found-page { display: flex; flex-direction: column; }
.not-found-main { flex: 1; display: grid; place-items: center; padding: 60px 0; }
.not-found-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; }
.not-found-code { margin: 0; font-size: clamp(110px, 18vw, 230px); line-height: .8; font-weight: 300; letter-spacing: -.08em; color: #bfe9dc; }
.not-found-copy h1 { margin: 28px 0 14px; max-width: 620px; font-size: clamp(34px, 5vw, 62px); line-height: 1.12; font-weight: 500; letter-spacing: -.035em; }
.not-found-copy p { max-width: 560px; margin: 0; color: var(--wswss-muted); font-size: 16px; line-height: 1.7; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.not-found-actions a { text-decoration: none; }
.not-found-visual { position: relative; min-height: 520px; display: grid; place-items: center; }
.not-found-visual::before { content: ""; position: absolute; width: 390px; height: 390px; border-radius: 50%; background: radial-gradient(circle, #d8f4eb, #eefaf6 66%, transparent 67%); }
.not-found-visual img { position: relative; width: min(340px, 80%); height: auto; filter: drop-shadow(0 30px 36px rgba(26, 58, 51, .16)); animation: wswssFloat 5s ease-in-out infinite; }
@keyframes wswssFloat { 50% { transform: translateY(-12px) rotate(.5deg); } }
@media (prefers-reduced-motion: reduce) { .not-found-visual img { animation: none; } }

@media (max-width: 900px) {
  .legal-header__inner { min-height: 68px; }
  .legal-brand img { width: 132px; }
  .legal-nav a:not(.legal-home-link) { display: none; }
  .legal-hero { padding: 60px 0 40px; }
  .legal-layout { grid-template-columns: 1fr; gap: 0; padding-bottom: 72px; }
  .legal-toc { display: none; }
  .legal-mobile-index { display: block; }
  .policy-cards { grid-template-columns: 1fr; }
  .legal-footer__top { grid-template-columns: 1fr 1fr; }
  .legal-footer__brand { grid-column: 1 / -1; }
  .not-found-grid { grid-template-columns: 1fr; }
  .not-found-visual { min-height: 360px; order: -1; }
  .not-found-visual img { width: min(270px, 70%); }
}

@media (max-width: 600px) {
  .legal-shell { width: min(100% - 28px, 1200px); }
  .legal-nav { gap: 10px; }
  .legal-home-link { min-height: 38px; padding: 0 14px; font-size: 12px; }
  .legal-hero h1 { font-size: 40px; }
  .legal-deck { font-size: 16px; }
  .legal-summary { padding: 22px; border-radius: 20px; }
  .legal-section { padding-bottom: 34px; margin-bottom: 34px; }
  .legal-section p, .legal-section li { font-size: 15px; }
  .legal-footer__top { grid-template-columns: 1fr; }
  .legal-footer__brand { grid-column: auto; }
  .legal-footer__bottom { flex-direction: column; }
  .cookie-consent-banner { bottom: 10px; padding: 17px; border-radius: 19px; }
  .cookie-consent-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cookie-consent-actions .cookie-consent-button--primary { grid-column: 1 / -1; }
  .cookie-consent-button { width: 100%; padding: 0 12px; }
  .cookie-consent-panel { padding: 22px; border-radius: 22px; }
  .cookie-consent-panel__actions { display: grid; grid-template-columns: 1fr; }
  .not-found-main { padding: 34px 0 50px; }
  .not-found-visual { min-height: 290px; }
  .not-found-visual::before { width: 260px; height: 260px; }
}

/* Localized legal typography */
html[lang="ko"] body.legal-page,
html[lang="ko"] body.not-found-page,
html[lang="ko"] .cookie-consent-root {
  font-family: "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html[lang="en"] body.legal-page,
html[lang="en"] body.not-found-page,
html[lang="en"] .cookie-consent-root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
