/*
Theme Name: MAOTHAI Archive
Theme URI: https://maothai.com/
Author: MAOTHAI Project
Description: A lightweight documentary archive theme for Thai Food Magic - MAOTHAI.
Version: 0.3.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: maothai-archive
*/

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@600&display=swap');

:root {
  --paper: #f3efe6;
  --ink: #181714;
  --muted: #6f6a61;
  --bronze: #896d43;
  --panel: #e8e1d4;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, Helvetica, Arial, sans-serif;
  --display: Archivo, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
}
body.admin-bar .site-header { top: 32px; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  margin: 12px;
  padding: 10px 14px;
  background: var(--paper);
  z-index: 9999;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 17px clamp(20px, 4vw, 58px);
  background: rgba(243, 239, 230, .94);
  border-bottom: 1px solid rgba(24, 23, 20, .08);
  backdrop-filter: blur(12px);
}
.site-branding a {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: .13em;
  text-decoration: none;
}
.site-nav { display: flex; align-items: center; gap: clamp(15px, 2.5vw, 32px); }
.site-nav a {
  color: var(--muted);
  font-size: .83rem;
  letter-spacing: .06em;
  text-decoration: none;
  text-transform: uppercase;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink); }
.languages { color: var(--ink); letter-spacing: .08em; white-space: nowrap; }
.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero {
  min-height: min(760px, 82vh);
  display: flex;
  align-items: flex-end;
  padding: clamp(55px, 8vw, 110px) clamp(24px, 7vw, 110px);
  color: #faf5eb;
  background-position: center;
  background-size: cover;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 7, 6, .82), rgba(7, 7, 6, .28) 58%, rgba(7, 7, 6, .08));
}
.hero-content { position: relative; max-width: 780px; }
.eyebrow, .chapter-label {
  color: #c9ab75;
  font-size: .78rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 15px 0 20px;
  font-family: var(--serif);
  font-size: clamp(3.4rem, 8.5vw, 8rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .88;
}
.hero-deck {
  max-width: 680px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.3vw, 1.75rem);
  line-height: 1.38;
}
.story-link {
  display: inline-flex;
  gap: 12px;
  margin-top: 30px;
  color: #faf5eb;
  font-size: .82rem;
  letter-spacing: .11em;
  text-decoration: none;
  text-transform: uppercase;
}
.story-link::after { content: '↓'; color: #c9ab75; }

.section { padding: clamp(70px, 10vw, 140px) clamp(24px, 9vw, 150px); }
.chapter-label { color: var(--bronze); }
.story-landing {
  position: relative;
  min-height: min(920px, calc(100vh - 72px));
  overflow: hidden;
  background-color: #080a0c;
  background-position: center;
  background-size: cover;
  color: #f8f5ef;
}
.story-landing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 5, 8, .95), rgba(2, 5, 8, .78) 34%, rgba(2, 5, 8, .32) 68%, rgba(2, 5, 8, .56));
}
.story-landing-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(380px, 1.1fr);
  gap: clamp(45px, 8vw, 145px);
  min-height: inherit;
  padding: clamp(42px, 5vw, 75px) clamp(30px, 7vw, 120px) clamp(32px, 4vw, 60px);
}
.story-column { display: flex; flex-direction: column; min-width: 0; }
.story-reader {
  flex: 1;
  min-height: 500px;
  max-height: min(69vh, 690px);
  overflow-y: auto;
  padding: 0 clamp(16px, 2vw, 28px) 0 0;
  background: transparent;
  border: 0;
  scrollbar-color: rgba(255, 255, 255, .55) transparent;
}
.story-panel[hidden] { display: none; }
.story-panel h3 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.6vw, 2.6rem);
  font-weight: 600;
  letter-spacing: .075em;
}
.story-text { max-width: 590px; font-family: var(--sans); font-size: clamp(1rem, 1.3vw, 1.22rem); line-height: 1.58; }
.story-text p { margin: 0 0 1.2em; }
.story-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 14px; margin-top: 17px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.32); }
.story-tab, .story-download {
  border: 0;
  padding: 7px 2px;
  background: transparent;
  color: #fff;
  font: 600 .78rem/1 var(--sans);
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}
.story-tab { cursor: pointer; }
.story-tab:hover, .story-tab:focus-visible, .story-tab.is-active,
.story-download:hover, .story-download:focus-visible { color: #fff; opacity: .68; }
.story-tab.is-active { border-bottom: 1px solid #fff; }
.story-download { margin-left: auto; padding: 7px 2px; color: #fff; background: transparent; }
.story-title { align-self: start; text-align: right; }
.story-title .eyebrow { color: #f8f5ef; font-size: .72rem; letter-spacing: .06em; }
.story-title h1 { margin: 14px 0 0; font-family: var(--sans); font-size: clamp(3rem, 5vw, 5.7rem); font-weight: 400; letter-spacing: -.025em; line-height: 1.04; text-transform: uppercase; }
.story-languages { margin-top: 28px; color: #f8f5ef; font-size: .78rem; letter-spacing: .05em; }
.story-languages::first-letter { color: #c9ab75; }

.origin {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  min-height: 620px;
  background: var(--panel);
}
.origin-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) contrast(1.03); }
.origin-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(55px, 8vw, 105px); }
.origin h2, .section-heading h2, .people-copy h2, .archive-copy h2 {
  margin: 15px 0 22px;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 5rem);
  font-weight: 400;
  line-height: 1.02;
}
.origin p, .people-copy p, .archive-copy p { color: var(--muted); }

.restaurants { padding: clamp(75px, 10vw, 135px) clamp(18px, 5vw, 75px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin: 0 auto 40px; max-width: 1500px; }
.section-heading h2 { margin: 0; }
.route { color: var(--bronze); letter-spacing: .12em; text-transform: uppercase; }
.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  max-width: 1500px;
  margin: auto;
}
.restaurant-card {
  min-height: 430px;
  position: relative;
  overflow: hidden;
  color: #fff9ee;
  background: #191816;
}
.restaurant-card img {
  width: 100%;
  height: 100%;
  position: absolute;
  object-fit: cover;
  opacity: .78;
  transition: transform .55s ease, opacity .55s ease;
}
.restaurant-card:hover img { transform: scale(1.025); opacity: .9; }
.restaurant-card::after {
  content: '';
  position: absolute;
  inset: 25% 0 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .88));
}
.restaurant-meta { position: absolute; inset: auto 0 0; z-index: 2; padding: 28px; }
.restaurant-meta small { color: #d5bc8d; letter-spacing: .13em; text-transform: uppercase; }
.restaurant-name {
  margin: 7px 0 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.2vw, 3.5rem);
  font-weight: 600;
  letter-spacing: .055em;
  line-height: 1.02;
  text-transform: uppercase;
}

