/**
 * Hotel The Hills — photography, places rail, seasons selector, panorama
 * and live local time. Loaded with theme.css (front end and editor).
 */

/* ------------------------------------------------------------------ */
/* Photography credits                                                 */
/* ------------------------------------------------------------------ */

.wp-block-image figcaption.wp-element-caption {
	margin: .5rem 0 0;
	padding: 0;
	background: none;
	color: inherit;
	font-size: .6875rem;
	line-height: 1.4;
	letter-spacing: .02em;
	text-align: left;
	opacity: .75;
}
.wp-block-image figcaption a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption.wp-element-caption {
	position: absolute;
	inset: auto 0 0;
	margin: 0;
	padding: 1.75rem .75rem .5rem;
	max-height: none;
	background: linear-gradient(transparent, rgba(10, 16, 26, .75));
	color: #f5f1e8;
	font-size: .6875rem;
	opacity: 0;
	transition: opacity .35s var(--hth-ease);
}
.wp-block-gallery.has-nested-images figure.wp-block-image:is(:hover, :focus-within) figcaption.wp-element-caption { opacity: 1; }
@media (hover: none) {
	.wp-block-gallery.has-nested-images figure.wp-block-image figcaption.wp-element-caption { opacity: .95; }
}

.hth-photo-credit {
	position: absolute;
	z-index: 3;
	right: var(--hth-gutter);
	bottom: .6rem;
	max-width: min(60ch, 70vw);
	margin: 0 !important;
	font-size: .6875rem !important;
	line-height: 1.4;
	text-align: right;
	color: #f5f1e8;
	opacity: .78;
	text-shadow: 0 1px 2px rgba(10, 16, 26, .7);
}
.hth-photo-credit a { color: inherit; }
/* Let photographic covers' content fill their height so the credit sits in the corner. */
.hth-final-cta > .wp-block-cover__inner-container,
.hth-page-hero > .wp-block-cover__inner-container { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.hth-page-hero > .wp-block-cover__inner-container { justify-content: flex-end; }
@media (max-width: 781px) {
	.hth-photo-credit { position: static; max-width: none; margin-top: 1rem !important; text-align: left; }
}

/* Lightbox gallery grid: fixed 4:3 tiles, the first of every six spans two rows. */
.wp-block-gallery.is-style-hth-lightbox.has-nested-images figure.wp-block-image { aspect-ratio: 4 / 3; }
.wp-block-gallery.is-style-hth-lightbox.has-nested-images figure.wp-block-image > a,
.wp-block-gallery.is-style-hth-lightbox.has-nested-images figure.wp-block-image img { display: block; width: 100% !important; height: 100% !important; aspect-ratio: auto !important; object-fit: cover; }
@media (min-width: 782px) {
	.wp-block-gallery.is-style-hth-lightbox.has-nested-images.columns-3 { grid-auto-rows: clamp(190px, 20vw, 330px); }
	.wp-block-gallery.is-style-hth-lightbox.has-nested-images.columns-3 figure.wp-block-image { aspect-ratio: auto; height: 100%; min-height: 0; }
}

/* Slow drift on photographic covers (the 3D hero animates itself). */
@media (prefers-reduced-motion: no-preference) {
	.hth-final-cta .wp-block-cover__image-background,
	.hth-page-hero .wp-block-cover__image-background { animation: hth-drift 26s ease-in-out infinite alternate; }
}
@keyframes hth-drift {
	from { transform: scale(1.02); }
	to { transform: scale(1.1) translate3d(-1.5%, -1%, 0); }
}

/* ------------------------------------------------------------------ */
/* Places to explore rail                                              */
/* ------------------------------------------------------------------ */

.hth-guide__head { margin-bottom: clamp(1.5rem, 3vw, 2.5rem) !important; }
.hth-guide__head h2 { margin: 0; }
.hth-places {
	display: grid !important;
	grid-auto-flow: column;
	grid-auto-columns: clamp(250px, 27vw, 380px);
	gap: clamp(1rem, 2vw, 1.75rem);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--hth-gutter);
	padding: 0 var(--hth-gutter) 1.25rem !important;
	scrollbar-width: thin;
	scrollbar-color: color-mix(in srgb, currentColor 30%, transparent) transparent;
}
.hth-places:focus-visible { outline: 2px solid var(--wp--preset--color--champagne); outline-offset: 4px; }
.hth-place { scroll-snap-align: start; margin: 0 !important; display: flex; flex-direction: column; gap: .5rem; }
.hth-place > * { margin: 0 !important; }
.hth-place .wp-block-image { overflow: hidden; }
.hth-place .wp-block-image img { width: 100%; transition: transform 1.2s var(--hth-ease); }
.hth-place:hover .wp-block-image img { transform: scale(1.05); }
.hth-place__title { margin-top: .5rem !important; }
.hth-place__text { font-size: .9375rem; line-height: 1.6; opacity: .85; }

