/*
Theme Name: Terroir & Tech
Description: Portfolio d'Adrien — électronique, ruches et vignes.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: terroir-tech
*/

:root { --tt-radius: 18px; --tt-gap: clamp(20px, 3vw, 32px); }

body { -webkit-font-smoothing: antialiased; }
img { height: auto; }
mark.tt-accent { background: none; color: var(--wp--preset--color--vigne); }

/* ---------- En-tête ---------- */
.wp-site-blocks > header.wp-block-template-part { position: sticky; top: 0; z-index: 50; }
.tt-header { padding-block: 22px; background: color-mix(in srgb, var(--wp--preset--color--creme) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid transparent; }
.tt-header .wp-block-site-title a { text-decoration: none; color: var(--wp--preset--color--encre); }
.tt-header .wp-block-navigation a { text-decoration: none; padding: 10px 12px; border-radius: 999px; }
.tt-header .wp-block-navigation a:hover { background: var(--wp--preset--color--sable); }
.tt-header .tt-nav-cta a { background: var(--wp--preset--color--encre); color: var(--wp--preset--color--creme) !important; padding-inline: 18px; }
.tt-header .tt-nav-cta a:hover { background: var(--wp--preset--color--vigne); }

/* ---------- Commun ---------- */
.tt-section { padding-block: clamp(64px, 9vw, 112px); }
.tt-eyebrow { font-size: 14px !important; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--miel); margin-bottom: 6px !important; }
.tt-muted { color: var(--wp--preset--color--gris); }
.tt-round img, .tt-round { border-radius: var(--tt-radius); }
.wp-block-image.tt-round img { width: 100%; object-fit: cover; }
.tt-link a, a.tt-link { font-weight: 600; text-decoration: none; }
.tt-link a:hover { text-decoration: underline; }

/* ---------- Accueil : hero ---------- */
.tt-hero { padding-block: clamp(40px, 6vw, 72px) clamp(56px, 8vw, 96px); }
.tt-hero h1 { font-size: clamp(44px, 7.5vw, 96px) !important; line-height: 1.02; letter-spacing: -.02em; text-wrap: balance; margin-bottom: 36px; }
.tt-hero__row { display: flex; flex-wrap: wrap; gap: 28px 48px; align-items: flex-end; justify-content: space-between; margin-bottom: 40px; }
.tt-hero__row > p { max-width: 580px; font-size: 19px; margin: 0; }
.tt-hero__img img { width: 100%; aspect-ratio: 21 / 8; min-height: 240px; object-fit: cover; border-radius: 22px; }

/* ---------- Projets ---------- */
.tt-feature { gap: clamp(28px, 5vw, 56px) !important; align-items: center !important; margin-block: 56px !important; }
.tt-feature .wp-block-image img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--tt-radius); }
.tt-feature h3 { font-size: clamp(30px, 3.4vw, 40px) !important; margin-block: 6px 12px; }
.tt-feature--reverse { flex-direction: row-reverse; }
.tt-tags { font-size: 14px; color: var(--wp--preset--color--gris); margin-block: 0 !important; }

.tt-grid { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--tt-gap); padding-top: 32px; border-top: 1px solid var(--wp--preset--color--ligne); }
.tt-grid > * { margin: 0 !important; }
.tt-card { display: flex; flex-direction: column; gap: 10px; }
.tt-card .wp-block-image, .tt-card .wp-block-image a { display: block; margin: 0; }
.tt-card .wp-block-image img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; transition: transform .3s ease; }
.tt-card .wp-block-image a:hover img { transform: scale(1.02); }
.tt-card h3 { font-size: 23px !important; margin: 6px 0 0; }
.tt-card h3 a { text-decoration: none; color: inherit; }
.tt-card h3 a:hover { color: var(--wp--preset--color--vigne); }
.tt-card p { margin: 0; font-size: 15px; color: var(--wp--preset--color--gris); }
.tt-tile { aspect-ratio: 3 / 2; border-radius: 14px; background: var(--wp--preset--color--sable); display: flex; align-items: flex-end; padding: 20px !important; margin: 0 !important; font-family: var(--wp--preset--font-family--fraunces); font-size: 30px !important; line-height: 1.1; color: var(--wp--preset--color--vigne); }
.tt-tile--miel { background: var(--wp--preset--color--miel-clair); color: var(--wp--preset--color--miel); }

