/* ==========================================================
   Read The Cloud · อ่านเมฆ — v3b (top menu, full width, single column)
   ========================================================== */

:root {
  --cream:        #F5F0E6;
  --cream-soft:   #EFE8D8;
  --cream-deep:   #E8DFC9;
  --cream-paper:  #FAF6EC;
  --ink:          #2B2B2B;
  --ink-soft:     #4A443C;
  --taupe:        #6B6258;
  --khaki:        #D9D0BC;
  --gold:         #C19A3A;
  --gold-dark:    #A07E28;
  --gold-light:   #D4B964;
  --brick:        #8B3A2E;
  --moss:         #5A7A3A;
  --white:        #FFFFFF;

  --serif-en:     'Cormorant Garamond', Georgia, serif;
  --serif-th:     'Noto Serif Thai', 'Cormorant Garamond', Georgia, serif;
  --sans-en:      'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --sans-th:      'IBM Plex Sans Thai', 'IBM Plex Sans', sans-serif;

  --content-max:  1400px;
  --content-narrow: 1180px;
  --gutter:       clamp(20px, 4vw, 64px);
  --header-h:     84px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans-th);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--gold-dark); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ==========================================================
   TOP BAR (thin utility strip, ink background)
   ========================================================== */
.topbar {
  background: var(--ink);
  color: var(--cream);
  padding: 8px var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--sans-en);
}
.topbar-left { display: flex; gap: 24px; align-items: center; }
.topbar-date {
  color: var(--gold);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0.02em;
  font-family: var(--serif-en);
  font-size: 13px;
}
.topbar-right { display: flex; gap: 16px; align-items: center; }
.lang-switch { display: flex; gap: 6px; }
.lang-switch span { opacity: 0.5; cursor: pointer; transition: opacity .2s; }
.lang-switch span.active { opacity: 1; color: var(--gold); }
.lang-switch span:hover { opacity: 1; }
.topbar-socials { display: flex; gap: 12px; }
.topbar-socials a { font-size: 11px; opacity: 0.7; transition: opacity .2s, color .2s; }
.topbar-socials a:hover { opacity: 1; color: var(--gold); }

/* ==========================================================
   MAIN HEADER — logo left, horizontal nav, sticky
   ========================================================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--khaki);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow .3s ease, background-color .3s ease;
}
.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(43, 43, 43, 0.06);
}
.site-header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: var(--header-h);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.brand-lockup img {
  width: 52px;
  height: auto;
}
.brand-lockup .brand-names {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.brand-lockup .brand-name-en {
  font-family: var(--serif-en);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-lockup .brand-name-th {
  font-family: var(--serif-th);
  font-size: 15px;
  font-weight: 500;
  color: var(--gold-dark);
  margin-top: 3px;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.primary-nav > a {
  font-family: var(--sans-en);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  transition: all .2s ease;
  position: relative;
}
.primary-nav > a:hover {
  color: var(--ink);
  border-bottom-color: var(--gold);
}
.primary-nav > a.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
  font-weight: 500;
}
.primary-nav > a .th {
  display: block;
  font-family: var(--sans-th);
  font-size: 11px;
  color: var(--taupe);
  margin-top: 2px;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-actions button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: background-color .2s, color .2s;
}
.header-actions button:hover { background: var(--cream); color: var(--ink); }
.header-actions .search-svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; }

/* Mobile hamburger */
.menu-toggle { display: none; }

/* ==========================================================
   HERO VARIANTS — text sits on image, NO overlay
   ========================================================== */

/* Split hero — image left half, text right half */
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  background-color: var(--cream-paper);
  border-bottom: 1px solid var(--khaki);
  min-height: 560px;
  position: relative;
  overflow: hidden;
}
.hero-split-image {
  position: relative;
  height: 100%;
  min-height: 560px;
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}
.hero-split-text {
  padding: 72px clamp(32px, 5vw, 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Full-bleed hero — image fills, text in clean zone of the artwork */
.hero-full {
  position: relative;
  background-color: var(--cream-paper);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--khaki);
  min-height: 540px;
  display: flex;
  align-items: center;
}
.hero-full-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
  display: flex;
}
.hero-full-text {
  padding: 56px 0;
  max-width: 620px;
  margin-left: auto; /* default: push to right */
}
.hero-full.align-left .hero-full-text { margin-left: 0; margin-right: auto; }
.hero-full.align-top { align-items: flex-start; }
.hero-full.align-top .hero-full-text { padding-top: clamp(48px, 7vw, 96px); }

