/* CHARAKAMA Guest Bungalow — mobile-first implementation.
   Identity: lime-wash garden + hibiscus, Zilla Slab/Public Sans, split-type-right hero,
   clay-tile triple rule signature, icons services, 2/4-column mixed gallery.
   Motion: none. Only the drawer, lightbox and switcher change, and only on user action. */

/* ------------------------------------------------------------------ layout */

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

.wrap {
  inline-size: 100%;
  max-inline-size: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--s-16); }
/* Defer off-screen section shaping/painting while keeping anchor navigation
   and the accessibility tree available. Remember each section's actual size. */
main > .section { content-visibility: auto; contain-intrinsic-block-size: auto 800px; }
main > .section + .section { border-block-start: 0; }

.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus-visible { outline-offset: 1px; }
.skip-link { display: inline-flex; align-items: center; min-block-size: 2.75rem; }

/* ------------------------------------------------------- signature element */

/* Three stacked 3px rules, 5px apart, 52px wide, hibiscus. */
.tile-mark {
  display: block;
  inline-size: var(--tile-w);
  block-size: var(--tile-h);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--c-accent) 0 var(--tile-rule),
    transparent var(--tile-rule) calc(var(--tile-rule) + var(--tile-gap))
  );
  background-repeat: no-repeat;
}

.section-head .tile-mark { margin-block: var(--s-4) var(--s-6); }

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

.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 30;
  background: var(--c-bg);
  border-block-end: 1px solid var(--c-line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-block-size: 3.5rem;
  padding-block: var(--s-2);
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-block-size: 2.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--c-ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark-sub {
  display: block;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.6875rem;
  line-height: 1.2;
  color: var(--c-muted);
}

.desktop-nav { display: none; }

.lang-switch {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  margin-inline-start: auto;
  font-size: 0.75rem;
  line-height: 1;
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Native switcher labels are short words; the floor keeps every one of them a
     full 44x44 target without changing the label text. */
  min-inline-size: 2.75rem;
  min-block-size: 2.75rem;
  color: var(--c-muted);
  text-decoration: none;
  padding-inline: var(--s-1);
  white-space: nowrap;
}

.lang-switch a[aria-current="true"] {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* The header CTA is desktop-only; the sticky bar carries the action on mobile.
   `a.header-cta` outranks `.button`'s own display without needing !important. */
a.header-cta { display: none; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 2.75rem;
  block-size: 2.75rem;
  flex: 0 0 auto;
  padding: 0;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--c-ink);
  cursor: pointer;
}

.icon-button svg { inline-size: 1.375rem; block-size: 1.375rem; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }

/* --------------------------------------------------------------- buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-block-size: 3rem;
  padding: var(--s-3) var(--s-6);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  background: var(--c-accent);
  color: var(--c-accent-ink);
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button svg { inline-size: 1.25rem; block-size: 1.25rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.button:hover { background: #A83240; }

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

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-block-size: 2.75rem;
  color: var(--c-accent);
  font-weight: 600;
}

/* ------------------------------------------------------------------ hero */

.hero { display: grid; gap: var(--s-6); padding-block-end: var(--s-16); }

.hero-figure { position: relative; margin: 0; }

/* The picture wrapper must carry the height, otherwise the percentage height on
   the image resolves against `auto` and the photograph stops short of the column. */
.hero-figure picture { display: block; block-size: 100%; }

.hero-figure img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  background: var(--c-tint);
  border-radius: var(--r-lg);
}

/* Authored cap is 28rem of type. The inline padding is added on top so the cap
   applies to the text column, not to the text plus its gutter. */
.hero-copy {
  padding-inline: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
  max-inline-size: calc(28rem + 2 * var(--s-12));
}

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

.hero-headline {
  margin: 0;
  font-weight: 600;
  font-feature-settings: "liga" 1;
  /* Greedy wrapping keeps the first line full, so the measured tile-mark
     position is deterministic. `balance` is allowed to add a line, which would
     strand the mark under a single word. */
  text-wrap: normal;
}

.hero-headline-text { display: block; }

/* The measured first line is locked so the tile mark can sit directly under it. */
.hero-line { display: inline-block; }

.hero-headline .tile-mark { margin-block: var(--s-3) var(--s-4); }

.hero-subline { margin: 0; color: var(--c-muted); }

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-6); }

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

.fact-chips li {
  background: var(--c-tint);
  color: var(--c-ink);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-0);
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* ----------------------------------------------------------------- about */

