/*
Theme Name: Bhatko
Theme URI: https://bhatko.com
Author: Unnat Digital
Author URI: https://unnatdigital.in
Description: A block theme for Bhatko, a field guide and trip-planning site for the Indian Himalayas. The look borrows from Himalayan road signs and survey sheets: condensed signage type, signal yellow, milestones and live status boards. Every template, part, pattern, colour and font is editable in the Site Editor.
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 8.1
Version: 0.2.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bhatko
Tags: blog, travel, full-site-editing, block-patterns, block-styles, style-variations, custom-colors, custom-logo, custom-menu, editor-style, featured-images, wide-blocks, translation-ready, accessibility-ready
*/

/*
 * Colours, type and spacing live in theme.json so admins can change them
 * in Appearance > Editor > Styles. This file only holds layout details
 * theme.json cannot express. Everything reads theme.json presets.
 */

/* ---------- Base ---------- */

:where(a, button, input, select, textarea, summary, .wp-element-button):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-1);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

:where(h1, h2, h3, .wp-block-post-title) {
	text-wrap: balance;
}

:where(p) {
	text-wrap: pretty;
}

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

::selection {
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--contrast);
}

/* Outline buttons: a ruled edge, not a pill. */
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
	padding: calc(0.95rem - 2px) calc(1.6rem - 2px) calc(0.9rem - 2px);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--accent-1);
}

/* Arrow after buttons that carry the class. */
.bhatko-arrow .wp-block-button__link::after,
.wp-block-read-more.bhatko-arrow::after {
	content: " →";
}

/* ---------- Header ---------- */

/*
 * The sticky element is the template part's own <header> wrapper: a sticky
 * child of a wrapper exactly its own height has nowhere to stick.
 *
 * It sticks at minus the strip's height, so the black top strip scrolls
 * away with the page and the main bar ends up flush with the top of the
 * screen. Nothing changes size, so the page never jumps. motion.js sets
 * --bhatko-topbar-h to the strip's real height (0 without it: the whole
 * header then simply stays).
 */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: calc(0px - var(--bhatko-topbar-h, 0px));
	z-index: 50;
}

.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: calc(var(--wp-admin--admin-bar--height, 32px) - var(--bhatko-topbar-h, 0px));
}

/* No block gap between the strip and the main bar: it would show the page
   through a see-through band once the strip has scrolled away. */
.bhatko-header > .bhatko-mainbar {
	margin-block-start: 0;
}

@media (max-width: 600px) {
	/* The toolbar scrolls away on small screens. */
	.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: calc(0px - var(--bhatko-topbar-h, 0px));
	}
}

.bhatko-topbar p {
	margin: 0;
}

.bhatko-topbar a {
	text-decoration: none;
	font-weight: 500;
}

/*
 * No backdrop-filter here: it would make the header the containing block
 * for the fixed-position mobile menu and trap the menu inside it.
 */

.bhatko-mainbar .wp-block-site-logo img {
	height: auto;
}

@media (max-width: 781px) {
	.bhatko-topbar .bhatko-topbar__regions {
		display: none;
	}

	.bhatko-mainbar .bhatko-mainbar__cta {
		display: none;
	}
}

/* Mobile menu overlay in signage style. */
.wp-block-navigation__responsive-container.is-menu-open {
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
	--navigation-layout-align: flex-start;
	background: var(--wp--preset--color--contrast-3) !important;
	color: var(--wp--preset--color--base) !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	font-size: 2.5rem;
	font-weight: 800;
	gap: 0.9rem;
	align-items: flex-start !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start !important;
	padding-top: 4.5rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	border-bottom: 1px solid rgb(255 255 255 / 0.15);
	width: 100%;
	padding-bottom: 0.6rem;
}

/* ---------- Hero ---------- */

.bhatko-hero .wp-block-cover__inner-container {
	width: 100%;
}

.bhatko-hero h1 {
	font-size: clamp(3.4rem, 1.4rem + 6.2vw, 7.25rem);
	line-height: 0.86;
	letter-spacing: -0.01em;
}

.bhatko-hero .is-style-bhatko-lead {
	max-width: 34rem;
}

@media (max-width: 781px) {
	.bhatko-hero {
		min-height: auto !important;
		padding-top: 9rem !important;
	}

	.bhatko-hero h1 {
		font-size: clamp(3rem, 15vw, 4.5rem);
	}
}

