/* Reusable components: buttons, links, section headings, chips, cards and tiles,
   ticker, facts, page header, breadcrumbs, forms, alerts. Mobile-first.
   Site chrome (header, destination panel, drawer, footer) is in layout.css. */
@layer components {

/* =========================================================== buttons */
.btn {
  --btn-bg: transparent;
  --btn-fg: inherit;
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-target);
  padding: 0.7rem 1.5rem;
  border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary { --btn-bg: var(--color-primary); --btn-fg: var(--color-on-dark); }
.btn-primary:hover { --btn-bg: var(--color-primary-dark); }

/* Ochre fill with dark text: the main call to action (7.5:1 contrast). */
.btn-accent { --btn-bg: var(--color-accent); --btn-fg: var(--color-night); }
.btn-accent:hover { --btn-bg: var(--color-accent-hover); }

.btn-outline { --btn-border: var(--color-primary); --btn-fg: var(--color-primary); }
.btn-outline:hover { --btn-bg: var(--color-primary); --btn-fg: var(--color-on-dark); }

.btn-outline-light { --btn-border: rgb(var(--rgb-white) / 0.75); --btn-fg: var(--color-on-dark); }
.btn-outline-light:hover { --btn-bg: var(--color-on-dark); --btn-fg: var(--color-night); }

.btn-sm { min-height: 42px; padding: 0.5rem 1.1rem; font-size: var(--text-sm); }
.btn-lg { min-height: 56px; padding: 0.9rem 2rem; font-size: var(--text-lg); }
.btn-block { width: 100%; }

/* Loading state: set aria-busy="true" on the button while a request runs. */
.btn[aria-busy="true"] {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 1.15em;
  height: 1.15em;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =========================================================== links */
/* Text links: colour marks them and changes on hover; no decorative underline. Keyboard
   focus keeps the site-wide outline (base.css). */
.link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease);
}
.link:hover {
  color: var(--color-accent-text);
}
:is(.section-dark, .section-night, .on-dark) .link:hover,
.link-light:hover {
  color: var(--color-accent);
}
.link-light {
  color: var(--color-on-dark);
}
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

/* =========================================================== section heading
   templates/components/section_heading.html */
.section-heading {
  display: grid;
  gap: var(--space-4) var(--space-6);
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
}
.section-heading-text {
  max-width: 44rem;
}
/* A link to the heading (#sec-why...) also shows the eyebrow above it; the html
   scroll-padding already keeps it clear of the sticky header. */
