/*
Theme Name: The Watchtower Child
Theme URI: https://thewatchtower.com.ar
Description: Child theme for The Watchtower store. Design tokens live in theme.json (colors, fonts, sizes, spacing); this file holds what theme.json cannot express. Parent: Twenty Twenty-Four. Design source: freelance-web-os/clients/the-watchtower/design-direction.md.
Author: Gonzalo Murua
Template: twentytwentyfour
Version: 0.8.2
Text Domain: the-watchtower
*/

/* ------------------------------------------------------------------
   1. Parent palette aliases
   Twenty Twenty-Four templates and patterns reference its own color
   slugs. Map them to the five approved tokens so nothing falls back
   to an unapproved color.
   ------------------------------------------------------------------ */
:root {
	--wp--preset--color--base: var(--wp--preset--color--cal);
	--wp--preset--color--base-2: var(--wp--preset--color--blanco);
	--wp--preset--color--contrast: var(--wp--preset--color--noche);
	--wp--preset--color--contrast-2: var(--wp--preset--color--piedra);
	--wp--preset--color--contrast-3: var(--wp--preset--color--piedra);
	--wp--preset--color--accent: var(--wp--preset--color--noche);
	--wp--preset--color--accent-2: var(--wp--preset--color--piedra);
	--wp--preset--color--accent-3: var(--wp--preset--color--noche);
	--wp--preset--color--accent-4: var(--wp--preset--color--piedra);
	--wp--preset--color--accent-5: var(--wp--preset--color--cal);
	--wp--preset--color--accent-6: var(--wp--preset--color--piedra);

	/* R1 hairline: the only border style. noche at 15% on light surfaces, piedra on dark ones. */
	--tw-hairline: 1px solid color-mix(in srgb, var(--wp--preset--color--noche) 15%, transparent);
}
.has-noche-background-color,
.has-piedra-background-color {
	--tw-hairline: 1px solid var(--wp--preset--color--piedra);
}

/* ------------------------------------------------------------------
   2. Dark surfaces
   Text and links on noche or piedra are white. Focus on dark is fuego
   (5.83:1 on noche), on light it is noche.
   ------------------------------------------------------------------ */
.has-noche-background-color,
.has-piedra-background-color {
	color: var(--wp--preset--color--blanco);
}
.has-noche-background-color :where(h1, h2, h3, h4, h5, h6),
.has-piedra-background-color :where(h1, h2, h3, h4, h5, h6),
.has-noche-background-color a:where(:not(.wp-element-button)),
.has-piedra-background-color a:where(:not(.wp-element-button)) {
	color: var(--wp--preset--color--blanco);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--noche);
	outline-offset: 2px;
}
:where(.has-noche-background-color, .has-piedra-background-color) :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline-color: var(--wp--preset--color--fuego);
}

/* Outline buttons on dark surfaces stay white; hover fills with white. */
:where(.has-noche-background-color, .has-piedra-background-color) .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--blanco);
}
:where(.has-noche-background-color, .has-piedra-background-color) .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--blanco);
	color: var(--wp--preset--color--noche);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--noche);
	border-color: var(--wp--preset--color--noche);
	color: var(--wp--preset--color--blanco);
}

/* ------------------------------------------------------------------
   3. Header and footer
   ------------------------------------------------------------------ */
.tw-logo {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}
.tw-logo :is(img, svg) {
	display: block;
	width: 180px;
	height: auto;
}
@media (max-width: 599px) {
	.tw-logo :is(img, svg) { width: 140px; }
	/* Logo + menu + account + cart must fit 360 px. */
	.tw-header .wp-block-group.is-nowrap { gap: 4px; }
}
.tw-header .wp-block-navigation a {
	text-decoration: none;
}
.tw-header .wp-block-navigation a:hover {
	text-decoration: underline;
}
.tw-header :where(.wc-block-mini-cart__button, .wc-block-customer-account a, .wp-block-navigation__responsive-container-open) {
	min-width: 44px;
	min-height: 44px;
	color: var(--wp--preset--color--blanco);
}
/* Cart count badge: white on noche, not amber (amber is reserved for the primary button). */
.tw-header .wc-block-mini-cart__badge {
	background: var(--wp--preset--color--blanco);
	color: var(--wp--preset--color--noche);
	border-color: var(--wp--preset--color--noche);
}