.hth-rail-nav {
	display: flex;
	gap: .6rem;
	justify-content: flex-end;
	max-width: var(--wp--style--global--wide-size, 1360px);
	margin: 0 auto 1rem !important;
	padding-inline: var(--hth-gutter);
}
.hth-rail-nav button,
.hth-lightbox-like {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background-color .3s var(--hth-ease), color .3s var(--hth-ease), opacity .3s;
}
.hth-rail-nav button:hover:not([disabled]) { background: var(--wp--preset--color--midnight); border-color: var(--wp--preset--color--midnight); color: var(--wp--preset--color--ivory); }
.hth-rail-nav button[disabled] { opacity: .3; cursor: default; }

/* ------------------------------------------------------------------ */
/* Seasons selector                                                    */
/* ------------------------------------------------------------------ */

.hth-seasons__head h2 { margin: 0 0 clamp(1.5rem, 3vw, 2.5rem); }
.hth-seasons__list { display: grid; gap: 3rem; }
.hth-season { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: end; margin: 0 !important; }
.hth-season > * { margin: 0 !important; }
.hth-season__image img { width: 100%; }
.hth-season__months { margin: 0 !important; font-size: .6875rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase; color: var(--wp--preset--color--champagne); }
.hth-season__name { margin: .5rem 0 1rem !important; font-weight: 300; }
.hth-season__desc { margin: 0 !important; max-width: 38ch; font-size: 1.125rem; line-height: 1.7; opacity: .92; }
@media (max-width: 781px) {
	.hth-season { grid-template-columns: 1fr; }
}

/* Tabs (set up by site.js; without JavaScript every season is listed). */
.hth-seasons.is-tabs .hth-seasons__list { gap: 0; }
.hth-seasons.is-tabs .hth-season[hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
	.hth-seasons.is-tabs .hth-season { animation: hth-season-in .7s var(--hth-ease-out) both; }
}
@keyframes hth-season-in {
	from { opacity: .01; transform: translate3d(0, 14px, 0); }
	to { opacity: 1; transform: none; }
}
.hth-season-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: .25rem clamp(1rem, 3vw, 2.5rem);
	margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
	padding: 0 0 .75rem;
	border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}
.hth-season-tabs button {
	position: relative;
	min-height: 44px;
	padding: .5rem 0;
	border: 0;
	background: none;
	color: inherit;
	text-align: left;
	font: 300 clamp(1.4rem, 2.4vw, 2rem)/1.1 var(--wp--preset--font-family--display);
	opacity: .6;
	cursor: pointer;
	transition: opacity .3s var(--hth-ease);
}
.hth-season-tabs button span { display: block; margin-top: .35rem; font: 600 .6875rem/1 var(--wp--preset--font-family--body); letter-spacing: .18em; text-transform: uppercase; }
.hth-season-tabs button[aria-selected="true"],
.hth-season-tabs button:hover { opacity: 1; }
.hth-season-tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(-.75rem - 1px); height: 2px; background: var(--wp--preset--color--champagne); }
.hth-season-tabs button:focus-visible { outline: 2px solid var(--wp--preset--color--champagne); outline-offset: 4px; }

