/*
Theme Name:        Voyager FSE
Theme URI:         https://example.com/voyager-fse
Author:            Antigravity
Author URI:        https://example.com
Description:       A premium, zero-bloat WordPress Full Site Editing (FSE) theme for a Personal Travel Website. Built on 100% native Gutenberg block architecture. Features fluid typography, client-adjustable Global Styles, trilingual DE/ES/PT routing architecture, password-protected chronicle portal, and WooCommerce readiness — all license-free.
Requires at least: 6.4
Tested up to:      6.7
Requires PHP:      8.1
Version:           2.0.0
License:           GNU General Public License v2 or later
License URI:       http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       voyager-fse
Tags:              full-site-editing, block-patterns, custom-colors, custom-logo, custom-menu, editor-style, featured-images, translation-ready, travel, portfolio, blog, e-commerce-ready, multilingual
*/

/* ==========================================================================
   VOYAGER FSE — Google Fonts Import
   Loaded here as a bulletproof fallback. wp_enqueue_style() in functions.php
   is the primary loader; this @import fires even if enqueueing is missed
   (e.g. block editor iframe, page builders, or manual template includes).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&display=swap');

/* ==========================================================================
   VOYAGER FSE — Global CSS
   Supplements theme.json token definitions with browser resets, utilities,
   and component-specific overrides that cannot be expressed in theme.json.
   Rev 2: Color tools fully open — clients can modify via Global Styles panel.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Reset & Root Base
   -------------------------------------------------------------------------- */

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

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	padding: 0;
	background-color: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
video {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
	color: var(--wp--preset--color--accent-hover);
}

/* --------------------------------------------------------------------------
   2. Skip Link — Accessibility
   -------------------------------------------------------------------------- */

.skip-link {
	position: absolute;
	top: -100%;
	left: 1rem;
	z-index: 9999;
	padding: 0.5rem 1.25rem;
	background: var(--wp--preset--color--accent);
	color: #fff;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--sm);
	text-decoration: none;
	border-radius: 0 0 8px 8px;
	transition: top 0.2s ease;
}

.skip-link:focus {
	top: 0;
}

/* --------------------------------------------------------------------------
   3. Focus Visible — Accessible Ring
   -------------------------------------------------------------------------- */

:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 3px;
}

/* --------------------------------------------------------------------------
   4. Typography — Headings
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	line-height: 1.2;
	color: var(--wp--preset--color--primary);
	margin-block-start: 0;
	margin-block-end: 0.5em;
}

/* --------------------------------------------------------------------------
   5. Header — Sticky, Shadow on Scroll
   -------------------------------------------------------------------------- */

.wp-block-template-part[data-area="header"] {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--wp--preset--color--surface);
	transition: box-shadow 0.3s ease;
}

/* JS class toggled by functions.php inline script */
.site-header--scrolled {
	box-shadow: 0 2px 20px rgba(28, 43, 58, 0.10);
}

/* --------------------------------------------------------------------------
   6. Trilingual Language Switcher Zone
   Developer Note: Language Switcher Zone — This block is a semantic placeholder
   aligned for Polylang or TranslatePress free-tier widget injection.
   Supports DE (/de/), ES (/es/), PT (/pt/) language routing.
   -------------------------------------------------------------------------- */

.language-switcher-zone {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

/* Polylang language switcher item */
.language-switcher-zone .pll-parent-menu-item > a,
.language-switcher-zone li.lang-item > a,
/* TranslatePress language switcher item */
.language-switcher-zone .trp-language-switcher a,
.language-switcher-zone .trp-ls-shortcode-language a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
	padding: 4px 10px;
	border: 1.5px solid transparent;
	border-radius: 6px;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.language-switcher-zone .pll-parent-menu-item > a:hover,
.language-switcher-zone li.lang-item > a:hover,
.language-switcher-zone .trp-language-switcher a:hover,
.language-switcher-zone .trp-ls-shortcode-language a:hover {
	background-color: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
}

/* Active language highlight */
.language-switcher-zone .lang-item-current > a,
.language-switcher-zone .trp-ls-shortcode-current-language a {
	background-color: var(--wp--preset--color--accent);
	color: #ffffff;
	border-color: var(--wp--preset--color--accent);
}

/* Flag icons (if plugin outputs them) */
.language-switcher-zone img.flag {
	width: 18px;
	height: auto;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   7. Navigation
   -------------------------------------------------------------------------- */

.wp-block-navigation a {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	letter-spacing: 0.02em;
	text-decoration: none;
	transition: color 0.2s ease;
}

.wp-block-navigation a:hover {
	color: var(--wp--preset--color--accent);
}

.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg {
	fill: var(--wp--preset--color--primary);
}

/* Mobile nav panel */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--surface);
}