.section-heading [id] {
  scroll-margin-top: 3rem;
}
.section-title {
  font-size: var(--text-2xl);
}
/* The accent phrase sits on its own line in section headings. */
.section-title em {
  display: block;
}
.section-intro {
  margin-top: var(--space-4);
  font-size: var(--text-lg);
  line-height: 1.55;
  color: var(--color-muted);
  max-width: 60ch;
}
.section-heading--center {
  justify-items: center;
  text-align: center;
}
.section-heading--center .section-intro {
  margin-inline: auto;
}
.section-heading--light .section-intro {
  color: var(--color-on-dark-muted);
}
.section-heading--light .section-heading-link {
  color: var(--color-on-dark);
}
@media (min-width: 900px) {
  .section-heading--with-link:not(.section-heading--center) {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

/* =========================================================== chips and tags */
.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
/* Pill link or toggle: filters, tags, trip-style choices. The one chip style for
   the site; the active state accepts a class or the matching ARIA attribute. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-sand);
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}
.chip .icon {
  color: var(--color-sage);
}
.chip:hover {
  background: var(--color-border);
}
.chip.is-active,
.chip[aria-pressed="true"],
.chip[aria-current="page"],
.chip[aria-current="true"] {
  background: var(--color-primary);
  color: var(--color-on-dark);
}
.chip.is-active .icon,
.chip[aria-pressed="true"] .icon,
.chip[aria-current] .icon {
  color: inherit;
}
.chip-count {
  font-weight: 400;
  opacity: 0.8;
}
/* A label, not a control: no hover change. */
.chip--static,
.chip--static:hover {
  background: var(--color-sand);
  cursor: default;
}
/* Checkbox chip: <label class="chip chip-check"><input type="checkbox">Kenya</label>.
   The real checkbox stays in the page for keyboards and screen readers. */
.chip-check {
  position: relative;
  user-select: none;
}
.chip-check input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.chip-check:has(input:checked) {
  background: var(--color-primary);
  color: var(--color-on-dark);
}
.chip-check:has(input:checked)::before {
  content: "";
  width: 0.45rem;
  height: 0.8rem;
  margin: -0.2rem 0.1rem 0 0;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.chip-check:has(input:focus-visible) {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
/* Small label on images and cards ("3 days", "Kenya"). */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  background: var(--color-sand-light);
  color: var(--color-text);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.tag-on-image {
  background: rgb(var(--rgb-on-dark) / 0.92);
  color: var(--color-night);
}

/* =========================================================== cards
   The title link stretches over the whole card, so the card is one target. */
.card {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}
.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-sand);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease);
}
.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
}
.card-title {
  font-size: var(--text-xl);
}
.card-title a {
  text-decoration: none;
}
.card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card-meta {
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.card-foot {
  margin-top: auto;
  padding-top: var(--space-3);
}
.card:focus-within {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
.card :focus-visible {
  outline: none;
}

/* =========================================================== image tiles
   Photograph with text over a dark gradient; optional index number ("01"). */
.tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(20rem, 18rem + 10vw, 30rem);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-primary-dark);
  color: var(--color-on-dark);
  text-decoration: none;
  isolation: isolate;
}
.tile img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease);
}
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--color-scrim) 0%, rgb(var(--rgb-night) / 0.25) 45%, transparent 70%),
    linear-gradient(to bottom, rgb(var(--rgb-night) / 0.35), transparent 28%);
}
.tile-body {
  display: grid;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-5);
}
/* Brand pattern: stands in for a destination's own photograph until it has one (never
   another place's photograph). Contour rings on deep forest green, in CSS only.
   !important: it replaces the plain background a card or header box has in the later
   layout and pages layers (an earlier layer's important declaration wins). */
.brand-pattern {
  background-color: var(--color-primary-dark) !important;
  background-image:
    repeating-radial-gradient(circle at 88% 112%, transparent 0 26px, rgb(var(--rgb-on-dark) / 0.07) 26px 27px),
    repeating-radial-gradient(circle at 8% -12%, transparent 0 38px, rgb(var(--rgb-on-dark) / 0.05) 38px 39px),
    linear-gradient(155deg, var(--color-primary) 0%, var(--color-primary-dark) 75%) !important;
}
.tile.brand-pattern::before {
  background: linear-gradient(to top, rgb(var(--rgb-night) / 0.45), transparent 60%);
}
.pattern-name {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--space-4);
  color: rgb(var(--rgb-on-dark) / 0.92);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.15;
  text-align: center;
}

/* No photograph yet: a calm typographic tile on muted green. */
.tile--plain {
  background: var(--color-sage-tint);
  color: var(--color-text);
}
.tile--plain::before {
  display: none;
}
.tile--plain .tile-index {
  color: var(--color-accent-text);
  opacity: 1;
}
.tile--plain .tile-meta {
  color: var(--color-muted);
}
.tile--plain:hover {
  background: var(--color-sand);
}
.tile-body > .tag {
  justify-self: start;
}
.tile-index {
  position: absolute;
  top: var(--space-4);
  left: var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-on-dark);
  opacity: 0.85;
}
/* Room for the number above the text, so a long name never runs into it. */
.tile-index + .tile-body {
  padding-top: calc(var(--space-4) + 2.75rem);
}
.tile-title {
  font-size: var(--text-xl);
}
.tile-meta {
  font-size: var(--text-sm);
  color: var(--color-on-dark-muted);
}
.tile:focus-visible {
  outline-offset: 4px;
}
@media (hover: hover) {
  .card:hover .card-media img,
  .tile:hover img {
    transform: scale(1.04);
  }
}

