/* Saman's Guesthouse — light split hero, tamarind kilometre post, list services, masonry gallery. */

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

:root { --header-h: 7.5rem; }

html {
  scroll-padding-top: calc(var(--header-h) + 0.75rem);
  scroll-padding-bottom: calc(var(--sticky-cta-h) + 0.75rem);
}

h1, h2, .section, #hero { scroll-margin-top: calc(var(--header-h) + 0.75rem); }

body { overflow-wrap: break-word; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header — two rows below 1024px so the wordmark and three language names are not clipped. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--c-bg);
}

.header-inner {
  width: min(calc(100% - var(--gutter) * 2), var(--max-w));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "brand menu"
    "langs langs";
  align-items: center;
  column-gap: var(--s-3);
}

.wordmark {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  min-height: 56px;
  color: var(--c-ink);
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  font-size: clamp(1rem, 3.6vw, 1.35rem);
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.desktop-nav,
.header-inner > .header-cta { display: none; }

.menu-toggle { grid-area: menu; }

.header-inner > .lang-switch {
  grid-area: langs;
  padding-bottom: var(--s-2);
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
}

.lang-dot {
  color: var(--c-muted);
  user-select: none;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.2rem 0.15rem;
  color: var(--c-muted);
  font-size: 0.875rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.lang-switch a[aria-current="true"] {
  color: var(--c-ink);
  text-decoration-color: var(--c-accent);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--c-line);
  background: transparent;
  color: var(--c-ink);
}

.icon-button svg,
.button svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 48px;
  padding: 0.65rem 1.25rem;
  border: 2px solid var(--c-accent);
  background: var(--c-accent);
  color: var(--c-accent-ink);
  font: 600 1rem/1.3 var(--font-body);
  text-align: center;
  text-decoration: none;
}

.button.secondary {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-ink);
}

.button svg { flex: none; }

/* Hero */
.hero { display: block; }

.hero-copy {
  width: min(calc(100% - var(--gutter) * 2), var(--max-w));
  margin-inline: auto;
  border-inline-start: 6px solid var(--c-accent);
  padding: var(--s-8) var(--s-4) var(--s-8) var(--s-4);
}

.kicker {
  margin: 0 0 var(--s-4);
  color: var(--c-muted);
  font-size: var(--fs-0);
}

.hero-subline {
  margin: var(--s-4) 0 0;
  max-width: 38rem;
  color: var(--c-ink);
}

.hero-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: var(--s-6);
}

.fact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
}

.fact-chips li {
  flex: 0 0 auto;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--c-line);
  background: var(--c-tint);
  color: var(--c-ink);
  font-size: var(--fs-0);
}

.hero-figure { margin: 0; }

.hero-figure picture,
.hero-figure img { width: 100%; }

.hero-figure img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center;
}

.image-note {
  width: min(calc(100% - var(--gutter) * 2), var(--max-w));
  margin: var(--s-2) auto 0;
  color: var(--c-muted);
  font-size: 0.75rem;
}

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.section-title::before {
  content: "";
  flex: 0 0 6px;
  width: 6px;
  height: 40px;
  background: var(--c-accent);
  margin-block-start: calc((var(--fs-3) * var(--scale-heading) * var(--lh-heading) - 40px) / 2);
}

.section-lead {
  margin: var(--s-4) 0 0;
  max-width: 40rem;
  color: var(--c-muted);
}

.about-grid {
  display: grid;
  gap: var(--s-8);
  margin-top: var(--s-6);
}

.prose p { margin: 0; }
.prose p + p { margin-top: var(--s-4); }

.about-figure { margin: 0; }
.about-figure img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.about-figure .image-note { width: auto; margin: var(--s-2) 0 0; }

.highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin: var(--s-8) 0 0;
}

.highlights > div {
  padding: var(--s-4);
  background: var(--c-tint);
  border: 1px solid var(--c-line);
}

.highlights dt {
  color: var(--c-muted);
  font-size: var(--fs-0);
}

.highlights dd {
  margin: var(--s-2) 0 0;
  font-weight: 600;
}

.services-note {
  margin: var(--s-3) 0 0;
  color: var(--c-muted);
  font-size: var(--fs-0);
}

.service-list {
  max-width: 40rem;
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
}

.service-list li {
  padding: var(--s-4) var(--s-6);
}

.service-list li + li { border-top: 1px solid var(--c-line); }

.service-list h3 {
  font-family: var(--font-body);
  font-size: var(--fs-1);
  font-weight: 600;
  line-height: var(--lh-body);
}

.service-list p {
  margin: var(--s-2) 0 0;
  color: var(--c-muted);
}

.gallery-head .section-lead { max-width: 42rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0.75rem;
  margin: var(--s-6) 0 0;
  padding: 0;
  list-style: none;
}

.gallery-link {
  position: relative;
  display: block;
  color: inherit;
  background: var(--c-tint);
}

.gallery-link img {
  width: 100%;
  height: auto;
}

.sample-badge {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  padding: 0.2rem 0.4rem;
  background: rgb(26 44 24 / .6);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

.contact-grid {
  display: grid;
  gap: var(--s-8);
}

.contact-details { margin: var(--s-6) 0 0; }

.contact-details > div {
  padding-block: var(--s-3);
}

.contact-details > div + div { border-top: 1px solid var(--c-line); }

.contact-details dt,
.hours-note .hours-label {
  color: var(--c-muted);
  font-size: var(--fs-0);
}

.contact-details dd { margin: 0.15rem 0 0; }

.contact-details a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-right: var(--s-4);
}

.phone-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-4); }

.hours-note {
  margin: var(--s-6) 0 0;
  max-width: 40rem;
}

.hours-note .hours-label { display: block; }