/* --------------------------------------------------------------------------
   8. Buttons — CTA Enhancement with Breathing Room
   -------------------------------------------------------------------------- */

.wp-block-button__link {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	transition: transform 0.18s ease, box-shadow 0.22s ease, background-color 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(196, 112, 58, 0.38);
}

/* Outline style upgrade */
.wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 2px;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: #ffffff;
	box-shadow: none;
}

/* --------------------------------------------------------------------------
   9. Cover Block
   -------------------------------------------------------------------------- */

.wp-block-cover {
	background-attachment: fixed;
}

@media (max-width: 768px) {
	/* Disable parallax on mobile — performance & iOS compatibility */
	.wp-block-cover {
		background-attachment: scroll;
	}
}

/* --------------------------------------------------------------------------
   10. Image Captions
   -------------------------------------------------------------------------- */

.wp-block-image figcaption {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--xs);
	font-style: italic;
	color: var(--wp--preset--color--muted);
	margin-block-start: 0.5rem;
	text-align: center;
}

/* --------------------------------------------------------------------------
   11. Travel Card — Logbook Grid Cards
   -------------------------------------------------------------------------- */

.travel-card {
	border-radius: 12px;
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	box-shadow: 0 2px 12px rgba(28, 43, 58, 0.08);
	transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.travel-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 16px 40px rgba(28, 43, 58, 0.16);
}

.travel-card .wp-block-image img {
	width: 100%;
	height: 240px;
	object-fit: cover;
	border-radius: 0;
}

/* Trilingual badge on cards */
.travel-card__lang-badge {
	display: inline-flex;
	gap: 4px;
	margin-block-end: var(--wp--preset--spacing--xs);
}

.travel-card__lang-badge span {
	display: inline-block;
	padding: 2px 8px;
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--2xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border-radius: 100px;
}

/* --------------------------------------------------------------------------
   12. Post Category/Tag Pills
   -------------------------------------------------------------------------- */

.wp-block-post-terms a {
	display: inline-block;
	padding: 0.2rem 0.8rem;
	background: var(--wp--preset--color--secondary);
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 100px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-post-terms a:hover {
	background: var(--wp--preset--color--accent);
	color: #ffffff;
}

/* --------------------------------------------------------------------------
   13. Separator
   -------------------------------------------------------------------------- */

.wp-block-separator {
	border-color: rgba(28, 43, 58, 0.12);
}

.wp-block-separator.is-style-wide {
	border-color: var(--wp--preset--color--accent);
	border-top-width: 2px;
	max-width: 48px;
	margin-inline: 0;
}

/* --------------------------------------------------------------------------
   14. Password-Protected Page — Premium Portal Modal
   Developer Note: Password Gateway — Replaces the unstyled WordPress default
   password form with a branded frosted-glass private-portal dashboard UI.
   Selectors target the native .post-password-form class output by WP core.
   -------------------------------------------------------------------------- */

.post-password-required .entry-content,
body.password-protected main {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 70vh;
	padding: var(--wp--preset--spacing--xl) var(--wp--preset--spacing--md);
	background-image: radial-gradient(ellipse at 30% 50%, rgba(196, 112, 58, 0.06) 0%, transparent 60%),
	                  radial-gradient(ellipse at 70% 50%, rgba(28, 43, 58, 0.06) 0%, transparent 60%);
}

.post-password-form {
	position: relative;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(20px) saturate(180%);
	-webkit-backdrop-filter: blur(20px) saturate(180%);
	border: 1px solid rgba(196, 112, 58, 0.15);
	border-radius: 20px;
	padding: clamp(2rem, 5vw, 3.75rem);
	max-width: 480px;
	width: 100%;
	box-shadow: 0 24px 64px rgba(28, 43, 58, 0.16), 0 4px 16px rgba(28, 43, 58, 0.08);
	text-align: center;
}

/* Decorative top accent bar */
.post-password-form::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 64px;
	height: 3px;
	background: linear-gradient(90deg, #C4703A, #E8904A);
	border-radius: 0 0 4px 4px;
}

.post-password-form p {
	margin: 0 0 1.25rem;
	color: var(--wp--preset--color--text);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--md);
	line-height: 1.6;
}

