/* Thai Food & Travel — restored site styles */

:root {
  --paper: #fbf7ef;
  --paper-2: #f3ecdf;
  --card: #ffffff;
  --ink: #1f1c17;
  --ink-2: #4c463d;
  --muted: #776f62;
  --line: #e4dccd;
  --green: #1f5a43;
  --green-2: #2c7a5b;
  --chili: #b8341b;
  --turmeric: #e3a524;
  --mark: #fde7a8;
  --shadow: 0 1px 2px rgb(40 30 10 / 6%), 0 6px 20px rgb(40 30 10 / 7%);
  --radius: 14px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 70ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15130f;
    --paper-2: #1d1a15;
    --card: #221f19;
    --ink: #f1ebe0;
    --ink-2: #d2c9b8;
    --muted: #a39a89;
    --line: #363128;
    --green: #7fcfa8;
    --green-2: #9fdcbd;
    --chili: #f08a6c;
    --turmeric: #f0bf52;
    --mark: #5a4512;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #15130f; --paper-2: #1d1a15; --card: #221f19; --ink: #f1ebe0; --ink-2: #d2c9b8;
  --muted: #a39a89; --line: #363128; --green: #7fcfa8; --green-2: #9fdcbd; --chili: #f08a6c;
  --turmeric: #f0bf52; --mark: #5a4512; --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 25%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.6 var(--sans);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { color: var(--chili); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 650; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--card); padding: .5rem 1rem; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; border-radius: 4px; }

/* ---------- masthead ---------- */
.masthead {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.masthead-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--chili); flex: none; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: var(--serif); font-size: 1.15rem; }
.brand small { color: var(--muted); font-size: .78rem; }
.nav { display: flex; gap: .25rem; }
.nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; padding: .4rem .7rem; border-radius: 999px; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current] { background: var(--green); color: var(--paper); }
.quicksearch { margin-left: auto; position: relative; display: flex; align-items: center; }
.quicksearch svg { position: absolute; left: .7rem; width: 18px; height: 18px; color: var(--muted); }
.quicksearch input {
  width: 17rem; padding: .5rem 2.2rem .5rem 2.2rem; font: inherit; font-size: .95rem;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 999px;
}
.quicksearch kbd {
  position: absolute; right: .6rem; font: .75rem var(--sans); color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 0 .35rem;
}

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--turmeric) 28%, transparent), transparent 70%),
    radial-gradient(900px 380px at -10% 110%, color-mix(in srgb, var(--green-2) 22%, transparent), transparent 70%),
    var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); max-width: 900px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 2.5rem; }
.has-photos .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.has-photos .hero h1, .has-photos h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
/* photo mosaic: one large tile and two small; originals are 600px so tiles stay small */
.hero-photos { display: grid; grid-template-columns: 1.35fr 1fr; grid-template-rows: 1fr 1fr; gap: .7rem; max-width: 560px; justify-self: end; width: 100%; }
.hero-photos.n1 { grid-template-columns: 1fr; grid-template-rows: auto; }
.hero-photos.n2 { grid-template-rows: auto; grid-template-columns: 1fr 1fr; }
.hero-photo { position: relative; display: block; overflow: hidden; border-radius: 16px; box-shadow: var(--shadow); background: var(--paper); }
.hero-photo img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; transition: transform .4s ease; }
.hero-photos.n3 .hero-photo:first-child { grid-row: span 2; }
.hero-photos.n3 .hero-photo:first-child img { aspect-ratio: auto; }
.hero-photo span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem .8rem .6rem; color: #fff; font-weight: 600; font-size: .9rem;
  line-height: 1.2; background: linear-gradient(transparent, rgb(0 0 0 / 65%)); opacity: 0; transition: opacity .2s ease;
}
.hero-photo:hover img { transform: scale(1.04); }
.hero-photo:hover span, .hero-photo:focus-visible span { opacity: 1; }
@media (max-width: 900px) {
  .has-photos .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hero-photos { justify-self: stretch; max-width: none; grid-template-columns: repeat(3, 1fr); grid-template-rows: auto; padding-bottom: 2rem; }
  .hero-photos.n3 .hero-photo:first-child { grid-row: auto; }
  .hero-photos.n3 .hero-photo:first-child img { aspect-ratio: 4 / 3; }
  .hero-photo span { display: none; }
}
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--chili); margin: 0 0 .5rem; }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); margin: 0 0 1rem; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: var(--measure); }
.hero-stats { color: var(--muted); font-size: .95rem; margin: 1rem 0 0; }
.bigsearch { display: flex; gap: .5rem; margin-top: 1.5rem; max-width: 680px; }
.bigsearch input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; padding: .85rem 1.1rem;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
  box-shadow: var(--shadow);
}

