/*
Theme Name: Hally Tours (Production)
Theme URI: https://hallytours.com/
Description: Block child theme of Twenty Twenty-Five for Hally Tours, an Arusha-based safari operator.
Author: Hally Tours
Author URI: https://hallytours.com/
Template: twentytwentyfive
Version: 0.1.0
Requires at least: 6.5
Tested up to: 6.5
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hallytours
Tags: block-theme, safari, tourism, child-theme
*/

/* ----- Global safety net ----- */

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

html, body {
	overflow-x: hidden;
	max-width: 100vw;
}

main.wp-block-group {
	max-width: 100vw;
	overflow-x: hidden;
}

/* Cover blocks shouldn't extend past viewport. */
.wp-site-blocks .wp-block-cover {
	max-width: 100%;
}

/* Mobile hero — tighter padding and type so the headline doesn't crowd the edges. */
@media (max-width: 599px) {
	.hallytours-hero {
		padding-left: 1rem !important;
		padding-right: 1rem !important;
		min-height: 440px !important;
	}
	.hallytours-hero h1 {
		font-size: 1.625rem !important;
		line-height: 1.2 !important;
		overflow-wrap: break-word;
		text-wrap: balance;
	}
	.hallytours-hero p {
		font-size: 1rem !important;
		line-height: 1.55 !important;
		overflow-wrap: break-word;
	}
	.hallytours-hero .wp-block-cover__inner-container {
		max-width: 100%;
		padding-left: 0;
		padding-right: 0;
	}
}

/* ----- Columns: don't break headings mid-word ----- */

.wp-block-column h2,
.wp-block-column h3,
.wp-block-column h4 {
	word-break: keep-all;
	overflow-wrap: normal;
	hyphens: none;
}

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

@media (max-width: 599px) {
	.hallytours-header-cta {
		display: none !important;
	}
}

/* ----- Filter chips (hallytours/tour-filters) ----- */

.hallytours-filters {
	display: grid;
	gap: var(--wp--preset--spacing--small);
	padding: var(--wp--preset--spacing--small);
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 6px;
	background: var(--wp--preset--color--cream);
}

.hallytours-filters__group {
	display: grid;
	gap: 0.5rem;
}

.hallytours-filters__label {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--wp--preset--color--forest);
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.hallytours-filters__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.hallytours-chip {
	display: inline-block;
	padding: 0.375rem 0.875rem;
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 99px;
	font-size: 0.875rem;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	background: var(--wp--preset--color--cream);
	font-weight: 500;
	line-height: 1.2;
}

.hallytours-chip:hover,
.hallytours-chip:focus-visible {
	border-color: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--forest);
}

.hallytours-chip.is-active {
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--cream);
	border-color: var(--wp--preset--color--forest);
}

/* ----- Itinerary accordion (hallytours/tour-itinerary) ----- */

.hallytours-itinerary {
	display: grid;
	gap: 0.75rem;
}

.hallytours-itinerary__day {
	border: 1px solid var(--wp--preset--color--mist);
	border-left: 4px solid var(--wp--preset--color--sunrise);
	border-radius: 4px;
	padding: 1rem 1.25rem;
	background: var(--wp--preset--color--cream);
}

.hallytours-itinerary__summary {
	cursor: pointer;
	list-style: none;
	display: flex;
	gap: 1rem;
	align-items: baseline;
	flex-wrap: wrap;
}

.hallytours-itinerary__summary::-webkit-details-marker { display: none; }

.hallytours-itinerary__summary::after {
	content: '+';
	margin-left: auto;
	color: var(--wp--preset--color--sunrise);
	font-size: 1.5rem;
	line-height: 1;
	font-weight: 700;
}

.hallytours-itinerary__day[open] > .hallytours-itinerary__summary::after {
	content: '–';
}

.hallytours-itinerary__num {
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 700;
	color: var(--wp--preset--color--earth);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

.hallytours-itinerary__title {
	font-family: var(--wp--preset--font-family--merriweather);
	font-size: 1.125rem;
	color: var(--wp--preset--color--forest);
	font-weight: 700;
}

.hallytours-itinerary__body {
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--wp--preset--color--mist);
}