.post-password-form label {
	display: block;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	color: var(--wp--preset--color--primary);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-align: left;
	margin-block-end: 0.5rem;
}

.post-password-form input[type="password"] {
	display: block;
	width: 100%;
	padding: 0.875rem 1.125rem;
	border: 1.5px solid rgba(28, 43, 58, 0.18);
	border-radius: 10px;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--md);
	color: var(--wp--preset--color--primary);
	background: #ffffff;
	outline: none;
	transition: border-color 0.22s ease, box-shadow 0.22s ease;
	margin-block-end: 1.25rem;
}

.post-password-form input[type="password"]::placeholder {
	color: var(--wp--preset--color--muted);
}

.post-password-form input[type="password"]:focus {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px rgba(196, 112, 58, 0.16);
}

.post-password-form input[type="submit"] {
	display: block;
	width: 100%;
	padding: 0.9rem 2rem;
	background: linear-gradient(135deg, #C4703A 0%, #D4803A 100%);
	color: #ffffff;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: opacity 0.18s ease, transform 0.15s ease, box-shadow 0.22s ease;
}

.post-password-form input[type="submit"]:hover {
	opacity: 0.9;
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(196, 112, 58, 0.42);
}

.post-password-form input[type="submit"]:active {
	transform: translateY(0);
}

/* --------------------------------------------------------------------------
   15. WooCommerce Compatibility Stubs
   Developer Note: WooCommerce Readiness — These stubs ensure zero layout
   disruption when WooCommerce is activated later. Full block styles inherit
   from theme.json token mappings. No premium plugins required.
   -------------------------------------------------------------------------- */

.wc-block-grid__product,
.wp-block-woocommerce-handpicked-products {
	--wc-product-card-radius: 12px;
	--wc-product-card-shadow: 0 2px 12px rgba(28, 43, 58, 0.08);
}

.wc-block-grid__product {
	border-radius: var(--wc-product-card-radius);
	overflow: hidden;
	background: var(--wp--preset--color--surface);
	box-shadow: var(--wc-product-card-shadow);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wc-block-grid__product:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 36px rgba(28, 43, 58, 0.14);
}

.wc-block-grid__product-title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--md);
	color: var(--wp--preset--color--primary);
}

.wc-block-grid__product-price {
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: var(--wp--preset--font-size--lg);
}

.wc-block-grid__product-rating .wc-block-grid__product-rating__stars {
	color: #C4703A;
}

.wc-block-components-product-button .wc-block-components-product-button__button {
	background: var(--wp--preset--color--accent);
	color: #ffffff;
	border-radius: 8px;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 0.75rem 1.5rem;
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.wc-block-components-product-button .wc-block-components-product-button__button:hover {
	background-color: var(--wp--preset--color--accent-hover);
	transform: translateY(-1px);
}

/* Cart & Checkout layout tokens */
.wc-block-cart,
.wc-block-checkout {
	--wc-block-max-width: var(--wp--style--global--wide-size);
	font-family: var(--wp--preset--font-family--body);
}

/* --------------------------------------------------------------------------
   16. Print Styles
   -------------------------------------------------------------------------- */

@media print {
	.wp-block-template-part[data-area="header"],
	.wp-block-template-part[data-area="footer"] {
		display: none;
	}

	body {
		font-size: 12pt;
		color: #000;
		background: #fff;
	}

	a {
		text-decoration: underline;
		color: #000;
	}

	.wp-block-cover {
		background-attachment: scroll;
	}
}
