/* Dimuth Travels & Tours — layout and components. Mobile first; tokens in tokens.css. */

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

.wrap { width: min(calc(100% - var(--gutter) * 2), var(--max-w)); margin-inline: auto; }
main .wrap { position: relative; z-index: 2; }
h1, h2, h3, p, li, dt, dd, .button, .wordmark { overflow-wrap: anywhere; }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset-inline: 0; top: 0; z-index: 40;
  padding-inline: env(safe-area-inset-left) env(safe-area-inset-right);
  background: transparent;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header[data-scrolled] { background: var(--c-bg); border-bottom-color: var(--c-line); }
.header-inner { display: flex; align-items: center; gap: var(--s-3); min-height: 4rem; }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2); color: var(--c-ink); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.header-nav { display: none; }
.site-header .header-cta { display: none; }
.menu-toggle, .icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--c-ink); cursor: pointer;
}
.menu-toggle { margin-inline-start: 0; }
.menu-toggle svg, .icon-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.menu-toggle:hover, .icon-button:hover { background: var(--c-tint); }
.lang-switch { display: flex; align-items: center; gap: var(--s-1); margin-inline-start: auto; }
.lang-switch a {
  display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--s-2);
  color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: var(--fs-0);
}
.lang-switch a:hover { color: var(--c-accent); }
.lang-switch a[aria-current="true"] { box-shadow: inset 0 -3px 0 var(--c-accent); }

@media (max-width: 480px) {
  .header-inner { flex-wrap: wrap; padding-block: var(--s-1); }
  .menu-toggle { margin-inline-start: auto; }
  .lang-switch { order: 3; width: 100%; margin-inline-start: 0; }
}

