/* Thailand Beaches — editorial travel guide */
:root {
  --ink: #1f2d30;
  --ink-soft: #4a5b5f;
  --accent: #0d5c66;
  --accent-deep: #08444c;
  --paper: #f4f8f7;
  --paper-soft: #e6eef0;
  --white: #ffffff;
  --line: rgba(13, 92, 102, 0.11);
  --radius: 2px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Figtree", system-ui, sans-serif;
  --max: 760px;
  --max-wide: 1180px;
  --toc-w: 250px;
  --nav-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 85% 50% at 0% 0%, rgba(56, 168, 170, 0.09), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 8%, rgba(13, 92, 102, 0.06), transparent 50%),
    radial-gradient(ellipse 55% 35% at 50% 100%, rgba(120, 190, 185, 0.07), transparent 55%),
    linear-gradient(165deg, #eef5f4 0%, #f6faf9 38%, #f2f7f6 72%, #eaf2f1 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

a {
  color: var(--accent);
  transition: color 0.2s var(--ease);
}

a:hover {
  color: var(--accent-deep);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

.container-wide {
  width: min(100% - 2.5rem, var(--max-wide));
  margin-inline: auto;
}

/* ——— Navbar ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(244, 248, 247, 0.82);
  backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid var(--line);
}

.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2.5rem, var(--max-wide));
}

.brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  cursor: pointer;
  position: relative;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--ink);
  position: absolute;
  left: 12px;
}

.nav-toggle span { top: 20px; }
.nav-toggle span::before { content: ""; top: -6px; left: 0; }
.nav-toggle span::after { content: ""; top: 6px; left: 0; }

.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-list a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--ink);
}

.nav-list .nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  background: var(--accent);
  color: var(--white);
  border-radius: var(--radius);
}

.nav-list .nav-cta:hover {
  background: var(--accent-deep);
  color: var(--white);
}

/* ——— Magazine cover hero ——— */
.hero {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 85vh;
  min-height: 85dvh;
  display: grid;
  align-items: center;
  color: var(--white);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  filter: saturate(0.95) brightness(1.04);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.18) 0%,
    rgba(0, 0, 0, 0.12) 40%,
    rgba(0, 0, 0, 0.35) 100%
  );
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100% - 2.5rem, var(--max-wide));
  margin-inline: auto;
  padding: 2rem 0;
  max-width: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(3.25rem, 9vw, 5.75rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
  max-width: 14ch;
  line-height: 1.02;
}

.hero-subtitle {
  margin: 0;
  font-size: clamp(1.05rem, 2.1vw, 1.25rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  max-width: 38ch;
  font-weight: 400;
}

/* ——— Content + sticky right TOC ——— */
.content-shell {
  width: min(100% - 2.5rem, var(--max-wide));
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--toc-w) minmax(0, 1fr);
  gap: 2.75rem 3.25rem;
  align-items: start;
  padding: 3rem 0 3.5rem;
  background: transparent;
}

.beach-list {
  min-width: 0;
  max-width: 48rem;
}

.beach {
  padding: 2.75rem 0;
  border-top: none;
  scroll-margin-top: calc(var(--nav-h) + 1.25rem);
}

.beach:first-child {
  padding-top: 0;
}

.beach-meta {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.beach h2 {
  font-size: clamp(1.55rem, 3vw, 2rem);
  margin-bottom: 1rem;
  color: var(--ink);
}

.beach-copy p {
  margin-bottom: 1rem;
  color: var(--ink-soft);
  max-width: 65ch;
}

.beach-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.35rem 0 1.65rem;
  max-width: 680px;
}

.beach-gallery:has(.gallery-tile:only-child) {
  grid-template-columns: 1fr;
  max-width: 420px;
}

.gallery-tile {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--paper-soft);
  box-shadow: 0 8px 24px rgba(13, 92, 102, 0.08);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

@media (prefers-reduced-motion: no-preference) {
  .gallery-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(13, 92, 102, 0.12);
  }
}

.gallery-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.gallery-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  background: rgba(12, 30, 34, 0.42);
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  transition: background 0.2s var(--ease);
}

.gallery-more:hover {
  background: rgba(12, 30, 34, 0.55);
}

.gallery-all {
  display: none;
}

/* Lightbox */
.lightbox[hidden] {
  display: none !important;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 24, 0.72);
  backdrop-filter: blur(4px);
}

.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 920px);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--paper);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.lightbox-close {
  position: sticky;
  top: 0;
  float: right;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  margin: 0 0 0.75rem 0.75rem;
}

.lightbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  clear: both;
}

.lightbox-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--paper-soft);
}

@media (max-width: 640px) {
  .lightbox-grid {
    grid-template-columns: 1fr;
  }
}

.beach-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.beach-read-more {
  display: inline-flex;
  align-items: center;
  margin-top: 1.35rem;
  padding: 0.7rem 1.15rem;
  background: var(--accent);
  color: var(--white) !important;
  text-decoration: none !important;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: background 0.2s var(--ease);
}