.about-grid { display: grid; gap: var(--s-6); }
.about-copy .prose p { margin: 0 0 var(--s-4); }
.about-copy .prose p:last-child { margin-block-end: 0; }

.about-figure { margin: 0; }
.about-figure img {
  inline-size: 100%;
  block-size: auto;
  border-radius: var(--r-lg);
  background: var(--c-tint);
}

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

.highlights > div {
  background: var(--c-surface);
  border-radius: var(--r-md);
  padding: var(--s-4);
}

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

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

/* -------------------------------------------------------------- services */

.section-intro { max-inline-size: 46rem; }
.section-intro > p { margin: var(--s-4) 0 0; color: var(--c-muted); }
.services-note { font-size: var(--fs-0); }

.service-list {
  display: grid;
  gap: var(--s-4);
  margin: var(--s-8) 0 0;
  padding: 0;
  list-style: none;
}

.service-list li {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.service-list svg {
  inline-size: 1.75rem;
  block-size: 1.75rem;
  fill: none;
  stroke: var(--c-accent);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.service-list h3 { margin: var(--s-4) 0 var(--s-2); font-weight: 600; }
.service-list p { margin: 0; color: var(--c-muted); }

/* --------------------------------------------------------------- gallery */

.gallery-heading { max-inline-size: 46rem; }
.gallery-heading > p { margin: var(--s-4) 0 0; color: var(--c-muted); }

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

.gallery-grid[data-masonry="true"] { grid-auto-rows: 1px; }

.gallery-grid > li { min-inline-size: 0; }

.gallery-link {
  position: relative;
  display: block;
  block-size: 100%;
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: zoom-in;
}

.gallery-link img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  background: var(--c-tint);
}

.sample-badge {
  position: absolute;
  inset-block-end: var(--s-2);
  inset-inline-start: var(--s-2);
  background: rgb(26 46 38 / .55);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 2px var(--s-2);
  font-size: 11px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------- map */

.map-card {
  background: var(--c-tint);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  min-block-size: 14rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--s-4);
}


.map-caption { margin: 0; font-family: var(--font-display); font-weight: 600; }

.maps-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-block-size: 2.75rem;
  margin-block-start: var(--s-4);
  color: var(--c-accent);
  font-weight: 600;
}

/* --------------------------------------------------------------- contact */

.contact-grid { display: grid; gap: var(--s-8); }
.contact-intro { margin: var(--s-4) 0 0; color: var(--c-muted); }

.contact-details { margin: var(--s-8) 0 0; display: grid; gap: var(--s-4); }
.contact-details > div { display: grid; gap: var(--s-1); }
.contact-details dt { font-size: var(--fs-0); font-weight: 600; color: var(--c-muted); }
.contact-details dd { margin: 0; font-weight: 500; }
.contact-details a {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  color: var(--c-accent);
}

.hours-note { margin: var(--s-8) 0 0; color: var(--c-muted); }
.hours-note p { margin: var(--s-2) 0 0; }
.map-column h3 { font-weight: 600; margin-block-end: var(--s-4); }

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

.site-footer {
  margin-block-start: var(--s-16);
  border-block-start: 1px solid var(--c-line);
  padding-block: var(--s-12) var(--s-16);
  background: var(--c-bg);
}

.footer-top { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: baseline; justify-content: space-between; }
.footer-top p { margin: var(--s-2) 0 0; color: var(--c-muted); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
  justify-content: space-between;
  margin-block-start: var(--s-8);
  color: var(--c-muted);
  font-size: var(--fs-0);
}

.footer-bottom p { margin: 0; }

.preview-notice {
  margin-block-start: var(--s-8);
  padding: var(--s-4);
  background: var(--c-tint);
  border-radius: var(--r-md);
  font-size: var(--fs-0);
  color: var(--c-muted);
}

.preview-notice p { margin: 0; }
.offer-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 2.75rem;
  margin-block-start: var(--s-3);
  font-weight: 600;
}

/* ------------------------------------------------------------ sticky cta */

.sticky-cta {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--gutter);
  padding-block-end: calc(var(--s-3) + env(safe-area-inset-bottom, 0px));
  background: var(--c-bg);
  border-block-start: 1px solid var(--c-line);
}

.sticky-cta .button { inline-size: 100%; max-inline-size: 26rem; }

/* --------------------------------------------------------- drawer/viewer */

.drawer, .lightbox {
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  background: var(--c-surface);
  color: var(--c-ink);
  padding: 0;
}

.drawer::backdrop, .lightbox::backdrop { background: rgb(26 46 38 / .5); }