.hallytours-itinerary__facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 0.25rem 1rem;
	margin-top: 0.5rem;
	font-size: 0.9rem;
}

.hallytours-itinerary__facts dt {
	font-weight: 700;
	color: var(--wp--preset--color--earth);
	text-transform: uppercase;
	font-size: 0.7rem;
	letter-spacing: 0.08em;
}

.hallytours-itinerary__facts dd { margin: 0; }

/* ----- Inclusion / exclusion lists (hallytours/tour-list) ----- */

.hallytours-tour-list {
	padding-left: 1.25rem;
	margin: 0;
}

.hallytours-tour-list li {
	margin-bottom: 0.4rem;
}

.hallytours-tour-list--inclusions li::marker {
	color: var(--wp--preset--color--forest);
}

.hallytours-tour-list--exclusions li::marker {
	color: var(--wp--preset--color--earth);
}

.hallytours-tour-list--exclusions {
	list-style-type: '✗  ';
}

.hallytours-tour-list--inclusions {
	list-style-type: '✓  ';
}

/* ----- Sticky tour-single sidebar ----- */

@media (min-width: 900px) {
	.tour-sidebar {
		position: sticky;
		top: 5rem;
	}
}

.hallytours-tour-card-meta__price {
	letter-spacing: -0.02em;
}

/* Meta rows: small icon (SVG via background-image), eyebrow + value stacked. */
.hallytours-meta-row {
	display: grid;
	grid-template-columns: 1.25rem 1fr;
	column-gap: 0.6rem;
	row-gap: 0.05rem;
	align-items: start;
	padding: 0.4rem 0;
	border-bottom: 1px solid color-mix(in srgb, var(--wp--preset--color--mist) 60%, transparent);
}

.hallytours-meta-row:last-child {
	border-bottom: none;
}

.hallytours-meta-row::before {
	content: "";
	width: 1.25rem;
	height: 1.25rem;
	grid-row: span 2;
	margin-top: 0.1rem;
	background-color: var(--wp--preset--color--earth);
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.hallytours-meta-row--duration::before {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><polyline points='12,7 12,12 15,14'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><polyline points='12,7 12,12 15,14'/></svg>");
}

.hallytours-meta-row--group::before {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='8' r='3'/><circle cx='17' cy='9' r='2.5'/><path d='M3 19c0-3 3-5 6-5s6 2 6 5'/><path d='M14 18c0-2 2-3 4-3s3 1 3 3'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='9' cy='8' r='3'/><circle cx='17' cy='9' r='2.5'/><path d='M3 19c0-3 3-5 6-5s6 2 6 5'/><path d='M14 18c0-2 2-3 4-3s3 1 3 3'/></svg>");
}

.hallytours-meta-row--difficulty::before {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='3,20 11,8 14,13 17,9 21,20'/><polyline points='9,14 11,12 13,15'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='3,20 11,8 14,13 17,9 21,20'/><polyline points='9,14 11,12 13,15'/></svg>");
}

.hallytours-meta-row--lodge::before {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11l9-7 9 7'/><path d='M5 10v10h14V10'/><rect x='10' y='14' width='4' height='6'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11l9-7 9 7'/><path d='M5 10v10h14V10'/><rect x='10' y='14' width='4' height='6'/></svg>");
}

.hallytours-meta-row--season::before {
	-webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'/><line x1='12' y1='3' x2='12' y2='5'/><line x1='12' y1='19' x2='12' y2='21'/><line x1='3' y1='12' x2='5' y2='12'/><line x1='19' y1='12' x2='21' y2='12'/><line x1='5.6' y1='5.6' x2='7' y2='7'/><line x1='17' y1='17' x2='18.4' y2='18.4'/><line x1='5.6' y1='18.4' x2='7' y2='17'/><line x1='17' y1='7' x2='18.4' y2='5.6'/></svg>");
	mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'/><line x1='12' y1='3' x2='12' y2='5'/><line x1='12' y1='19' x2='12' y2='21'/><line x1='3' y1='12' x2='5' y2='12'/><line x1='19' y1='12' x2='21' y2='12'/><line x1='5.6' y1='5.6' x2='7' y2='7'/><line x1='17' y1='17' x2='18.4' y2='18.4'/><line x1='5.6' y1='18.4' x2='7' y2='17'/><line x1='17' y1='7' x2='18.4' y2='5.6'/></svg>");
}

/* ----- Tour card hover ----- */

.tour-card {
	transition: border-color 200ms ease-out, transform 200ms ease-out;
}

.tour-card:hover {
	border-color: var(--wp--preset--color--forest) !important;
}

/* ----- Contact Form 7 (theme-styled) ----- */

.hallytours-form { display: grid; gap: 1rem; }

.hallytours-form .hallytours-form__row {
	display: grid;
	gap: 1rem;
}

@media (min-width: 600px) {
	.hallytours-form .hallytours-form__row {
		grid-template-columns: 1fr 1fr;
	}
}

.hallytours-form label {
	display: grid;
	gap: 0.375rem;
	font-weight: 700;
	font-size: 0.875rem;
	color: var(--wp--preset--color--forest);
}

.hallytours-form label .optional {
	font-weight: 400;
	color: var(--wp--preset--color--earth);
	font-size: 0.85em;
}

.hallytours-form input[type="text"],
.hallytours-form input[type="email"],
.hallytours-form input[type="tel"],
.hallytours-form input[type="number"],
.hallytours-form select,
.hallytours-form textarea {
	font: inherit;
	font-family: var(--wp--preset--font-family--roboto);
	font-size: 1rem;
	font-weight: 400;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 4px;
	background: var(--wp--preset--color--cream);
	color: var(--wp--preset--color--ink);
	width: 100%;
}

.hallytours-form textarea {
	resize: vertical;
	min-height: 7em;
}

.hallytours-form input:focus,
.hallytours-form select:focus,
.hallytours-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--sunrise);
	outline-offset: 2px;
	border-color: var(--wp--preset--color--forest);
}

