/*
Theme Name: Terre-Api
Theme URI: https://terreapi.latelier22.fr
Author: L'Atelier 22
Description: Thème WordPress léger pour Terre-Api, apiculteur et récoltant en Provence.
Version: 2.1.0
Requires at least: 6.6
Requires PHP: 8.2
Text Domain: terreapi
*/

:root {
  --ink: #12120f;
  --ink-soft: #25231d;
  --honey: #e7b83f;
  --honey-light: #f7d875;
  --cream: #fffaf0;
  --paper: #f5edda;
  --lavender: #7354a4;
  --leaf: #526a42;
  --white: #fff;
  --radius: 26px;
  --shadow: 0 22px 60px rgba(30, 22, 8, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }

.ta-container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.ta-section { padding: 105px 0; position: relative; }
.ta-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--lavender);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.ta-eyebrow::before { content: ""; width: 26px; height: 2px; background: currentColor; }
.ta-title {
  max-width: 800px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 4.6rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.045em;
}
.ta-lead { max-width: 690px; margin: 24px 0 0; color: #625c50; font-size: 1.08rem; }

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  color: var(--white);
  transition: background .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled { background: rgba(18, 18, 15, .94); box-shadow: 0 10px 35px rgba(0,0,0,.14); backdrop-filter: blur(12px); }
.header-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 800; }
.brand img { width: 64px; height: 64px; object-fit: contain; border-radius: 14px; }
.brand-name { display: grid; line-height: 1.05; }
.brand-name small { color: var(--honey-light); font-size: .62rem; letter-spacing: .13em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a { color: #fff; text-decoration: none; font-size: .9rem; font-weight: 700; }
.main-nav a:hover { color: var(--honey-light); }
.nav-cta { padding: 11px 17px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; }
.menu-toggle { display: none; border: 0; color: white; background: transparent; font-size: 1.5rem; }

.hero {
  min-height: 820px;
  display: grid;
  align-items: end;
  position: relative;
  color: white;
  background: var(--ink);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(14,14,11,.96) 0%, rgba(14,14,11,.73) 48%, rgba(14,14,11,.22) 100%),
    url("assets/miel-garrigue.jpg") center 42% / cover;
  opacity: .86;
  transform: scale(1.03);
}
.hero::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -150px;
  top: 100px;
  border: 1px solid rgba(231,184,63,.35);
  transform: rotate(30deg);
  border-radius: 28%;
}
.hero-inner { position: relative; z-index: 2; padding: 180px 0 80px; }
.hero-copy { max-width: 790px; }
.hero .ta-eyebrow { color: var(--honey-light); }
.hero h1 {
  margin: 0;
  max-width: 850px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.25rem, 8.5vw, 7.9rem);
  font-weight: 500;
  line-height: .86;
  letter-spacing: -.065em;
}
.hero h1 em { display: block; color: var(--honey); font-weight: 500; }
.hero-text { max-width: 600px; margin: 28px 0 0; color: rgba(255,255,255,.82); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 35px; }
.button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  transition: transform .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--ink); background: var(--honey); }
.button-primary:hover { background: var(--honey-light); }
.button-ghost { color: white; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.06); }
.hero-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 74px; background: rgba(255,255,255,.15); }
.hero-fact { min-height: 100px; padding: 22px 24px; background: rgba(16,16,13,.63); backdrop-filter: blur(10px); }
.hero-fact strong { display: block; color: var(--honey-light); font-family: Georgia, serif; font-size: 1.35rem; font-weight: 500; }
.hero-fact span { color: rgba(255,255,255,.68); font-size: .85rem; }

