/*
Theme Name: G2RD Theme
Theme URI: https://g2rd.fr/themes/g2rd-agence-web
Author: Sebastien GERARD
Author URI: https://g2rd.fr
Copyright: © 2025 Sebastien GERARD
Description: Un thème Full Site Editing (FSE) moderne et flexible pour les agences web.
Requires at least: 6.6
Tested up to: 7.0
Requires PHP: 8.0
Version: 1.26.4
License: EUPL-1.2
License URI: https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
Text Domain: g2rd
Tags: full-site-editing, editor-style, block-styles, wide-blocks, custom-colors, custom-menu, custom-logo, featured-images, footer-widgets, portfolio, blog, translation-ready, rtl-language-support, threaded-comments, accessibility-ready
GitHub Theme URI: https://github.com/SebG2RD/g2rd-theme
*/

/* Socle minimal — refonte 2026-07.
   Sections legacy supprimées : TranslatePress, cookies SeoPress,
   template produit FluentCart (.g2rd-product-*, orphelin), classes orphelines
   (.resize-img, .ti-widget). .img-h-100 CONSERVÉE (utilisée par les patterns
   grid-portfolio et post-grid). */

/* ==========================================================================
   VARIABLES
   ========================================================================== */

:root {
  --transition-standard: 0.2s ease;
  --transition-slow: 0.5s ease;
  --z-index-base: 1;
  --z-index-links: 2;
  --z-index-buttons: 2;
  --z-index-overlay: 3;
}

/* ==========================================================================
   RESET FSE
   ========================================================================== */

:where(.wp-site-blocks) > * {
  margin-block-start: 0;
}

:root :where(.is-layout-flow) > * {
  margin-block-start: 0;
}

ul {
  list-style: none;
}

.wp-block-buttons {
  width: auto !important;
}

/* ==========================================================================
   UTILITAIRES
   ========================================================================== */

/* Utilisée par les patterns grid-portfolio.php et post-grid.php pour que les
   images remplissent leur cellule de grille. NE PAS retirer sans migrer ces
   patterns (sinon les images s'affichent à leur taille naturelle). */
.img-h-100 {
  height: 100%;
  width: 100%;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes reveal {
  from {
    opacity: 0;
    translate: 0 32px;
    scale: 0.98;
  }

  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

.scroll-animation {
  animation: reveal linear both;
  animation-timeline: view(block);
  animation-range: cover -10% cover 25%;
}

@keyframes particle-float {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }

  20% {
    opacity: 0.8;
  }

  100% {
    transform: translateY(-100px) translateX(30px);
    opacity: 0;
  }
}

/* ==========================================================================
   ARTICLES / PORTFOLIO
   ========================================================================== */

.h-article,
.portfolio {
  position: relative;
  z-index: var(--z-index-base);
  height: 100%;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--wp--preset--shadow--huge);
  transition:
    transform var(--transition-standard),
    box-shadow var(--transition-standard);
}

