/* Andaman Guide
   One stylesheet. No framework, no inherited theme, no !important.

   Daylight: white ground, shallow-water greens, soft radii, generous air.
   Typography is a single family differentiated by weight and size, so the
   display and body tokens resolve to the same stack today; they stay
   separate so a display face can be introduced without touching components.

   Every colour pair below meets WCAG AA on every surface it can appear on,
   including the tinted card and table-header surfaces. */

/* ---------- font ---------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/inter-roman.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- tokens ---------- */

:root {
  --paper: #ffffff;
  --paper-raised: #f3faf8;
  --paper-sunk: #e4f2ef;

  --ink: #123338;
  --ink-soft: #4c6a6c;
  --accent: #0a6f68;
  --accent-deep: #07514c;

  --rule: rgba(18, 51, 56, 0.13);
  --rule-strong: rgba(18, 51, 56, 0.28);

  --font-stack: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: var(--font-stack);
  --font-body: var(--font-stack);

  --radius: 10px;
  --radius-lg: 16px;

  --shell-max: 68rem;
  --measure: 40rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --step: clamp(2.5rem, 6vw, 4.5rem);
}

/* ---------- base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
iframe,
video { display: block; max-width: 100%; }

img { height: auto; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.028em;
  text-wrap: balance;
  margin: 0;
}

p, ul, ol, figure, table, blockquote { margin: 0; }

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

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.shell {
  width: min(100% - (2 * var(--gutter)), var(--shell-max));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 50;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); color: var(--paper); }

.section-title {
  font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.7rem);
  margin-bottom: 1.5rem;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding-block: 1.25rem;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark:hover { color: var(--accent-deep); }

.site-nav {
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.98rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent-deep); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- home ---------- */

.home-intro {
  max-width: var(--measure);
  padding-block: var(--step) clamp(2rem, 5vw, 3rem);
}

.home-intro__title {
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.032em;
}

.home-intro__lede {
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 1.1em;
  text-wrap: pretty;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: clamp(1.5rem, 3vw, 2.25rem);
  margin: 0 0 var(--step);
  padding: 0;
  list-style: none;
}

.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--paper-raised);
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.card__link:hover { background: var(--paper-sunk); }

.card__image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--paper-sunk);
}

.card__body { padding: 1.15rem 1.2rem 1.35rem; }

.card__title {
  font-size: 1.16rem;
  line-height: 1.3;
}

.card__link:hover .card__title { color: var(--accent-deep); }

.card__excerpt {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
  text-wrap: pretty;
}

@media (min-width: 45rem) {
  .card--featured { grid-column: 1 / -1; }
  .card--featured .card__link {
    flex-direction: row;
    align-items: center;
  }
  /* Both axes are pinned deliberately. With only the flex basis set, the
     image is a replaced element with an intrinsic ratio and a stretched
     cross size, so the browser resolves its main size from that ratio and
     it overruns the 55%, squeezing the text until overflow clips it. */
  .card--featured .card__image {
    flex: 0 0 55%;
    width: 55%;
    align-self: stretch;
    height: 100%;
  }
  .card--featured .card__body {
    min-width: 0;
    padding: clamp(1.5rem, 3vw, 2.5rem);
  }
  .card--featured .card__title { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 1.9rem); }
  .card--featured .card__excerpt { font-size: 1rem; }
}

/* ---------- post ---------- */

.post__header { padding-block: var(--step) clamp(1.75rem, 4vw, 2.75rem); }

.post__title {
  max-width: var(--measure);
  margin-inline: auto;
  font-size: clamp(2rem, 1.3rem + 3.2vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.032em;
}

.post__meta {
  max-width: var(--measure);
  margin: 1.1rem auto 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.post__meta a { color: var(--ink-soft); }
.post__meta a:hover { color: var(--accent-deep); }
.post__meta-sep { margin-inline: 0.5rem; }

.post__lede { margin-top: clamp(2rem, 4vw, 3rem); }

.post__lede img {
  width: 100%;
  border-radius: var(--radius-lg);
  background: var(--paper-sunk);
}

.post__lede figcaption,
.prose figcaption {
  max-width: var(--measure);
  margin: 0.7rem auto 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: center;
}

/* ---------- prose ---------- */

.prose {
  max-width: var(--measure);
  padding-bottom: var(--step);
}

.prose > * + * { margin-top: 1.25rem; }

.prose h2 {
  margin-top: 2.75rem;
  font-size: clamp(1.45rem, 1.2rem + 1.1vw, 1.9rem);
  scroll-margin-top: 1.5rem;
}

.prose h3 {
  margin-top: 2rem;
  font-size: clamp(1.2rem, 1.08rem + 0.5vw, 1.4rem);
  scroll-margin-top: 1.5rem;
}

.prose h4 { margin-top: 1.75rem; font-size: 1.1rem; }

.prose p { text-wrap: pretty; }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.16em;
}
.prose a:hover { text-decoration-thickness: 0.12em; }

.prose strong { font-weight: 650; color: var(--ink); }

.prose ul,
.prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.5rem; }
.prose li::marker { color: var(--ink-soft); }

.prose blockquote {
  padding: 0.75rem 0 0.75rem 1.25rem;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-soft);
  font-style: italic;
}

.prose figure { margin-block: 2rem; }
.prose img { border-radius: var(--radius); }

.prose hr {
  height: 1px;
  margin-block: 2.5rem;
  border: 0;
  background: var(--rule);
}

.prose code {
  padding: 0.1em 0.35em;
  background: var(--paper-sunk);
  border-radius: 4px;
  font-size: 0.9em;
}

/* ---------- tables ---------- */

.table-scroll {
  margin-block: 2rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--paper-raised);
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  line-height: 1.55;
}

.table-scroll :is(th, td) {
  padding: 0.7rem 0.95rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule);
}

.table-scroll th {
  font-weight: 650;
  background: var(--paper-sunk);
}

.table-scroll thead th { white-space: nowrap; }
.table-scroll tr:last-child :is(th, td) { border-bottom: 0; }

.prose .text-center { text-align: center; }

/* ---------- related ---------- */

.related {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  border-top: 1px solid var(--rule);
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: var(--step);
  padding-block: 2.25rem;
  border-top: 1px solid var(--rule);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.wordmark--footer { font-size: 1.1rem; }

.site-footer__legal {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
}
