/*
Theme Name: TAD Site
Theme URI: https://example.com
Author: TAD — Thilogne Association Développement
Author URI: https://example.com
Description: Theme block pour TAD — Thilogne Association Développement, direction "Lumière Collective" : vert vif, or soleil, typographies Sora et Work Sans, motifs wax en filigrane.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tad-site
*/

/* ==========================================================================
   Base
   ========================================================================== */

html, body {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--wp--preset--color--cream);
  -webkit-font-smoothing: antialiased;
}

a {
  transition: color 0.2s ease;
}

.wp-site-blocks > * {
  margin-block-start: 0 !important;
}

.wp-site-blocks > footer {
  margin-block-start: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header-inner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 243, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(21, 41, 29, 0.08);
}

.logo-mark-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--wp--preset--color--green-vivid) 0%, var(--wp--preset--color--sun-yellow) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--wp--preset--color--white);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.logo-mark-name {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800 !important;
  font-size: 1.15rem !important;
  color: var(--wp--preset--color--ink-green);
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.15;
}

.logo-mark-tagline {
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.74rem !important;
  font-weight: 500;
  color: var(--wp--preset--color--ink-green-soft);
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.15;
}

.main-navigation .wp-block-navigation__container {
  gap: 1.9rem !important;
}

.main-navigation a.wp-block-navigation-item__content {
  position: relative;
  font-family: var(--wp--preset--font-family--body);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--wp--preset--color--ink-green);
  padding: 0.35rem 0.1rem !important;
}

.main-navigation a.wp-block-navigation-item__content::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background: var(--wp--preset--color--green-vivid);
  border-radius: 2px;
  transition: width 0.25s ease;
}

.main-navigation a.wp-block-navigation-item__content:hover::after,
.main-navigation a.wp-block-navigation-item__content:focus-visible::after {
  width: 100%;
}

.main-navigation a.wp-block-navigation-item__content:hover,
.main-navigation a.wp-block-navigation-item__content:focus-visible {
  color: var(--wp--preset--color--green-vivid-dark);
}

.btn-cta .wp-block-button__link {
  box-shadow: 0 6px 16px rgba(47, 158, 68, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  font-size: 0.92rem;
}

.btn-cta .wp-block-button__link:hover,
.btn-cta .wp-block-button__link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(47, 158, 68, 0.36);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-top: 5rem !important;
  padding-bottom: 6rem !important;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50'%3E%3Cdefs%3E%3Cpattern id='w' width='50' height='50' patternUnits='userSpaceOnUse' patternTransform='rotate(8)'%3E%3Ccircle cx='25' cy='25' r='2.2' fill='%232F9E44' fill-opacity='0.14'/%3E%3Cpath d='M25 6 L34 25 L25 44 L16 25 Z' fill='none' stroke='%23E8A33D' stroke-width='1' stroke-opacity='0.16'/%3E%3Ccircle cx='0' cy='0' r='1.4' fill='%2315291D' fill-opacity='0.08'/%3E%3Ccircle cx='50' cy='50' r='1.4' fill='%2315291D' fill-opacity='0.08'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='50' height='50' fill='url(%23w)'/%3E%3C/svg%3E");
  background-size: 50px 50px;
}

.hero-eyebrow {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--wp--preset--font-family--body);
  font-weight: 500;
  font-size: 0.85rem !important;
  color: var(--wp--preset--color--green-vivid-dark) !important;
  background: rgba(47, 158, 68, 0.1);
  border: 1px solid rgba(47, 158, 68, 0.22);
  padding: 0.4rem 0.9rem !important;
  border-radius: 999px;
}

.hero-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wp--preset--color--sun-yellow);
  flex-shrink: 0;
}

