/*
Theme Name: Tirano Hotel
Theme URI: https://tiranohotel.it
Author: TiranoHotel.it
Description: Tema custom per tiranohotel.it — alberghi, cultura, sport, passeggiate ed enogastronomia tra Tirano e Aprica.
Version: 1.0.0
Text Domain: tiranohotel
*/

/* ==========================================================================
   0. TOKEN — palette e tipografia
   ========================================================================== */
:root {
	--verde-pino: #1F3A2E;
	--verde-pino-scuro: #142720;
	--rosso-bernina: #B7352D;
	--rosso-bernina-scuro: #8F2620;
	--pietra: #8F8879;
	--pietra-chiara: #C9C2B0;
	--crema: #F3EEE0;
	--crema-scuro: #E8E0CB;
	--oro: #B8863B;
	--testo: #2B2621;
	--bianco: #FFFDF8;

	--font-display: 'Fraunces', Georgia, serif;
	--font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, monospace;

	--radius: 4px;
	--wrap: 1180px;
	--shadow: 0 12px 32px -16px rgba(20, 39, 32, 0.35);
}

/* ==========================================================================
   1. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--testo);
	background: var(--crema);
	font-size: 17px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.15;
	margin: 0 0 0.5em;
	color: var(--verde-pino-scuro);
}
p { margin: 0 0 1em; }
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 999;
	background: var(--verde-pino); color: var(--bianco); padding: 10px 16px; border-radius: var(--radius);
}
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 3px solid var(--oro); outline-offset: 2px;
}
.th-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.th-no-scroll { overflow: hidden; }

/* ==========================================================================
   2. HEADER & NAVIGAZIONE
   ========================================================================== */
.th-header {
	position: sticky; top: 0; z-index: 100;
	background: transparent;
	transition: background-color .25s ease, box-shadow .25s ease;
}
.th-header.is-scrolled,
.page-template-default .th-header,
body:not(.home) .th-header {
	background: var(--verde-pino);
	box-shadow: 0 2px 18px rgba(0,0,0,.15);
}
.th-header-inner {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 24px;
}
.th-logo { display: flex; align-items: center; gap: 10px; color: var(--bianco); }
.th-logo-mark { color: var(--rosso-bernina); display: inline-flex; }
.th-logo-text { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; }
.th-logo-text em { font-style: normal; color: var(--rosso-bernina); }
.custom-logo { max-height: 56px; width: auto; }

.th-menu { display: flex; align-items: center; gap: 4px; }
.th-menu > li { position: relative; }
.th-menu > li > a {
	display: block; padding: 10px 14px; color: var(--bianco);
	font-size: .95rem; font-weight: 500; border-radius: var(--radius);
	transition: background-color .2s ease;
}
.th-menu > li > a:hover { background: rgba(255,255,255,.1); }
.th-menu .menu-item-has-children > a::after { content: '▾'; margin-left: 5px; font-size: .7em; opacity: .7; }
.th-menu .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 230px;
	background: var(--bianco); border-radius: var(--radius); box-shadow: var(--shadow);
	padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.th-menu li:hover > .sub-menu,
.th-menu li.is-open > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.th-menu .sub-menu a { display: block; padding: 9px 12px; color: var(--testo); font-size: .92rem; border-radius: var(--radius); }
.th-menu .sub-menu a:hover { background: var(--crema); color: var(--rosso-bernina); }
.th-menu .sub-menu .sub-menu { top: 0; left: 100%; }
.th-menu-note { font-size: .8rem; color: var(--pietra-chiara); padding: 8px 12px; }

.th-menu-toggle {
	display: none; flex-direction: column; justify-content: center; gap: 5px;
	width: 40px; height: 40px; background: none; border: none; cursor: pointer;
}
.th-menu-toggle span { width: 22px; height: 2px; background: var(--bianco); border-radius: 2px; }

/* ==========================================================================
   3. HERO
   ========================================================================== */
