/*
 * DIVSA OS — Layout Studio (v4.9.48, Phase 4B).
 *
 * Maps the admin's choices (custom properties + body classes printed by
 * TAP_Layout) onto the class names the app already renders. Nothing here
 * invents a new component and nothing here uses !important — the nine UI
 * presets must still be able to win where they are supposed to.
 *
 * Loads last, and only on DIVSA pages.
 */

/* ── Date & time selector cards ──────────────────────────────────────────
 * `.tap-slots` was a one-column flex list with a fixed card size. It is now a
 * grid whose column count and card scale come from the admin.
 */
.tap-lay .tap-slots {
	display: grid;
	grid-template-columns: var(--tap-slot-cols, 1fr);
	gap: 10px;
	margin-top: 12px;
}

.tap-lay .tap-slot {
	padding: var(--tap-slot-pad, 14px 16px);
	min-width: var(--tap-slot-min, 100px);
	border-radius: var(--tap-slot-radius, 14px);
	margin: 0;                       /* the grid owns the spacing now */
}

.tap-lay .tap-slot2-date {
	min-width: var(--tap-slot-date, 48px);
}

.tap-lay .tap-slot2-num {
	font-size: var(--tap-slot-num, 21px);
}

.tap-lay .tap-slot2-time {
	font-size: var(--tap-slot-time, 13px);
}

/* Small cards in multiple columns: the seats line is the first thing to go —
 * it wraps, and a wrapped card in a 3-column grid drags the whole row taller. */
.tap-lay.tap-slot-sm.tap-slotcols-3 .tap-slot2-seats {
	font-size:12px;
}

/* Optional information. Hidden, not deleted — the countdown keeps running and
 * keeps firing `tap-slot-expired`, so a slot that closes still closes. */
.tap-no-seats .tap-slot2-seats { display: none; }
.tap-no-countdown .tap-countdown,
.tap-no-countdown .tap-slot-countdown,
.tap-no-countdown .tap-slot2-countdown { display: none; }

/* ── Cards & density ────────────────────────────────────────────────────── */
.tap-density-compact .tap-section { margin-bottom: var(--tap-section-gap, 20px); }
.tap-density-compact .tap-card,
.tap-density-compact .tap-pkg { padding: var(--tap-card-pad, 12px 14px); }
.tap-lay .tap-card,
.tap-lay .tap-pkg { border-radius: var(--tap-card-radius, 16px); }

/* ── Gallery: shared ────────────────────────────────────────────────────── */
.tap-lay .tap-gallery img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 10px;
}

.tap-lay .tap-gthumb {
	aspect-ratio: var(--tap-gallery-ratio, 4 / 3);
	display: block;
	overflow: hidden;
	border-radius: 10px;
	background: color-mix(in srgb,var(--tap-primary) 8%,var(--tap-card));
}

/* natural → let the image decide */
.tap-lay .tap-gallery[data-ratio="auto"] .tap-gthumb { aspect-ratio: auto; }

/* ── Gallery: grid (default) ────────────────────────────────────────────── */
.tap-gal-grid .tap-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

/* ── Gallery: masonry — pure CSS, photos keep their own shape ───────────── */
.tap-gal-masonry .tap-gallery {
	column-count: 3;
	column-gap: 10px;
}

.tap-gal-masonry .tap-gthumb {
	aspect-ratio: auto;
	break-inside: avoid;
	margin-bottom: 10px;
}

.tap-gal-masonry .tap-gallery img { height: auto; }

@media (max-width: 767.98px) {
	.tap-gal-masonry .tap-gallery { column-count: 2; }
}

/* ── Gallery: lightbox grid ─────────────────────────────────────────────── */
.tap-gal-lightbox .tap-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

.tap-gal-lightbox .tap-gthumb { cursor: zoom-in; }

.tap-lb {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(14, 4, 24, .92);
	display: grid;
	place-items: center;
	padding: 24px;
}

.tap-lb img {
	max-width: 92vw;
	max-height: 86dvh;
	border-radius: 12px;
}

.tap-lb-x,
.tap-lb-prev,
.tap-lb-next {
	position: absolute;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	border: 0;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 20px;
	cursor: pointer;
}