/* ---------- buttons and chips ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: var(--s-2) var(--s-6);
  border: 1.5px solid transparent; border-radius: var(--r-sm);
  background: var(--c-accent); color: var(--c-accent-ink);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.button:hover { background: #9A3D08; }
.button--secondary { background: transparent; color: var(--c-accent); border-color: var(--c-accent); }
.button--secondary:hover { background: var(--c-tint); color: var(--c-accent); }

/* ---------- signature: route line ---------- */
main { position: relative; }
.route { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.route path { fill: none; stroke: var(--c-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.route .route-disc { fill: var(--c-accent); stroke: var(--c-bg); stroke-width: 2; }
.route.route--animate .route-draw {
  stroke-dasharray: var(--route-len, 0);
  stroke-dashoffset: var(--route-len, 0);
  animation: route-draw var(--t-hero) var(--ease) forwards;
}
@keyframes route-draw { to { stroke-dashoffset: 0; } }

/* ---------- hero ---------- */
.hero { position: relative; }
.hero__media { position: relative; z-index: 0; overflow: hidden; width: 100%; aspect-ratio: 4 / 5; background: var(--c-tint); }
.hero__media picture { display: block; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__panel { position: relative; z-index: 2; margin-top: -47.5%; }
.hero__panel-body {
  background: rgb(238 244 247 / 95%);
  padding: var(--s-6) var(--gutter) var(--s-8);
  box-shadow: var(--shadow-1);
}
.hero__kicker { margin: 0 0 var(--s-3); color: var(--c-muted); font-weight: 600; font-size: var(--fs-0); }
.hero__title { margin: 0; }
.hero__subline { margin: var(--s-4) 0 0; max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-6) 0 0; padding: 0; list-style: none; }
.hero__chips li {
  background: var(--c-tint); color: var(--c-ink);
  border-radius: var(--r-sm); padding: var(--s-1) var(--s-3);
  font-size: var(--fs-0); font-weight: 600;
}

/* Reserve the measured Sinhala mobile copy blocks before a font
   reconciliation so the hero actions do not move the first-view sections. */
@media (max-width: 768px) {
  html[data-lang="si"] .hero__title { min-height: 88px; }
  html[data-lang="si"] .hero__subline { min-height: 88px; }
  html[data-lang="si"] .hero__actions { min-height: 108px; }
  html[data-lang="si"] .hero__chips { min-height: 75px; }
}

@media (min-width: 769px) {
  .hero__media { aspect-ratio: 16 / 9; min-height: 78vh; }
  .hero__panel { margin-top: -48px; width: min(calc(100% - var(--gutter) * 2), var(--max-w)); margin-inline: auto; }
  .hero__panel-body { max-width: 40rem; margin-inline-start: calc(-1 * var(--s-4)); padding: var(--s-8) var(--s-8) var(--s-12) var(--s-4); background: rgb(238 244 247 / 88%); }
}

/* ---------- sections ---------- */
.section { padding-block: var(--s-16); }
.section-head { margin-bottom: var(--s-4); }
.section-intro { max-width: 62ch; margin: 0 0 var(--s-8); color: var(--c-muted); }
@media (min-width: 769px) { .section { padding-block: var(--s-24); } }

/* ---------- about ---------- */
.about-grid { display: grid; gap: var(--s-8); }
.about-copy p { margin: 0 0 var(--s-4); max-width: 62ch; }
.about-media { margin: 0; }
.about-media img { width: 100%; }
.highlights { display: grid; gap: var(--s-4); margin: var(--s-8) 0 0; padding: 0; }
.highlights div { border-top: 1px solid var(--c-line); padding-top: var(--s-3); }
.highlights dt { color: var(--c-muted); font-size: var(--fs-0); font-weight: 600; }
.highlights dd { margin: var(--s-1) 0 0; font-weight: 600; overflow-wrap: anywhere; }
@media (min-width: 769px) {
  .about-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-12); align-items: start; }
  .highlights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- services ---------- */
.service-list { display: grid; gap: var(--s-6); margin: 0; padding: 0; list-style: none; }
.service { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.service__disc { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c-tint); }
.service__disc svg { width: 24px; height: 24px; fill: none; stroke: var(--c-accent); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.service__body h3 { margin: 0; }
.service__body p { margin: var(--s-2) 0 0; color: var(--c-muted); }
.services__note { margin: var(--s-8) 0 0; color: var(--c-muted); font-weight: 600; }
@media (min-width: 1024px) {
  .header-inner { gap: var(--s-2); }
  .header-nav { display: flex; gap: var(--s-4); margin-inline-start: auto; }
  .header-nav a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; color: var(--c-ink); text-decoration: none; font-weight: 600; }
  .header-nav a:hover { color: var(--c-accent); }
  .lang-switch { margin-inline-start: 0; }
  .lang-switch a { padding-inline: var(--s-1); white-space: nowrap; }
  .site-header .header-cta { display: inline-flex; padding-inline: var(--s-4); }
  .site-header .header-cta { white-space: nowrap; }
  .site-header .menu-toggle { display: none; }
  .service-list { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-6); }
  .service { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1200px) {
  .header-inner { gap: var(--s-3); }
  .header-nav { gap: var(--s-6); }
  .lang-switch a { padding-inline: var(--s-2); }
  .site-header .header-cta { padding-inline: var(--s-6); }
}

/* ---------- gallery ---------- */
.gallery-strip {
  position: relative; z-index: 2;
  display: flex; gap: var(--s-4);
  margin: var(--s-2) 0 0; padding: var(--s-1) max(var(--gutter), calc((100% - var(--max-w)) / 2)) var(--s-4);
  list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100% - var(--max-w)) / 2));
  scrollbar-width: thin;
}
.gallery-item { flex: 0 0 auto; width: min(78vw, 320px); }
.gallery-tile {
  position: relative; display: block; width: 100%; padding: 0; border: 0;
  background: var(--c-tint); color: inherit; cursor: pointer;
  scroll-snap-align: start;
}
.gallery-tile picture, .gallery-tile img { display: block; width: 100%; }
.gallery-tile img { aspect-ratio: 4 / 3; object-fit: cover; }
.sample-badge {
  position: absolute; inset-inline-start: var(--s-2); inset-block-end: var(--s-2);
  padding: 2px var(--s-3); border-radius: var(--r-sm);
  background: rgb(28 44 56 / 55%); color: #FFFFFF;
  font-family: var(--font-body); font-size: 11px; font-weight: 600; line-height: 1.6;
}
.gallery-expand {
  position: absolute; inset-inline-end: var(--s-2); inset-block-start: var(--s-2);
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgb(28 44 56 / 55%); color: #FFFFFF; font-size: 12px;
}

