/*
Theme Name: Teranga Travel
Theme URI: https://terangatravel.it
Author: Teranga Travel
Description: Tema su misura per Teranga Travel — viaggi di gruppo esperienziali. Minimal, caldo, autentico.
Version: 1.0.2
Requires at least: 6.6
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: teranga
*/

:root {
	--tg-sand: var(--wp--preset--color--sand, #F6F1EA);
	--tg-paper: var(--wp--preset--color--paper, #FFFDF9);
	--tg-ink: var(--wp--preset--color--ink, #161616);
	--tg-stone: var(--wp--preset--color--stone, #6B645C);
	--tg-line: var(--wp--preset--color--line, #E5DDD2);
	--tg-terra: var(--wp--preset--color--terracotta, #D9542B);
	--tg-terra-dark: var(--wp--preset--color--terracotta-dark, #B8431E);
	--tg-forest: var(--wp--preset--color--forest, #1F4D45);
	--tg-sun: var(--wp--preset--color--sun, #F2B33D);
	--tg-display: var(--wp--preset--font-family--display, "Bricolage Grotesque", sans-serif);
	--tg-radius: 18px;
	--tg-shadow: 0 1px 2px rgba(22, 22, 22, .04), 0 12px 32px -12px rgba(22, 22, 22, .14);
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
::selection { background: var(--tg-sun); color: var(--tg-ink); }
.wp-site-blocks > * + * { margin-block-start: 0; }
main.tg-main { margin-block-start: 0; }
.tg-main--full > * + * { margin-block-start: 0; }
.tg-main--full > .alignfull:first-child { margin-top: 0; }

/* ---------- Header ---------- */
.tg-header-wrap { position: sticky; top: 0; z-index: 50; }
.admin-bar .tg-header-wrap { top: 32px; }
@media (max-width: 782px) { .admin-bar .tg-header-wrap { top: 46px; } }
.tg-header {
	background: rgba(246, 241, 234, .86);
	backdrop-filter: saturate(1.4) blur(14px);
	-webkit-backdrop-filter: saturate(1.4) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .25s, background .25s;
}
.tg-scrolled .tg-header { border-bottom-color: var(--tg-line); background: rgba(246, 241, 234, .95); }
.tg-header__right { gap: 1.6rem; }

.tg-logo { display: inline-flex; align-items: baseline; gap: .35rem; text-decoration: none; color: var(--tg-ink); line-height: 1; }
.tg-logo:hover { color: var(--tg-ink); }
.tg-logo__main { font-family: var(--tg-display); font-weight: 800; font-size: 1.55rem; letter-spacing: .06em; }
.tg-logo__sub { font-family: var(--tg-display); font-weight: 500; font-size: .8rem; letter-spacing: .28em; text-transform: uppercase; color: var(--tg-terra); }
.tg-logo--light, .tg-logo--light:hover { color: var(--tg-paper); }
.tg-logo--light .tg-logo__sub { color: var(--tg-sun); }

.tg-nav a { text-decoration: none; position: relative; }
.tg-nav .wp-block-navigation-item__content { color: var(--tg-ink); }
.tg-nav .wp-block-navigation-item__content::after {
	content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px; background: var(--tg-terra); transition: right .25s ease;
}
.tg-nav .wp-block-navigation-item__content:hover::after,
.tg-nav .current-menu-item > .wp-block-navigation-item__content::after { right: 0; }
.tg-nav .wp-block-navigation__responsive-container.is-menu-open { background: var(--tg-sand); padding: 2rem 1.5rem; }
.tg-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-family: var(--tg-display); font-size: 2rem; font-weight: 700; }

.tg-account-btn {
	display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
	padding: .55rem 1.1rem; border-radius: 999px; background: var(--tg-ink); color: var(--tg-paper) !important;
	font-weight: 600; font-size: .9rem; text-decoration: none; transition: background .2s, transform .2s;
}
.tg-account-btn:hover { background: var(--tg-terra); transform: translateY(-1px); }
.tg-account-btn svg { width: 16px; height: 16px; }
@media (max-width: 600px) { .tg-account-btn span { display: none; } .tg-account-btn { padding: .55rem; } }

/* ---------- Typography helpers ---------- */
.tg-kicker, .tg-kicker a {
	font-size: .78rem !important; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--tg-terra); text-decoration: none;
}
.tg-meta { color: var(--tg-stone); font-size: .9rem; }
.tg-lead { font-size: clamp(1.15rem, 1.6vw, 1.4rem) !important; line-height: 1.5; color: var(--tg-stone); max-width: 46ch; }
.tg-highlight { background: linear-gradient(transparent 62%, rgba(242, 179, 61, .55) 62%); padding: 0 .1em; }
.tg-terra { color: var(--tg-terra); }
.tg-italic { font-style: italic; font-weight: 500; }
.has-huge-font-size { line-height: 1.02 !important; letter-spacing: -0.035em; }

/* ---------- Buttons ---------- */
.wp-block-button__link { transition: background .2s, color .2s, transform .2s; }
.wp-block-button__link:hover { transform: translateY(-2px); }
.wp-block-button.is-style-outline > .wp-block-button__link { border: 2px solid currentColor; background: transparent; color: inherit; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--tg-ink); color: var(--tg-paper); border-color: var(--tg-ink); }
.tg-btn-terra .wp-block-button__link { background: var(--tg-terra); }
.tg-btn-terra .wp-block-button__link:hover { background: var(--tg-paper); color: var(--tg-ink); }
.tg-on-dark .wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--tg-paper); color: var(--tg-ink); border-color: var(--tg-paper); }

/* ---------- Sections ---------- */
.tg-section { padding-top: var(--wp--preset--spacing--60) !important; padding-bottom: var(--wp--preset--spacing--60) !important; }
.tg-section--tight { padding-top: var(--wp--preset--spacing--50) !important; padding-bottom: var(--wp--preset--spacing--50) !important; }
.tg-paper { background: var(--tg-paper); }
.tg-sectionhead { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; margin-bottom: 2.5rem !important; }
.tg-sectionhead h2 { margin: .3rem 0 0; max-width: 18ch; }

/* Hero */
.tg-hero { min-height: min(92vh, 860px) !important; align-items: flex-end !important; }
.tg-hero .wp-block-cover__inner-container { max-width: 1240px; width: 100%; margin: 0 auto; padding-bottom: clamp(2rem, 6vw, 5rem); }
.tg-hero h1 { color: var(--tg-paper); max-width: 14ch; margin: .6rem 0 1rem; }
.tg-hero .tg-lead { color: rgba(255, 253, 249, .88); max-width: 40ch; }
.tg-hero .tg-kicker { color: var(--tg-sun); }
.tg-badges { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0 !important; margin: 1.8rem 0 0 !important; }
.tg-badges li { padding: .45rem .9rem; border: 1px solid rgba(255, 253, 249, .35); border-radius: 999px; font-size: .85rem; color: var(--tg-paper); backdrop-filter: blur(6px); background: rgba(22, 22, 22, .18); }

.tg-pagehero { padding-top: var(--wp--preset--spacing--60) !important; padding-bottom: var(--wp--preset--spacing--50) !important; }
.tg-pagehero h1 { max-width: 16ch; margin-top: .5rem; }

/* Marquee */
.tg-marquee { overflow: hidden; background: var(--tg-terra); color: var(--tg-paper); padding: 1rem 0 !important; white-space: nowrap; }
.tg-marquee p { display: inline-block; margin: 0 !important; font-family: var(--tg-display); font-weight: 700; font-size: clamp(1.2rem, 2.5vw, 1.9rem); letter-spacing: -.01em; animation: tg-marquee 38s linear infinite; padding-left: 100%; }
@keyframes tg-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .tg-marquee p { animation: none; padding-left: 1rem; } }

/* Tribe cards */
.tg-tribes { gap: 1.25rem !important; }
.tg-tribe { border-radius: var(--tg-radius); padding: 2rem 1.8rem 1.8rem !important; position: relative; overflow: hidden; min-height: 330px; display: flex; flex-direction: column; justify-content: flex-end; transition: transform .3s ease; }
.tg-tribe:hover { transform: translateY(-6px) rotate(-.4deg); }
.tg-tribe__age { font-family: var(--tg-display); font-weight: 800; font-size: clamp(3.2rem, 6vw, 4.6rem); line-height: .9 !important; letter-spacing: -.04em; margin: 0 0 auto !important; }
.tg-tribe h3 { margin-top: 1.5rem !important; }
.tg-tribe p { margin-top: .5rem !important; }

/* Split */
.tg-split { gap: clamp(2rem, 5vw, 5rem) !important; align-items: center !important; }
.tg-split figure img { border-radius: var(--tg-radius); aspect-ratio: 4/5; object-fit: cover; width: 100%; }
.tg-split--wide figure img { aspect-ratio: 5/4; }

/* Pillars / steps */
.tg-pillars { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem !important; }
.tg-pillar { background: var(--tg-paper); border: 1px solid var(--tg-line); border-radius: var(--tg-radius); padding: 1.8rem !important; margin: 0 !important; }
.tg-pillar__num { font-family: var(--tg-display); font-weight: 800; color: var(--tg-terra); font-size: 1rem !important; letter-spacing: .1em; }
.tg-pillar h3 { margin: .8rem 0 .5rem !important; }
.tg-pillar p { color: var(--tg-stone); margin: 0 !important; font-size: .98rem; }
.tg-on-dark .tg-pillar { background: rgba(255, 253, 249, .06); border-color: rgba(255, 253, 249, .14); }
.tg-on-dark .tg-lead { color: rgba(255, 253, 249, .78); }
.tg-on-dark .tg-pillar p { color: rgba(255, 253, 249, .75); }

/* Big quote */
.tg-bigquote { font-family: var(--tg-display); font-weight: 700; font-size: clamp(2rem, 5vw, 4rem) !important; line-height: 1.05 !important; letter-spacing: -.03em; max-width: 20ch; }

/* CTA band */
.tg-cta { border-radius: calc(var(--tg-radius) * 1.4); padding: clamp(2rem, 6vw, 4.5rem) !important; position: relative; overflow: hidden; }
.tg-cta::after { content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: var(--tg-terra); opacity: .9; }
.tg-cta > * { position: relative; z-index: 1; }
.tg-cta h2 { max-width: 18ch; }

/* Checks list */
.tg-checks { list-style: none; padding: 0 !important; }
.tg-checks li { position: relative; padding-left: 2rem; margin: .7rem 0; }
.tg-checks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--tg-terra) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='%23fff' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; }

/* FAQ */
.tg-faq details { border-bottom: 1px solid var(--tg-line); padding: 1.1rem 0; }
.tg-faq summary { cursor: pointer; font-family: var(--tg-display); font-weight: 700; font-size: 1.2rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.tg-faq summary::-webkit-details-marker { display: none; }
.tg-faq summary::after { content: "+"; color: var(--tg-terra); font-size: 1.5rem; line-height: 1; transition: transform .2s; }
.tg-faq details[open] summary::after { transform: rotate(45deg); }
.tg-faq details p { color: var(--tg-stone); margin: .7rem 0 0; }

/* Blog grid */
.tg-postgrid { gap: 2rem !important; }
.tg-postgrid .wp-block-post-title a { text-decoration: none; color: var(--tg-ink); }
.tg-postgrid .wp-block-post-title a:hover { color: var(--tg-terra); }

/* Footer */
.tg-footer a { color: var(--tg-paper); text-decoration: none; }
.tg-footer a:hover { color: var(--tg-sun); }
.tg-footer__title { font-family: var(--wp--preset--font-family--body) !important; font-size: .78rem !important; letter-spacing: .18em; text-transform: uppercase; color: var(--tg-sun); font-weight: 700 !important; }
.tg-footer__list { list-style: none; padding: 0 !important; }
.tg-footer__list li { margin: .45rem 0; font-size: .95rem; overflow-wrap: anywhere; }
.tg-footer__small, .tg-footer__legal { color: rgba(255, 253, 249, .65); font-size: .85rem; }
.tg-footer__sep { border-color: rgba(255, 253, 249, .15) !important; opacity: 1; }
.tg-footer .tg-logo { margin-bottom: 1rem; }

/* Reveal on scroll */
.tg-reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.tg-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .tg-reveal { opacity: 1; transform: none; } }

@media (max-width: 781px) {
	.tg-hero { min-height: 80vh !important; }
	.tg-sectionhead { margin-bottom: 1.5rem !important; }
}