.tw-footer__symbol {
	display: block;
	width: 56px;
	height: 56px;
	margin-bottom: var(--wp--preset--spacing--20);
}
.tw-footer__links {
	list-style: none;
	padding-left: 0;
}
.tw-footer__links li + li {
	margin-top: var(--wp--preset--spacing--10);
}
.tw-footer__links a {
	display: inline-block;
	padding: 4px 0;
}

/* ------------------------------------------------------------------
   4. Base elements for every page (forms, tables, notices)
   ------------------------------------------------------------------ */
input:where([type="text"], [type="email"], [type="tel"], [type="number"], [type="password"], [type="search"]),
select,
textarea {
	border: 1px solid var(--wp--preset--color--piedra);
	border-radius: 2px;
	background: var(--wp--preset--color--blanco);
	color: var(--wp--preset--color--noche);
	font: inherit;
	min-height: 44px;
	padding: 8px 12px;
	line-height: 1.4;
}
select {
	height: auto;
	padding-right: 36px;
}

table {
	border-collapse: collapse;
	width: 100%;
}
:where(th, td) {
	border-bottom: var(--tw-hairline);
	padding: 8px 12px;
	text-align: left;
}

.wc-block-components-notice-banner,
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	border-radius: 2px;
}

/* Prices use the heading face (design-direction §4). */
.wc-block-components-product-price,
.wp-block-woocommerce-product-price,
.woocommerce-Price-amount {
	font-family: var(--wp--preset--font-family--heading);
}

/* ------------------------------------------------------------------
   5. Motion
   ------------------------------------------------------------------ */
a,
.wp-element-button,
.wp-block-button__link {
	transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
/* R3: the door of the seal lights once per visit (piedra to fuego, 600 ms).
   "tw-door-seen" is set in <head> from sessionStorage on later pages. */
@keyframes tw-door-light {
	from { fill: var(--wp--preset--color--piedra); }
	to { fill: var(--wp--preset--color--fuego); }
}
.tw-logo .tw-door { animation: tw-door-light 600ms ease-out 300ms both; }
.tw-door-seen .tw-logo .tw-door { animation: none; }

/* R2: section content fades in and rises 8 px, once. Only hidden once the footer
   script adds "tw-reveal-ready"; the hero is never hidden. */
.tw-reveal-ready .tw-section:not(.tw-hero) > :not(.screen-reader-text) {
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 200ms ease-out, transform 200ms ease-out;
}
.tw-reveal-ready .tw-section:not(.tw-hero) > .is-revealed {
	opacity: 1;
	transform: none;
}

/* R4: photos grow slightly on hover, pointer devices only. */
@media (hover: hover) and (pointer: fine) {
	:where(.woocommerce-product-gallery__image, .wc-block-components-product-image, .tw-photo-frame) { overflow: hidden; }
	:where(.woocommerce-product-gallery__image, .wc-block-components-product-image, .tw-photo-frame) img {
		transition: transform 250ms ease-out;
	}
	:where(.woocommerce-product-gallery__image, .wc-block-components-product-image, .tw-photo-frame):hover img {
		transform: scale(1.03);
	}
}

/* R5: details open smoothly where the browser can animate to "auto" height
   (Chromium today). Elsewhere they open at once, as before. */
@supports (interpolate-size: allow-keywords) {
	:root { interpolate-size: allow-keywords; }
	.wp-block-details::details-content {
		height: 0;
		opacity: 0;
		overflow: clip;
		transition: height 200ms ease-out, opacity 200ms ease-out, content-visibility 200ms allow-discrete;
	}
	.wp-block-details[open]::details-content {
		height: auto;
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tw-reveal-ready .tw-section:not(.tw-hero) > * { opacity: 1; transform: none; }
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
	}
}

/* ------------------------------------------------------------------
   6. Home sections (design-direction §5)
   ------------------------------------------------------------------ */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.tw-home > * { margin-block-start: 0; }
.tw-section {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
}
@media (min-width: 782px) {
	.tw-section {
		padding-top: var(--wp--preset--spacing--70);
		padding-bottom: var(--wp--preset--spacing--70);
	}
}
.tw-section > h2 { margin-bottom: var(--wp--preset--spacing--40); }

.tw-hero__price {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--large);
	margin: var(--wp--preset--spacing--30) 0;
}
.tw-hero__price del { opacity: .7; margin-right: 8px; }
.tw-hero__price ins { text-decoration: none; }