.intro-grid { display: grid; grid-template-columns: 1.06fr .94fr; gap: 72px; align-items: center; }
.intro-card { position: relative; min-height: 530px; overflow: hidden; border-radius: 160px 28px 28px; box-shadow: var(--shadow); }
.intro-card img { width: 100%; height: 100%; min-height: 530px; object-fit: cover; }
.intro-note { position: absolute; right: 18px; bottom: 18px; width: min(280px, calc(100% - 36px)); padding: 22px; color: white; background: rgba(18,18,15,.88); border-radius: 20px; backdrop-filter: blur(10px); }
.intro-note strong { display: block; color: var(--honey-light); font-family: Georgia, serif; font-size: 1.4rem; }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 34px; }
.value { padding: 21px; background: white; border: 1px solid #e9dfca; border-radius: 18px; }
.value strong { display: block; margin-bottom: 5px; }
.value span { color: #71695b; font-size: .88rem; }

.honey-section { color: white; background: var(--lavender); }
.honey-section .ta-lead { color: rgba(255,255,255,.88); }
.honey-section .product-card { background: #503873; }
.honey-section .product-content p { color: #f0e8f7; }
.honey-section .ta-eyebrow { color: var(--honey-light); }
.honey-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; margin-top: 48px; }
.honey-card { grid-column: span 4; min-height: 500px; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--ink-soft); }
.honey-card:nth-child(4), .honey-card:nth-child(5) { grid-column: span 6; min-height: 430px; }
.honey-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.honey-card:hover img { transform: scale(1.055); }
.honey-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 32%, rgba(9,9,8,.88) 100%); }
.honey-content { position: absolute; z-index: 2; inset: auto 25px 24px; }
.honey-content h3 { margin: 0; font-family: Georgia, serif; font-size: 1.8rem; font-weight: 500; }
.honey-content p { display: -webkit-box; overflow: hidden; margin: 10px 0 0; color: rgba(255,255,255,.72); font-size: .9rem; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.honey-link { display: inline-flex; margin-top: 13px; color: var(--honey-light); font-size: .85rem; font-weight: 800; text-decoration: none; }

.pedagogy { background: var(--paper); }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; }
.service-card { position: relative; padding: 34px 30px; overflow: hidden; background: var(--cream); border: 1px solid #e7dbc0; border-radius: 22px; }
.service-card::before { content: attr(data-number); position: absolute; right: 15px; top: 3px; color: rgba(231,184,63,.18); font-family: Georgia, serif; font-size: 6rem; line-height: 1; }
.service-icon { display: grid; width: 54px; height: 54px; place-items: center; margin-bottom: 50px; color: var(--ink); background: var(--honey); border-radius: 16px; font-size: 1.5rem; }
.service-card h3 { margin: 0; font-family: Georgia, serif; font-size: 1.65rem; font-weight: 500; }
.service-card p { margin: 13px 0 0; color: #696255; font-size: .94rem; }

.sponsor-wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: 65px; align-items: center; }
.sponsor-visual { min-height: 520px; position: relative; overflow: hidden; border-radius: 28px 150px 28px 28px; }
.sponsor-visual img { position: absolute; width: 100%; height: 100%; object-fit: cover; }
.sponsor-panel { position: relative; padding: 45px; color: white; background: var(--lavender); border-radius: 28px; }
.sponsor-panel h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2.3rem, 5vw, 4.1rem); font-weight: 500; line-height: .98; }
.sponsor-panel p { color: rgba(255,255,255,.78); }
.sponsor-list { display: grid; gap: 10px; margin: 28px 0 34px; padding: 0; list-style: none; }
.sponsor-list li { display: flex; gap: 11px; align-items: center; }
.sponsor-list li::before { content: "✦"; color: var(--honey-light); }

.visit { padding: 90px 0; color: white; background: var(--leaf); }
.visit-inner { display: flex; align-items: center; justify-content: space-between; gap: 50px; }
.visit h2 { max-width: 760px; margin: 0; font-family: Georgia, serif; font-size: clamp(2.3rem, 5vw, 4.9rem); font-weight: 500; line-height: .98; }
.visit p { color: rgba(255,255,255,.75); }

.site-footer { padding: 62px 0 30px; color: rgba(255,255,255,.73); background: #0b0b09; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 45px; }
.footer-logo { width: 110px; border-radius: 20px; }
.footer-title { margin: 0 0 13px; color: white; font-weight: 800; }
.footer-links { display: grid; gap: 8px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--honey-light); }
.footer-bottom { margin-top: 45px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); font-size: .8rem; }