/* ---------- contact ---------- */
.contact-grid { display: grid; gap: var(--s-8); }
.contact-rows { display: grid; gap: var(--s-4); margin: 0; }
.contact-row dt { color: var(--c-muted); font-size: var(--fs-0); font-weight: 600; }
.contact-row dd { margin: var(--s-1) 0 0; font-weight: 600; }
.contact-row dd a { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.hours-heading { margin-top: var(--s-8); }
.hours { display: grid; gap: var(--s-2); margin: var(--s-3) 0 0; }
.hours div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-4); border-bottom: 1px solid var(--c-line); padding-bottom: var(--s-2); }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; color: var(--c-muted); }
.map-label { margin-bottom: var(--s-3); color: var(--c-muted); font-size: var(--fs-0); font-weight: 600; }
.map-card {
  position: relative; display: grid; place-items: center; min-height: 260px;
  background: var(--c-tint); border-radius: var(--r-card);
}
.map-placeholder { display: grid; gap: var(--s-4); justify-items: center; text-align: center; padding: var(--s-8) var(--s-6) var(--s-8) calc(var(--s-6) + 28px); }
.map-placeholder .button { background: var(--c-surface); }
.map-placeholder .button:hover { background: var(--c-bg); }
.map-address { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.map-card iframe { width: 100%; height: 100%; min-height: 300px; border: 0; border-radius: inherit; display: block; }
.map-pin { position: absolute; inset-inline-start: 12px; inset-block-end: -14px; width: 28px; height: 28px; }
.map-pin path { fill: var(--c-accent); }
.map-pin circle { fill: var(--c-bg); }
.maps-link { display: inline-flex; align-items: center; gap: var(--s-2); margin-top: var(--s-4); min-height: 44px; font-weight: 600; }
@media (min-width: 769px) {
  .contact-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-12); align-items: start; }
}

/* ---------- footer ---------- */
.site-footer { padding-block: var(--s-12) calc(var(--s-8) + var(--sticky-cta-h)); }
.footer-top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--s-4); }
.footer-brand p { margin: var(--s-2) 0 0; color: var(--c-muted); }
.back-top { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; color: var(--c-ink); font-weight: 600; }
.footer-bottom { display: grid; gap: var(--s-2); margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--c-line); color: var(--c-muted); font-size: var(--fs-0); }
.footer-bottom p { margin: 0; }
.preview-notice { display: grid; gap: var(--s-3); justify-items: start; margin-top: var(--s-8); padding: var(--s-6); background: var(--c-tint); border-radius: var(--r-card); }
.preview-notice p { margin: 0; max-width: 62ch; }
.offer-link { display: inline-flex; align-items: center; min-height: 44px; color: #9A3D08; font-weight: 600; }

/* ---------- sticky CTA ---------- */
.sticky-cta {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center;
  padding: 10px calc(var(--gutter) + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(var(--gutter) + env(safe-area-inset-left));
  background: var(--c-bg); border-top: 1px solid var(--c-line);
}
.sticky-cta .button { width: 100%; max-width: 32rem; }
body:has(dialog[open]) .sticky-cta { visibility: hidden; }
@media (min-width: 1024px) { .sticky-cta { display: none; } }

/* ---------- dialogs ---------- */
.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; width: min(100%, 420px); height: 100dvh; max-height: none;
  border: 0; padding: var(--s-6); background: var(--c-surface); color: var(--c-ink);
  overscroll-behavior: contain;
}
.drawer::backdrop { background: rgb(28 44 56 / 50%); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); }
.drawer-nav { display: grid; gap: var(--s-1); margin-top: var(--s-8); }
.drawer-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: var(--s-2) 0; color: var(--c-ink); font-family: var(--font-display); font-size: var(--fs-2); font-weight: 600; text-decoration: none; }
.drawer-nav a:hover { color: var(--c-accent); }
.drawer-lang { margin: var(--s-6) 0 0; justify-content: flex-start; }
.drawer-cta { margin-top: var(--s-8); width: 100%; }

.lightbox {
  width: min(1050px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px);
  border: 0; border-radius: var(--r-card); padding: 0; background: var(--c-surface); color: var(--c-ink);
  box-shadow: var(--shadow-1); overscroll-behavior: contain;
}
.lightbox::backdrop { background: rgb(28 44 56 / 65%); }
.viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-3) var(--s-4); }
.viewer-toolbar .sample-badge { position: static; }
.viewer-image { display: grid; place-items: center; min-height: 200px; background: var(--c-tint); }
.viewer-image img { width: auto; max-width: 100%; max-height: 62dvh; height: auto; object-fit: contain; }
.viewer-bottom { display: grid; gap: var(--s-3); padding: var(--s-4); }
#viewer-caption { margin: 0; color: var(--c-muted); }
.viewer-controls { display: flex; align-items: center; justify-content: center; gap: var(--s-8); }
.viewer-count { min-width: 4ch; text-align: center; color: var(--c-muted); font-variant-numeric: tabular-nums; }

/* ---------- image fallback ---------- */
img.image-unavailable { background: var(--c-tint); min-height: 120px; }

@media (prefers-reduced-motion: reduce) {
  .route.route--animate .route-draw { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
}