/* Photo placeholders: replaced by the real photos (due 2026-12-18). */
.tw-photo {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 4 / 3;
	padding: var(--wp--preset--spacing--30);
	border: 1px dashed currentColor;
	border-radius: 2px;
	text-align: center;
	font-size: var(--wp--preset--font-size--small);
	background: color-mix(in srgb, var(--wp--preset--color--piedra) 12%, transparent);
	margin-bottom: var(--wp--preset--spacing--30);
}
.tw-photo--arch {
	aspect-ratio: 4 / 5;
	max-width: 440px;
	margin-inline: auto;
	border-radius: 999px 999px 2px 2px;
	background: var(--wp--preset--color--piedra);
}
.tw-photo span { max-width: 22ch; opacity: .85; }

.tw-callout {
	position: absolute;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	margin: -16px 0 0 -16px;
	border-radius: 50%;
	background: var(--wp--preset--color--noche);
	color: var(--wp--preset--color--blanco);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	font-weight: 400;
}

.tw-numbered {
	list-style: none;
	counter-reset: tw;
	padding-left: 0;
}
.tw-numbered li {
	counter-increment: tw;
	position: relative;
	padding-left: 48px;
	min-height: 32px;
}
.tw-numbered li + li { margin-top: var(--wp--preset--spacing--20); }
.tw-numbered li::before {
	content: counter(tw);
	position: absolute;
	left: 0;
	top: 0;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--wp--preset--color--noche);
	color: var(--wp--preset--color--blanco);
	font-family: var(--wp--preset--font-family--heading);
}