/* ------------------------------------------------------------------ */
/* Panorama                                                            */
/* ------------------------------------------------------------------ */

.hth-panorama {
	position: relative;
	overflow: hidden;
	margin-block: 0 !important;
	background: var(--wp--preset--color--midnight);
	color: #f5f1e8;
}
.hth-panorama:not(.is-panning) { overflow-x: auto; }
.hth-panorama::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(10, 16, 26, .7)); pointer-events: none; }
.hth-panorama__label,
.hth-panorama__image figcaption.wp-element-caption { z-index: 1; }
.hth-panorama__image { margin: 0 !important; }
.hth-panorama__image img { display: block; width: auto; max-width: none; height: clamp(280px, 52vh, 620px); object-fit: cover; will-change: transform; }
.hth-panorama__image figcaption.wp-element-caption {
	position: absolute;
	right: var(--hth-gutter);
	bottom: .6rem;
	margin: 0;
	color: #f5f1e8;
	text-shadow: 0 1px 2px rgba(10, 16, 26, .7);
	opacity: .8;
}
.hth-panorama__label {
	position: absolute;
	left: var(--hth-gutter);
	bottom: 1.4rem;
	max-width: 30ch;
	margin: 0 !important;
	font: 300 clamp(1.3rem, 2.4vw, 2rem)/1.2 var(--wp--preset--font-family--display);
	text-shadow: 0 2px 18px rgba(10, 16, 26, .7);
}

/* ------------------------------------------------------------------ */
/* Live time in Dharamshala (hero)                                     */
/* ------------------------------------------------------------------ */

.hth-localtime {
	position: absolute;
	z-index: 3;
	top: calc(var(--hth-header-h) + 1.5rem);
	left: max(var(--hth-gutter), calc((100% - 1360px) / 2));
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	padding: .55rem .9rem;
	border: 1px solid rgba(245, 241, 232, .28);
	background: rgba(16, 27, 43, .38);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: #f5f1e8;
	font: 500 .75rem/1.2 var(--wp--preset--font-family--body);
	letter-spacing: .06em;
}
.hth-localtime::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--wp--preset--color--champagne); box-shadow: 0 0 0 4px rgba(199, 174, 130, .25); }
.hth-localtime b { font-weight: 700; }
@media (max-width: 599px), (max-height: 700px) {
	.hth-localtime { display: none; }
}

/* ------------------------------------------------------------------ */
/* Motion: depth parallax, card tilt, word reveals, seasons            */
/* ------------------------------------------------------------------ */

.hth-intro__images figure,
.hth-season__image,
.hth-feature .wp-block-image { overflow: hidden; }
.hth-parallax { translate: 0 var(--hth-py, 0); scale: 1.12; will-change: translate; }
.hth-page-hero .wp-block-cover__image-background.hth-parallax { scale: 1.08; }

.hth-tilt {
	position: relative;
	transform: perspective(900px) rotateX(var(--hth-rx, 0deg)) rotateY(var(--hth-ry, 0deg));
	transition: transform .6s var(--hth-ease);
	will-change: transform;
}
.hth-tilt::after {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at var(--hth-gx, 50%) var(--hth-gy, 50%), rgba(255, 255, 255, .2), transparent 55%);
	opacity: 0;
	transition: opacity .45s var(--hth-ease);
	pointer-events: none;
}
.hth-tilt:hover::after { opacity: 1; }

.hth-words .hth-word { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .08em .14em 0; margin: 0 -.08em -.14em 0; }
.hth-words .hth-word > span { display: inline-block; transform: translate3d(0, 108%, 0); transition: transform 1.05s var(--hth-ease-out); }
.hth-words.is-words-in .hth-word > span { transform: none; }

