/*
Theme Name: Trapani Coast to Coast
Theme URI: https://trapanicoasttocoast.it
Author: Trapani Coast to Coast
Description: Tema di guida turistica per la provincia di Trapani. Palette "Sicilian Sun", layout storytelling, pensato per il plugin Trapani Coast to Coast – Core.
Version: 1.0.1
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tpc2c-theme
Tags: blog, travel, custom-menu, translation-ready, block-styles, wide-blocks
*/

:root {
	--tpc-radius: 0.75rem;
	--tpc-font-body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--tpc-font-display: "Sora", ui-sans-serif, system-ui, sans-serif;

	--tpc-background: oklch(0.99 0 0);
	--tpc-foreground: oklch(0.2 0.05 240);
	--tpc-card: oklch(1 0 0);
	--tpc-primary: oklch(0.45 0.1 240);
	--tpc-primary-foreground: oklch(0.99 0 0);
	--tpc-secondary: oklch(0.95 0.03 95);
	--tpc-muted: oklch(0.95 0.01 240);
	--tpc-muted-foreground: oklch(0.5 0.05 240);
	--tpc-accent: oklch(0.85 0.18 95);
	--tpc-accent-foreground: oklch(0.2 0.05 240);
	--tpc-border: oklch(0.88 0.03 240);
	--tpc-sun: oklch(0.78 0.17 60);
	--tpc-sea: oklch(0.6 0.11 220);
	--tpc-sand: oklch(0.92 0.05 85);

	--tpc-shadow: 0 1px 2px oklch(0.2 0.05 240 / 0.06), 0 12px 32px oklch(0.2 0.05 240 / 0.08);
	--tpc-shadow-lg: 0 24px 60px oklch(0.2 0.05 240 / 0.16);
	--tpc-container: 1180px;
}

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

body {
	margin: 0;
	background: var(--tpc-background);
	color: var(--tpc-foreground);
	font-family: var(--tpc-font-body);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: var(--tpc-font-display);
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 0.5em;
	text-wrap: balance;
}

h1 { font-size: clamp( 2.2rem, 5vw, 3.6rem ); }
h2 { font-size: clamp( 1.7rem, 3.4vw, 2.5rem ); }
h3 { font-size: 1.25rem; }

a {
	color: var(--tpc-primary);
	text-underline-offset: 3px;
}

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

.tpc-container {
	width: min( var(--tpc-container), calc( 100% - 2.5rem ) );
	margin-inline: auto;
}

.tpc-section { padding-block: clamp( 2.5rem, 6vw, 4.5rem ); }
.tpc-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.18em;
	font-size: 0.72rem;
	font-weight: 700;
	color: var(--tpc-sea);
	margin: 0 0 0.6rem;
}
.tpc-lead { font-size: 1.15rem; color: var(--tpc-muted-foreground); max-width: 62ch; }
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect( 1px, 1px, 1px, 1px );
	white-space: nowrap;
}

/* Header */
.tpc-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background: oklch( 1 0 0 / 0.88 );
	backdrop-filter: blur( 12px );
	border-bottom: 1px solid var(--tpc-border);
}
.tpc-header-inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 68px;
}
.tpc-brand {
	font-family: var(--tpc-font-display);
	font-weight: 700;
	font-size: 1.05rem;
	text-decoration: none;
	color: var(--tpc-foreground);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	white-space: nowrap;
}
.tpc-brand span { color: var(--tpc-sun); }
.tpc-nav { margin-left: auto; }
.tpc-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.tpc-nav a {
	text-decoration: none;
	color: var(--tpc-muted-foreground);
	font-size: 0.92rem;
	font-weight: 600;
	white-space: nowrap;
	padding: 0.35rem 0;
}
.tpc-nav a:hover,
.tpc-nav .current-menu-item > a { color: var(--tpc-foreground); }
.tpc-nav-toggle {
	display: none;
	margin-left: auto;
	background: none;
	border: 1px solid var(--tpc-border);
	border-radius: var(--tpc-radius);
	padding: 0.45rem 0.6rem;
	cursor: pointer;
}

@media ( max-width: 1100px ) {
	.tpc-nav-toggle { display: block; }
	.tpc-nav {
		display: none;
		width: 100%;
		order: 3;
		padding-bottom: 1rem;
	}
	.tpc-nav.is-open { display: block; }
	.tpc-nav ul { flex-direction: column; }
	.tpc-header-inner { flex-wrap: wrap; }
}
/* ============================================
   MENU A TENDINA (sottomenu)
   Incollare subito dopo il blocco:
   @media ( max-width: 1100px ) { ... } del .tpc-nav
   e prima del commento "/* Hero */" in style.css
   ============================================ */

/* Il contenitore <li> di una voce con sottomenu deve poter
   posizionare la tendina rispetto a sé */
.tpc-nav .menu-item-has-children {
	position: relative;
}

/* Frecetta accanto alle voci che hanno un sottomenu */
.tpc-nav .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	width: 0.4em;
	height: 0.4em;
	margin-left: 0.35em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	opacity: 0.6;
}