.tw-colors {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: var(--wp--preset--spacing--30);
	list-style: none;
	padding: 0;
	margin: 0 0 var(--wp--preset--spacing--30);
}
.tw-colors__item {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--blanco);
	border: var(--tw-hairline);
	border-radius: 2px;
}
.tw-swatch {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 2px;
	border: 1px solid var(--wp--preset--color--piedra);
}
.tw-swatch--negro { background: #1a1a1a; }
.tw-swatch--blanco { background: #ffffff; }
.tw-swatch--pedido { background: repeating-linear-gradient(45deg, #ffffff 0 6px, #d9d6d2 6px 12px); }

.tw-trust {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--wp--preset--spacing--40);
	list-style: none;
	padding: 0;
	margin: 0;
}
.tw-trust strong {
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 400;
	font-size: var(--wp--preset--font-size--large);
	margin-bottom: var(--wp--preset--spacing--10);
}

.tw-faq {
	border-bottom: var(--tw-hairline);
	padding: var(--wp--preset--spacing--20) 0;
}
.tw-faq summary {
	cursor: pointer;
	min-height: 44px;
	display: flex;
	align-items: center;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--noche);
}
.tw-faq p { margin-top: var(--wp--preset--spacing--10); }

.tw-cta h2 { margin-bottom: var(--wp--preset--spacing--40); }

/* "Del taller" (decision D1) */
.tw-lead { max-width: 60ch; margin-bottom: var(--wp--preset--spacing--40); }
.tw-workshop .tw-photo { background: var(--wp--preset--color--piedra); }

/* The tower's world (decision D5): line drawing of hills, tower and pines.
   Decorative; a quiet tone of the text color. Never behind text. */
.tw-hills {
	/* A quiet tone of whatever text color surrounds it (white on noche, noche on cal). */
	color: color-mix(in srgb, currentColor 30%, transparent);
	margin-bottom: var(--wp--preset--spacing--50);
}
.tw-hills svg {
	display: block;
	width: 100%;
	height: clamp(64px, 10vw, 120px);
}

/* D2 accent line (decision 2026-11-23): fuego, 2 px, on dark surfaces only
   (5.83:1 on noche). Under the current menu item and under section headings
   on noche. Never on light backgrounds. */
.tw-header .wp-block-navigation :is(.current-menu-item, [aria-current="page"]) > a,
.tw-header .wp-block-navigation a[aria-current="page"] {
	text-decoration: none;
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--fuego);
}
.has-noche-background-color.tw-section:not(.tw-hero) > h2::after {
	content: "";
	display: block;
	width: 32px;
	height: 2px;
	margin-top: var(--wp--preset--spacing--20);
	background: var(--wp--preset--color--fuego);
}

/* Page "La torre": the hills sit under the intro text. */
.tw-page-intro .tw-hills {
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: 0;
}

/* 0.5.1: no root gap between header, full-width pages and footer (a 24 px
   strip of cal showed above the first section and below the last one). */
.wp-site-blocks > main:is(.tw-home, .tw-product, .tw-shop),
.wp-site-blocks > main:is(.tw-home, .tw-product, .tw-shop) + *,
.wp-site-blocks > :has(> main.tw-product),
.wp-site-blocks > :has(> main.tw-product) + * {
	margin-block-start: 0;
}
/* A heading that follows text inside a section needs air above it. */
.tw-section > p + h2 { margin-top: var(--wp--preset--spacing--60); }
/* Lead text lines up with the section heading in wide sections. */
/* Wide sections use contentSize 1200px; align the lead with the heading. */
.tw-section .tw-lead { margin-left: max(0px, calc((100% - 1200px) / 2)) !important; }

/* ------------------------------------------------------------------
   7. Product page (refinement R6, REQ-007, decision D3)
   ------------------------------------------------------------------ */
.tw-product > * { margin-block-start: 0; }
.tw-product__main { padding-top: var(--wp--preset--spacing--40); }
@media (min-width: 782px) {
	.tw-product__main { padding-top: var(--wp--preset--spacing--60); }
}
.tw-product__summary > * + * { margin-top: var(--wp--preset--spacing--30); }
.tw-product__summary h1 { margin-bottom: 0; }

.tw-facts {
	margin-top: var(--wp--preset--spacing--10) !important;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--piedra);
}

/* Gallery: plain frame until the photos arrive; no zoom icon clutter. */
.tw-product .woocommerce-product-gallery__image--placeholder img { background: var(--wp--preset--color--cal); }
.tw-product .woocommerce-product-gallery__image,
.tw-product .woocommerce-product-gallery__image img { border-radius: 2px; }

/* Color rows replace the select (assets/js/product.js). */
.tw-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	min-width: 0 !important;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}
.tw-color-rows {
	border: 0;
	padding: 0;
	margin: 0 0 var(--wp--preset--spacing--30);
	display: grid;
	gap: var(--wp--preset--spacing--10);
}
.tw-color-rows legend {
	font-family: var(--wp--preset--font-family--heading);
	margin-bottom: var(--wp--preset--spacing--10);
	padding: 0;
}
.tw-color-row {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
	min-height: 56px;
	padding: 8px var(--wp--preset--spacing--20);
	background: var(--wp--preset--color--blanco);
	border: var(--tw-hairline);
	border-radius: 2px;
	cursor: pointer;
}
.tw-color-row input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}
.tw-color-row .tw-swatch { width: 32px; height: 32px; }
.tw-color-row__text { display: grid; line-height: 1.3; }
.tw-color-row__text small { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--piedra); }
.tw-color-row:has(input:checked) {
	border-color: var(--wp--preset--color--noche);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--noche);
}
.tw-color-row:has(input:focus-visible) {
	outline: 2px solid var(--wp--preset--color--noche);
	outline-offset: 2px;
}