/* ---------- buttons, chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem; font: 600 1rem var(--sans);
  background: var(--green); color: var(--paper); border: 0; border-radius: 10px;
  padding: .65rem 1.1rem; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--chili); color: #fff; }
.btn-quiet { background: transparent; color: var(--green); border: 1px solid var(--line); }
.btn-quiet:hover { background: var(--paper-2); color: var(--ink); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: .75rem 0; }
.chips a, .chip {
  display: inline-block; font: 600 .9rem var(--sans); padding: .3rem .75rem; border-radius: 999px;
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); text-decoration: none; cursor: pointer;
}
.chips a:hover, .chip:hover { border-color: var(--green); color: var(--green); }
.chips em { font-weight: 400; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--paper); }
.chip small { opacity: .7; font-weight: 400; }
.chips-small a { font-size: .8rem; padding: .15rem .6rem; }
.chips-small a.tag { background: transparent; }

/* ---------- sections & grids ---------- */
.section { padding: clamp(2rem, 5vw, 3.5rem) 0 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.band { background: var(--paper-2); border-block: 1px solid var(--line); margin-top: clamp(2rem, 5vw, 3.5rem); padding-bottom: clamp(2rem, 5vw, 3.5rem); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }
.grid-compact { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.filter-item { display: contents; }
.filter-item[hidden] { display: none; }

.card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--green) 40%, var(--line)); color: var(--ink); }
.card-img { aspect-ratio: 4 / 3; background: var(--paper-2); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem 1rem; }
.card-kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--chili); font-weight: 700; }
.card-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 650; line-height: 1.2; }
.card-thai { font-style: italic; color: var(--muted); font-size: .95rem; }
.card-summary { color: var(--ink-2); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-text { border-top: 4px solid var(--turmeric); }

.course-tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; }
.course-tiles a {
  display: flex; justify-content: space-between; align-items: center; padding: .9rem 1rem; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600;
}
.course-tiles a:hover { border-color: var(--green); color: var(--green); }
.course-tiles small { color: var(--muted); font-weight: 400; }

.pantry { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.pantry a { display: flex; align-items: center; gap: .75rem; padding: .5rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.pantry a:hover { border-color: var(--green); }
.pantry img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.pantry span { display: flex; flex-direction: column; line-height: 1.2; }
.pantry em { color: var(--muted); font-size: .9rem; }

.about-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 1.1rem; align-items: start; }
.about-strip > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2.25rem); }
.about-strip #archive { border-top: 4px solid var(--turmeric); }
.about-strip h2 { margin-top: 0; }