.hero-title {
  font-size: clamp(2.3rem, 4.4vw, 3.6rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -0.01em;
  margin: 0 0 0.2rem !important;
}

.hero-title .accent-text {
  background: linear-gradient(100deg, var(--wp--preset--color--green-vivid) 0%, var(--wp--preset--color--sun-yellow) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-weight: 400;
  font-size: 1.12rem !important;
  line-height: 1.65 !important;
  color: var(--wp--preset--color--ink-green-soft) !important;
  max-width: 46ch;
}

.hero-cta .wp-block-button__link {
  box-shadow: 0 10px 24px rgba(47, 158, 68, 0.32);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.hero-cta .wp-block-button__link:hover,
.hero-cta .wp-block-button__link:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(47, 158, 68, 0.4);
}

.hero-link-secondary a {
  font-weight: 500;
  font-size: 0.98rem;
  color: var(--wp--preset--color--ink-green) !important;
  border-bottom: 1px solid rgba(21, 41, 29, 0.35);
  padding-bottom: 2px;
  text-decoration: none !important;
}

.hero-link-secondary a:hover {
  color: var(--wp--preset--color--green-vivid-dark) !important;
  border-color: var(--wp--preset--color--green-vivid-dark);
}

.hero-stat-number {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800 !important;
  font-size: 1.6rem !important;
  color: var(--wp--preset--color--ink-green);
  margin: 0 !important;
}

.hero-stat-label {
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.82rem !important;
  color: var(--wp--preset--color--ink-green-soft) !important;
  margin: 0.15rem 0 0 !important;
}

.hero-visual-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual-wrap::before {
  content: "";
  position: absolute;
  width: 115%;
  height: 115%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 163, 61, 0.45) 0%, rgba(47, 158, 68, 0.22) 45%, rgba(250, 248, 243, 0) 72%);
  filter: blur(10px);
  z-index: -1;
  animation: ambient-pulse 4.5s ease-in-out infinite;
}

.hero-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: 28px;
  border: 1px solid rgba(21, 41, 29, 0.08);
  background: var(--wp--preset--color--white);
  padding: 0.9rem;
  box-shadow: 0 30px 60px -20px rgba(21, 41, 29, 0.28), 0 10px 24px -8px rgba(47, 158, 68, 0.18);
}

.hero-card .wp-block-image {
  margin: 0;
}

.hero-card img {
  border-radius: 18px;
  display: block;
  width: 100%;
  height: 460px;
  object-fit: cover;
}

.hero-card-tag {
  position: absolute;
  top: 1.6rem;
  right: 1.6rem;
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--ink-green);
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 0.78rem !important;
  padding: 0.45rem 0.85rem !important;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(21, 41, 29, 0.18);
  z-index: 2;
}

.hero-card-badge {
  position: absolute;
  left: 1.6rem;
  bottom: 1.6rem;
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  background: rgba(21, 41, 29, 0.45);
  backdrop-filter: blur(6px);
  color: var(--wp--preset--color--white) !important;
  font-weight: 500;
  font-size: 0.82rem !important;
  padding: 0.5rem 0.9rem !important;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  z-index: 2;
}

.hero-card-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wp--preset--color--sun-yellow);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.35);
}

.hero-float-card {
  position: absolute;
  bottom: -1.4rem;
  left: -1.6rem;
  display: flex !important;
  align-items: center;
  gap: 0.7rem;
  background: var(--wp--preset--color--white);
  border: 1px solid rgba(21, 41, 29, 0.08);
  border-radius: 16px;
  padding: 0.8rem 1.1rem !important;
  box-shadow: 0 16px 32px -12px rgba(21, 41, 29, 0.25);
  z-index: 3;
}

.hero-float-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--wp--preset--color--sun-yellow);
  flex-shrink: 0;
}

.hero-float-number {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800 !important;
  font-size: 1.05rem !important;
  color: var(--wp--preset--color--ink-green);
  margin: 0 !important;
  line-height: 1.2;
}

.hero-float-label {
  font-family: var(--wp--preset--font-family--body);
  font-size: 0.74rem !important;
  color: var(--wp--preset--color--ink-green-soft) !important;
  margin: 0 !important;
  line-height: 1.2;
}

@media (max-width: 782px) {
  .hero-float-card {
    left: 50%;
    transform: translateX(-50%);
    bottom: -1.2rem;
  }
}

/* ==========================================================================
   Section rhythm & titles
   ========================================================================== */

.section-eyebrow {
  display: inline-flex;
  font-family: var(--wp--preset--font-family--body);
  font-weight: 500;
  font-size: 0.85rem !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wp--preset--color--green-vivid-dark) !important;
  margin-bottom: 0.5rem !important;
}