/* =========================================================== ticker
   A slow horizontal strip of names. The list is rendered twice (the copy has
   aria-hidden) so the loop is seamless. Static and scrollable with reduced motion. */
.ticker {
  overflow: hidden;
  padding-block: var(--space-4);
  border-block: 1px solid var(--color-border);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 60s linear infinite;
}
.ticker:hover .ticker-track,
.ticker:focus-within .ticker-track {
  animation-play-state: paused;
}
.ticker-list {
  display: flex;
  flex: none;
  gap: var(--space-6);
  padding-right: var(--space-6);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  white-space: nowrap;
}
.ticker-list li {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.ticker-list li + li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}
.ticker-list a {
  text-decoration: none;
}
.ticker-list a:hover {
  color: var(--color-primary);
}
@keyframes ticker {
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker {
    position: relative; /* keeps visually hidden text inside, so it cannot widen the page */
    overflow-x: auto;
  }
  .ticker-track {
    animation: none;
  }
  .ticker-track > [aria-hidden="true"] {
    display: none;
  }
}

/* =========================================================== facts row
   Label over value: duration, best time to visit, starting point. */
.facts {
  display: grid;
  gap: var(--space-4) var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
}
.fact dt {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-muted);
}
.fact dd {
  margin-top: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-lg);
}
:where(.section-dark, .section-night, .on-dark) .fact dt {
  color: var(--color-on-dark-muted);
}

/* =========================================================== numbered features */
.numbered {
  display: grid;
  gap: var(--space-6) var(--space-7);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  counter-reset: numbered;
}
.numbered > li {
  counter-increment: numbered;
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}
.numbered > li::before {
  content: counter(numbered, decimal-leading-zero);
  display: block;
  margin-bottom: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-accent-text);
}
.numbered h3 {
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
}
.numbered p {
  color: var(--color-muted);
}
:where(.section-dark, .section-night) .numbered > li {
  border-top-color: var(--color-line-on-dark);
}
:where(.section-dark, .section-night) .numbered > li::before {
  color: var(--color-accent);
}
:where(.section-dark, .section-night) .numbered p {
  color: var(--color-on-dark-muted);
}

/* =========================================================== check list */
.check-list {
  display: grid;
  gap: var(--space-2);
}
.check-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}
.check-list .icon {
  margin-top: 0.3em;
  color: var(--color-sage);
}
:where(.section-dark, .section-night, .on-dark) .check-list .icon {
  color: var(--color-accent);
}

/* =========================================================== article cards
   templates/content/_article_card.html: blog, homepage and search. */
.article-grid {
  display: grid;
  gap: var(--space-7) var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}
.article-link {
  display: grid;
  gap: var(--space-2);
  text-decoration: none;
}
.article-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  margin-bottom: var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--color-sand);
}
.article-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}
.article-link:hover .article-media img {
  transform: scale(1.04);
}
.article-meta {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent-text);
}
.article-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.2;
}
.article-link:hover .article-title {
  color: var(--color-primary);
}
.article-excerpt {
  color: var(--color-muted);
}
/* =========================================================== listings: count, pagination, empty state */
.results-count {
  min-height: 1.6em;
  margin: var(--space-6) 0 var(--space-3);
  color: var(--color-muted);
}
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-7);
}
.pagination-status {
  color: var(--color-muted);
}
/* Nothing to show yet: a calm card with a way forward. */
.empty-state {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  max-width: 46rem;
  margin-inline: auto;
  padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) clamp(1.5rem, 1rem + 3vw, 3.5rem);
  border-radius: var(--radius-lg);
  background: var(--color-sand-light);
  text-align: center;
}
.empty-state h2 {
  font-size: var(--text-2xl);
}
.empty-state p {
  color: var(--color-muted);
  max-width: 52ch;
}
.empty-state .actions {
  justify-content: center;
  margin-top: var(--space-3);
}
.empty-state--left {
  justify-items: start;
  margin-inline: 0;
  text-align: left;
}
.empty-state--left .actions {
  justify-content: flex-start;
}
.empty-state-text {
  font-size: var(--text-lg);
}