@media (prefers-reduced-motion: no-preference) {
	.hth-seasons.is-tabs .hth-season:not([hidden]) .hth-season__image img { animation: hth-season-zoom 14s cubic-bezier(.2, .7, .1, 1) both; }
}
@keyframes hth-season-zoom {
	from { transform: scale(1.12); }
	to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.hth-parallax { translate: none; scale: 1; }
	.hth-tilt { transform: none; }
}

/* A day in Dharamshala ------------------------------------------------- */
.hth-day__head { margin-bottom: var(--wp--preset--spacing--50); }
.hth-day__head h2 em { color: var(--wp--preset--color--champagne); }
.hth-day__track { display: grid; gap: var(--wp--preset--spacing--50); }
.hth-day__moment { display: grid; gap: 1rem 2.5rem; align-items: center; }
.hth-day__moment > .wp-block-image { margin: 0; }
.hth-day__moment img { width: 100%; height: auto; border-radius: 4px; }
.hth-day__time { margin: 0 0 .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--wp--preset--color--champagne); }
.hth-day__title { margin: 0 0 .75rem; }
.hth-day__desc { margin: 0; max-width: 42ch; opacity: .86; }
@media (min-width: 782px) {
	.hth-day__moment { grid-template-columns: 1.3fr 1fr; }
	.hth-day__moment:nth-child(even) > .wp-block-image { order: 2; }
}

/* Scroll story (added by site.js on wide screens only). */
.hth-day--story .hth-day__track { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 0 clamp(2rem, 5vw, 5rem); align-items: start; }
.hth-day--story .hth-day__stage { grid-column: 1; grid-row: 1 / span 20; position: sticky; top: max(5.5rem, calc(50vh - min(38vh, 23vw))); height: min(76vh, 46vw); border-radius: 6px; overflow: hidden; isolation: isolate; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.hth-day--story .hth-day__moment { grid-column: 2; display: flex; align-items: center; min-height: 72vh; opacity: .28; transition: opacity .6s ease; }
.hth-day--story .hth-day__moment:first-of-type { min-height: 60vh; }
.hth-day--story .hth-day__moment:last-child { min-height: 80vh; }
.hth-day--story .hth-day__moment.is-active { opacity: 1; }
.hth-day--story .hth-day__moment.is-active .hth-day__title { animation: hth-day-rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hth-day__frames { position: absolute; inset: 0; }
.hth-day__frames .wp-block-image { position: absolute; inset: 0; margin: 0; opacity: 0; transform: scale(1.08); transition: opacity 1.1s ease, transform 6s cubic-bezier(.2,.6,.2,1); }
.hth-day__frames .wp-block-image.is-active { opacity: 1; transform: scale(1); }
.hth-day__frames img { width: 100%; height: 100% !important; aspect-ratio: auto !important; object-fit: cover; border-radius: 0; }
.hth-day__frames figcaption.wp-element-caption { position: absolute; right: .75rem; bottom: .6rem; z-index: 3; margin: 0; }
.hth-day__stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(var(--hth-day-tint, 255,200,150), .28), rgba(var(--hth-day-tint, 255,200,150), 0) 45%), linear-gradient(0deg, rgba(10,16,28,.55), rgba(10,16,28,0) 40%); mix-blend-mode: soft-light; transition: background .4s linear; }
.hth-day__dial { position: absolute; left: 1.25rem; bottom: 1.25rem; z-index: 2; width: min(40%, 240px); padding: .9rem 1rem .7rem; border-radius: 6px; color: #fff; background: rgba(10, 16, 28, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hth-day__arc { display: block; width: 100%; height: auto; overflow: visible; }
.hth-day__arc-path { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 1; stroke-dasharray: 2 3; }
.hth-day__dot { fill: rgba(255,255,255,.6); transition: fill .4s; }
.hth-day__dot.is-past { fill: var(--wp--preset--color--champagne); }
.hth-day__sun { fill: #ffe7b0; }
.hth-day__sun-glow { fill: rgba(255,214,140,.35); filter: blur(2px); }
.hth-day__now { margin: .25rem 0 0; font-size: .75rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
@keyframes hth-day-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