.drawer {
  margin: 0 0 0 auto;
  inset-block: 0;
  block-size: 100dvh;
  max-block-size: 100dvh;
  inline-size: min(22rem, 92vw);
  max-inline-size: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-6);
  border-block-end: 1px solid var(--c-line);
}

.drawer-nav, .drawer-lang { display: grid; gap: var(--s-1); padding: var(--s-4) var(--s-6) 0; }
.drawer-nav a, .drawer-lang a {
  display: flex;
  align-items: center;
  min-block-size: 2.75rem;
  color: var(--c-ink);
  text-decoration: none;
  font-weight: 500;
}
.drawer-lang a[aria-current="true"] { color: var(--c-accent); font-weight: 600; }
.drawer-cta { margin: var(--s-6); }

.lightbox {
  inline-size: min(60rem, 96vw);
  max-inline-size: none;
  background: var(--c-surface);
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border-block-end: 1px solid var(--c-line);
}

.viewer-toolbar > span { font-size: 11px; color: var(--c-muted); }

.viewer-image { display: flex; align-items: center; justify-content: center; background: var(--c-tint); }
.viewer-image img { inline-size: auto; max-inline-size: 100%; block-size: auto; max-block-size: 68vh; }

.viewer-bottom { padding: var(--s-4); display: grid; gap: var(--s-3); }
.viewer-bottom p { margin: 0; color: var(--c-muted); font-size: var(--fs-0); }
.viewer-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.viewer-count { font-variant-numeric: tabular-nums; color: var(--c-muted); }

/* ------------------------------------------------- image failure fallback */

picture.picture-failed {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s-6);
  background: var(--c-tint);
  border-radius: var(--r-md);
  color: var(--c-muted);
  font-size: var(--fs-0);
  min-block-size: 8rem;
}

picture.picture-failed img { display: none; }
.picture-failed .image-failed { max-inline-size: 28rem; }

/* ------------------------------------------------------------ breakpoints */

@media (min-width: 37.5rem) {
  .service-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .highlights { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery-grid { gap: var(--s-4); }
}

/* Authored mobile header shows only the other two languages ([si ta] under EN).
   The drawer keeps all three with aria-current, so the switcher is never
   drawer-only and every header control keeps a full 44px target. */
@media (max-width: 63.99rem) {
  html[data-lang="en"] .site-header .lang-switch [data-lang-switch="en"],
  html[data-lang="si"] .site-header .lang-switch [data-lang-switch="si"],
  html[data-lang="ta"] .site-header .lang-switch [data-lang-switch="ta"] { display: none; }
}

@media (min-width: 48rem) {
  .section { padding-block: var(--s-24); }
  .service-list { gap: var(--s-6); }
  .contact-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .about-grid { grid-template-columns: 7fr 5fr; align-items: center; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .drawer { inline-size: min(24rem, 60vw); }
}

@media (min-width: 64rem) {
  .header-inner { min-block-size: 4rem; }
  .desktop-nav {
    display: flex;
    gap: var(--s-6);
    margin-inline: auto;
    font-size: var(--fs-0);
  }
  .desktop-nav a {
    display: inline-flex;
    align-items: center;
    min-block-size: 2.75rem;
    color: var(--c-ink);
    text-decoration: none;
    font-weight: 500;
  }
  .desktop-nav a:hover { color: var(--c-accent); }
  .lang-switch { margin-inline-start: 0; font-size: 0.8125rem; gap: var(--s-2); }
  .wordmark { font-size: 1.0625rem; }
  a.header-cta { display: inline-flex; min-block-size: 2.75rem; padding: var(--s-2) var(--s-6); }
  .menu-toggle { display: none; }

  .hero {
    grid-template-columns: 56% 44%;
    gap: 0;
    align-items: stretch;
    padding-block-end: var(--s-24);
  }
  .hero-figure { min-block-size: 72vh; }
  .hero-figure img { border-radius: var(--r-lg) 0 0 var(--r-lg); }
  .hero-copy { padding-inline: var(--s-12); padding-block: var(--s-12); align-self: center; }

  .service-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sticky-cta { display: none; }
  .footer-top { align-items: end; }
}

@media (min-width: 80rem) {
  .hero-copy { padding-inline: var(--s-16); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .sticky-cta, .drawer, .lightbox { display: none; }
}

/* Sample captions remain visible over both bright and shaded supplied images. */
.about-figure { position: relative; }
.hero-figure .sample-badge, .about-figure .sample-badge { background: var(--c-ink); }

/* The active campaign link needs body-text contrast on the tinted footer. */
.offer-link { color: var(--c-ink); text-decoration: underline; }