/* =========================================================== FAQ accordion */
.faq-list {
  border-top: 1px solid var(--color-border);
}
.faq {
  border-bottom: 1px solid var(--color-border);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 64px;
  padding: var(--space-4) 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
  transition: color var(--duration-fast) var(--ease);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary:hover {
  color: var(--color-primary);
}
.faq summary .icon {
  flex: none;
  width: 2rem;
  height: 2rem;
  padding: 0.55rem;
  border-radius: 50%;
  background: var(--color-sand);
  transition: transform var(--duration) var(--ease), background-color var(--duration-fast) var(--ease);
}
.faq[open] summary .icon {
  transform: rotate(180deg);
  background: var(--color-primary);
  color: var(--color-on-dark);
}
.faq .prose {
  padding: 0 var(--space-7) var(--space-5) 0;
  color: var(--color-muted);
}

/* =========================================================== page header */
/* templates/components/page_header.html (older pages use the same classes directly). */
.page-header {
  position: relative;
  padding-block: clamp(2.5rem, 2rem + 4vw, 5.5rem) clamp(2.5rem, 2rem + 3vw, 4.5rem);
  background: linear-gradient(to bottom, var(--color-sand-light), var(--color-background));
  isolation: isolate;
}
.page-header h1 {
  font-size: var(--text-4xl);
  letter-spacing: -0.035em;
  max-width: 18ch;
}
.page-header h1 em {
  display: block;
}
.page-header .eyebrow {
  margin-bottom: var(--space-4);
}
.page-header .lead {
  margin-top: var(--space-5);
}

/* The header already provides space above the content. */
.page-header + .section {
  padding-top: clamp(1.5rem, 1rem + 2vw, 3rem);
}

/* Photograph header: full width, text over a scrim, site header on top of it. */
.page-header--image {
  overflow: hidden; /* the photograph eases in from a slight zoom */
  display: flex;
  align-items: flex-end;
  min-height: clamp(26rem, 62svh, 40rem);
  padding-top: calc(var(--utility-height) + var(--offer-height) + var(--header-height) + var(--space-7));
  background: var(--color-night);
  color: var(--color-on-dark);
}
.page-header-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.page-header-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.page-header--image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgb(var(--rgb-night-deep) / 0.9) 0%, rgb(var(--rgb-night-deep) / 0.55) 45%, rgb(var(--rgb-night-deep) / 0.25) 80%),
    linear-gradient(to right, rgb(var(--rgb-night-deep) / 0.55), transparent 70%);
}
.page-header--image .lead,
.page-header--image .breadcrumbs ol {
  color: var(--color-on-dark-muted);
}
.page-header--image .eyebrow,
.page-header--image h1 em {
  color: var(--color-accent);
}
.page-header--tall {
  min-height: clamp(32rem, 86svh, 52rem);
}
.page-header--image h1 {
  max-width: 20ch;
}
.page-header--image .lead {
  max-width: 44rem;
  color: var(--color-on-dark-soft);
}
.page-header-actions {
  margin-top: var(--space-6);
}
/* On arrival: the photograph settles from a slight zoom and the text rises in. */
@media (prefers-reduced-motion: no-preference) {
  .page-header--image .page-header-media img {
    animation: header-settle 2.4s var(--ease) both;
  }
  .page-header--image .page-header-inner > * {
    animation: header-rise 0.9s var(--ease) both;
  }
  .page-header--image .page-header-inner > :nth-child(2) { animation-delay: 0.1s; }
  .page-header--image .page-header-inner > :nth-child(3) { animation-delay: 0.2s; }
  .page-header--image .page-header-inner > :nth-child(4) { animation-delay: 0.32s; }
  .page-header--image .page-header-inner > :nth-child(5) { animation-delay: 0.44s; }
}
@keyframes header-settle {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
@keyframes header-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

/* =========================================================== call-to-action band */
/* templates/components/cta_band.html */
.cta-band {
  position: relative;
  padding-block: var(--space-section);
  background: var(--color-primary-dark);
  color: var(--color-on-dark);
  text-align: center;
  isolation: isolate;
  overflow: hidden;
}
.cta-band-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.cta-band-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cta-band--image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(var(--rgb-night-deep) / 0.7);
}
.cta-band h2 {
  max-width: 18ch;
  margin-inline: auto;
  font-size: var(--text-3xl);
  letter-spacing: -0.03em;
}
.cta-band-text {
  max-width: 38rem;
  margin: var(--space-5) auto 0;
  font-size: var(--text-lg);
  color: var(--color-on-dark-soft);
}
.cta-band .actions {
  justify-content: center;
  margin-top: var(--space-6);
}