.th-hero {
	position: relative;
	background: linear-gradient(160deg, var(--verde-pino) 0%, var(--verde-pino-scuro) 100%);
	color: var(--bianco);
	padding: 150px 0 110px;
	overflow: hidden;
}
.th-hero-line { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.th-hero-line path { fill: none; stroke: var(--rosso-bernina); stroke-width: 2.5; stroke-dasharray: 6 8; }
.th-hero-line .th-dot { fill: var(--oro); }
.th-hero-inner { position: relative; max-width: 700px; }
.th-eyebrow {
	font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .12em;
	font-size: .78rem; color: var(--oro); margin-bottom: 14px;
}
.th-hero-title { font-size: clamp(2.4rem, 5vw, 3.6rem); color: var(--bianco); margin-bottom: 22px; }
.th-hero-sub { font-size: 1.1rem; color: var(--crema-scuro); max-width: 560px; margin-bottom: 34px; }
.th-hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ==========================================================================
   4. BOTTONI
   ========================================================================== */
.th-btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 13px 26px; border-radius: var(--radius); font-weight: 600; font-size: .95rem;
	transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
	white-space: nowrap;
}
.th-btn-primary { background: var(--rosso-bernina); color: var(--bianco); }
.th-btn-primary:hover { background: var(--rosso-bernina-scuro); transform: translateY(-1px); }
.th-btn-ghost { background: transparent; color: var(--bianco); border: 1.5px solid rgba(255,255,255,.5); }
.th-btn-ghost:hover { border-color: var(--bianco); background: rgba(255,255,255,.08); }
.th-btn-block { display: flex; width: 100%; margin-top: 16px; }

/* ==========================================================================
   5. SEZIONI GENERICHE
   ========================================================================== */
.th-section { padding: 76px 0; }
.th-section-alt { background: var(--crema-scuro); }
.th-section-title { font-size: 2rem; }
.th-section-sub { color: var(--pietra); max-width: 560px; font-size: 1.02rem; }
.th-section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.th-link-arrow { color: var(--rosso-bernina); font-weight: 600; white-space: nowrap; }
.th-link-arrow:hover { text-decoration: underline; }

/* Griglia argomenti (home) */
.th-topics-grid {
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 40px;
}
.th-topic-card {
	background: var(--bianco); border: 1px solid var(--crema-scuro); border-radius: var(--radius);
	padding: 30px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.th-topic-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--rosso-bernina); }
.th-topic-card-accent { background: var(--verde-pino); border-color: var(--verde-pino); }
.th-topic-card-accent h3, .th-topic-card-accent p { color: var(--bianco); }
.th-topic-card-accent .th-topic-icon { color: var(--oro); }
.th-topic-icon { display: inline-flex; width: 46px; height: 46px; color: var(--rosso-bernina); margin-bottom: 16px; }
.th-topic-icon svg { width: 100%; height: 100%; }
.th-topic-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.th-topic-card p { color: var(--pietra); font-size: .94rem; margin: 0; }

/* Banda CTA */
.th-cta-band { background: var(--rosso-bernina); color: var(--bianco); text-align: center; }
.th-cta-band-inner h2 { color: var(--bianco); }
.th-cta-band-inner p { color: rgba(255,255,255,.85); margin-bottom: 24px; }
.th-cta-band .th-btn-primary { background: var(--bianco); color: var(--rosso-bernina); }
.th-cta-band .th-btn-primary:hover { background: var(--crema); }

/* ==========================================================================
   6. ALBERGHI — card e griglia
   ========================================================================== */