/* ---------- index pages ---------- */
.page-head { padding: clamp(2rem, 5vw, 3.25rem) 0 1rem; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .5rem; }
.filterbar input {
  width: min(520px, 100%); font: inherit; padding: .6rem .9rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.jump { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: 1rem 0 0; font-weight: 600; }
.jump a { text-decoration: none; }
.course { padding-top: 2rem; }
.course h2 { font-size: 1.6rem; border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.course h2 small { color: var(--muted); font: 400 1rem var(--sans); }
.course[hidden] { display: none; }
.empty-note { padding: 2rem 0; color: var(--muted); }

/* ---------- documents ---------- */
.doc { max-width: 820px; padding: 1.5rem 0 1rem; }
.crumbs { font-size: .9rem; display: flex; gap: .4rem; flex-wrap: wrap; color: var(--muted); }
.crumbs a { text-decoration: none; font-weight: 600; }
.doc-head h1 { font-size: clamp(2rem, 5vw, 3rem); margin: .5rem 0 .25rem; }
.thai-name { font-family: var(--serif); font-style: italic; font-size: 1.3rem; color: var(--chili); margin: 0 0 .5rem; }
.byline { color: var(--muted); margin: 0; }
.doc-actions { display: flex; gap: .5rem; margin-top: 1rem; }
.notice { background: color-mix(in srgb, var(--turmeric) 18%, var(--card)); border: 1px solid color-mix(in srgb, var(--turmeric) 45%, var(--line)); padding: .75rem 1rem; border-radius: 10px; }

.prose { margin-top: 1.5rem; }
.prose::after { content: ""; display: block; clear: both; }
.prose > * { max-width: var(--measure); }
.prose h2 { font-size: 1.6rem; margin: 2rem 0 .75rem; }
.prose h3 { font-size: 1.3rem; margin: 1.75rem 0 .5rem; }
.prose h4 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.prose blockquote { margin: 1.25rem 0; padding: .25rem 1.25rem; border-left: 4px solid var(--turmeric); color: var(--ink-2); }
.prose table { border-collapse: collapse; margin: 1rem 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: .4rem .6rem; vertical-align: top; }
.prose iframe { max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; }
.prose a.archived::after { content: " ↗"; font-size: .8em; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.photo { margin: .4rem 0 1.25rem; max-width: 100%; }
.photo img { border-radius: 10px; display: block; }
.photo a.zoom { display: block; width: fit-content; max-width: 100%; cursor: zoom-in; }
.photo figcaption { font-size: .88rem; color: var(--muted); margin-top: .35rem; line-height: 1.35; }
@media (min-width: 720px) {
  .photo.left { float: left; margin: .35rem 1.5rem 1rem 0; max-width: 46%; }
  .photo.right { float: right; margin: .35rem 0 1rem 1.5rem; max-width: 46%; }
  .prose h2, .prose h3 { clear: both; }
}

ul.recipe {
  list-style: none; padding: 1.1rem 1.25rem; margin: 1rem 0 1.5rem; background: var(--card);
  border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 12px; overflow: hidden;
}
ul.recipe li { padding: .3rem 0 .3rem 1.6rem; position: relative; border-bottom: 1px dashed var(--line); }
ul.recipe li:last-child { border-bottom: 0; }
ul.recipe li::before {
  content: ""; position: absolute; left: 0; top: .72rem; width: .7rem; height: .7rem;
  border: 2px solid var(--green-2); border-radius: 3px;
}
ul.recipe li.done { color: var(--muted); text-decoration: line-through; }
ul.recipe li.done::before { background: var(--green-2); }
ul.recipe li { cursor: pointer; }

.aside-block { margin: 2rem 0 0; }
.aside-block h2 { font-size: 1.2rem; }
.archive-note { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.archive-note p { margin: .25rem 0; }
.more { padding: 2rem 0 0; }
.more h2 { font-size: 1.5rem; }

/* ---------- comments ---------- */
.comments { padding-top: 2rem; }
.comments h2 { font-size: 1.5rem; margin-bottom: 0; }
.comments ol { list-style: none; padding: 0; }
.comment { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .75rem 1rem; margin: .75rem 0; }
.comment.depth-1 { margin-left: 1.5rem; } .comment.depth-2 { margin-left: 3rem; } .comment.depth-3 { margin-left: 4rem; }
.comment.is-kasma { border-left: 4px solid var(--chili); }
.comment-meta { margin: 0; font-size: .9rem; color: var(--muted); }
.comment-meta strong { color: var(--ink); }
.comment-body p { margin: .4rem 0; }
.badge { background: var(--chili); color: #fff; font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- search ---------- */
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; max-width: 900px; }
.result a { display: flex; gap: 1rem; padding: .9rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.result a:hover { border-color: var(--green); }
.result img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; flex: none; background: var(--paper-2); }
.result .r-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 650; }
.result .r-thai { font-style: italic; color: var(--muted); }
.result .r-kind { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--chili); font-weight: 700; }
.result .r-excerpt { color: var(--ink-2); font-size: .95rem; margin: .2rem 0 0; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 .1em; }
.more-results { margin: 1.5rem 0; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgb(10 8 5 / 92%); display: grid; place-items: center; padding: 3rem 4rem; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; text-align: center; }
.lightbox img { max-width: min(1400px, 92vw); max-height: 82vh; border-radius: 6px; }
.lightbox figcaption { color: #eee; margin-top: .75rem; font-size: 1rem; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.5rem; cursor: pointer; padding: .5rem 1rem; line-height: 1; }
.lightbox-close { top: .5rem; right: .75rem; }
.lightbox-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: .5rem; top: 50%; transform: translateY(-50%); }

/* ---------- footer ---------- */
.footer { margin-top: 4rem; border-top: 1px solid var(--line); background: var(--paper-2); color: var(--ink-2); font-size: .95rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; padding: 2.5rem 0; }
.footer-inner > div { max-width: 560px; }
.footer-brand { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); margin: 0 0 .5rem; }
.footer nav { display: grid; grid-template-columns: repeat(2, auto); gap: .3rem 2rem; align-content: start; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .masthead-inner { flex-wrap: wrap; gap: .5rem 1rem; padding: .5rem 0; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .quicksearch input { width: 11rem; }
  .quicksearch kbd { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .brand small { display: none; }
  .quicksearch { flex: 1; }
  .quicksearch input { width: 100%; }
  .grid { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .grid-compact { grid-template-columns: 1fr; }
  .card-body { padding: .6rem .7rem .8rem; }
  .card-title { font-size: 1rem; }
  .result img { width: 80px; height: 64px; }
  .comment.depth-1, .comment.depth-2, .comment.depth-3 { margin-left: .75rem; }
  .lightbox { padding: 3rem .5rem; }
}

/* ---------- print (recipes) ---------- */
@media print {
  .masthead, .footer, .crumbs, .doc-actions, .more, .aside-block, .comments, .lightbox, .archive-note a { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .doc { max-width: none; padding: 0; }
  .photo { max-width: 40% !important; }
  a { color: inherit; text-decoration: none; }
  ul.recipe { border: 1px solid #999; }
}