/* =========================================================== breadcrumbs */
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0 0 var(--space-5);
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.breadcrumbs li + li::before {
  content: "/";
  margin-right: var(--space-2);
  opacity: 0.6;
}
.breadcrumbs a {
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* =========================================================== forms */
.form {
  display: grid;
  gap: var(--space-5);
}
.form-grid {
  display: grid;
  gap: var(--space-5);
}
@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-grid > .field--full {
    grid-column: 1 / -1;
  }
}

.form-section {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.form-section > legend {
  padding: 0;
  margin-bottom: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-xl);
}
/* A radio or checkbox group inside a form row uses the normal field label style. */
.form-section > legend.field-label {
  margin-bottom: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}
.field-label {
  font-weight: 600;
  font-size: var(--text-sm);
}
.field-required,
.field-optional {
  margin-left: var(--space-1);
  font-weight: 400;
  color: var(--color-muted);
  font-size: var(--text-xs);
}
.field-help {
  font-size: var(--text-sm);
  color: var(--color-muted);
  overflow-wrap: break-word; /* long example addresses wrap on phones */
}

/* :where() keeps specificity low so state rules (invalid, hover, focus) override it. */
.input,
.field :where(input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea) {
  width: 100%;
  min-height: 52px;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
}
.field textarea {
  min-height: 9rem;
  line-height: 1.5;
  resize: vertical;
}
.field select {
  appearance: none;
  padding-right: 2.6rem;
  background-image: var(--icon-chevron-down);
  background-repeat: no-repeat;
  background-position: right 0.95rem center;
  background-size: 0.9rem;
  cursor: pointer;
}
/* Native date pickers on mobile need the field tall enough to tap. */
.field input[type="date"] {
  min-height: 52px;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--color-placeholder);
}
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--color-primary);
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--focus-glow);
}

/* Errors are shown with text and an icon, not colour alone. */
.field--invalid input,
.field--invalid select,
.field--invalid textarea {
  border-color: var(--color-error);
  background-color: var(--color-error-bg);
}
.field-errors {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-error);
  font-size: var(--text-sm);
  font-weight: 600;
}
.field-errors li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}
.field-errors .icon {
  margin-top: 0.2em;
}

/* Checkboxes and radios */
.choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 44px;
  cursor: pointer;
}
.choice input {
  width: 1.3rem;
  height: 1.3rem;
  margin: 0.15rem 0 0;
  flex: none;
  accent-color: var(--color-primary);
  cursor: pointer;
}
.choice-list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-5);
}
.form-note {
  font-size: var(--text-sm);
  color: var(--color-muted);
  max-width: 44ch;
}