.section-title {
  font-size: clamp(1.9rem, 3vw, 2.6rem) !important;
  letter-spacing: -0.01em;
  margin: 0 0 1rem !important;
}

.section-lede {
  font-size: 1.08rem !important;
  color: var(--wp--preset--color--ink-green-soft) !important;
  max-width: 62ch;
}

/* ==========================================================================
   Piliers (icon circles + cards)
   ========================================================================== */

.pillar-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--wp--preset--color--white);
  margin-bottom: 1.2rem;
}

.pillar-icon.icon-education { background: linear-gradient(135deg, #2F9E44, #4fb85f); }
.pillar-icon.icon-sante { background: linear-gradient(135deg, #E8A33D, #f0bc6c); }
.pillar-icon.icon-environnement { background: linear-gradient(135deg, #27863a, #2F9E44); }
.pillar-icon.icon-culture { background: linear-gradient(135deg, #15291D, #2a4234); }

.card-surface {
  background: var(--wp--preset--color--white);
  border: 1px solid rgba(21, 41, 29, 0.08);
  border-radius: 24px;
  padding: 2rem !important;
  box-shadow: 0 16px 32px -20px rgba(21, 41, 29, 0.16);
}

/* ==========================================================================
   Equal-height card rows
   ========================================================================== */

.equal-cards > .wp-block-column {
  display: flex;
  flex-direction: column;
  flex-grow: 0;
}

.equal-cards > .wp-block-column > .wp-block-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.equal-cards .cta-bottom {
  margin-top: auto;
  justify-content: flex-start;
}

/* ==========================================================================
   Project cards
   ========================================================================== */

.project-card {
  position: relative;
  overflow: hidden;
}

.project-card .wp-block-image {
  margin: 0 0 1.2rem;
  border-radius: 16px;
  overflow: hidden;
}

.project-card .wp-block-image img {
  height: 220px;
  width: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

.project-badge {
  display: inline-flex !important;
  align-items: center;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 0.74rem !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.4rem 0.8rem !important;
  border-radius: 999px;
  margin-bottom: 0.8rem !important;
}

.project-badge.status-en-cours {
  background: rgba(47, 158, 68, 0.14);
  color: var(--wp--preset--color--green-vivid-dark) !important;
}

.project-badge.status-nouveau {
  background: rgba(232, 163, 61, 0.18);
  color: #a3650f !important;
}

.project-badge.status-a-venir {
  background: rgba(21, 41, 29, 0.08);
  color: var(--wp--preset--color--ink-green-soft) !important;
}

.project-category {
  font-size: 0.78rem !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wp--preset--color--ink-green-soft) !important;
  margin-bottom: 0.3rem !important;
}

/* ==========================================================================
   Stats band
   ========================================================================== */

.stats-band {
  position: relative;
  overflow: hidden;
}

.stats-band::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.12;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cdefs%3E%3Cpattern id='p' width='40' height='40' patternUnits='userSpaceOnUse' patternTransform='rotate(-6)'%3E%3Cpath d='M20 4 L32 20 L20 36 L8 20 Z' fill='none' stroke='%23FFFFFF' stroke-width='1.4' stroke-opacity='0.5'/%3E%3Ccircle cx='20' cy='20' r='2.6' fill='%23FFFFFF' fill-opacity='0.4'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='40' height='40' fill='url(%23p)'/%3E%3C/svg%3E");
  background-size: 40px 40px;
}

.stat-number {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800 !important;
  font-size: clamp(2.2rem, 4vw, 3rem) !important;
  color: var(--wp--preset--color--white) !important;
  margin: 0 !important;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.92rem !important;
  color: rgba(255, 255, 255, 0.75) !important;
  margin: 0.4rem 0 0 !important;
}

/* ==========================================================================
   Territoire
   ========================================================================== */

.territoire-frame {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(21, 41, 29, 0.25);
}

.territoire-frame img {
  display: block;
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.territoire-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(21, 41, 29, 0.1);
  font-weight: 500;
}

.territoire-list li:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Engagement cards
   ========================================================================== */

.engage-card {
  text-align: left;
}

.engage-card .wp-block-button__link {
  background: transparent !important;
  color: var(--wp--preset--color--green-vivid-dark) !important;
  padding: 0 !important;
  font-size: 0.95rem !important;
  box-shadow: none !important;
  border-bottom: 1px solid var(--wp--preset--color--green-vivid-dark);
  border-radius: 0 !important;
}

.engage-card .wp-block-button__link:hover {
  color: var(--wp--preset--color--green-vivid) !important;
  border-color: var(--wp--preset--color--green-vivid);
  transform: none;
}

/* ==========================================================================
   Partners band
   ========================================================================== */

.partner-badge {
  background: var(--wp--preset--color--white);
  border: 1px solid rgba(21, 41, 29, 0.1);
  border-radius: 14px;
  padding: 1.1rem 1.4rem !important;
  text-align: center;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  font-size: 0.95rem !important;
  color: var(--wp--preset--color--ink-green-soft) !important;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer-inner {
  padding-top: 4rem !important;
  padding-bottom: 2rem !important;
}

.footer-logo-badge {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--wp--preset--color--green-vivid) 0%, var(--wp--preset--color--sun-yellow) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800;
  font-size: 1rem;
  color: var(--wp--preset--color--white);
}

.footer-tagline {
  color: rgba(250, 248, 243, 0.75) !important;
  max-width: 46ch;
}

.footer-links a,
.footer-social a {
  color: rgba(250, 248, 243, 0.8) !important;
  font-weight: 500;
  text-decoration: none !important;
}

.footer-links a:hover,
.footer-social a:hover {
  color: var(--wp--preset--color--sun-yellow) !important;
}

.footer-bottom {
  border-top: 1px solid rgba(250, 248, 243, 0.12);
  padding-top: 1.5rem !important;
  margin-top: 2rem !important;
}

.footer-bottom p {
  color: rgba(250, 248, 243, 0.55) !important;
  font-size: 0.85rem !important;
}

/* ==========================================================================
   Page title (non-home pages)
   ========================================================================== */

.page-title-band {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.page-title-band::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.45;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50'%3E%3Cdefs%3E%3Cpattern id='w' width='50' height='50' patternUnits='userSpaceOnUse' patternTransform='rotate(8)'%3E%3Ccircle cx='25' cy='25' r='2.2' fill='%232F9E44' fill-opacity='0.14'/%3E%3Cpath d='M25 6 L34 25 L25 44 L16 25 Z' fill='none' stroke='%23E8A33D' stroke-width='1' stroke-opacity='0.16'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='50' height='50' fill='url(%23w)'/%3E%3C/svg%3E");
  background-size: 50px 50px;
}

.page-title-band h1 {
  font-size: clamp(2.1rem, 4vw, 3rem) !important;
}

/* ==========================================================================
   Animation & Motion
   ========================================================================== */

.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.6s ease forwards;
}
.fade-in {
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}
.scale-in {
  opacity: 0;
  transform: scale(0.92);
  animation: scaleIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.slide-in-left {
  opacity: 0;
  transform: translateX(-28px);
  animation: slideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { to { opacity: 1; } }
@keyframes scaleIn { to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }

@keyframes ambient-pulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}
.stagger-children.is-visible > * {
  animation: fadeUp 0.5s ease forwards;
}
.stagger-children.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children.is-visible > *:nth-child(2) { animation-delay: 0.15s; }
.stagger-children.is-visible > *:nth-child(3) { animation-delay: 0.25s; }
.stagger-children.is-visible > *:nth-child(4) { animation-delay: 0.35s; }

.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
  transform: translateY(-6px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .animate-on-scroll,
  .fade-up,
  .fade-in,
  .slide-in-left,
  .scale-in,
  .stagger-children > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* === Editor: keep animated content visible while editing === */
.editor-styles-wrapper .fade-up,
.editor-styles-wrapper .fade-in,
.editor-styles-wrapper .slide-in-left,
.editor-styles-wrapper .scale-in,
.editor-styles-wrapper .animate-on-scroll,
.editor-styles-wrapper .stagger-children > * {
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  transition: none !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 600px) {
  .logo-mark-tagline {
    display: none;
  }
}
