/* base.css: moved out of src/styles/global.css and src/layouts/Base.astro on 2026-10-27, so a style fix is a single file upload. */

:root {
  --ink: #12303f;
  --ink-deep: #0c222d;
  --ink-soft: #4a626e;
  --accent: #6fcf97;
  --accent-deep: #1b7f52;
  --paper: #fff;
  --paper-deep: #e4ebf0;
  --white: #fff;
  --card: #f2f5f8;
  --line: #d9e1e7;
  /* Roboto Slab for titles, Karla for everything else (--head is the bold label and button face). */
  --title: 'Roboto Slab Variable', 'Roboto Slab', Georgia, serif;
  --head: 'Karla Variable', 'Karla', system-ui, sans-serif;
  --body: 'Karla Variable', 'Karla', system-ui, sans-serif;
  /* "Noche andina" (redesign of 2026-10-27): Fraunces for the display titles of the header, the footer and the home,
     on night blues. The other pages keep Roboto Slab until they are redesigned. */
  --display: 'Fraunces Variable', 'Fraunces', Georgia, serif;
  --night: #0c171d;
  --night-2: #11222a;
  --night-deep: #08121a;
  --wrap: 1180px;
  --gutter: clamp(18px, 4vw, 40px);
  --radius: 14px;
  --shadow: 0 1px 2px rgb(18 48 63 / 0.06), 0 10px 30px -12px rgb(18 48 63 / 0.22);
  --header: 66px;
}

/* Taller header on desktop, where the destinations sit inside it. */
@media (min-width: 1081px) {
  :root {
    --header: 86px;
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header) + 64px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--title);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
}

h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

/* A <picture> only chooses the file: the <img> inside is laid out as if the wrapper were not there.
   Its <source> tags must not count as boxes, or each would take a cell of a grid or a flex row. */
picture {
  display: contents;
}

picture > source {
  display: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* No blue flash when a phone taps a link, a button or an accordion. Keyboard users
   still get the outline below, which only shows when focus comes from the keyboard. */
* {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.section {
  padding-block: clamp(56px, 8vw, 104px);
}

.section.tight {
  padding-block: clamp(40px, 6vw, 72px);
}

.section.white {
  background: var(--card);
}

.section.dark {
  background: var(--ink);
  color: var(--paper);
}

.eyebrow {
  display: block;
  margin-bottom: 12px;
  font: 700 0.78rem/1 var(--head);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.dark .eyebrow {
  color: var(--accent);
}

.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 62ch;
}

.dark .lead {
  color: rgb(255 255 255 / 0.78);
}

.head {
  margin-bottom: clamp(28px, 4vw, 48px);
}

.head h2 + .lead {
  margin-top: 14px;
}

.prose {
  max-width: 68ch;
}

.prose h2 {
  margin: 1.6em 0 0.5em;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose ul {
  margin: 0 0 1em;
  padding-left: 1.2em;
  list-style: disc;
}

.prose li {
  margin-bottom: 0.4em;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 700 0.98rem/1 var(--head);
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}

.btn:active {
  transform: translateY(1px);
}

.btn.accent {
  background: var(--accent);
  color: var(--ink-deep);
}

.btn.accent:hover {
  background: #89dbab;
}

.btn.ink {
  background: var(--ink);
  color: var(--paper);
}

.btn.ink:hover {
  background: var(--ink-deep);
}

.btn.line {
  border-color: currentColor;
  background: transparent;
}

.btn.line:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.dark .btn.line:hover,
.btn.line.on-dark:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 0.98rem/1 var(--head);
  text-decoration: none;
}

.more::after {
  content: '';
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--accent-deep);
  border-right: 2px solid var(--accent-deep);
  transform: rotate(45deg);
  transition: transform 0.18s;
}

.more:hover::after {
  transform: translateX(4px) rotate(45deg);
}

/* Grids */
.grid {
  display: grid;
  gap: clamp(18px, 2.4vw, 28px);
}

.grid.three {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* Breadcrumb */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.crumbs li + li::before {
  content: '/';
  margin-right: 10px;
  color: var(--line);
}

.crumbs a {
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

/* Accordion */
.acc {
  border-bottom: 1px solid var(--line);
}

.acc:first-of-type {
  border-top: 1px solid var(--line);
}

.acc > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  font: 700 1.06rem/1.3 var(--title);
  cursor: pointer;
  list-style: none;
}

.acc > summary::-webkit-details-marker {
  display: none;
}

.acc > summary::after {
  content: '';
  flex: none;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-right: 2px solid var(--accent-deep);
  border-bottom: 2px solid var(--accent-deep);
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.acc[open] > summary::after {
  transform: rotate(-135deg);
}

.acc > .acc-body {
  padding: 0 2px 22px;
  color: var(--ink-soft);
}

/* Page hero for inner pages */
.page-hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(320px, 46vw, 480px);
  color: var(--paper);
  background: var(--ink-deep);
  isolation: isolate;
}

.page-hero > picture > img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgb(12 34 45 / 0.25), rgb(12 34 45 / 0.86));
}

.page-hero .wrap {
  padding-block: clamp(28px, 5vw, 56px);
}

.page-hero .crumbs {
  margin-bottom: 14px;
  color: rgb(255 255 255 / 0.8);
}

.page-hero .lead {
  margin-top: 14px;
  color: rgb(255 255 255 / 0.88);
}

/* Andean weave: a band of stepped diamonds that closes the dark bands of the blog. */
.weave {
  height: 18px;
  background: var(--ink-deep)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24'%3E%3Cpath fill='%236fcf97' d='M22 2h4v4h4v4h4v4h-4v4h-4v4h-4v-4h-4v-4h-4v-4h4V6h4zM0 10h2v4H0zM46 10h2v4h-2z'/%3E%3Cpath fill='%230c222d' d='M22 10h4v4h-4z'/%3E%3C/svg%3E")
    center / 36px 18px repeat-x;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

/* Japanese: the fonts have no real italic and tiny tracked labels are hard to read in kanji. */
html:lang(ja) body {
  line-height: 1.8;
}

html:lang(ja) :is(em, blockquote p, .insight p) {
  font-style: normal;
}

:where(html:lang(ja)) :is(.eyebrow, .tag, .weather dt, .specs dt, .drop small, thead th) {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

:lang(ja) :is(h1, h2, h3) {
  line-height: 1.3;
  letter-spacing: 0;
  /* Break titles between phrases, not in the middle of a word (browsers without support ignore it). */
  word-break: auto-phrase;
  /* A single phrase wider than a phone screen may still break, instead of widening the whole column. */
  overflow-wrap: anywhere;
}

/* Skip link */
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink-deep);
  font-weight: 700;
}

.skip:focus {
  top: 12px;
}
