/*
Theme Name: Afcor
Theme URI: https://afcor.ca
Author: TactikMedia
Description: Thème en blocs d'Afcor Construction (remplace Oxygen). Mise en page modifiable dans l'éditeur WordPress.
Version: 1.0.2
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: afcor
*/

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
:where(.wp-site-blocks) > main { margin-block-start: 0; }
img { height: auto; }

/* Surtitre bleu en majuscules (ancien « c-tagline ») */
.is-style-surtitre, .surtitre {
  font-family: var(--wp--preset--font-family--texte);
  font-size: 0.875rem !important;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent);
}

/* Bouton contour (ancien bouton avec flèche) */
.wp-block-button.is-style-outline > .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--blanc);
  border: 1px solid var(--wp--preset--color--accent);
  padding: 13px 26px;
}
.wp-block-button.is-style-outline > .wp-block-button__link::after { content: "  →"; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--accent); text-decoration: none; }
.has-gris-clair-background-color .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--texte-fonce); }
.wp-block-button__link:hover { text-decoration: none; }

/* ---------- En-tête ---------- */
.afcor-entete {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 14, 33, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-bar .afcor-entete { top: 32px; }
@media (max-width: 782px) { .admin-bar .afcor-entete { top: 46px; } }
.afcor-entete .wp-block-site-logo img { width: 170px; }
.afcor-entete .wp-block-navigation a { color: var(--wp--preset--color--blanc); }
.afcor-entete .wp-block-navigation a:hover { color: var(--wp--preset--color--accent); text-decoration: none; }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--marine) !important; color: #fff !important; }
@media (max-width: 900px) { .afcor-entete .bouton-entete { display: none; } }

/* ---------- Héros (bandeaux en haut de page) ---------- */
.afcor-heros { min-height: 70vh; }
.afcor-heros h1 { max-width: 14em; }
.afcor-heros-accueil { min-height: calc(100vh - 80px); }

/* ---------- Cartes ---------- */
.afcor-carte-image {
  min-height: 420px;
  transition: transform .3s ease;
}
.afcor-carte-image:hover { transform: translateY(-4px); }
.afcor-carte-image a { color: inherit; }
.afcor-carte-image a::before { content: ""; position: absolute; inset: 0; z-index: 2; }
.afcor-carte-contour {
  border: 1px solid var(--wp--preset--color--accent);
  padding: var(--wp--preset--spacing--l);
  height: 100%;
}
.afcor-carte-blanche {
  background: #fff; color: var(--wp--preset--color--texte-fonce);
  padding: var(--wp--preset--spacing--l);
  height: 100%;
}
.afcor-carte-blanche .surtitre { text-align: right; }

/* Grille de réalisations (archive + accueil) */
.afcor-grille-projets .wp-block-post { position: relative; }
.afcor-grille-projets .wp-block-cover { min-height: 420px !important; }
.afcor-grille-projets .wp-block-post-title a { color: #fff; }
.afcor-grille-projets .wp-block-post-title a::before { content: ""; position: absolute; inset: 0; z-index: 2; }
.afcor-grille-projets .wp-block-post-title a::after { content: " →"; }

/* Filtres des réalisations */
.afcor-filtres a { color: var(--wp--preset--color--texte-doux); display: inline-block; margin: 0 1.75rem 0.5rem 0; padding-bottom: 4px; border-bottom: 1px solid transparent; }
.afcor-filtres a[aria-current] { border-bottom-color: var(--wp--preset--color--accent); }
.afcor-filtres a:hover, .afcor-filtres a[aria-current] { color: #fff; }

/* ---------- Carrousels défilants (historique, logos, projets, avantages) ---------- */
.afcor-defilant {
  display: flex !important;
  flex-wrap: nowrap !important;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  gap: var(--wp--preset--spacing--m) !important;
  padding-bottom: 4px;
}
.afcor-defilant::-webkit-scrollbar { display: none; }
.afcor-defilant > * {
  flex: 0 0 calc((100% - 2 * var(--wp--preset--spacing--m)) / 3) !important;
  max-width: none !important;
  margin: 0 !important;
  scroll-snap-align: start;
}
@media (max-width: 1024px) { .afcor-defilant > * { flex-basis: calc((100% - var(--wp--preset--spacing--m)) / 2) !important; } }
@media (max-width: 640px) { .afcor-defilant > * { flex-basis: 85% !important; } }
.afcor-defilant-nav { display: flex; gap: 8px; justify-content: center; margin-top: var(--wp--preset--spacing--l); }
.afcor-defilant-nav button {
  width: 55px; height: 55px; border: 0; cursor: pointer;
  background: var(--wp--preset--color--accent); color: #fff; font-size: 20px;
}
.afcor-defilant-nav button:hover { background: var(--wp--preset--color--bleu-marque); }
.afcor-defilant-nav button:disabled { opacity: .4; cursor: default; }

/* ---------- Bandeau de valeurs défilant (Carrières) ---------- */
.afcor-marquee { overflow: hidden; white-space: nowrap; }
.afcor-marquee p {
  display: inline-block; margin: 0;
  animation: afcor-defile 30s linear infinite;
  padding-left: 100%;
}
@keyframes afcor-defile { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .afcor-marquee p { animation: none; padding-left: 0; } }

/* ---------- Réalisation (fiche) ---------- */
.afcor-meta p { margin: 0; }
.afcor-meta .libelle { font-family: var(--wp--preset--font-family--titres); font-size: 1.25rem; }
.afcor-meta .valeur { color: var(--wp--preset--color--texte-doux); font-size: 0.9rem; margin-bottom: 1rem; }
.single-realisations .wp-block-gallery img { aspect-ratio: 4/3; object-fit: cover; }
.single-realisations .wp-block-post-content > p:first-child strong { color: #fff; }

/* ---------- Formulaires Fluent Forms sur fond sombre ---------- */
.afcor-formulaire .ff-el-input--label label { color: #fff; }
.afcor-formulaire .ff-el-form-control { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 0; }
.afcor-formulaire .ff-el-form-control option { color: #000; }
.afcor-formulaire .ff-btn-submit { background: var(--wp--preset--color--accent) !important; border-radius: 0 !important; padding: 14px 28px !important; }

/* ---------- Pied de page ---------- */
.afcor-pied a { color: #fff; }
.afcor-pied a:hover { color: var(--wp--preset--color--accent); text-decoration: none; }
.afcor-pied .wp-block-site-logo img { width: 220px; }
.afcor-pied h6 { color: rgba(255,255,255,.45); }
.afcor-pied .colonne-menu { border-left: 1px solid rgba(255,255,255,.15); padding-left: var(--wp--preset--spacing--l); }
@media (max-width: 781px) { .afcor-pied .colonne-menu { border-left: 0; padding-left: 0; } }
.afcor-pied .wp-block-social-links .wp-social-link { background: transparent !important; border: 1px solid rgba(255,255,255,.25); }

/* Logos clients : tuiles blanches */
.afcor-logos .wp-block-image { margin: 0; }
.afcor-logos img { width: 100%; aspect-ratio: 512/270; object-fit: contain; background: #fff; }

/* Correctifs v1.0.2 */
.afcor-defilant-nav[hidden] { display: none; }
.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { flex-grow: 0; }