/* Quantity and buy button on one row, button fills the rest. */
.tw-buy .woocommerce-variation-add-to-cart,
.tw-buy form.cart:not(.variations_form) {
	display: flex;
	gap: var(--wp--preset--spacing--20);
	align-items: stretch;
}
.tw-buy .quantity input { width: 64px; min-height: 48px; text-align: center; }
.tw-buy .single_add_to_cart_button { flex: 1; min-height: 48px; }
.tw-buy .woocommerce-variation-price,
.tw-buy .reset_variations { display: none !important; }
.tw-buy .woocommerce-variation-availability { font-size: var(--wp--preset--font-size--small); }

.tw-buy-notes {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
}
.tw-buy-notes li { padding: var(--wp--preset--spacing--10) 0; border-top: var(--tw-hairline); }

/* Phone sticky buy bar. D3: soft shadow, this element only. */
.tw-sticky-buy {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20);
	padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
	background: var(--wp--preset--color--blanco);
	box-shadow: 0 -4px 12px color-mix(in srgb, var(--wp--preset--color--noche) 15%, transparent);
}
.tw-sticky-buy[hidden] { display: none; }
.tw-sticky-buy__info { display: grid; line-height: 1.25; min-width: 0; }
.tw-sticky-buy__name { font-size: var(--wp--preset--font-size--small); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-sticky-buy__price { font-family: var(--wp--preset--font-family--heading); }
.tw-sticky-buy__price del { opacity: .7; margin-right: 4px; font-size: .85em; }
.tw-sticky-buy__price ins { text-decoration: none; }
.tw-sticky-buy__button {
	flex: none;
	min-height: 44px;
	padding: 10px 24px;
	border: 0;
	border-radius: 2px;
	background: var(--wp--preset--color--fuego);
	color: var(--wp--preset--color--noche);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	cursor: pointer;
}
body.tw-has-sticky-buy .wp-site-blocks { padding-bottom: 72px; }
@media (min-width: 782px) {
	.tw-sticky-buy { display: none !important; }
}
/* On the product page the "what is included" line already sits under the
   buy button; do not repeat it under "Qué guarda". */
.tw-product .tw-numbered + p { display: none; }

/* ------------------------------------------------------------------
   8. Cart, checkout and 404 (Sprint 1)
   ------------------------------------------------------------------ */
.tw-shop > .wp-block-post-title {
	max-width: 1200px !important;
	width: 100%;
	margin-bottom: var(--wp--preset--spacing--40);
}

/* Block cart and checkout: corners and lines from the tokens. */
:where(.wc-block-cart, .wc-block-checkout, .wc-block-components-sidebar-layout) :is(
	input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea,
	.wc-blocks-components-select__select,
	.wc-block-components-quantity-selector,
	.wc-block-components-radio-control-accordion-option,
	.wc-block-components-radio-control__option,
	.wc-block-checkout__shipping-method-option,
	.wc-block-components-order-summary,
	.wc-block-components-checkout-order-summary__content,
	.wc-block-components-button
) {
	border-radius: 2px !important;
}
.wc-block-components-checkout-step__title,
.wc-block-cart__totals-title,
.wc-block-components-title {
	font-family: var(--wp--preset--font-family--heading) !important;
	text-transform: none !important;
}

/* Empty cart (content of the Cart page). */
.tw-empty-cart {
	text-align: center;
	padding: var(--wp--preset--spacing--50) 0;
}
.tw-empty-cart .tw-hills { max-width: 640px; margin: var(--wp--preset--spacing--40) auto 0; }

/* Checkout header: lockup and the way back to the cart. */
.tw-back-to-cart {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	font-size: var(--wp--preset--font-size--small);
}

/* 404 */
.tw-404 { text-align: center; }
.tw-404__door {
	display: block;
	width: 96px;
	height: auto;
	margin: 0 auto var(--wp--preset--spacing--40);
	color: color-mix(in srgb, var(--wp--preset--color--blanco) 60%, transparent);
}