.map-column h3 {
  margin-bottom: var(--s-4);
  font-family: var(--font-body);
  font-size: var(--fs-1);
  font-weight: 600;
}

.map-card {
  display: grid;
  aspect-ratio: 4 / 3;
  min-height: 220px;
  background: var(--c-tint);
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-4);
  padding: var(--s-6);
  text-align: center;
}

.map-pin {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  color: var(--c-ink);
  stroke-width: 1.5;
}

.map-card iframe {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border: 0;
}

.maps-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  margin-top: var(--s-2);
  color: var(--c-ink);
  font-weight: 600;
}

.site-footer {
  padding-top: var(--s-12);
  padding-bottom: calc(var(--s-8) + var(--sticky-cta-h));
}

.footer-top,
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s-4);
  align-items: center;
}

.footer-top p,
.footer-bottom {
  color: var(--c-muted);
  font-size: var(--fs-0);
}

.back-top {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  color: var(--c-ink);
  text-decoration: none;
}

.footer-bottom { margin-top: var(--s-6); }

.preview-notice {
  margin-top: var(--s-6);
  padding: var(--s-4);
  background: var(--c-tint);
  color: var(--c-muted);
  font-size: 0.75rem;
}

.preview-notice p { margin: 0; max-width: 70ch; }

.offer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--s-2);
  color: var(--c-ink);
  font-size: var(--fs-0);
  font-weight: 600;
}

.offer-link[hidden] { display: none; }

.sticky-cta {
  position: fixed;
  z-index: 25;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.55rem var(--gutter) calc(0.55rem + env(safe-area-inset-bottom));
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
}

.sticky-cta .button { width: 100%; }

body:has(dialog[open]) { overflow: hidden; }
body:has(dialog[open]) .sticky-cta { visibility: hidden; }

dialog {
  padding: 0;
  border: 0;
  color: var(--c-ink);
  background: var(--c-surface);
  box-shadow: var(--shadow-1);
}

dialog::backdrop { background: rgb(26 44 24 / .55); }

.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100%, 26rem);
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: var(--s-4) var(--gutter) max(var(--s-6), env(safe-area-inset-bottom));
  overflow-y: auto;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.drawer-nav {
  display: grid;
  margin: var(--s-4) 0 var(--s-6);
  padding: 0;
}

.drawer-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--c-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--c-line);
}

.drawer .lang-switch { margin-bottom: var(--s-4); }
.drawer > .button { width: 100%; }

.lightbox {
  width: min(64rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  overflow: auto;
}

.viewer-toolbar,
.viewer-controls {
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.viewer-toolbar {
  justify-content: space-between;
  padding: var(--s-2) var(--s-4);
  font-size: 0.75rem;
}

.viewer-image { background: var(--c-tint); }
.viewer-image img {
  width: 100%;
  height: min(62dvh, 640px);
  object-fit: contain;
}

.viewer-bottom { padding: var(--s-4); }

#viewer-caption { margin: 0; font-size: var(--fs-0); }

.viewer-controls { justify-content: flex-end; margin-top: var(--s-3); }

.viewer-count { font-variant-numeric: tabular-nums; font-size: var(--fs-0); }

.image-unavailable { position: relative; min-height: 8rem; background: var(--c-tint); }
.image-unavailable img { visibility: hidden; }
.image-unavailable::after {
  content: attr(data-fallback-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--s-4);
  color: var(--c-muted);
  font-size: var(--fs-0);
  text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy { animation: km-enter var(--t-hero) var(--ease) both; }
  .hero-figure img { animation: hero-photo var(--t-hero) var(--ease) both; }
  .button, .icon-button { transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
}

@keyframes km-enter {
  from { transform: translateX(-16px); }
  to { transform: none; }
}

@keyframes hero-photo {
  from { opacity: 0.9; }
  to { opacity: 1; }
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .button:hover { background: #A93E12; border-color: #A93E12; }
  .button.secondary:hover { background: var(--c-tint); border-color: var(--c-ink); color: var(--c-ink); }
  .icon-button:hover,
  .lang-switch a:hover { background: var(--c-tint); }
}

@media (min-width: 769px) {
  .hero {
    display: grid;
    grid-template-columns: minmax(0, min(42%, 34rem)) minmax(0, 1fr);
    align-items: stretch;
    width: min(calc(100% - var(--gutter) * 2), var(--max-w));
    min-height: 78vh;
    margin-inline: auto;
  }

  .hero-copy {
    width: auto;
    max-width: 34rem;
    margin: 0;
    padding-top: var(--s-12);
  }

  .hero-actions { display: flex; flex-wrap: wrap; align-items: center; }

  .hero-figure {
    min-height: 78vh;
    display: flex;
    flex-direction: column;
  }

  .hero-figure picture { flex: 1 1 auto; min-height: 0; }
  .hero-figure img {
    width: 100%;
    height: 100%;
    min-height: 78vh;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center;
  }

  .hero-figure .image-note {
    width: auto;
    margin: var(--s-2) var(--s-4) var(--s-4);
  }

  .about-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
  .highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}

@media (min-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  :root { --sticky-cta-h: 0px; --header-h: 64px; }

  .header-inner {
    display: flex;
    align-items: center;
    min-height: 64px;
    gap: var(--s-4);
  }

  .wordmark { min-height: 64px; font-size: 1.35rem; }
  .header-inner > .lang-switch { padding: 0; }

  .desktop-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.25rem 1rem;
    margin-inline: auto;
  }

  .desktop-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--c-ink);
    text-decoration: none;
    font-weight: 600;
  }

  .header-inner > .header-cta { display: inline-flex; }
  .menu-toggle { display: none; }
  .sticky-cta { display: none; }
  .site-footer { padding-bottom: var(--s-12); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy,
  .hero-figure img,
  .button,
  .icon-button { animation: none; transition: none; }
}