.h-article::before,
.portfolio::before {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  z-index: var(--z-index-overlay);
  width: 50%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 0%,
    color-mix(in srgb, var(--wp--preset--color--secondary, #b9ff56) 22%, transparent) 50%,
    transparent 100%
  );
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.h-article:hover,
.portfolio:hover {
  transform: translateY(-4px);
  box-shadow:
    0 16px 48px color-mix(in srgb, var(--wp--preset--color--secondary, #b9ff56) 20%, rgba(0, 0, 0, 0.12)),
    0 4px 12px rgba(0, 0, 0, 0.06);
}

.h-article:hover::before,
.portfolio:hover::before {
  left: 130%;
}

.h-article img,
.portfolio img,
.g2rd-clickable-article img {
  transition: transform var(--transition-slow);
}

.h-article:hover img,
.portfolio:hover img,
.g2rd-clickable-article:hover img {
  transform: scale(1.05);
}

/* ==========================================================================
   ARTICLES CLIQUABLES
   ========================================================================== */

.g2rd-clickable-article {
  position: relative;
  z-index: var(--z-index-base);
  height: 100%;
  overflow: hidden;
  cursor: pointer !important;
}

.g2rd-clickable-article::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-index-base);
  pointer-events: none;
}

.g2rd-clickable-article * {
  position: relative;
  z-index: 0;
}

.g2rd-clickable-article a {
  position: relative;
  z-index: var(--z-index-links);
}

.g2rd-clickable-article button {
  position: relative;
  z-index: var(--z-index-buttons);
}

[data-clickable-articles="true"] {
  position: relative;
}

[data-clickable-articles="true"] .g2rd-clickable-article {
  position: relative;
  z-index: var(--z-index-base);
}

/* ==========================================================================
   EFFET GLASS
   ========================================================================== */

[data-glass="true"] {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
}

@supports not (backdrop-filter: blur(5px)) {
  [data-glass="true"] {
    background: rgba(255, 255, 255, 0.88);
  }
}

/* ==========================================================================
   PARTICULES
   ========================================================================== */

[data-particles="true"] {
  position: relative;
  overflow: hidden;
}

[data-particles="true"]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
}

[data-particles="true"]::after {
  display: none;
}

[data-particles="true"] > *:not(.node):not(.line):not(.particle) {
  position: relative;
  z-index: 1;
}

[data-particles="true"] .node {
  position: absolute;
  z-index: -1;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: var(--wp--preset--color--secondary, #b9ff56);
  opacity: 0.7;
  transition:
    transform 0.15s ease-out,
    opacity 0.15s ease-out;
  will-change: transform, left, top;
}

[data-particles="true"] .line {
  position: absolute;
  z-index: -1;
  height: 0.5px;
  background: var(--wp--preset--color--secondary, #b9ff56);
  opacity: 0.3;
  transform-origin: 0 0;
  transition: opacity 0.2s ease;
  will-change: transform, width, opacity;
}

[data-particles="true"]:hover .node {
  opacity: 0.9;
}

[data-particles="true"]:hover .line {
  opacity: 0.6;
}

.particles-container {
  position: relative;
  z-index: 0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  .groupe-flex,
  .wp-block-group-is-layout-flex {
    flex-direction: column;
  }

  .responsive-group {
    padding: 0.5rem;
  }

  .wp-container-core-social-links-is-layout-d445cf74 {
    justify-content: center;
  }

  li.wp-social-link {
    width: 10%;
  }

}

/* ==========================================================================
   WP MANAGER — Animations de composants (GLOBAL, tokens uniquement)
   Exception CSS justifiée : :hover + transform ne sont pas exprimables en
   theme.json. Variables --wp--… exclusivement, aucune valeur en dur, aucune
   règle par page. Respecte prefers-reduced-motion (RGAA).
   ========================================================================== */

.wp-block-group.is-style-card,
.wp-block-group.is-style-card-dark,
.wp-block-group.is-style-card-action {
  transition:
    transform var(--transition-standard),
    box-shadow var(--transition-standard);
}

.wp-block-group.is-style-card:hover,
.wp-block-group.is-style-card-dark:hover,
.wp-block-group.is-style-card-action:hover {
  transform: translateY(-4px);
  box-shadow: var(--wp--preset--shadow--xl);
  will-change: transform;
}

/* Bouton : micro-élévation au survol (la transition est posée par theme.json) */
.wp-block-button__link:hover {
  transform: translateY(-1px);
  will-change: transform;
}

/* Halo signature des sections sombres (rappel du fond login wp-manager) */
.wp-block-group.is-style-section-dark,
.wp-block-group.is-style-card-dark {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.wp-block-group.is-style-section-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 85% 12%,
      color-mix(in srgb, var(--wp--preset--color--accent-2) 22%, transparent),
      transparent 38%
    ),
    radial-gradient(
      circle at 12% 88%,
      color-mix(in srgb, var(--wp--preset--color--secondary) 14%, transparent),
      transparent 40%
    );
}

/* Globe géodésique filaire (fond signature du hero) : extrait dans
   assets/css/globe.css — chargé front + canvas éditeur par GlobeEffect,
   activable par bloc (sidebar) et désactivable depuis la page d'options. */

@media (prefers-reduced-motion: reduce) {
  .wp-block-group.is-style-card,
  .wp-block-group.is-style-card-dark,
  .wp-block-group.is-style-card-action,
  .wp-block-button__link {
    transition: none;
  }

  .wp-block-group.is-style-card:hover,
  .wp-block-group.is-style-card-dark:hover,
  .wp-block-group.is-style-card-action:hover,
  .wp-block-button__link:hover {
    transform: none;
  }
}