.beach-read-more:hover {
  background: var(--accent-deep);
  color: var(--white) !important;
}

.beach-copy p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.beach-copy p a:hover {
  color: var(--accent-deep);
}

.tag {
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--accent-deep);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
}

.beach-layout {
  display: block;
}

/* Sticky TOC — left column, below hero */
.toc {
  min-width: 0;
  position: sticky;
  top: calc(var(--nav-h) + 1.25rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 2.5rem);
}

.toc-sticky {
  max-height: inherit;
  overflow-y: auto;
  padding: 1.2rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  scrollbar-width: thin;
}

.toc-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.toc-list {
  list-style: none;
  counter-reset: toc;
}

.toc-list li {
  counter-increment: toc;
}

.toc-list a {
  display: grid;
  grid-template-columns: 1.35rem 1fr;
  gap: 0.4rem;
  align-items: start;
  padding: 0.45rem 0.4rem;
  margin: 0 -0.4rem;
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.35;
}

.toc-list a::before {
  content: counter(toc);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
  padding-top: 0.1rem;
  font-variant-numeric: tabular-nums;
}

.toc-list a:hover,
.toc-list a.is-active {
  color: var(--ink);
  background: var(--paper-soft);
}

.toc-list a.is-active::before {
  color: var(--accent-deep);
}

/* ——— About us ——— */
.about-section {
  padding: 3.25rem 0 3.5rem;
  border-top: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(13, 92, 102, 0.055) 0%, rgba(120, 190, 185, 0.04) 100%);
}

.about-section--brief {
  padding: 2.75rem 0 3rem;
}

.about-inner {
  width: min(100% - 2.5rem, 40rem);
  margin-inline: auto;
}

.about-label {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.55rem;
}

.about-section h2 {
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  margin-bottom: 0.85rem;
  color: var(--ink);
}

.about-copy p {
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
  max-width: 58ch;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-more,
.about-back a {
  display: inline-block;
  margin-top: 1.15rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.about-more:hover,
.about-back a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-hero {
  padding: 3.5rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(56, 168, 170, 0.08) 0%, transparent 100%);
}

.page-hero-inner {
  width: min(100% - 2.5rem, 40rem);
  margin-inline: auto;
}

.page-hero h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  margin-bottom: 0.85rem;
}

.page-hero-lead {
  color: var(--ink-soft);
  font-size: 1.12rem;
  max-width: 40ch;
  line-height: 1.55;
}

.about-page {
  padding: 2.75rem 0 4rem;
}

.about-page .about-copy p {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.about-back {
  margin-top: 0.5rem;
}

/* ——— CTA + footer ——— */
.cta-band {
  margin: 0;
  padding: 3.25rem 0;
  border-top: 1px solid var(--line);
  background: var(--paper-soft);
}

.cta-band .container,
.site-footer .container {
  width: min(100% - 2.5rem, var(--max-wide));
}

.cta-band .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.cta-band h2 {
  font-size: 1.45rem;
  margin-bottom: 0.4rem;
}

.cta-band p {
  color: var(--ink-soft);
  max-width: 40ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent-deep);
  color: var(--white);
}

.site-footer {
  padding: 2.75rem 0 1.75rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(230, 238, 240, 0.55), rgba(220, 232, 232, 0.75));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 1.75rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
}

.footer-grid p {
  margin-top: 0.65rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 28ch;
}

.footer-grid h4 {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 0.4rem;
}

.footer-grid a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-grid a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.reveal {
  opacity: 1;
  transform: none;
}

/* ——— Responsive ——— */
@media (max-width: 960px) {
  .content-shell {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    padding-top: 2.25rem;
  }

  .beach-list {
    max-width: none;
    order: 1;
  }

  .toc {
    order: 2;
  }

  .toc {
    position: relative;
    top: auto;
    max-height: none;
  }

  .toc-sticky {
    max-height: none;
    overflow: visible;
  }

  .toc-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.75rem;
  }

  .hero {
    min-height: 75vh;
    min-height: 75dvh;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-block;
  }

  .nav-list {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.75rem 1rem 1rem;
    background: rgba(250, 249, 246, 0.98);
    border-bottom: 1px solid var(--line);
  }

  .nav-list.is-open {
    display: flex;
  }

  .nav-list li {
    border-bottom: 1px solid var(--line);
  }

  .nav-list a {
    display: block;
    padding: 0.85rem 0.25rem;
  }

  .nav-list .nav-cta {
    margin: 0.75rem 0 0.25rem;
    justify-content: center;
  }

  .hero {
    min-height: 70vh;
    min-height: 70dvh;
  }

  .hero-inner {
    padding: 1.5rem 0;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 12vw, 3.8rem);
  }

  .toc-list {
    grid-template-columns: 1fr;
  }

  .beach-gallery {
    max-width: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }
}