.tap-lb-x { top: 18px; right: 18px; }
.tap-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.tap-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* ── Gallery: carousel (Flipkart style) ─────────────────────────────────
 * Thumbnail rail beside a large main image. On a phone the rail moves under
 * the image and turns horizontal — a vertical rail on a 380px screen steals
 * half the width from the thing people came to look at.
 */
.tap-gal-carousel .tap-gallery {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 12px;
	align-items: start;
}

.tap-gal-carousel .tap-gal-rail {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 420px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.tap-gal-carousel .tap-gal-rail .tap-gthumb {
	aspect-ratio: 1 / 1;
	border: 2px solid transparent;
	opacity: .72;
	transition: opacity .15s ease, border-color .15s ease;
}

.tap-gal-carousel .tap-gal-rail .tap-gthumb.is-active,
.tap-gal-carousel .tap-gal-rail .tap-gthumb:hover {
	opacity: 1;
	border-color: var(--tap-purple);
}

.tap-gal-carousel .tap-gal-main {
	position: relative;
	aspect-ratio: var(--tap-gallery-ratio, 4 / 3);
	overflow: hidden;
	border-radius: 14px;
	background: color-mix(in srgb,var(--tap-primary) 8%,var(--tap-card));
}

.tap-gal-carousel .tap-gal-main img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Hover zoom — desktop only. On a touch screen there is no hover, and a
 * transform that never resets is a photo the devotee cannot see. */
@media (hover: hover) {
	.tap-gal-zoom .tap-gal-main img {
		transition: transform .25s ease;
	}
	.tap-gal-zoom .tap-gal-main:hover img {
		transform: scale(1.6);
	}
}

@media (max-width: 767.98px) {
	.tap-gal-carousel .tap-gallery {
		grid-template-columns: 1fr;
	}
	.tap-gal-carousel .tap-gal-rail {
		flex-direction: row;
		max-height: none;
		overflow-x: auto;
		order: 2;
	}
	.tap-gal-carousel .tap-gal-rail .tap-gthumb { flex: 0 0 62px; }
	.tap-gal-carousel .tap-gal-main { order: 1; }
}

/* ── Gallery: full-width swipeable slider ───────────────────────────────── */
.tap-gal-slider .tap-gallery {
	display: block;
	position: relative;
}

.tap-gal-slider .tap-gal-track {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.tap-gal-slider .tap-gal-track::-webkit-scrollbar { display: none; }

.tap-gal-slider .tap-gal-track .tap-gthumb {
	flex: 0 0 100%;
	scroll-snap-align: center;
	aspect-ratio: var(--tap-gallery-ratio, 4 / 3);
}

.tap-gal-slider .tap-gal-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 10px;
}

.tap-gal-slider .tap-gal-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: color-mix(in srgb,var(--tap-primary) 18%,var(--tap-card));
	border: 0;
	padding: 0;
	cursor: pointer;
}

.tap-gal-slider .tap-gal-dot.is-active {
	background: var(--tap-purple);
	width: 18px;
	border-radius: 999px;
}

/* ── Motion level (Layout Studio → Motion) — v6.9.4 (P6) ─────────────────────
   Admin-chosen animation level as a body class. 'full' adds no class (the
   shipped feel). 'subtle' quickens and calms motion; 'off' removes it entirely
   (fastest, and the most accessible — it also reinforces a device already set
   to "reduce motion"). Scoped to the body class, so only DIVSA pages that opt
   in are affected. */
.tap-motion-subtle *,
.tap-motion-subtle *::before,
.tap-motion-subtle *::after {
	animation-duration: .18s !important;
	transition-duration: .12s !important;
}
.tap-motion-off *,
.tap-motion-off *::before,
.tap-motion-off *::after {
	animation: none !important;
	transition: none !important;
	scroll-behavior: auto !important;
}

/* ══ Booking experience formats (Layout Studio → Booking experience) — P6d ═══
   ONE curated, coherent presentation the whole journey inherits. Presentation
   only — rhythm, scale, density. Brand colour stays with the Brand Customizer;
   step order stays with Flow Builder. 'signature' is the baseline (no rules).
   Scoped to the tap-fmt-* body class, no !important, so the UI presets and the
   Customizer still win where they should, and any client colour is respected. */

/* ── Compact — dense & app-like, fits noticeably more per screen (Swiggy/Zepto
      efficiency). Tighter vertical rhythm, smaller hero, denser imagery. ── */