.floating-actions { position: fixed; z-index: 45; right: 18px; bottom: 18px; display: grid; gap: 9px; }
.floating-actions a { display: grid; width: 52px; height: 52px; place-items: center; color: var(--ink); background: var(--honey); border-radius: 50%; box-shadow: 0 10px 30px rgba(0,0,0,.22); text-decoration: none; font-size: 1.2rem; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .main-nav { display: none; position: absolute; inset: 78px 20px auto; padding: 20px; align-items: stretch; background: rgba(18,18,15,.98); border-radius: 18px; flex-direction: column; gap: 4px; }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 10px; }
  .intro-grid, .sponsor-wrap { grid-template-columns: 1fr; }
  .intro-card { order: -1; min-height: 410px; }
  .intro-card img { min-height: 410px; }
  .honey-card, .honey-card:nth-child(4), .honey-card:nth-child(5) { grid-column: span 6; min-height: 440px; }
  .service-grid { grid-template-columns: 1fr; }
  .service-icon { margin-bottom: 30px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .ta-container { width: min(100% - 28px, 1180px); }
  .ta-section { padding: 74px 0; }
  .header-inner { min-height: 76px; }
  .brand img { width: 54px; height: 54px; }
  .brand-name { font-size: .92rem; }
  .hero { min-height: 740px; }
  .hero-inner { padding: 135px 0 38px; }
  .hero h1 { font-size: clamp(3.15rem, 18vw, 5.2rem); }
  .hero-facts { grid-template-columns: 1fr; margin-top: 45px; }
  .hero-fact { min-height: auto; }
  .intro-card, .intro-card img { min-height: 360px; }
  .values { grid-template-columns: 1fr; }
  .honey-grid { display: flex; margin-inline: -14px; padding: 0 14px 8px; overflow-x: auto; scroll-snap-type: x mandatory; }
  .honey-card, .honey-card:nth-child(4), .honey-card:nth-child(5) { flex: 0 0 83vw; min-height: 450px; scroll-snap-align: center; }
  .sponsor-panel { padding: 32px 25px; }
  .sponsor-visual { min-height: 390px; }
  .visit-inner { align-items: flex-start; flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > :first-child { grid-column: auto; }
  .floating-actions { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Version 2 : pages détaillées, catalogue et demandes. */
.site-header { background: rgba(18,18,15,.95); }
body.admin-bar .site-header { top: 32px; }
.nav-list { display: flex; align-items: center; gap: 22px; list-style: none; padding: 0; margin: 0; }
.brand-name small { margin-top: 5px; font-size: .55rem; }
.skip-link { position: fixed; top: -100px; z-index: 100; padding: 12px; background: var(--honey); }
.skip-link:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--lavender); outline-offset: 4px; }
section[id], h2[id], .anchor-target { scroll-margin-top: 115px; }
.hero h1 { font-size: clamp(3rem, 7.7vw, 6.9rem); line-height: 1.02; letter-spacing: -.045em; }
.ta-title, .sponsor-panel h2, .visit h2 { line-height: 1.08; }
.text-link { display: inline-block; margin-top: 22px; color: var(--leaf); font-weight: 800; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.section-actions { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 36px; }
.section-actions .text-link { margin-top: 0; }
.light-eyebrow { color: var(--honey-light); }
.product-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; margin-top: 48px; }
.product-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: #25231d; }
.product-photo { display: block; aspect-ratio: 1.15; overflow: hidden; background: #393225; text-decoration: none; }
.product-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.product-photo:hover img { transform: scale(1.04); }
.product-placeholder { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; text-align: center; color: var(--honey-light); background: radial-gradient(circle at 60% 30%, #5d502c, #25231d); font: 2.1rem/1.2 Georgia,serif; }
.product-content { display: flex; flex: 1; flex-direction: column; padding: 25px; }
.product-content h3 { font: 500 1.6rem/1.2 Georgia,serif; margin: 0; }
.product-content h3 a { text-decoration: none; }
.product-content p { color: #d4cbb9; margin: 14px 0; font-size: .95rem; }
.product-content .honey-link { margin-top: auto; padding-top: 8px; }
.product-price { font-weight: 700; color: var(--honey-light); margin: 0 0 12px; }
.visit-inner > div { max-width: 750px; }
.visit-inner > a { flex-shrink: 0; }
.custom-section { background: var(--paper); }
.page-hero { padding: 165px 0 65px; background: var(--paper); }
.page-content { max-width: 890px; padding: 50px 0 95px; }
.page-content h2 { font: 500 clamp(1.7rem,3vw,2.5rem)/1.15 Georgia,serif; margin: 48px 0 20px; }
.page-content h2:first-child { margin-top: 0; }
.page-content p, .page-content li { color: #514c42; }
.page-content li { margin-bottom: 10px; }
.page-content ul { padding-left: 25px; }
.contact-details { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; margin: 30px 0; }
.button-outline { color: var(--ink); border-color: #b9aa8f; }
.contact-form { padding: 30px; border: 1px solid #e7dbc0; border-radius: 22px; background: #fff; }
.contact-form label { display: block; font-size: .92rem; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.contact-form input:not([type="checkbox"]), .contact-form textarea, .contact-form select { width: 100%; border: 1px solid #c9bea9; padding: 12px; margin-top: 7px; border-radius: 8px; background: var(--cream); color: var(--ink); font: inherit; }
.contact-form textarea { resize: vertical; }
.contact-form .form-consent { display: flex; gap: 12px; margin: 20px 0; align-items: flex-start; }
.form-consent input { margin-top: 7px; }
.form-trap { position: absolute; left: -10000px; }
.contact-form button { font: inherit; cursor: pointer; }
.form-notice { padding: 18px; border: 1px solid var(--honey); border-radius: 10px; background: #fff1c9; }
.commerce-main { padding-top: 150px; min-height: 60vh; }
.woocommerce .woocommerce-breadcrumb { color: #655c4c; }
.woocommerce ul.products li.product .woocommerce-loop-product__title { font: 500 1.6rem/1.25 Georgia,serif; }
.woocommerce ul.products li.product .price, .woocommerce div.product p.price { color: var(--leaf); }
.woocommerce a.button, .woocommerce button.button.alt, .woocommerce input.button.alt { border-radius: 999px; background: var(--honey); color: var(--ink); padding: 13px 22px; }
.woocommerce a.button:hover, .woocommerce button.button.alt:hover { background: var(--honey-light); color: var(--ink); }
.woocommerce div.product div.summary { overflow-wrap: anywhere; }
/* Le contenu reste lisible quand le JavaScript ne se charge pas. */
.reveal { opacity: 1; transform: none; }
@media (max-width: 1050px) {
  .brand-name small { display: none; }
  .nav-list { gap: 15px; }
}
@media (max-width: 900px) {
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav-list a { display: block; }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .visit-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }
@media (max-width: 620px) {
  .product-grid { grid-template-columns: 1fr; gap: 20px; }
  .product-photo { aspect-ratio: 1.3; }
  .hero h1 { font-size: clamp(2.7rem,12vw,4.3rem); }
  .page-hero { padding-top: 135px; }
  .form-grid { grid-template-columns: 1fr; }
  .contact-form { padding: 20px; }
  .page-content { padding-bottom: 70px; }
  .floating-actions { display: none; }
}
@keyframes terreapi-reveal { from { opacity: .55; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.reveal.is-visible { animation: terreapi-reveal .6s ease both; }

.page-content h3 { font: 500 clamp(1.45rem,2.5vw,2rem)/1.2 Georgia,serif; margin: 32px 0 18px; }
h3[id] { scroll-margin-top: 115px; }
.catalogue-text { padding: 8px 0 24px; margin-bottom: 20px; border-bottom: 1px solid #e7dbc0; }
.catalogue-text .text-link { margin-top: 0; }

/* Lightweight illustrated fallback for products without a photograph. */
.product-placeholder-animated {
  position: relative; flex-direction: column; gap: 0; overflow: hidden;
  color: #f7d875;
  background: radial-gradient(ellipse at 50% 35%, #8661b1 0%, #65448e 48%, #442c65 100%);
}
.ruche-art { width: 82%; max-width: 310px; height: auto; flex-shrink: 1; min-height: 0; }
.ruche-caption { margin: -8px 12px 22px; font: italic 1.25rem/1.3 Georgia, serif; color: #fff4cf; }
.ruche-bee { animation: ruche-flight 5s ease-in-out infinite; }
.ruche-cells { animation: ruche-drift 7s ease-in-out infinite; }
.ruche-sparkles { animation: ruche-glow 4s ease-in-out infinite; }
.product-card:nth-child(2n) .ruche-bee { animation-delay: -2.5s; }
.product-card:nth-child(3n) .ruche-sparkles { animation-delay: -1.5s; }
@keyframes ruche-flight {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-10px, -12px) rotate(-3deg); }
}
@keyframes ruche-drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes ruche-glow { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .ruche-bee, .ruche-cells, .ruche-sparkles { animation: none; }
}

/* Six tiles at a time, with staggered replacement transitions. */
#produits .product-mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 24px; }
.product-mosaic > [hidden] { display: none !important; }
.product-mosaic > .product-card { min-width: 0; }
.product-mosaic .product-content p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-mosaic .product-card.is-entering { animation: mosaic-tile-in .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--tile-index, 0) * 45ms); }
.product-mosaic .product-card.is-leaving { animation: mosaic-tile-out .18s ease both; }
@keyframes mosaic-tile-in {
  from { opacity: 0; transform: translate(15px, 22px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes mosaic-tile-out { to { opacity: 0; transform: translate(-12px, -8px) scale(.97); } }
.mosaic-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-top: 28px; }
.mosaic-controls button { font: inherit; cursor: pointer; padding: 10px 18px; }
.mosaic-controls button:focus-visible { outline: 3px solid #f7d875; outline-offset: 4px; }
.mosaic-status { color: #fff4cf; font-size: .9rem; min-width: 150px; text-align: center; }
@media (max-width: 900px) {
  #produits .product-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  #produits .product-mosaic { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .mosaic-controls { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .product-mosaic .product-card.is-entering,
  .product-mosaic .product-card.is-leaving { animation: none; }
}