/* Honeypot fields (spam protection, Phase 8): hidden from people, not from bots. */
.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* A form on a white card (contact page, trip form). */
.form-card {
  padding: clamp(1.5rem, 1rem + 2vw, 2.75rem);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

/* =========================================================== alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid currentColor;
  border-radius: var(--radius);
}
.alert .icon {
  margin-top: 0.2em;
  width: 1.25rem;
  height: 1.25rem;
}
.alert-title {
  font-weight: 600;
}
.alert-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}
.alert-error {
  background: var(--color-error-bg);
  color: var(--color-error);
}
.alert-warning {
  background: var(--color-accent-tint);
  color: var(--color-accent-text);
}
.alert-info {
  background: var(--color-sage-tint);
  color: var(--color-text);
  border-left-color: var(--color-sage);
}
.alert > div {
  color: var(--color-text);
}
.alert .alert-title {
  color: inherit;
}
.alert-success .alert-title { color: var(--color-success); }
.alert-error .alert-title { color: var(--color-error); }
.alert:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.messages {
  display: grid;
  gap: var(--space-3);
  margin-block: var(--space-5);
}

/* =========================================================== placeholder notice */
.notice {
  padding: var(--space-5);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

/* =========================================================== aside cards (shared) */
.glance-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.glance-card + .glance-card {
  margin-top: var(--space-4);
}
.glance-card h2 {
  margin-bottom: var(--space-4);
}
.plan-contact a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.plan-contact span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
}
.plan-contact .icon {
  color: var(--color-accent-text);
}


/* Site search on the 404 page and search results */
.search-404 {
  margin-block: 1.5rem;
  max-width: 36rem;
}
.search-404 .cluster {
  flex-wrap: nowrap;
}
.search-404 .input {
  flex: 1 1 auto;
  min-width: 0;
}
.search-group + .search-group {
  margin-top: 2rem;
}
.search-summary {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}

/* Installable app: install button, offline notice, offline form message */
.footer-install {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.offline-notice {
  margin: 0;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary-dark);
  color: var(--color-on-dark);
  text-align: center;
  font-size: 0.9375rem;
}
.offline-notice[hidden] {
  display: none;
}
.form-offline {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--color-error);
  background: var(--color-surface);
  font-weight: 600;
}
.offline-page ul {
  margin-block: var(--space-3) var(--space-5);
}

/* =========================================================== error pages (404) */
.error-layout {
  display: grid;
  gap: var(--space-7);
  align-items: center;
}
@media (min-width: 960px) {
  .error-layout {
    grid-template-columns: 1.4fr 1fr;
  }
}
.error-main h1 em {
  display: block;
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 3rem + 10vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: var(--color-sand);
}
.error-link-list {
  margin-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}
.error-link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  text-decoration: none;
}
.error-link-list a:hover {
  color: var(--color-primary);
}

/* ------------------------------------------------------------ shared bits
   Used by several page stylesheets; defined once here. */
.btn-danger {
  border-color: var(--color-error);
  color: var(--color-error);
}

/* Lists of links (related tours, article links, search results). */
.link-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 44px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}
.link-list li a:hover {
  color: var(--color-accent-text);
}

/* Maps load only after the visitor asks (see destinations.js). */
.dest-map {
  display: grid;
  gap: var(--space-3);
}
.map-frame {
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  background: var(--color-sand);
}
.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Office location card (contact and About pages). The placeholder looks like a
   folded paper map; Google Maps loads in its place only when pressed. */
.location-map {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}
.location-map-head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.location-map-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--color-sage-tint);
  color: var(--color-primary);
}
.location-map-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
}
.location-map-address {
  color: var(--color-muted);
}
.map-placeholder {
  position: relative;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--space-1);
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: var(--space-5);
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgb(24 69 46 / 0.07) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    linear-gradient(rgb(24 69 46 / 0.07) 1px, transparent 1px) 0 0 / 2.5rem 2.5rem,
    linear-gradient(135deg, var(--color-sand-light), var(--color-sage-tint));
  color: var(--color-primary-dark);
  font: inherit;
  cursor: pointer;
}
.map-placeholder-pin {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: var(--space-2);
  border-radius: 50% 50% 50% 0;
  background: var(--color-primary);
  color: var(--color-on-dark);
  transform: rotate(-45deg);
  box-shadow: 0 6px 16px rgb(var(--rgb-night) / 0.2);
  transition: transform var(--duration) var(--ease);
}
.map-placeholder-pin .icon {
  transform: rotate(45deg);
}
.map-placeholder:hover .map-placeholder-pin {
  transform: rotate(-45deg) translate(2px, -2px);
}
.map-placeholder-label {
  font-weight: 600;
}
.map-placeholder-note {
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.map-placeholder[hidden] {
  display: none;
}

/* =========================================================== offers and announcements
   templates/components/offers/: the top bar (inside the site header, scrolling away
   with the utility bar; --offer-height tells the header and heroes), the homepage
   banner and the popup. */
:root:has(.offer-bar:not([hidden])) {
  --offer-height: 40px;
}
.offer-bar {
  height: var(--offer-height);
  background: var(--color-accent);
  color: var(--color-night);
  font-size: var(--text-sm);
}
.offer-bar[hidden] {
  display: none;
}
.offer-bar-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
}
.offer-bar-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 759px) {
  .offer-bar-message {
    display: none;
  }
}
.offer-bar-link {
  flex: none;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.offer-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}