.tap-fmt-compact .tap-problem-search { padding: 22px 0; }
.tap-fmt-compact .tap-home-section,
.tap-fmt-compact .tap-section { margin-bottom: 22px; }
.tap-fmt-compact .tap-section-head { margin-bottom: 12px; }
.tap-fmt-compact .tap-display { font-size: clamp(24px, 4.2vw, 40px); }
.tap-fmt-compact .tap-deity-grid { gap: 12px; }
.tap-fmt-compact .tap-deity-icon { width: 54px; height: 54px; font-size: 24px; }
.tap-fmt-compact .tap-deity-name { font-size:12px; }

/* ── Devotional — spacious & warm, temple-first storytelling (devotional marketplace / marketplace
      warmth). Generous rhythm, larger hero and imagery, a soft gold wash on the
      discovery header drawn from the brand palette (not a hardcoded colour). ── */
.tap-fmt-devotional .tap-problem-search {
	padding: 60px 0;
	background: linear-gradient(180deg, var(--tap-gold-light, #FFF8E7), transparent);
}
.tap-fmt-devotional .tap-home-section,
.tap-fmt-devotional .tap-section { margin-bottom: 46px; }
.tap-fmt-devotional .tap-section-head { margin-bottom: 26px; }
.tap-fmt-devotional .tap-display { font-size: clamp(32px, 6vw, 60px); }
.tap-fmt-devotional .tap-deity-grid { gap: 22px; }
.tap-fmt-devotional .tap-deity-icon { width: 76px; height: 76px; font-size: 34px; }
.tap-fmt-devotional .tap-deity-name { font-size: 13px; }

/* Format targeting for the booking page's real classes (hero = .tap-headline,
   intent search = .tap-search-box, blocks = .tap-section). The home-page
   selectors above cover /puja-home/; these cover /book/. */
.tap-fmt-compact .tap-headline { font-size: clamp(24px, 4vw, 38px); }
.tap-fmt-compact .tap-section { margin-bottom: 20px; }
.tap-fmt-compact .tap-search-suggestions { margin: 8px 0; }
.tap-fmt-compact .tap-ptabs { margin-bottom: 10px; }

/* v7.9.0: experience formats own rhythm and storytelling only. Catalogue
   geometry (card scale, image ratio, columns and gaps) is now exclusively
   owned by Layout Studio's Catalogue presentation controls. Keeping direct
   .tap-thumb/.tap-grid sizes here made an Experience preset silently override
   explicit operator choices. */

.tap-fmt-devotional .tap-headline { font-size: clamp(34px, 6.5vw, 64px); line-height: 1.12; }
.tap-fmt-devotional .tap-section { margin-bottom: 44px; }
.tap-fmt-devotional .tap-search-box {
	margin-top: 18px; padding-top: 16px; padding-bottom: 16px;
	box-shadow: 0 10px 34px rgba(249,144,0,.16), var(--tap-shadow);
}
.tap-fmt-devotional .tap-search-suggestions { margin: 18px 0; gap: 10px; }
.tap-fmt-devotional .tap-ptabs { margin-bottom: 22px; }

/* Keyboard focus must remain visible even when a theme globally suppresses/* Keyboard focus must remain visible even when a theme globally suppresses
   outlines. :focus-visible avoids drawing focus rings for ordinary pointer
   taps while preserving keyboard accessibility. */

.tap-root :where(input,select,textarea,button,a,[tabindex]){
	scroll-margin-block:96px;
}

/* Respect the visitor's OS motion preference regardless of the tenant's
   optional animation level. This is deliberately stronger than visual presets. */
@media (prefers-reduced-motion:reduce){
	
}


/* UNIVERSAL AUTO RESPONSIVE COMPONENT ENGINE
   Components respond to the space they actually receive. The page canvas and
   horizontal gutter are owned exclusively by tap-shell.css. */

/* Fluid headings and controls keep readable endpoints while avoiding jumps. */
.tap-responsive-smart .tap-sec-title{font-size:clamp(1.2rem,1.04rem + .7vw,1.75rem)}
.tap-responsive-smart .tap-btn,
.tap-responsive-smart button.tap-btn{min-height:max(var(--tap-target-min,44px),2.75rem);padding-inline:clamp(.9rem,2.4vw,1.35rem)}

/* Gallery components also use their own received width. */
.tap-responsive-smart.tap-gal-carousel .tap-root{container:tapGallery / inline-size}
@container tapGallery (max-width:560px){
  .tap-gal-carousel .tap-gallery{grid-template-columns:1fr}
  .tap-gal-carousel .tap-gal-rail{flex-direction:row;max-height:none;overflow-x:auto;order:2}
  .tap-gal-carousel .tap-gal-main{order:1}
}

/* No hard image heights in Smart mode: the canonical ratio is the contract. */
.tap-responsive-smart .tap-fcard-art,
.tap-responsive-smart .tap-pcard-thumb{max-width:100%}

@media(prefers-reduced-motion:reduce){
  .tap-responsive-smart *{scroll-behavior:auto}
}


/* Component fit contract. Page-shell geometry is intentionally excluded. */
.tap-responsive-smart .tap-app-shell :where(.tap-container,.tap-grid,.tap-lay,.tap-section,.tap-panel,.tap-card,.tap-fcard,.tap-pcard){min-inline-size:0;max-inline-size:100%}
.tap-responsive-smart .tap-app-shell :where(img,video,canvas,iframe){max-inline-size:100%}
.tap-responsive-smart .tap-app-shell img{height:auto}
.tap-responsive-smart .tap-app-shell :where(input,select,textarea,button){max-inline-size:100%}

/* Components may wrap their own text, while the App Shell remains the only
   viewport-gutter owner. */
@media(max-width:767.98px){
  .tap-responsive-smart .tap-app-shell :where(.tap-section,.tap-panel){overflow-wrap:anywhere}
}
/* Phase 2 smart spacing preset. Spacious remains token-driven and does not add a second responsive engine. */
.tap-density-spacious .tap-section{margin-bottom:var(--tap-section-gap,32px)}
.tap-density-spacious .tap-card,.tap-density-spacious .tap-pkg{padding:var(--tap-card-pad,18px 20px)}

/*
 * v8.6.26 — a listing card must not become a billboard.
 *
 * .tap-lay-grid takes its track count from the operator's Cards & Layout
 * setting. At one column on a desktop the card gets the full 1144px content
 * width, and the 4/3 art turned that into an 858px-tall image — the
 * "unfinished" look on Chadhava, Healing and any vertical with few published
 * items. Capping the art height (rather than the card width) leaves the card
 * and every multi-column layout exactly as they were: at narrower tracks the
 * art is already shorter than the cap, so this never binds. background-size
 * stays cover, so the crop is clean.
 */
.tap-lay-grid .tap-fcard-art { max-height: 320px; }

/*
 * Same reason as the art cap above. .tap-fcard-body carries min-height:190px
 * so homepage rail cards (title + blurb + rating + CTA) line up. A listing
 * card that only has a title inherits that 190px as dead space between the
 * name and the CTA. Inside a grid the row already stretches every card to the
 * tallest one, so releasing the floor here costs nothing and removes the gap.
 */
.tap-lay-grid .tap-fcard-body { min-height: 0; }

/*
 * v8.6.26 — vertical listing pages show ONE card per row on a phone.
 *
 * MEASURED on /chadhava/ at 375px before this rule:
 *   .tap-vertical-grid  grid-template-columns: 168.5px 168.5px
 *   two 163px cards side by side, which forced "Kashi / Vishwanath /
 *   Chadhava" onto three lines and squeezed the CTA.
 *
 * The single-column rule for this grid already existed, but it lives in
 * tap-home-experience.css as `.tap-home-root .tap-vertical-grid` — and that
 * stylesheet is NOT enqueued on the vertical listing pages. Loaded there are
 * tokens, core, booking, consultation, cards, chrome, layout and perf only,
 * so every rule in that file is dead on /pujas/ and /chadhava/ and the grid
 * falls back to tap-core's generic
 *   .tap-lay-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,148px),1fr))}
 * at which two 148px tracks fit inside 375px.
 *
 * The rule is restated here — in a sheet that IS loaded — rather than
 * enqueuing the whole home-experience sheet, which carries a full set of
 * card-density overrides and would restyle the listing cards as a side
 * effect. 560px matches the breakpoint the original rule used, so the two
 * agree wherever both happen to apply.
 */
/* Transactional/PDP geometry moved to canonical tap-booking.css in Phase 6. */

/* Transaction feedback, checkout width and success geometry live in tap-booking.css. */