.bhatko-hero h1 em {
	font-style: normal;
	color: var(--wp--preset--color--accent-1);
}

.bhatko-hero__panel {
	background: color-mix(in srgb, var(--wp--preset--color--contrast-3) 78%, transparent);
	backdrop-filter: blur(14px) saturate(1.1);
	border-top: 4px solid var(--wp--preset--color--accent-1);
}

.bhatko-hero .wp-block-bhatko-image-credit {
	opacity: 0.75;
}

/* ---------- Section headers ---------- */

.bhatko-section-head {
	border-top: 3px solid currentColor;
	padding-top: var(--wp--preset--spacing--30);
}

.bhatko-section-head.wp-block-columns > * {
	margin-block: 0;
}

.bhatko-section-head .wp-block-query-title {
	margin-top: 0.3rem;
}

/* ---------- Destination cards ---------- */

.bhatko-card {
	height: 100%;
}

.bhatko-card__media {
	position: relative;
	overflow: hidden;
	background: var(--wp--preset--color--contrast-3);
}

.bhatko-card__media .wp-block-post-featured-image {
	margin: 0;
}

.bhatko-card__media .wp-block-post-featured-image img {
	transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
}

.bhatko-card__media .wp-block-bhatko-milestone {
	position: absolute;
	left: 0.9rem;
	bottom: 0;
	margin: 0;
	transform: translateY(0.35rem);
	pointer-events: none;
}

.bhatko-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.bhatko-card {
	position: relative;
}

.bhatko-card:focus-within {
	outline: 3px solid var(--wp--preset--color--accent-1);
	outline-offset: 4px;
}

@media (prefers-reduced-motion: no-preference) {
	.bhatko-card:hover .bhatko-card__media img,
	.bhatko-card:focus-within .bhatko-card__media img {
		transform: scale(1.045);
	}
}

.bhatko-card .wp-block-post-title a:hover {
	text-decoration: none;
}

.bhatko-facts-row {
	border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
	padding-top: 0.6rem;
}

.bhatko-facts-row > p {
	margin: 0;
}

/* ---------- Trips ---------- */

.bhatko-trip {
	border-top: 3px solid currentColor;
	padding-top: var(--wp--preset--spacing--40);
}

.bhatko-trip .wp-block-post-featured-image {
	margin: 0;
}

.bhatko-route {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.82rem;
	line-height: 1.7;
	word-spacing: 0.05em;
}

.bhatko-route::before {
	content: "";
	display: inline-block;
	width: 0.55rem;
	height: 0.55rem;
	margin-right: 0.6rem;
	background: var(--wp--preset--color--accent-1);
	outline: 2px solid var(--wp--preset--color--contrast);
	vertical-align: 0.02em;
}

.bhatko-stat > p:first-child {
	opacity: 0.7;
}

.bhatko-stat > p {
	margin: 0;
}

.bhatko-stat > p:last-child {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.5rem;
	font-weight: 700;
	text-transform: uppercase;
	line-height: 1.05;
}

/* Day-by-day itinerary: a dotted route line down the side. */
.bhatko-itinerary h3 {
	position: relative;
	margin-top: var(--wp--preset--spacing--50);
	padding-left: 2.25rem;
	font-size: var(--wp--preset--font-size--large);
	letter-spacing: 0.01em;
}

.bhatko-itinerary h3::before {
	content: "";
	position: absolute;
	left: 0.2rem;
	top: 0.1em;
	width: 0.9rem;
	height: 0.9rem;
	background: var(--wp--preset--color--accent-1);
	outline: 2px solid var(--wp--preset--color--contrast);
}

.bhatko-itinerary h3 + p {
	margin-top: 0.5rem;
	padding-left: 2.25rem;
	position: relative;
}

.bhatko-itinerary h3 + p::before {
	content: "";
	position: absolute;
	left: 0.6rem;
	top: -0.4rem;
	bottom: -2.5rem;
	border-left: 2px dashed color-mix(in srgb, currentColor 35%, transparent);
}

.bhatko-itinerary .bhatko-ai-note::before {
	display: none;
}

/* ---------- Single place / pass ---------- */

.bhatko-place-hero {
	background-color: var(--wp--preset--color--contrast-3);
}

.bhatko-place-hero .wp-block-cover__inner-container {
	width: 100%;
}

.bhatko-place-hero .wp-block-post-excerpt {
	max-width: 40rem;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.45;
}