/* Shared hero typography */
.hero-kicker {
  font-family: var(--sans-en);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-kicker::before { content: ''; width: 32px; height: 1px; background: var(--gold-dark); }
.hero-title {
  font-family: var(--serif-en);
  font-size: clamp(44px, 6.2vw, 88px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 12px;
}
.hero-title-th {
  font-family: var(--serif-th);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 500;
  color: var(--gold-dark);
  margin-bottom: 28px;
  line-height: 1.25;
}
.hero-lede {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: clamp(17px, 1.5vw, 21px);
  line-height: 1.55;
  color: var(--taupe);
  max-width: 540px;
  margin-bottom: 18px;
}
.hero-lede-th {
  font-family: var(--sans-th);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 540px;
}

/* ==========================================================
   SECTIONS (single-column full-width magazine)
   ========================================================== */

.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.section-narrow {
  max-width: var(--content-narrow);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-label {
  font-family: var(--sans-en);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dark);
  padding: 56px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-label-text { display: flex; align-items: center; gap: 12px; }
.section-label-text::before { content: ''; width: 24px; height: 1px; background: var(--gold-dark); }
.section-label a {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--taupe);
  border-bottom: 1px solid var(--khaki);
  padding-bottom: 2px;
}
.section-label a:hover { color: var(--gold-dark); border-bottom-color: var(--gold); }
.section-body { padding: 28px 0 56px; }

/* -------- Featured story -------- */
.featured {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}
.featured-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--cream-deep);
}
.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.featured:hover .featured-image img { transform: scale(1.03); }
.featured-meta {
  font-family: var(--sans-en);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.featured-meta .dot { width: 3px; height: 3px; background: var(--gold-dark); border-radius: 50%; }
.featured h2 {
  font-family: var(--serif-en);
  font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.featured h2 a:hover { color: var(--gold-dark); }
.featured .byline {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  color: var(--taupe);
  margin-bottom: 16px;
}
.featured p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 24px;
  max-width: 520px;
}
.read-more {
  font-family: var(--sans-en);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
  display: inline-flex;
  gap: 8px;
}
.read-more::after { content: '→'; transition: transform .2s ease; }
.read-more:hover { color: var(--gold-dark); border-bottom-color: var(--gold-dark); }
.read-more:hover::after { transform: translateX(4px); }

/* -------- Categories Gallery -------- */
.categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.category {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--cream-deep);
  cursor: pointer;
  display: block;
}
.category::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(43,43,43,0) 40%, rgba(43,43,43,0.82) 100%);
  z-index: 2;
  transition: opacity .4s ease;
}
.category-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}
.category:hover .category-bg { transform: scale(1.06); }
.category:hover::before { opacity: 0.95; }
.category-inner {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 24px;
  color: var(--cream);
  z-index: 3;
}
.category-count {
  font-family: var(--sans-en);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.category-name-en {
  font-family: var(--serif-en);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 2px;
}
.category-name-th {
  font-family: var(--serif-th);
  font-size: 17px;
  color: var(--cream-soft);
  font-weight: 400;
}

/* -------- Story grid -------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 28px;
}
@media (max-width: 1200px) { .story-grid { grid-template-columns: repeat(3, 1fr); } }
.column-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .column-grid { grid-template-columns: repeat(2, 1fr); } }

.story { display: flex; flex-direction: column; gap: 14px; }
.story-img {
  aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--cream-deep);
}
.story-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.story:hover .story-img img { transform: scale(1.05); }
.story-cat {
  font-family: var(--sans-en);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-dark);
}
.story h3 {
  font-family: var(--serif-en);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.story h3 a:hover { color: var(--gold-dark); }
.story-th {
  font-family: var(--sans-th);
  font-size: 14px;
  color: var(--taupe);
  line-height: 1.55;
}
.story-byline {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 13px;
  color: var(--taupe);
  margin-top: 4px;
}

/* -------- Split editorial band (full-bleed) -------- */
.split-band {
  background: var(--cream-soft);
  background-image: url('assets/bg-pattern.png');
  background-repeat: repeat;
  background-size: 700px auto;
  border-top: 1px solid var(--khaki);
  border-bottom: 1px solid var(--khaki);
  margin: 56px 0;
}
.split {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  padding: 64px var(--gutter);
}
.split-card { display: flex; gap: 24px; align-items: flex-start; }
.split-num {
  font-family: var(--serif-en);
  font-size: 56px;
  font-weight: 400;
  font-style: italic;
  color: var(--gold);
  line-height: 1;
  flex-shrink: 0;
  margin-top: -4px;
}
.split-card h3 {
  font-family: var(--serif-en);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 8px;
}
.split-card p { font-size: 15px; color: var(--ink-soft); line-height: 1.65; }

/* -------- Newsletter -------- */
.newsletter {
  padding: 72px var(--gutter);
  text-align: center;
  border-top: 1px solid var(--khaki);
  position: relative;
  max-width: var(--content-max);
  margin: 0 auto;
}
.newsletter::before {
  content: '◈';
  position: absolute;
  top: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 14px;
}
.newsletter-title {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.3;
  color: var(--ink);
  max-width: 520px;
  margin: 24px auto 8px;
}
.newsletter-sub {
  font-family: var(--serif-th);
  font-size: 16px;
  color: var(--taupe);
  margin-bottom: 28px;
}
.newsletter-form {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  border-bottom: 1px solid var(--ink);
}
.newsletter-form input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 4px;
  font-family: var(--sans-en);
  font-size: 14px;
  color: var(--ink);
  outline: none;
}
.newsletter-form input::placeholder { color: var(--taupe); font-style: italic; }
.newsletter-form button {
  font-family: var(--sans-en);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 16px;
  color: var(--ink);
  font-weight: 500;
}
.newsletter-form button:hover { color: var(--gold-dark); }