.th-hotel-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.th-hotel-card {
	background: var(--bianco); border-radius: var(--radius); overflow: hidden;
	border: 1px solid var(--crema-scuro); transition: transform .18s ease, box-shadow .18s ease;
}
.th-hotel-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.th-hotel-card-img { position: relative; aspect-ratio: 4/3; background: var(--pietra-chiara); overflow: hidden; }
.th-hotel-card-img img { width: 100%; height: 100%; object-fit: cover; }
.th-hotel-card-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--bianco); }
.th-hotel-card-placeholder svg { width: 60px; height: 60px; }
.th-hotel-card-tag {
	position: absolute; top: 12px; left: 12px; background: var(--verde-pino); color: var(--bianco);
	font-size: .74rem; font-weight: 600; padding: 5px 11px; border-radius: 20px;
}
.th-hotel-card-body { padding: 20px; }
.th-hotel-card-body h3 { font-size: 1.15rem; margin-bottom: 6px; }
.th-hotel-card-body p { color: var(--pietra); font-size: .92rem; margin-bottom: 10px; }
.th-hotel-card-meta { display: flex; gap: 10px; }
.th-hotel-card-meta span {
	font-family: var(--font-mono); font-size: .78rem; color: var(--oro);
	border: 1px solid var(--crema-scuro); border-radius: 20px; padding: 3px 10px;
}

.th-filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 34px; }
.th-filter-pill {
	padding: 8px 18px; border-radius: 30px; border: 1.5px solid var(--crema-scuro);
	font-size: .88rem; font-weight: 600; color: var(--verde-pino);
}
.th-filter-pill.is-active, .th-filter-pill:hover { background: var(--verde-pino); border-color: var(--verde-pino); color: var(--bianco); }
.th-empty { color: var(--pietra); font-style: italic; }

/* Scheda singolo albergo */
.th-hotel-hero { max-height: 480px; overflow: hidden; }
.th-hotel-hero img { width: 100%; height: 100%; object-fit: cover; }
.th-hotel-header-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.th-hotel-tags { display: flex; gap: 10px; margin-top: 10px; }
.th-tag { font-family: var(--font-mono); font-size: .8rem; color: var(--oro); border: 1px solid var(--crema-scuro); border-radius: 20px; padding: 4px 12px; }
.th-hotel-layout { display: grid; grid-template-columns: 1fr 320px; gap: 50px; align-items: start; }
.th-hotel-content { font-size: 1.05rem; }
.th-info-box { background: var(--bianco); border: 1px solid var(--crema-scuro); border-radius: var(--radius); padding: 24px; }
.th-info-box h3 { font-size: 1.05rem; margin-bottom: 14px; }
.th-info-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--crema-scuro); font-size: .93rem; }
.th-info-list li:last-child { border-bottom: none; }
.th-info-list strong { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--pietra); }
.th-info-list a:hover { color: var(--rosso-bernina); }
.th-map-box { margin-top: 20px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--crema-scuro); }
.th-map-box iframe { width: 100%; height: 220px; border: 0; display: block; }

/* ==========================================================================
   7. PAGINE DI CONTENUTO (page.php — struttura ad albero dell'indice)
   ========================================================================== */
.th-page-header { padding: 130px 0 40px; background: var(--verde-pino); color: var(--bianco); }
.th-page-header h1 { color: var(--bianco); font-size: clamp(1.9rem, 4vw, 2.6rem); margin-top: 8px; }
.th-page-lead { color: var(--crema-scuro); max-width: 620px; margin-top: 8px; }
.th-hotel-header { padding-bottom: 30px; }

.th-breadcrumb { font-size: .84rem; color: var(--crema-scuro); font-family: var(--font-mono); }
.th-breadcrumb a { color: var(--crema-scuro); }
.th-breadcrumb a:hover { color: var(--oro); }
.th-breadcrumb .sep { margin: 0 6px; opacity: .5; }
.th-breadcrumb .current { color: var(--oro); }

.th-page-layout { display: grid; grid-template-columns: 1fr 260px; gap: 50px; align-items: start; }
.th-page-cover { border-radius: var(--radius); overflow: hidden; margin-bottom: 30px; }
.th-prose { font-size: 1.06rem; }
.th-prose h2 { margin-top: 1.6em; font-size: 1.5rem; }
.th-prose h3 { margin-top: 1.3em; font-size: 1.2rem; }
.th-prose img { border-radius: var(--radius); margin: 1.2em 0; }
.th-prose ul, .th-prose ol { padding-left: 1.3em; margin-bottom: 1em; }
.th-prose ul li { list-style: disc; }
.th-prose ol li { list-style: decimal; }

