/*
Theme Name: Tihoti Tarua
Theme URI: https://tihotitarua.com
Author: REDSOYU
Author URI: https://www.redsoyu.com
Description: Thème du site Tihoti Tarua et KokoFare (Raiatea).
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: tihoti-tarua
*/

/* Sections pleine largeur */
.tt-section {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--60);
}
/* En-tête vert des pages intérieures : plus d'air autour du titre (l'accueil a son hero) */
.wp-block-post-content > .tt-foret:first-child > .tt-section {
	padding-top: clamp(72px, 9vw, 128px);
	padding-bottom: clamp(72px, 9vw, 128px);
}
.tt-papier {
	background: var(--wp--preset--color--creme) url("assets/images/paper.webp") center / 1600px auto repeat;
}
.tt-foret {
	background: var(--wp--preset--color--foret) url("assets/images/green.webp") center top / cover no-repeat;
	color: var(--wp--preset--color--creme);
}
.tt-foret :where(h1, h2, h3, h4) { color: var(--wp--preset--color--creme); }
.tt-foret a:where(:not(.wp-element-button)) { color: #F2C9A0; }
.tt-blanc { background: var(--wp--preset--color--blanc); }
.tt-terre { background: var(--wp--preset--color--terre); color: var(--wp--preset--color--creme); }

/* Frise */
.wp-block-group.tt-frise {
	/* Hauteur calculée sur la largeur : aspect-ratio + min-height élargissait la page sur mobile */
	width: 100%;
	height: max(28px, 3.375vw);
	padding: 0 !important;
	background: var(--wp--preset--color--rouge-vif) url("assets/images/frise.webp") center / cover no-repeat;
}
:where(.wp-site-blocks) > .tt-frise,
.tt-frise { margin-top: 0 !important; margin-bottom: 0 !important; }

/* Pas d'espace entre sections empilées */
.wp-site-blocks > main > .entry-content > .alignfull,
.entry-content > .alignfull + .alignfull { margin-top: 0; }
.tt-page > * { margin-block-start: 0; }

/* Cinq entrées ne tiennent pas sur une ligne à côté du logo : le menu burger reste jusqu'à 900 px (600 par défaut) */
@media (min-width: 600px) and (max-width: 899px) {
	.tt-entete .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.tt-entete .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}

/* Surtitre */
.tt-surtitre {
	color: var(--wp--preset--color--rouge);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--grand);
	margin-bottom: 0.25rem;
}
.tt-foret .tt-surtitre { color: #F2C9A0; }
/* Cartes claires posées sur fond vert : on revient aux couleurs du papier */
.tt-foret :where(.tt-carte-creme, .tt-carte-blanc) .tt-surtitre,
.tt-foret :where(.tt-carte-creme, .tt-carte-blanc) a:where(:not(.wp-element-button)) { color: var(--wp--preset--color--rouge); }

/* Boutons clairs (sur fond vert) */
.wp-block-button.tt-btn-clair .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--creme);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--creme);
}
.wp-block-button.tt-btn-clair .wp-block-button__link:hover {
	background: var(--wp--preset--color--creme);
	color: var(--wp--preset--color--foret);
}
.wp-block-button.tt-btn-vert .wp-block-button__link { background: var(--wp--preset--color--foret); color: var(--wp--preset--color--creme); }
.wp-block-button.tt-btn-vert .wp-block-button__link:hover { background: #16261A; }

/* Cartes */
.tt-carte {
	border-radius: 18px;
	padding: clamp(24px, 3vw, 36px) !important;
	height: 100%;
	box-sizing: border-box;
}
.tt-carte > * + * { margin-top: 0.75rem; }
.tt-carte-creme { background: var(--wp--preset--color--creme); }
.tt-carte-blanc { background: var(--wp--preset--color--blanc); }
.tt-carte-foret { background: var(--wp--preset--color--foret); color: var(--wp--preset--color--creme); }
.tt-carte-foret :where(h2, h3) { color: var(--wp--preset--color--creme); }
.tt-carte-rouge { background: var(--wp--preset--color--rouge); color: #FFF8EC; }
.tt-carte-rouge :where(h2, h3) { color: #FFF8EC; }
.tt-carte-ligne { border: 1px solid rgba(249, 243, 231, 0.35); }
.tt-carte-ligne p { color: var(--wp--preset--color--sable); }

.tt-pastille {
	width: 64px; height: 64px; border-radius: 50%;
	display: flex !important; align-items: center; justify-content: center;
	margin-bottom: 0.5rem !important;
}
.tt-pastille img { width: 38px; height: auto; }
.tt-pastille-foret { background: var(--wp--preset--color--foret); }
.tt-pastille-rouge { background: var(--wp--preset--color--rouge); }

/* Photo à fournir */
.tt-photo-vide {
	aspect-ratio: 4 / 3;
	border: 2px dashed rgba(122, 113, 95, 0.5);
	border-radius: 18px;
	display: flex !important; align-items: center; justify-content: center;
	text-align: center;
	color: #7A715F;
	font-size: var(--wp--preset--font-size--petit);
}
.tt-foret .tt-photo-vide { border-color: rgba(249, 243, 231, 0.5); color: var(--wp--preset--color--sable); }

/* Grand millésime de l'histoire */
.tt-annee {
	font-family: var(--wp--preset--font-family--titres);
	font-size: clamp(4.5rem, 9vw, 8rem);
	line-height: 1;
	margin: 0.5rem 0 0;
}

/* Activités : trois colonnes séparées par un filet, pas de cartes */
.tt-activites { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: var(--wp--preset--spacing--50) !important; }
.tt-activites > * { margin: 0 !important; }
/* même marge haute que la carte KokoFare : pastilles et titres sur une même ligne */
.tt-activite { padding: clamp(24px, 3vw, 40px) clamp(24px, 3vw, 44px); border-left: 1px solid #E4DAC6; }
.tt-activite:first-child { padding-left: 0; border-left: 0; }
.tt-activite > * + * { margin-top: 0.9rem; }
.tt-activite .tt-pastille { width: 76px; height: 76px; margin-bottom: 1.25rem !important; }
.tt-activite .tt-pastille img { width: 44px; }
.tt-activite .wp-block-buttons { margin-top: 1.5rem; }
@media (max-width: 860px) {
	.tt-activite, .tt-activite:first-child { padding: 28px 0; border-left: 0; border-top: 1px solid #E4DAC6; }
	.tt-activite:first-child { border-top: 0; padding-top: 0; }
}
/* KokoFare, le lieu d'accueil : la seule activité en carte, sur le vert du site */
.tt-activite.tt-activite-foret {
	padding: clamp(24px, 3vw, 40px);
	border: 0;
	border-radius: 18px;
	background: var(--wp--preset--color--foret) url("assets/images/green.webp") center / cover no-repeat;
	color: var(--wp--preset--color--creme);
}
.tt-activite-foret .wp-block-heading { color: var(--wp--preset--color--creme); }

/* Valeurs : un trait de frise rouge au-dessus de chaque valeur */
.tt-valeurs { display: grid !important; gap: 40px 48px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.tt-valeurs > * { margin: 0 !important; }
.tt-valeur { padding-top: 22px; position: relative; }
.tt-valeur::before { content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 4px; border-radius: 2px; background: var(--wp--preset--color--rouge-vif); }
.tt-valeur p { margin: 0; color: var(--wp--preset--color--sable); }
.tt-valeur p + p { margin-top: 0.6rem; }
.tt-valeur p strong { display: block; color: var(--wp--preset--color--creme); font-size: var(--wp--preset--font-size--grand); font-weight: 600; line-height: 1.25; }

/* Photos posées (scotch) : ombre portée et mise en place à l'apparition */
.tt-pose img { filter: drop-shadow(0 22px 26px rgba(38, 48, 31, 0.24)); }
.tt-js .tt-pose { transition: transform 1s cubic-bezier(0.2, 0.75, 0.25, 1), opacity 0.6s ease; }
.tt-js .tt-pose:not(.is-pose) { opacity: 0; transform: translateY(28px) rotate(-5deg) scale(0.97); }
.tt-js .tt-pose-droite:not(.is-pose) { transform: translateY(28px) rotate(5deg) scale(0.97); }
@media (prefers-reduced-motion: reduce) {
	.tt-js .tt-pose, .tt-js .tt-pose:not(.is-pose) { transition: none; opacity: 1; transform: none; }
}

/* Nous trouver */
.tt-adresse { font-family: var(--wp--preset--font-family--titres); text-transform: uppercase; font-size: var(--wp--preset--font-size--titre-3); line-height: 1.2; color: var(--wp--preset--color--vert); }

/* Actualités : la section n'apparaît qu'à la première publication */
.tt-section-actus:has(.wp-block-query-no-results) { display: none; }

/* Grilles */
.tt-grille { display: grid !important; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tt-grille > * { margin: 0 !important; }

/* En-tête */
.tt-entete {
	background: var(--wp--preset--color--blanc);
	border-bottom: 1px solid #E9E0CF;
	padding-top: 14px; padding-bottom: 14px;
	position: relative; z-index: 10;
}
.tt-entete .wp-block-navigation {
	font-family: var(--wp--preset--font-family--titres);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--vert);
}
.tt-entete .wp-block-navigation a:hover,
.tt-entete .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--rouge); }
.tt-logo img { height: 52px; width: auto; }

/* Sélecteur FR / EN : le menu se cale à droite, juste avant lui */
.tt-entete .wp-block-navigation { margin-left: auto; }
.tt-langues { display: flex; gap: 4px; margin-left: 20px; }
.tt-langues a {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 8px; box-sizing: border-box;
	border-radius: 999px; font-family: var(--wp--preset--font-family--titres); font-size: 0.95rem; letter-spacing: 0.04em;
	color: var(--wp--preset--color--vert); text-decoration: none;
}
.tt-langues a:hover { color: var(--wp--preset--color--rouge); }
.tt-langues a[aria-current] { background: var(--wp--preset--color--vert); color: var(--wp--preset--color--creme); }
@media (max-width: 900px) {
	.tt-langues { margin-left: 8px; }
}
/* Le bouton n'existe que sous 600 px : ne pas écraser le display:none du cœur au-delà */
@media (max-width: 599px) {
	.tt-entete .wp-block-navigation__responsive-container-open,
	.tt-entete .wp-block-navigation__responsive-container-close {
		min-width: 44px; min-height: 44px;
		display: inline-flex; align-items: center; justify-content: center;
	}
}

/* Pied de page */
.tt-pied { background: var(--wp--preset--color--blanc); border-top: 1px solid #E9E0CF; }
.tt-pied a { color: var(--wp--preset--color--vert); text-decoration: none; }
.tt-pied a:hover { color: var(--wp--preset--color--rouge); }
.tt-pied .tt-pied-bas { border-top: 1px solid #E9E0CF; color: #6B6656; font-size: var(--wp--preset--font-size--petit); }
.tt-pied .wp-block-social-links .wp-social-link { color: var(--wp--preset--color--rouge); }
.tt-pied .wp-block-social-links { margin-left: -10px; }
.tt-pied .wp-block-social-links .wp-social-link a { padding: 10px; }

/* Produits */
.tt-produits { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 24px 0 0; padding: 0; list-style: none; }
.tt-produit { background: var(--wp--preset--color--blanc); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.tt-produit-image { aspect-ratio: 4 / 3; background: #EFE6D4; display: flex; align-items: center; justify-content: center; }
.tt-produit-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tt-produit-image .tt-produit-sans-photo { width: 56px; height: auto; opacity: 0.3; object-fit: contain; }
.tt-produit-corps { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.tt-produit-corps h3 { font-size: 1.25rem; margin: 0; }
.tt-produit-desc { margin: 0; font-size: var(--wp--preset--font-size--petit); }
.tt-formats { margin: 0; padding: 0; list-style: none; font-size: var(--wp--preset--font-size--petit); }
.tt-formats li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted #D8CDB8; padding: 3px 0; }
.tt-formats strong { color: var(--wp--preset--color--rouge); white-space: nowrap; }
.tt-conservation { margin: 0; font-size: 0.875rem; color: #6B6656; }
.tt-vedettes { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 24px 0 0; padding: 0; list-style: none; }
.tt-vedettes a { text-decoration: none; color: var(--wp--preset--color--vert); display: flex; flex-direction: column; gap: 12px; }
.tt-vedettes img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; display: block; transition: transform 0.45s cubic-bezier(0.2, 0.75, 0.25, 1), box-shadow 0.45s ease; }
.tt-vedettes span { font-family: var(--wp--preset--font-family--titres); text-transform: uppercase; font-size: 1.25rem; line-height: 1.1; transition: color 0.2s ease; }
.tt-vedettes a:hover img { transform: translateY(-6px); box-shadow: 0 18px 30px -12px rgba(38, 48, 31, 0.35); }
.tt-vedettes a:hover span { color: var(--wp--preset--color--rouge); }
.tt-gammes { display: flex; flex-wrap: wrap; gap: 12px; }
.tt-gammes a {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
	border-radius: 999px; border: 2px solid var(--wp--preset--color--foret);
	color: var(--wp--preset--color--foret); text-decoration: none; font-weight: 700;
}
.tt-gammes a:hover { background: var(--wp--preset--color--foret); color: var(--wp--preset--color--creme); }

/* Actualités */
.tt-actus .wp-block-post { background: var(--wp--preset--color--blanc); border-radius: 16px; overflow: hidden; }
.tt-actus .wp-block-post-featured-image img { aspect-ratio: 16 / 10; object-fit: cover; }
.tt-actus .tt-actu-corps { padding: 20px 24px 26px; }
.tt-actus .wp-block-post-date { color: var(--wp--preset--color--rouge); font-weight: 700; font-size: var(--wp--preset--font-size--petit); }
.tt-actus .wp-block-post-title { font-size: 1.375rem; }
.tt-actus .wp-block-post-title a { color: var(--wp--preset--color--vert); text-decoration: none; }

/* Accessibilité */
:where(a, button, .wp-element-button, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--rouge-vif);
	outline-offset: 3px;
	border-radius: 4px;
}
.wp-element-button:focus-visible { border-radius: 999px; }
/* Longueur de ligne confortable dans les colonnes de texte */
.wp-block-column > p, .tt-section > p { max-width: 64ch; }
/* Sans ça, la mise en page contrainte centre ces paragraphes sous un titre aligné à gauche */
.tt-section.is-layout-constrained > p { margin-left: max(0px, calc((100% - 1240px) / 2)) !important; margin-right: auto !important; }
.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 !important; width: 1px; word-wrap: normal !important;
}
.tt-pied .tt-pied-bas { padding-top: 18px; padding-bottom: 28px; }
main.wp-block-group { margin-top: 0; }
.wp-site-blocks > * + * { margin-block-start: 0; }
.tt-annee { white-space: nowrap; }
.tt-page > .wp-block-post-content { margin-top: 0; }
.wp-block-post-content > .alignfull { margin-top: 0 !important; margin-bottom: 0 !important; }
.tt-foret .tt-carte-creme .tt-photo-vide { border-color: rgba(122, 113, 95, 0.5); color: #7A715F; }
@media (max-width: 781px) {
	.tt-entete .tt-logo img { height: 42px; }
	.tt-annee { font-size: 4.5rem; }
}
@media (max-width: 600px) {
	.tt-vedettes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.tt-vedettes span { font-size: 1rem; }
}