/* Reading text: calmer heading sizes inside articles. */
.wp-block-post-content h2 {
	font-size: var(--wp--preset--font-size--x-large);
	margin-top: var(--wp--preset--spacing--50);
}

.wp-block-post-content h3 {
	font-size: var(--wp--preset--font-size--large);
}

@media (max-width: 781px) {
	.bhatko-place-hero {
		min-height: 70svh !important;
	}

	.bhatko-place-hero .wp-block-column[style*="flex-basis:25%"] {
		justify-content: flex-start !important;
	}

	.bhatko-sticky {
		position: static;
	}
}

.bhatko-place-hero h1 {
	font-size: clamp(3.2rem, 1.4rem + 6.4vw, 7.5rem);
}

.bhatko-sticky {
	position: sticky;
	top: 7.5rem;
}

.bhatko-ai-note {
	margin-top: var(--wp--preset--spacing--60) !important;
	padding: 0.85rem 1rem;
	border-left: 3px solid var(--wp--preset--color--accent-1);
	background: color-mix(in srgb, currentColor 5%, transparent);
	font-family: var(--wp--preset--font-family--mono);
	line-height: 1.55;
}

/* Region filter list on archives. */
/* Region filter: one panel per state, its valleys and districts as chips. */
.bhatko-region-filter.wp-block-categories {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
	gap: 0.75rem;
	margin: var(--wp--preset--spacing--20) 0 0;
	padding: 0;
	list-style: none;
}

.bhatko-region-filter ul,
.bhatko-region-filter li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bhatko-region-filter > li {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
	padding: 1rem 1.1rem 1.15rem;
	background: #fff;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 18%, transparent);
	border-top: 4px solid var(--wp--preset--color--accent-1);
}

.bhatko-region-filter > li > a {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px dashed color-mix(in srgb, var(--wp--preset--color--contrast) 35%, transparent);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

.bhatko-region-filter > li > a::after {
	content: "→";
	font-size: 1.1rem;
	transition: translate 0.3s ease;
}

.bhatko-region-filter > li > a:hover::after,
.bhatko-region-filter > li > a:focus-visible::after {
	translate: 0.3rem 0;
}

.bhatko-region-filter .children {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.bhatko-region-filter .children a {
	display: inline-block;
	padding: 0.45rem 0.65rem 0.4rem;
	background: var(--wp--preset--color--base);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 20%, transparent);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
}

.bhatko-region-filter .children a:hover,
.bhatko-region-filter .children a:focus-visible {
	background: var(--wp--preset--color--accent-1);
	border-color: var(--wp--preset--color--contrast);
}

/* The page you are on. */
.bhatko-region-filter > li.current-cat {
	border-color: var(--wp--preset--color--contrast);
	border-top-color: var(--wp--preset--color--contrast);
}

.bhatko-region-filter .children .current-cat > a {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--accent-1);
}

/* ---------- Footer ---------- */

.bhatko-wordmark {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: clamp(5rem, 24vw, 22rem);
	line-height: 0.78;
	letter-spacing: -0.01em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-1);
	user-select: none;
	white-space: nowrap;
	overflow: hidden;
	text-align: center;
}

.bhatko-footer-nav .wp-block-navigation__container {
	gap: 0.55rem;
}

.bhatko-emergency {
	list-style: none;
	padding: 0;
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.82rem;
}

.bhatko-emergency li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.45rem 0;
	border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	margin: 0;
}

.bhatko-emergency strong {
	font-weight: 500;
	color: var(--wp--preset--color--accent-1);
}

/* ---------- Floating "Plan my trip": WhatsApp or the enquiry form ---------- */

.wp-block-details.bhatko-plan {
	position: fixed;
	right: max(1rem, env(safe-area-inset-right));
	bottom: max(1rem, env(safe-area-inset-bottom));
	z-index: 90;
	margin: 0;
	padding: 0;
}

.bhatko-plan > summary {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 0.95rem 0.5rem 0.5rem;
	list-style: none;
	cursor: pointer;
	background: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--contrast);
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 999px;
	box-shadow: 0 4px 0 0 var(--wp--preset--color--contrast), 0 16px 30px -12px rgb(18 20 23 / 0.55);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1;
	text-transform: uppercase;
	white-space: nowrap;
	transition: translate 0.25s ease, box-shadow 0.25s ease;
	user-select: none;
}

.bhatko-plan > summary::-webkit-details-marker {
	display: none;
}