.th-page-sidebar {
	position: sticky; top: 110px; background: var(--bianco); border: 1px solid var(--crema-scuro);
	border-radius: var(--radius); padding: 22px;
}
.th-page-sidebar h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--pietra); margin-bottom: 14px; }
.th-sibling-list li { border-left: 2px solid var(--crema-scuro); }
.th-sibling-list a { display: block; padding: 8px 0 8px 14px; font-size: .93rem; color: var(--testo); }
.th-sibling-list li.is-current { border-left-color: var(--rosso-bernina); }
.th-sibling-list li.is-current a { color: var(--rosso-bernina); font-weight: 700; }
.th-sibling-list a:hover { color: var(--rosso-bernina); }

.th-children-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 40px; }
.th-child-card {
	display: flex; gap: 16px; background: var(--bianco); border: 1px solid var(--crema-scuro);
	border-radius: var(--radius); overflow: hidden; transition: box-shadow .18s ease, transform .18s ease;
}
.th-child-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.th-child-card-img { width: 110px; flex-shrink: 0; background: var(--crema-scuro); }
.th-child-card-img img { width: 100%; height: 100%; object-fit: cover; }
.th-child-card-placeholder { min-height: 90px; }
.th-child-card-body { padding: 14px 16px 14px 0; }
.th-child-card-body h3 { font-size: 1rem; margin-bottom: 4px; }
.th-child-card-body p { font-size: .86rem; color: var(--pietra); margin: 0; }

.th-simple-post { padding: 22px 0; border-bottom: 1px solid var(--crema-scuro); }
.th-404 { text-align: center; padding: 160px 0; }
.th-404 h1 { font-size: 2rem; }

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
.th-footer { background: var(--verde-pino-scuro); color: var(--crema-scuro); margin-top: 40px; }
.th-footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 64px 24px 40px; }
.th-footer-brand .th-logo-text { color: var(--bianco); }
.th-footer-brand p { margin-top: 12px; font-size: .92rem; max-width: 300px; }
.th-footer-col h4, .footer-widget-title { color: var(--bianco); font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 16px; }
.th-footer-col ul li { margin-bottom: 9px; font-size: .92rem; }
.th-footer-col a:hover { color: var(--oro); }
.th-footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-top: 1px solid rgba(255,255,255,.08); font-size: .8rem; }
.th-footer-line { width: 60px; height: 2px; background: var(--rosso-bernina); margin: 0; }

/* ==========================================================================
   9. RESPONSIVE
   ========================================================================== */
@media (max-width: 980px) {
	.th-topics-grid { grid-template-columns: repeat(2, 1fr); }
	.th-hotel-grid { grid-template-columns: repeat(2, 1fr); }
	.th-page-layout, .th-hotel-layout { grid-template-columns: 1fr; }
	.th-page-sidebar { position: static; }
	.th-footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
	.th-menu-toggle { display: flex; }
	.th-nav {
		position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw); height: 100vh;
		background: var(--verde-pino-scuro); transform: translateX(100%); transition: transform .25s ease;
		padding: 90px 26px 26px; overflow-y: auto;
	}
	.th-nav.is-open { transform: translateX(0); }
	.th-menu { flex-direction: column; align-items: stretch; gap: 0; }
	.th-menu > li > a { padding: 13px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
	.th-menu .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none;
		background: rgba(255,255,255,.04); display: none; padding: 4px 0 4px 14px;
	}
	.th-menu li.is-open > .sub-menu { display: block; }
	.th-menu .sub-menu a { color: var(--crema-scuro); }
	.th-header { background: var(--verde-pino); }
}

@media (max-width: 640px) {
	.th-topics-grid, .th-hotel-grid, .th-children-grid, .th-footer-top { grid-template-columns: 1fr; }
	.th-hero { padding: 130px 0 80px; }
	.th-section { padding: 56px 0; }
	.th-child-card { flex-direction: column; }
	.th-child-card-img { width: 100%; height: 140px; }
}