/* ---------- Atelier ---------- */
.tt-atelier { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 32px !important; }
.tt-atelier > * { margin: 0 !important; }
.tt-atelier img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 14px; }
.tt-atelier figcaption { font-size: 15px; color: var(--wp--preset--color--gris); text-align: left; margin-top: 8px; }

/* ---------- Passions ---------- */
.tt-passions { background: var(--wp--preset--color--vigne); color: var(--wp--preset--color--creme); }
.tt-passions .tt-eyebrow { color: var(--wp--preset--color--miel-clair); }
.tt-passions h2, .tt-passions h3 { color: var(--wp--preset--color--creme); }
.tt-passions p { color: var(--wp--preset--color--vigne-clair); }
.tt-passions .wp-block-columns { gap: clamp(28px, 5vw, 56px) !important; margin-top: 40px; }
.tt-passions .wp-block-image img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; }
.tt-passions h3 { font-size: 28px !important; margin-block: 18px 8px; }
.tt-passions a { color: var(--wp--preset--color--miel-clair); }

/* ---------- À propos ---------- */
.tt-about { gap: clamp(28px, 5vw, 64px) !important; align-items: flex-start !important; }
.tt-portrait img { width: 100%; max-width: 400px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 200px 200px 18px 18px; }
.tt-lead { font-family: var(--wp--preset--font-family--fraunces); font-size: clamp(24px, 2.6vw, 30px) !important; line-height: 1.35; }
.tt-chips { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px !important; }
.tt-chips li { padding: 7px 14px; border: 1px solid #CFC4AD; border-radius: 999px; font-size: 15px; margin: 0; }

/* ---------- Contact / pied de page ---------- */
.tt-cta { border-top: 1px solid var(--wp--preset--color--ligne); padding-block: clamp(64px, 8vw, 96px) 32px; }
.tt-cta h2 { font-size: clamp(34px, 5vw, 60px) !important; text-wrap: balance; padding-right: min(30%, 380px); margin-bottom: 28px; }
.tt-footer { padding-block: 28px 40px; font-size: 14px; color: var(--wp--preset--color--gris); }
.tt-footer a { color: inherit; }

/* ---------- Boutons ---------- */
.wp-block-button.is-style-outline .wp-block-button__link { border: 1.5px solid currentColor; background: transparent; color: var(--wp--preset--color--encre); }
.wp-element-button { transition: background-color .2s ease; }

/* ---------- Pages intérieures (contenu Elementor existant) ---------- */
.tt-page-head { padding-block: clamp(48px, 7vw, 88px) 40px; position: relative; z-index: 2; }
.tt-page-body { position: relative; z-index: 1; }
.tt-page-body .elementor-widget-image img { max-height: 70vh; width: auto; object-fit: contain; }
.tt-page-head h1 { font-size: clamp(40px, 6vw, 72px) !important; letter-spacing: -.02em; }
.tt-page-body { padding-bottom: 96px; }
.tt-page-body .elementor-heading-title { font-family: var(--wp--preset--font-family--fraunces) !important; color: var(--wp--preset--color--encre) !important; }
.tt-page-body .elementor img { border-radius: 12px; }

/* ---------- Pages projet ---------- */
.tt-projet .tt-page-head a { text-decoration: none; color: inherit; }
.tt-projet .tt-page-head a:hover { color: var(--wp--preset--color--vigne); }
.tt-projet .tt-page-body > * + * { margin-top: 1.4rem; }
.tt-projet h2 { margin-top: 4.5rem !important; margin-bottom: 1rem; }
.tt-projet h3 { margin-bottom: .6rem; }
.tt-projet .tt-prose { padding: 0 !important; }
.tt-projet .alignwide { margin-block: 3rem !important; }
.tt-projet figcaption { font-size: 14px; color: var(--wp--preset--color--gris); text-align: left; margin-top: 10px; }
.tt-projet .wp-block-image img { border-radius: 14px; }
.tt-projet .wp-block-image.tt-round img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tt-stats { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-block: 2rem !important; }
.tt-stats > p { margin: 0 !important; padding: 18px 20px; background: var(--wp--preset--color--sable); border-radius: 14px; font-size: 15px; line-height: 1.35; color: var(--wp--preset--color--gris); }
.tt-stats strong { display: block; font-family: var(--wp--preset--font-family--fraunces); font-weight: 500; font-size: 40px; line-height: 1.1; color: var(--wp--preset--color--vigne); margin-bottom: 4px; }
.tt-checks { list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.tt-checks li { padding: 14px 18px 14px 48px; border: 1px solid var(--wp--preset--color--ligne); border-radius: 12px; position: relative; margin: 0; }
.tt-checks li::before { content: ""; position: absolute; left: 18px; top: 20px; width: 14px; height: 14px; border-radius: 50%; background: var(--wp--preset--color--vigne); }
.tt-steps { padding-left: 0 !important; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.tt-steps li { counter-increment: step; position: relative; padding-left: 52px; margin: 0; min-height: 36px; }
.tt-steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%; background: var(--wp--preset--color--miel-clair); color: var(--wp--preset--color--miel); font-family: var(--wp--preset--font-family--fraunces); font-weight: 700; display: grid; place-items: center; }
.tt-gallery2 { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.tt-gallery2 > * { margin: 0 !important; }
.tt-gallery2 img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tt-projet .tt-feature .wp-block-image img { aspect-ratio: auto; }
.tt-step { margin-top: 5.5rem !important; margin-bottom: 0 !important; display: flex; align-items: center; gap: 14px; font-size: 14px !important; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--miel); }
.tt-step::after { content: ""; flex: 1; height: 1px; background: var(--wp--preset--color--ligne); }
.tt-projet .tt-step + h2 { margin-top: .4rem !important; }
.tt-facts { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border: 1px solid var(--wp--preset--color--ligne); border-radius: 14px; overflow: hidden; margin-block: 1.5rem 2rem !important; }
.tt-facts > p { margin: 0 !important; padding: 14px 18px; border-bottom: 1px solid var(--wp--preset--color--ligne); border-right: 1px solid var(--wp--preset--color--ligne); margin-right: -1px !important; margin-bottom: -1px !important; font-size: 15px; line-height: 1.45; background: #FBF8F1; }
.tt-facts span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--miel); margin-bottom: 2px; }
.tt-history { list-style: none; padding: 0 0 0 6px !important; }
.tt-history li { position: relative; padding: 0 0 18px 24px; margin: 0; border-left: 2px solid var(--wp--preset--color--ligne); }
.tt-history li:last-child { padding-bottom: 4px; }
.tt-history li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--wp--preset--color--creme); border: 2px solid var(--wp--preset--color--vigne); }
.tt-limit img { max-width: 520px; width: 100%; }
.tt-clip { margin: 0; }
.tt-clip video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: var(--wp--preset--color--sable); display: block; }
.tt-prose .tt-clip { margin-block: 2rem 1rem !important; }
@media (prefers-reduced-motion: reduce) { .tt-clip video { animation: none; } }
.tt-contain img { background: #FFFFFF; object-fit: contain !important; max-height: 460px; padding: 16px; box-sizing: border-box; }
.tt-credits { margin-top: 3rem !important; padding: 20px 24px; border-left: 3px solid var(--wp--preset--color--vigne); background: var(--wp--preset--color--vigne-clair); border-radius: 0 12px 12px 0; font-size: 15px; }

@media (max-width: 781px) {
  .tt-feature--reverse { flex-direction: column; }
  .tt-header { padding-block: 14px; }
}

/* Bouton de langue FR / EN */
.tt-header .tt-lang a { border: 1px solid currentColor; padding-inline: 14px; font-size: .9em; }
.tt-header .tt-lang a:hover { background: var(--wp--preset--color--sable); }

/* CTA : titre centre comme les boutons */
.tt-cta h2 { box-sizing: border-box; }