.offer-close[hidden] {
  display: none;
}
.offer-close:hover {
  background: rgb(var(--rgb-night) / 0.1);
}
.offer-close .icon {
  width: 0.9rem;
  height: 0.9rem;
}

.offer-banner-wrap {
  padding-block: var(--space-6) 0;
}
.offer-banner-wrap[hidden] {
  display: none;
}
.offer-banner {
  position: relative;
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-primary-dark);
  color: var(--color-on-dark);
  box-shadow: var(--shadow-card);
}
.offer-banner-media img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.offer-banner-body {
  display: grid;
  gap: var(--space-2);
  align-content: center;
  padding: var(--space-6) var(--space-6) var(--space-6);
  padding-right: calc(var(--space-6) + 36px);
}
.offer-banner-body p {
  margin: 0;
  color: rgb(var(--rgb-on-dark) / 0.85);
}
.offer-banner-title {
  color: inherit;
  font-size: var(--text-2xl);
}
.offer-banner .offer-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: rgb(var(--rgb-night) / 0.35);
}
.offer-banner .offer-close:hover {
  background: rgb(var(--rgb-night) / 0.6);
}
@media (min-width: 760px) {
  .offer-banner--image {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }
  .offer-banner-media img {
    aspect-ratio: auto;
    min-height: 14rem;
  }
}

.offer-popup {
  width: min(32rem, 100% - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 60px rgb(var(--rgb-night) / 0.3);
}
.offer-popup::backdrop {
  background: rgb(var(--rgb-night) / 0.55);
}
.offer-popup-inner {
  position: relative;
}
.offer-popup-media img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.offer-popup-body {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6);
}
.offer-popup-body p {
  margin: 0;
}
.offer-popup-title {
  padding-right: 2.5rem;
  font-size: var(--text-2xl);
}
.offer-popup-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  z-index: 1;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}
@media print {
  .offer-bar,
  .offer-banner-wrap,
  .offer-popup {
    display: none;
  }
}

/* Cookie banner: a bar along the bottom until the visitor chooses. It never covers the
   middle of the page or stops scrolling; the page gains room at the bottom so the
   footer can still be read above it. The three choices look exactly alike. */
.cookie-banner {
  position: fixed;
  inset: auto 0 0;
  z-index: calc(var(--z-float) + 1);
  padding-block: var(--space-3) max(var(--space-3), env(safe-area-inset-bottom));
  border-top: 1px solid rgb(var(--rgb-white) / 0.14);
  background: rgb(var(--rgb-night-deep) / 0.97);
  color: var(--color-on-dark);
  box-shadow: 0 -10px 30px rgb(var(--rgb-night) / 0.25);
}
.cookie-banner[hidden],
html:not(.js) .cookie-banner {
  display: none;
}
.cookie-banner:focus {
  outline: none;
}
.cookie-banner-inner {
  display: grid;
  gap: var(--space-3);
}
.cookie-banner-title {
  margin: 0 0 var(--space-1);
  color: inherit;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 700;
}
.cookie-banner-text p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: rgb(var(--rgb-on-dark) / 0.85);
}
.cookie-banner-text .link {
  color: var(--color-on-dark);
}
.cookie-banner-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.cookie-btn {
  justify-content: center;
  min-height: var(--tap-target);
  padding-inline: var(--space-3);
  border: 1px solid var(--color-on-dark);
  background: var(--color-on-dark);
  color: var(--color-primary-dark);
  white-space: nowrap;
}
.cookie-btn:hover {
  background: var(--color-sage-tint);
}
@media (max-width: 420px) {
  .cookie-btn {
    padding-inline: var(--space-2);
    font-size: var(--text-xs);
  }
}
@media (min-width: 900px) {
  .cookie-banner-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-6);
  }
}
body:has(.cookie-banner:not([hidden])) {
  padding-bottom: 11rem;
}
@media (min-width: 900px) {
  body:has(.cookie-banner:not([hidden])) {
    padding-bottom: 6rem;
  }
}
body:has(.cookie-banner:not([hidden])) .to-top {
  display: none;
}
@media print {
  .cookie-banner {
    display: none;
  }
}