.hallytours-form fieldset {
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 4px;
	padding: 0.75rem 1rem;
	margin: 0;
}

.hallytours-form fieldset legend {
	font-weight: 700;
	color: var(--wp--preset--color--forest);
	padding: 0 0.5rem;
	font-size: 0.875rem;
}

.hallytours-form .wpcf7-list-item {
	display: inline-block;
	margin: 0.25rem 1rem 0.25rem 0;
}

.hallytours-form .wpcf7-list-item-label {
	font-weight: 400;
	color: var(--wp--preset--color--ink);
	margin-left: 0.25rem;
}

.hallytours-form hr {
	border: none;
	border-top: 1px solid var(--wp--preset--color--mist);
	margin: 0.5rem 0;
}

.hallytours-form .hallytours-form__privacy {
	font-size: 0.85rem;
	color: var(--wp--preset--color--earth);
	margin: 0;
}

.hallytours-form .wpcf7-submit,
.hallytours-form input[type="submit"].hallytours-submit {
	display: inline-block;
	padding: 0.875rem 1.5rem;
	background: var(--wp--preset--color--sunrise);
	color: var(--wp--preset--color--ink);
	border: 2px solid transparent;
	border-radius: 4px;
	font-family: var(--wp--preset--font-family--roboto);
	font-weight: 700;
	font-size: 1rem;
	cursor: pointer;
	width: auto;
	transition: background-color 200ms ease-out, color 200ms ease-out;
}

.hallytours-form .wpcf7-submit:hover,
.hallytours-form input[type="submit"].hallytours-submit:hover {
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--cream);
}

.hallytours-form .wpcf7-not-valid-tip {
	color: #b3261e;
	font-size: 0.85rem;
	font-weight: 400;
	margin-top: 0.25rem;
}

.hallytours-form .wpcf7-not-valid {
	border-color: #b3261e;
}

.wpcf7-response-output {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	border-radius: 4px;
	font-size: 0.95rem;
	font-family: var(--wp--preset--font-family--roboto);
}