.identity {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  align-items: center;
  gap: clamp(35px, 7vw, 100px);
  padding: clamp(70px, 9vw, 120px) clamp(24px, 8vw, 125px);
  background: #fff;
}
.identity-copy h2 {
  margin: 15px 0 24px;
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  font-weight: 600;
  letter-spacing: .06em;
  line-height: .98;
}
.identity-copy p { max-width: 570px; color: var(--muted); }
.identity-media img { width: 100%; height: auto; object-fit: contain; }

.permits { background: #0d0f12; color: #f4f0e8; }
.permits .section-heading { max-width: none; }
.permits .section-heading h2 { font-size: clamp(2.3rem, 4vw, 4.4rem); }
.document-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px; }
.document-card { background: #15181c; overflow: hidden; }
.document-card-primary { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(280px, .75fr) 1.25fr; }
.document-card a { display: contents; color: inherit; text-decoration: none; }
.document-card img { width: 100%; height: 420px; object-fit: contain; background: #e8e5dd; }
.document-card-primary img { height: 600px; }
.document-meta { padding: 23px 25px 28px; }
.document-card-primary .document-meta { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 6vw, 90px); }
.document-meta small { color: #caae79; letter-spacing: .11em; text-transform: uppercase; }
.document-meta h3 { margin: 10px 0 0; font-family: var(--display); font-size: clamp(1.45rem, 2.7vw, 2.8rem); font-weight: 600; letter-spacing: .045em; line-height: 1.08; text-transform: uppercase; }
.document-meta span { margin-top: 18px; color: #cac4b9; }

.people, .archive-feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  background: #161512;
  color: #f5efe5;
}
.people img, .archive-feature img { width: 100%; height: 100%; min-height: 590px; object-fit: cover; }
.people-copy, .archive-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(58px, 8vw, 115px); }
.people-copy p, .archive-copy p { color: #c4bdb1; }

.archive-feature { background: var(--panel); color: var(--ink); }
.archive-feature img { filter: saturate(.84); }
.archive-copy p { color: var(--muted); }
.archive-list { margin: 12px 0 0; padding: 0; list-style: none; }
.archive-list li { padding: 11px 0; border-top: 1px solid rgba(24, 23, 20, .16); }

.epilogue { text-align: center; }
.epilogue blockquote {
  max-width: 1000px;
  margin: auto;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.4vw, 4.5rem);
  line-height: 1.15;
}
.epilogue cite { display: block; margin-top: 28px; color: var(--bronze); font-style: normal; letter-spacing: .1em; text-transform: uppercase; }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 35px clamp(24px, 5vw, 75px);
  color: #c4bdb1;
  background: #161512;
  font-size: .82rem;
}
.site-footer a { color: #eee7db; }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  body.admin-bar .site-header { top: 46px; }
  .menu-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    background: var(--paper);
    border-bottom: 1px solid rgba(24, 23, 20, .12);
  }
  .site-nav.is-open { display: flex; }
  .origin, .people, .archive-feature, .identity { grid-template-columns: 1fr; }
  .document-card-primary { grid-template-columns: 1fr; }
  .document-card-primary img { height: 500px; }
  .origin-media img, .people img, .archive-feature img { min-height: 0; height: min(70vw, 600px); }
  .restaurant-card { min-height: 390px; }
}

@media (max-width: 640px) {
  .hero { min-height: 650px; background-position: 58% center; }
  .story-landing { min-height: 0; }
  .story-landing-inner { grid-template-columns: 1fr; gap: 35px; padding: 34px 24px 30px; }
  .story-title { grid-row: 1; text-align: left; }
  .story-column { grid-row: 2; }
  .story-title h1 { font-size: clamp(2.7rem, 13vw, 4.5rem); }
  .story-reader { min-height: 480px; max-height: 68vh; padding-right: 10px; }
  .story-download { width: 100%; margin: 8px 0 0; text-align: left; }
  .section-heading { display: block; }
  .route { display: block; margin-top: 10px; }
  .restaurant-grid { grid-template-columns: 1fr; }
  .restaurant-card { min-height: 370px; }
  .document-grid { grid-template-columns: 1fr; }
  .document-card-primary { grid-column: auto; }
  .document-card img, .document-card-primary img { height: min(120vw, 520px); }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .restaurant-card img, .reveal { transition: none; }
  .reveal { opacity: 1; transform: none; }
}