/* WhatsApp badge on the left of the pill. */
.bhatko-plan > summary::before {
	content: "";
	flex: none;
	width: 2.1rem;
	height: 2.1rem;
	border-radius: 50%;
	background:
		#25d366 url(assets/images/icon-whatsapp.svg) center / 62% no-repeat;
	background-blend-mode: normal;
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--contrast);
	filter: none;
}

/* Plus that turns into a close cross. */
.bhatko-plan > summary::after {
	content: "+";
	font-size: 1.45rem;
	font-weight: 600;
	line-height: 0.7;
	transition: rotate 0.3s ease;
}

.bhatko-plan[open] > summary::after {
	rotate: 45deg;
}

.bhatko-plan > summary:hover {
	translate: 0 -2px;
	box-shadow: 0 6px 0 0 var(--wp--preset--color--contrast), 0 20px 34px -12px rgb(18 20 23 / 0.6);
}

.bhatko-plan > summary:focus-visible {
	outline: 3px solid var(--wp--preset--color--contrast);
	outline-offset: 4px;
}

.bhatko-plan__panel {
	position: absolute;
	right: 0;
	bottom: calc(100% + 0.9rem);
	width: min(20rem, calc(100vw - 2rem));
	padding: 1.15rem 1.15rem 1.2rem;
	background: #fff;
	color: var(--wp--preset--color--contrast);
	border: 2px solid var(--wp--preset--color--contrast);
	border-top: 6px solid var(--wp--preset--color--accent-1);
	box-shadow: 0 24px 48px -18px rgb(18 20 23 / 0.6);
	animation: bhatko-plan-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.bhatko-plan__panel > * {
	margin: 0;
}

.bhatko-plan__title {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

.bhatko-plan__text {
	margin-top: 0.45rem !important;
	font-size: 0.95rem;
	line-height: 1.45;
	color: var(--wp--preset--color--contrast-2);
}

.bhatko-plan__actions {
	gap: 0.55rem;
	margin-top: 1rem !important;
}

.bhatko-plan__actions .wp-block-button,
.bhatko-plan__actions .wp-block-button__link {
	width: 100%;
}

.bhatko-plan__actions .wp-block-button__link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.8rem 1rem 0.75rem;
	border: 2px solid var(--wp--preset--color--contrast);
	text-align: left;
}

.bhatko-plan__whatsapp .wp-block-button__link {
	background: #25d366;
	color: var(--wp--preset--color--contrast);
}

.bhatko-plan__whatsapp .wp-block-button__link::after {
	content: "";
	order: -1;
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	background: currentColor;
	-webkit-mask: url(assets/images/icon-whatsapp.svg) center / contain no-repeat;
	mask: url(assets/images/icon-whatsapp.svg) center / contain no-repeat;
}

.bhatko-plan__enquiry .wp-block-button__link {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.bhatko-plan__enquiry .wp-block-button__link::after {
	content: "→";
	margin-left: auto;
	color: var(--wp--preset--color--accent-1);
}

@keyframes bhatko-plan-in {
	from {
		opacity: 0;
		translate: 0 0.6rem;
	}
}

/* Small phones: the pill keeps its label but gets a little tighter. */
@media (max-width: 480px) {
	.bhatko-plan > summary {
		font-size: 0.95rem;
	}
}

/* ---------- Cursor: a signal-yellow arrow, and a map pin over anything clickable ---------- */

@media (hover: hover) and (pointer: fine) {
	html {
		cursor: url(assets/images/cursor-arrow.svg) 3 2, auto;
	}

	a,
	button,
	summary,
	label,
	select,
	[role="button"],
	input[type="submit"],
	input[type="checkbox"],
	input[type="radio"],
	.wp-element-button {
		cursor: url(assets/images/cursor-pin.svg) 14 32, pointer;
	}

	input:not([type="submit"], [type="checkbox"], [type="radio"]),
	textarea,
	[contenteditable="true"] {
		cursor: text;
	}
}

/* ---------- Credits ---------- */

.bhatko-credit {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.7rem;
	opacity: 0.8;
}

.bhatko-credit a {
	color: inherit;
}

/* Full-width covers with a custom content position keep the layout width. */
.wp-block-cover.alignfull.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container {
	width: 100%;
}

/* Credit under featured images: core makes links in this block display:block. */
.wp-block-post-featured-image .bhatko-credit {
	margin-top: 0.6rem;
}

.wp-block-post-featured-image .bhatko-credit a {
	display: inline;
	height: auto;
}