.wpcf7 form.sent .wpcf7-response-output {
	border-color: var(--wp--preset--color--forest);
	background: rgba(26, 77, 46, 0.08);
	color: var(--wp--preset--color--forest);
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
	border-color: #b3261e;
	background: rgba(179, 38, 30, 0.08);
	color: #b3261e;
}

/* ----- Hero placeholder pattern (used until a featured image is set) ----- */

.hero-pattern {
	background-color: var(--wp--preset--color--forest);
	background-image:
		linear-gradient( rgba(26, 77, 46, 0.55), rgba(26, 77, 46, 0.85) ),
		repeating-linear-gradient( 45deg, var(--wp--preset--color--mist) 0 12px, #c5c1b1 12px 24px );
}

.hallytours-hero {
	color: var(--wp--preset--color--cream);
}

/* ----- Tour hero contrast fix -----
   The tour hero is a wp:cover over a featured photo with a forest overlay.
   Cream text gets washed out on high-key photos (snowy mountains, bright sky).
   We add a bottom-anchored gradient on top of the existing dim layer so the
   title/eyebrow read cleanly without losing the photo at the top, and a soft
   text-shadow as belt-and-braces for any unusually bright photo. */
.hallytours-tour-hero {
	position: relative;
}
.hallytours-tour-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.45) 0%,
		rgba(0, 0, 0, 0.20) 45%,
		rgba(0, 0, 0, 0) 75%
	);
	pointer-events: none;
	z-index: 1;
}
.hallytours-tour-hero > .wp-block-cover__inner-container {
	position: relative;
	z-index: 2;
}
.hallytours-tour-hero h1,
.hallytours-tour-hero .wp-block-post-title,
.hallytours-tour-hero .wp-block-post-terms,
.hallytours-tour-hero p {
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

/* ----- Link contrast on dark-background sections -----
   The default link color is `earth` (#814c27) which gives only ~1.3:1 contrast
   on `forest` (#1a4d2e) — fails WCAG AA. Inside dark-bg blocks (footer, the
   single-tour enquiry strip, the 404 hero) use cream with an underline so links
   are distinguishable from same-color headings. */
/* `.wp-block-navigation__responsive-container` carries `has-forest-background-color`
   on every page render, but the forest bg is only painted when the mobile overlay
   is open. Excluding it here prevents desktop menu links going cream-on-cream. */
.has-forest-background-color:not(.wp-block-navigation__responsive-container) a:not(.wp-block-button__link):not(.wp-block-social-link-anchor),
.has-ink-background-color a:not(.wp-block-button__link):not(.wp-block-social-link-anchor),
.hallytours-hero a:not(.wp-block-button__link),
.hallytours-tour-hero a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--cream);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	transition: color 0.15s ease;
}
.has-forest-background-color:not(.wp-block-navigation__responsive-container) a:not(.wp-block-button__link):not(.wp-block-social-link-anchor):hover,
.has-forest-background-color:not(.wp-block-navigation__responsive-container) a:not(.wp-block-button__link):not(.wp-block-social-link-anchor):focus,
.has-ink-background-color a:not(.wp-block-button__link):not(.wp-block-social-link-anchor):hover,
.has-ink-background-color a:not(.wp-block-button__link):not(.wp-block-social-link-anchor):focus,
.hallytours-hero a:not(.wp-block-button__link):hover,
.hallytours-hero a:not(.wp-block-button__link):focus,
.hallytours-tour-hero a:not(.wp-block-button__link):hover,
.hallytours-tour-hero a:not(.wp-block-button__link):focus {
	color: var(--wp--preset--color--sun);
}
/* When the mobile menu overlay IS open, the forest bg is actually showing —
   then we DO want cream link text. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--cream);
}
/* The breadcrumb in the tour hero uses sun color via inline class — keep that
   distinct yellow accent there rather than overriding to cream. */
.hallytours-tour-hero .has-sun-color a,
.hallytours-tour-hero .has-sun-color a:visited {
	color: var(--wp--preset--color--sun);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
/* No underlines on nav links — affordance comes from layout, not text-decoration. */
.wp-block-navigation a {
	text-decoration: none;
}