/* La tendina vera e propria: nascosta di default */
.tpc-nav .sub-menu {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0.5rem;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: var(--tpc-card);
	border: 1px solid var(--tpc-border);
	border-radius: var(--tpc-radius);
	box-shadow: var(--tpc-shadow);
	z-index: 20;
}

.tpc-nav .sub-menu li {
	width: 100%;
}

.tpc-nav .sub-menu a {
	display: block;
	padding: 0.5rem 0.6rem;
	border-radius: calc(var(--tpc-radius) - 0.3rem);
	white-space: nowrap;
}

.tpc-nav .sub-menu a:hover {
	background: var(--tpc-muted);
	color: var(--tpc-foreground);
}

/* Apertura al passaggio del mouse e da tastiera (accessibile) */
.tpc-nav .menu-item-has-children:hover > .sub-menu,
.tpc-nav .menu-item-has-children:focus-within > .sub-menu {
	display: block;
}

/* Da mobile in giù (sotto i 1100px, come il resto del menu)
   la tendina non serve: il sottomenu resta semplicemente
   visibile e rientrato sotto la voce padre, perché tutto il
   menu è già nascosto dietro al pulsante "Menu" */
@media ( max-width: 1100px ) {
	.tpc-nav .sub-menu {
		display: block;
		position: static;
		box-shadow: none;
		border: none;
		padding-left: 1rem;
		margin-top: 0.25rem;
	}
	.tpc-nav .menu-item-has-children > a::after {
		display: none;
	}
}


/* Hero */
.tpc-hero {
	position: relative;
	color: oklch( 0.99 0 0 );
	padding-block: clamp( 4rem, 12vw, 8rem );
	background: linear-gradient( 140deg, var(--tpc-primary), var(--tpc-sea) );
	overflow: hidden;
}
.tpc-hero--compact { padding-block: clamp( 2.5rem, 7vw, 4.5rem ); }
.tpc-hero img.tpc-hero-bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.42;
}
.tpc-hero .tpc-container { position: relative; }
.tpc-hero .tpc-eyebrow { color: var(--tpc-accent); }
.tpc-hero .tpc-lead { color: oklch( 0.99 0 0 / 0.9 ); }

/* Buttons and chips */
.tpc-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	border: 1px solid var(--tpc-border);
	background: var(--tpc-card);
	color: var(--tpc-foreground);
	padding: 0.6rem 1.1rem;
	border-radius: 999px;
	font: inherit;
	font-weight: 600;
	font-size: 0.92rem;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tpc-btn:hover { transform: translateY( -1px ); box-shadow: var(--tpc-shadow); }
.tpc-btn--primary {
	background: var(--tpc-sun);
	border-color: transparent;
	color: oklch( 0.22 0.05 60 );
}
.tpc-btn--outline { background: transparent; }