/* -------- Category page: subnav + intro + pagination -------- */
.cat-intro {
  padding: 48px 0 24px;
  max-width: 820px;
}
.cat-intro p {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.cat-intro p.th {
  font-family: var(--sans-th);
  font-style: normal;
  font-size: 15px;
  color: var(--taupe);
  line-height: 1.75;
}

.subnav {
  border-bottom: 1px solid var(--khaki);
  background: var(--cream-paper);
}
.subnav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a {
  font-family: var(--sans-en);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--taupe);
  padding: 16px 18px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all .2s ease;
}
.subnav a:hover, .subnav a.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 32px 0 72px;
  font-family: var(--sans-en);
  font-size: 13px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--khaki);
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}
.pagination a:hover { border-color: var(--gold); color: var(--ink); }
.pagination .current {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

/* -------- Footer -------- */
.footer {
  background: var(--ink);
  color: var(--cream-soft);
  padding: 64px clamp(24px, 4vw, 72px) 28px;
  font-family: var(--sans-en);
  margin-top: 40px;
}
.footer-inner { max-width: var(--content-max); margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand-en {
  font-family: var(--serif-en);
  font-size: 30px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--cream);
}
.footer-brand-th {
  font-family: var(--serif-th);
  font-size: 20px;
  color: var(--gold);
  margin-bottom: 16px;
}
.footer-about {
  font-family: var(--serif-en);
  font-style: italic;
  font-size: 14px;
  line-height: 1.55;
  color: var(--khaki);
  max-width: 360px;
}
.footer h4 {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(217, 208, 188, 0.2);
}
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer ul a { font-size: 13px; color: var(--cream-soft); opacity: 0.8; transition: opacity .2s; }
.footer ul a:hover { opacity: 1; color: var(--gold); }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(217, 208, 188, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--taupe);
  text-transform: uppercase;
}
.footer-bottom a { color: var(--cream-soft); }
.footer-bottom a:hover { color: var(--gold); }

/* ==========================================================
   RESPONSIVE
   ========================================================== */
@media (max-width: 1100px) {
  .primary-nav > a { padding: 10px 10px; font-size: 12px; }
  .primary-nav > a .th { display: none; }
}

@media (max-width: 920px) {
  .site-header-inner { min-height: 68px; }
  .brand-lockup img { width: 42px; }
  .brand-lockup .brand-name-en { font-size: 19px; }
  .brand-lockup .brand-name-th { font-size: 13px; }

  /* Hide desktop nav, show hamburger */
  .primary-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 86vw;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 80px 24px 32px;
    z-index: 40;
    transform: translateX(100%);
    transition: transform .3s ease;
    box-shadow: -20px 0 40px rgba(0,0,0,0.08);
    overflow-y: auto;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav > a {
    border-bottom: 1px solid var(--cream-deep);
    padding: 14px 0;
    font-size: 14px;
  }
  .primary-nav > a .th { display: block; }
  .menu-toggle {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    font-size: 22px;
    z-index: 60;
  }

  .hero-split { grid-template-columns: 1fr; min-height: auto; }
  .hero-split-image { min-height: 280px; aspect-ratio: 16/9; }
  .hero-split-text { padding: 48px 24px; }
  .hero-full { min-height: 440px; background-position: center left; }
  .hero-full-text { padding: 40px 0; max-width: 100%; margin: 0; }

  .featured { grid-template-columns: 1fr; gap: 28px; }
  .categories { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .story-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .split { grid-template-columns: 1fr; gap: 32px; padding: 48px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .topbar-left { gap: 14px; }
  .topbar-date, .topbar-socials { display: none; }
}

@media (max-width: 560px) {
  .categories { grid-template-columns: 1fr; }
  .story-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .newsletter { padding: 56px 20px; }
  .brand-lockup .brand-names { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: rise .8s ease forwards;
}
.fade-in.d1 { animation-delay: .08s; }
.fade-in.d2 { animation-delay: .16s; }
.fade-in.d3 { animation-delay: .24s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--cream);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Lock body scroll when mobile nav is open */
body.nav-open { overflow: hidden; }
