/* Gallery: a quiet photographic index, grouped by place. */
html:has(.gallery-body), body.gallery-body { background: #f7f3ea !important; color: #1b1b19 !important; }
/* Navigation inherits the shared site header; gallery content keeps its own style. */
.gallery-page { width: min(1320px,calc(100% - 96px)); margin: 0 auto; padding: 154px 0 80px; }
.gallery-page ::selection { color: #fff; background: #1b1b19; }
.gallery-page :is(a,button,select):focus-visible { outline: 2px solid #a8854f; outline-offset: 4px; }
.gallery-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-bottom: 54px; }
.gallery-intro h1 { margin: 0; color: #1b1b19 !important; font: 400 clamp(2.6rem,5vw,4rem)/1.05 'Rosemartin',Georgia,serif !important; letter-spacing: -.035em !important; }
.gallery-intro > p { margin: 0 0 5px; color: #5d5a52; font-size: 15px; line-height: 1.8; }
.gallery-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 22px; border-top: 1px solid rgba(27,27,25,.12); border-bottom: 1px solid rgba(27,27,25,.12); margin-bottom: 0; }
.gallery-toolbar[hidden] { display: none; }
.gallery-mobile-filter { display: none; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: 0 30px; }
.gallery-filters button { position: relative; border: 0; border-radius: 0; background: transparent; color: #5d5a52; padding: 21px 0 22px; min-height: 60px; font: 600 11px/1.4 'Manrope',sans-serif; cursor: pointer; }
.gallery-filters button[aria-pressed='true'] { color: #1b1b19; }
.gallery-filters button[aria-pressed='true']::after { content: ''; position: absolute; bottom: -1px; inset-inline: 0; height: 2px; background: #a8854f; }
.gallery-filters button:hover { color: #a8854f; }
#gallery-status { color: #5d5a52; font-size: 13px; white-space: nowrap; }
.gallery-collection { display: block; }
.gallery-chapter { padding-top: 67px; }
.gallery-chapter[hidden] { display: none; }
.gallery-chapter + .gallery-chapter { margin-top: 96px; border-top: 1px solid rgba(27,27,25,.12); }
.gallery-chapter-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 20px; margin-bottom: 32px; }
.gallery-chapter-count { color: #a8854f; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; line-height: 1.6; font-variant-numeric: tabular-nums; }
.gallery-chapter-count { padding-top: 9px; text-align: right; }
.gallery-chapter-heading h2 { margin: 0; color: #1b1b19 !important; font: 400 clamp(1.9rem,3vw,2.6rem)/1.1 'Rosemartin',Georgia,serif !important; letter-spacing: -.02em !important; }
.gallery-chapter-heading p { margin: 10px 0 0; color: #5d5a52; font-size: 15px; line-height: 1.5; }
.gallery-chapter-photos { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); column-gap: 22px; row-gap: 46px; }
.gallery-item { grid-column: span 6; min-width: 0; margin: 0; }
.gallery-item[hidden] { display: none; }
.gallery-item a { position: relative; display: block; overflow: hidden; aspect-ratio: var(--photo-ratio, 4/3); background: #efe9db; cursor: zoom-in; }
.gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; transition: opacity .18s ease; }
.gallery-item a:is(:hover,:focus-visible) img { opacity: .93; }
.gallery-item figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 16px; padding-top: 12px; }
.gallery-item figcaption > span { color: #1b1b19; font-size: 15px; font-weight: 600; line-height: 1.6; }
.gallery-item figcaption small { color: #a8854f; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; line-height: 1.7; }
.gallery-chapter--nature .gallery-item:nth-child(1) { grid-column: span 8; --photo-ratio: 3/2; }
.gallery-chapter--nature .gallery-item:nth-child(2) { grid-column: span 4; --photo-ratio: 3/4; }
.gallery-chapter--nature .gallery-item:nth-child(3), .gallery-chapter--nature .gallery-item:nth-child(4) { --photo-ratio: 3/4; }
.gallery-chapter--nature .gallery-item:nth-child(5) { grid-column: span 7; --photo-ratio: 3/2; }
.gallery-chapter--nature .gallery-item:nth-child(6) { grid-column: span 5; --photo-ratio: 1/1; }
.gallery-chapter--niva .gallery-item:nth-child(1) { grid-column: span 5; --photo-ratio: 5/4; }
.gallery-chapter--niva .gallery-item:nth-child(2) { grid-column: span 7; --photo-ratio: 7/4; }
.gallery-chapter--riparian .gallery-item:nth-child(1) { grid-column: span 8; --photo-ratio: 16/9; }
.gallery-chapter--riparian .gallery-item:nth-child(2) { grid-column: span 4; --photo-ratio: 8/9; }
.gallery-chapter--moments .gallery-item:nth-child(1), .gallery-chapter--moments .gallery-item:nth-child(5) { grid-column: span 7; --photo-ratio: 7/5; }
.gallery-chapter--moments .gallery-item:nth-child(2), .gallery-chapter--moments .gallery-item:nth-child(6) { grid-column: span 5; --photo-ratio: 1/1; }
.gallery-contact { margin-top: 86px; padding-top: 26px; border-top: 1px solid rgba(27,27,25,.12); display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.gallery-contact p { margin: 0; color: #5d5a52; font-size: 15px; line-height: 1.8; }
.gallery-contact a { display: inline-flex; align-items: center; gap: 22px; padding: 12px 0; color: #1b1b19; font-size: 15px; text-underline-offset: 5px; }
.gallery-contact a:hover { text-decoration: underline; }
.gallery-contact svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.gallery-viewer { position: fixed; z-index: 300; inset: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 18px; background: #151515; color: #fff; padding: 25px 35px; }
.gallery-viewer[hidden] { display: none; }
.gallery-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.gallery-viewer-header span { font-size: 13px; font-variant-numeric: tabular-nums; }
.gallery-viewer button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #8d8d8d; color: #fff; background: transparent; cursor: pointer; }
.gallery-viewer button:hover { background: #333; }
.gallery-viewer button:focus-visible { outline: 2px solid #fff !important; outline-offset: 4px; box-shadow: none !important; }
.gallery-viewer svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.gallery-viewer-stage { position: relative; min-height: 0; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 24px; align-items: center; }
.gallery-viewer-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; opacity: 1; transition: opacity .18s ease; }
.gallery-viewer-stage.is-loading img, .gallery-viewer-stage.is-error img { opacity: 0; }
.gallery-viewer-message { position: absolute; inset: 0 70px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; pointer-events: none; }
.gallery-viewer-message[hidden] { display: none; }
.gallery-viewer-message p { margin: 0; color: #eee; text-align: center; font-size: 14px; line-height: 1.6; }
.gallery-viewer-message button { width: auto; padding-inline: 20px; font-size: 13px; pointer-events: auto; }
.gallery-viewer-message button[hidden] { display: none; }
.gallery-viewer-caption { text-align: center; min-height: 38px; font-size: 14px; line-height: 1.6; }
.gallery-viewer-caption small { display: block; color: #ccc; font-size: 12px; }
.gallery-viewer-open { overflow: hidden; }

@media(max-width: 900px) {
  .gallery-page { width: calc(100% - 48px); }
  .gallery-chapter-photos { column-gap: 16px; row-gap: 34px; }
  .gallery-item figcaption { display: block; }
  .gallery-item figcaption small { display: block; margin-top: 2px; }
}
@media(max-width: 600px) {
  .gallery-page { width: calc(100% - 36px); }
  .gallery-page { padding-top: 119px; padding-bottom: 44px; }
  .gallery-intro { display: block; margin-bottom: 36px; }
  .gallery-intro h1 { font-size: 2.25rem !important; }
  .gallery-intro > p { margin-top: 18px; font-size: 12px; }
  .gallery-toolbar { min-height: 70px; gap: 12px; }
  .gallery-filters { display: none; }
  .gallery-mobile-filter { display: flex; flex-direction: column; gap: 2px; color: #636363; font-size: 11px; }
  .gallery-mobile-filter select { appearance: auto; max-width: 220px; min-height: 44px; padding: 7px 22px 7px 0; border: 0; border-radius: 0; background: #fff; color: #222; font: 500 13px/1.5 'Manrope',sans-serif; cursor: pointer; }
  #gallery-status { font-size: 11px; }
  .gallery-chapter { padding-top: 43px; }
  .gallery-chapter + .gallery-chapter { margin-top: 68px; }
  .gallery-chapter-heading { grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; margin-bottom: 22px; }
  .gallery-chapter-heading h2 { font-size: 26px !important; }
  .gallery-chapter-heading p { margin-top: 6px; font-size: 12px; }
  .gallery-chapter-count { padding-top: 8px; }
  .gallery-chapter-photos { grid-template-columns: minmax(0,1fr); row-gap: 29px; }
  .gallery-item, .gallery-chapter .gallery-item:nth-child(n) { grid-column: 1; }
  .gallery-item a, .gallery-chapter .gallery-item:nth-child(n) a { aspect-ratio: auto; }
  .gallery-item img { width: 100%; height: auto; object-fit: contain; }
  .gallery-contact { display: block; margin-top: 58px; padding-top: 22px; }
  .gallery-contact a { margin-top: 7px; }
  .gallery-viewer { padding: 16px; gap: 12px; }
.gallery-viewer-stage { grid-template-columns: 1fr; position: relative; }
.gallery-viewer-stage button { position: absolute; bottom: 0; background: #151515; }
.gallery-viewer-stage [data-next] { right: 0; }
.gallery-viewer-stage img { padding-bottom: 58px; }
}
@media(prefers-reduced-motion: reduce) { .gallery-item img, .gallery-viewer-stage img { transition: none; } }
.gallery-filters button { letter-spacing: .18em; text-transform: uppercase; }
.gallery-item a { border-radius: 14px; }

/* Intro band in the Journal/FAQ beige, running full width above the filters. */
html:has(.gallery-body) { overflow-x: clip; }
.gallery-intro { position: relative; z-index: 0; }
.gallery-intro::before { position: absolute; z-index: -1; top: -154px; bottom: -54px; left: 50%; width: 100vw; transform: translateX(-50%); content: ''; background: #efe9db; border-bottom: 1px solid rgba(27,27,25,.08); }
.gallery-toolbar { border-top: 0 !important; }

/* Centred layout: intro, filters and chapter headings sit on the page's centre line. */
.gallery-intro { flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.gallery-intro > p { margin: 0; }
.gallery-toolbar { flex-direction: column; justify-content: center; gap: 0; }
.gallery-filters { justify-content: center; gap: 0 36px; }
#gallery-status { padding-bottom: 14px; }
.gallery-chapter-heading { grid-template-columns: 1fr; justify-items: center; gap: 10px; text-align: center; }
.gallery-chapter-count { padding-top: 0; text-align: center; }
.gallery-item figcaption { justify-content: center; text-align: center; flex-direction: column; align-items: center; }
.gallery-contact { flex-direction: column; justify-content: center; text-align: center; gap: 6px; }
/* Only draw the divider between chapters that are both visible, so a filtered view starts clean. */
.gallery-chapter + .gallery-chapter { margin-top: 0; border-top: 0; }
.gallery-chapter:not([hidden]) ~ .gallery-chapter:not([hidden]) { margin-top: 96px; border-top: 1px solid rgba(27,27,25,.12); }

/* Match the Journal page: same content width, heading size, kicker, intro band depth and botanical. */
.gallery-page { width: min(1168px, calc(100% - 48px)); padding-top: 168px; }
.gallery-intro { margin-bottom: 130px; }
.gallery-intro::before { top: -182px; bottom: -74px; }
.gallery-intro h1 { font-size: clamp(2.6rem, 4vw, 3rem) !important; }
.gallery-intro h1::before { display: block; margin-bottom: 18px; color: var(--gold); font: 800 10px/1 'Manrope', sans-serif; letter-spacing: .18em; text-transform: uppercase; content: 'Padathil Stays'; }
.gallery-intro::after { position: absolute; z-index: -1; top: -240px; left: calc(50% - 50vw + clamp(-160px, -6vw, -45px)); width: clamp(320px, 34vw, 560px); height: clamp(220px, 23vw, 380px); opacity: .14; pointer-events: none; content: ''; background: url('images/kerala-coconut-jasmine-botanical.webp') center / contain no-repeat; }

.gallery-intro::after { display: none; }
/* The bougainvillea layer spans the full-width intro band (see bougainvillea.css). */
.gallery-intro > .bougain { inset: auto; top: -182px; bottom: -74px; left: 50%; width: 100vw; transform: translateX(-50%); }