.tpc-chiprow, .tpc-tags, .tpc-map-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-block: 1rem;
}
.tpc-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	border: 1px solid var(--tpc-border);
	background: var(--tpc-card);
	border-radius: 999px;
	padding: 0.35rem 0.85rem;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--tpc-muted-foreground);
	text-decoration: none;
	cursor: pointer;
}
.tpc-chip.is-active {
	background: var(--tpc-foreground);
	border-color: var(--tpc-foreground);
	color: oklch( 0.99 0 0 );
}
.tpc-dot { width: 0.6rem; height: 0.6rem; border-radius: 999px; display: inline-block; }
.tpc-badge {
	display: inline-block;
	background: var(--tpc-sand);
	color: var(--tpc-accent-foreground);
	border-radius: 999px;
	padding: 0.2rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Cards */
.tpc-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 300px, 1fr ) );
	gap: 1.5rem;
}
.tpc-card {
	display: flex;
	flex-direction: column;
	background: var(--tpc-card);
	border: 1px solid var(--tpc-border);
	border-radius: calc( var(--tpc-radius) + 8px );
	overflow: hidden;
	box-shadow: var(--tpc-shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tpc-card:hover { transform: translateY( -3px ); box-shadow: var(--tpc-shadow-lg); }
.tpc-card-media img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.tpc-card-head {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	padding: 1.1rem 1.25rem 0;
}
.tpc-card-title { margin: 0; font-size: 1.2rem; flex: 1; }
.tpc-card-title a { color: inherit; text-decoration: none; }
.tpc-card-icon { color: var(--tpc-sea); }
.tpc-icon { width: 1.4rem; height: 1.4rem; }
.tpc-card-body { padding: 0.6rem 1.25rem 1.4rem; display: flex; flex-direction: column; gap: 0.75rem; }
.tpc-card-tagline { margin: 0; color: var(--tpc-sun); font-weight: 600; font-size: 0.95rem; }
.tpc-card-text { margin: 0; color: var(--tpc-muted-foreground); }
.tpc-card-list { margin: 0; padding-left: 1.1rem; color: var(--tpc-muted-foreground); font-size: 0.92rem; }
.tpc-card-meta { margin: 0; display: grid; gap: 0.35rem; font-size: 0.9rem; }
.tpc-card-meta div { display: flex; gap: 0.4rem; }
.tpc-card-meta dt { font-weight: 700; margin: 0; }
.tpc-card-meta dd { margin: 0; color: var(--tpc-muted-foreground); }
.tpc-card-more { font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.tpc-card-more::after { content: " →"; }
.tpc-note {
	margin: 0;
	background: var(--tpc-secondary);
	border-radius: var(--tpc-radius);
	padding: 0.7rem 0.9rem;
	font-size: 0.9rem;
}

/* Card variants */
.tpc-card--beach .tpc-card-icon { color: var(--tpc-sea); }
.tpc-card--dish .tpc-card-icon { color: oklch( 0.6 0.16 30 ); }
.tpc-card--event .tpc-card-icon { color: oklch( 0.62 0.17 350 ); }
.tpc-card--experience .tpc-card-icon { color: oklch( 0.58 0.13 160 ); }
.tpc-card--town .tpc-card-icon { color: var(--tpc-sun); }
.tpc-card--stay .tpc-card-icon { color: oklch( 0.55 0.1 280 ); }

/* Favourite button */
.tpc-fav {
	border: 1px solid var(--tpc-border);
	background: var(--tpc-card);
	border-radius: 999px;
	width: 2.25rem;
	height: 2.25rem;
	display: grid;
	place-items: center;
	cursor: pointer;
	color: var(--tpc-muted-foreground);
}
.tpc-fav.is-active { color: oklch( 0.55 0.2 20 ); border-color: currentColor; }
.tpc-fav.is-active .tpc-icon { fill: currentColor; }

/* Map, search, timeline */
.tpc-map { border-radius: calc( var(--tpc-radius) + 8px ); overflow: hidden; border: 1px solid var(--tpc-border); }
.tpc-map-count { color: var(--tpc-muted-foreground); font-size: 0.9rem; }
.tpc-marker-pin {
	display: block;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 999px;
	border: 3px solid oklch( 1 0 0 );
	box-shadow: 0 2px 6px oklch( 0.2 0.05 240 / 0.35 );
}
.tpc-search-form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.tpc-search-form input[type="search"],
.tpc-search-form input[type="text"] {
	flex: 1 1 260px;
	padding: 0.75rem 1rem;
	border-radius: 999px;
	border: 1px solid var(--tpc-border);
	font: inherit;
	background: var(--tpc-card);
}
.tpc-results-count { color: var(--tpc-muted-foreground); font-size: 0.92rem; }
.tpc-empty { color: var(--tpc-muted-foreground); }

.tpc-day { margin-bottom: 3rem; }
.tpc-day-head p { color: var(--tpc-muted-foreground); margin: 0; }
.tpc-timeline { list-style: none; margin: 1.5rem 0 0; padding: 0 0 0 1.4rem; border-left: 2px dashed var(--tpc-border); }
.tpc-timeline-item { position: relative; display: grid; grid-template-columns: 4.5rem 1fr; gap: 1rem; padding-bottom: 1.6rem; }
.tpc-timeline-item::before {
	content: "";
	position: absolute;
	left: -1.85rem;
	top: 0.55rem;
	width: 0.7rem;
	height: 0.7rem;
	border-radius: 999px;
	background: var(--tpc-sun);
}
.tpc-time { font-weight: 700; font-family: var(--tpc-font-display); color: var(--tpc-sea); }
.tpc-timeline-item h3 { margin: 0 0 0.2rem; font-size: 1.1rem; }
.tpc-timeline-item p { margin: 0; color: var(--tpc-muted-foreground); }
.tpc-timeline-meta { font-size: 0.85rem; }
.tpc-itinerary-index { display: grid; grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) ); gap: 1.5rem; }
.tpc-itinerary-town ul, .tpc-related ul { list-style: none; margin: 0; padding: 0; }
.tpc-itinerary-town li, .tpc-related li { padding: 0.2rem 0; }

/* Related links */
.tpc-related { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--tpc-border); }
.tpc-related-grid { display: grid; grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) ); gap: 1.5rem; }
.tpc-related-col h3 { font-size: 1rem; }

/* Single */
.tpc-single-content { max-width: 72ch; }
.tpc-entry-media img { border-radius: calc( var(--tpc-radius) + 8px ); box-shadow: var(--tpc-shadow); }
.tpc-entry-meta { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; color: var(--tpc-muted-foreground); font-size: 0.92rem; }

/* Footer */
.tpc-footer {
	margin-top: 4rem;
	background: var(--tpc-foreground);
	color: oklch( 0.95 0.01 240 );
	padding-block: 3rem 2rem;
}
.tpc-footer a { color: var(--tpc-accent); text-decoration: none; }
.tpc-footer-grid { display: grid; grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) ); gap: 2rem; }
.tpc-footer ul { list-style: none; margin: 0; padding: 0; }
.tpc-footer-bottom { margin-top: 2rem; font-size: 0.85rem; opacity: 0.75; }

@media print {
	.tpc-header, .tpc-footer, .tpc-fav, .tpc-account-actions, .tpc-nav { display: none !important; }
	body { font-size: 12pt; }
}