/* Cookie settings dialog ("Manage choices"). */
.cookie-dialog {
  width: min(34rem, 100% - 2rem);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 60px rgb(var(--rgb-night) / 0.3);
}
.cookie-dialog::backdrop {
  background: rgb(var(--rgb-night) / 0.55);
}
.cookie-dialog-inner {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
}
.cookie-title {
  font-size: var(--text-2xl);
}
.cookie-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cookie-list li {
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-border);
}
.cookie-item-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  font-weight: 600;
}
.cookie-choice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
}
.cookie-choice input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  accent-color: var(--color-primary);
}
.cookie-choice > span {
  display: grid;
}
.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.cookie-tag {
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--color-sage-tint);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* ------------------------------------------------------------ Motion
   Scroll reveal (site.js marks elements with .reveal, then .is-revealed in view).
   Content rises 24px and fades in; photographs inside cards unveil from a slight
   zoom. Only transform and opacity animate, so it stays smooth on phones. Visitors
   who prefer reduced motion never get the hidden state. */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition:
      opacity 0.7s var(--ease) var(--reveal-delay, 0ms),
      transform 0.8s var(--ease) var(--reveal-delay, 0ms);
  }
  .reveal.is-revealed {
    opacity: 1;
    transform: none;
  }
  .reveal :is(img) {
    transform: scale(1.06);
    transition: transform 1.2s var(--ease) var(--reveal-delay, 0ms);
  }
  .reveal.is-revealed :is(img) {
    transform: none;
  }
}
/* Where an element starts from; only while it waits to be revealed, so nothing stays
   shifted afterwards. */
@media (prefers-reduced-motion: no-preference) {
  .reveal--zoom:not(.is-revealed) {
    transform: scale(0.94);
  }
  .reveal--left:not(.is-revealed) {
    transform: translateX(-40px);
  }
  .reveal--right:not(.is-revealed) {
    transform: translateX(40px);
  }
}

/* =========================================================== back to top */
/* templates/components/to_top.html, js/to-top.js: public site and CRM. */
.to-top {
  position: fixed;
  right: max(var(--space-4), env(safe-area-inset-right));
  bottom: max(var(--space-4), env(safe-area-inset-bottom));
  z-index: var(--z-float);
  display: grid;
  place-items: center;
  width: var(--tap-target);
  height: var(--tap-target);
  padding: 0;
  border: 1px solid rgb(var(--rgb-white) / 0.18);
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-on-dark);
  box-shadow: var(--shadow-panel);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease);
}
.to-top .icon {
  width: 1.25rem;
  height: 1.25rem;
  transform: rotate(180deg);
}
.to-top:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: no-preference) {
  .to-top:not([hidden]) {
    animation: to-top-in var(--duration) var(--ease);
  }
}
@keyframes to-top-in {
  from { opacity: 0; transform: translateY(12px); }
}
/* Above the staff article-preview bar when it shows. */
body:has(.preview-banner) .to-top {
  bottom: calc(4.5rem + env(safe-area-inset-bottom));
}
@media print {
  .to-top {
    display: none;
  }
}

} /* end @layer components */
