/*
Theme Name:   APEO Child Theme
Theme URI:    https://apeo.ca
Description:  Thème enfant Astra personnalisé pour l'Association des Professionnels et Entrepreneurs de l'Outaouais (APEO). Inclut le CPT Membres, l'annuaire filtrable et les templates FSE.
Author:       Jean-François LeBlanc — CyberAllié
Author URI:   https://cyberallie.com
Template:     astra
Version:      1.0.0
License:      GNU General Public License v2 or later
Text Domain:  apeo-child
Tags:         business, professional, directory, members, gutenberg
*/

/* ============================================================
   APEO — Styles globaux du thème enfant
   ============================================================ */

/* ── Variables CSS (APEO Brand) ─────────────────────────────── */
:root {
  --apeo-navy:       #1A3A5C;
  --apeo-blue:       #256FB4;
  --apeo-orange:     #E87222;
  --apeo-light-bg:   #F8F9FA;
  --apeo-text:       #1F2D3D;
  --apeo-text-muted: #6B7C93;
  --apeo-white:      #FFFFFF;
  --apeo-light-blue: #D6E8F7;
  --apeo-border:     #DDE3EC;
  --apeo-radius:     8px;
  --apeo-radius-lg:  16px;
  --apeo-shadow:     0 2px 12px rgba(26,58,92,.10);
  --apeo-shadow-lg:  0 6px 32px rgba(26,58,92,.15);
  --apeo-transition: all .2s ease;
}

/* ── Reset utilitaire ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Corps du texte ──────────────────────────────────────────── */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--apeo-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Typographie ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Inter', sans-serif;
  color: var(--apeo-navy);
  line-height: 1.25;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); }

a {
  color: var(--apeo-blue);
  text-decoration: none;
  transition: var(--apeo-transition);
}
a:hover { color: var(--apeo-navy); text-decoration: underline; }

/* ── Boutons ─────────────────────────────────────────────────── */
.wp-block-button__link,
.apeo-btn {
  border-radius: var(--apeo-radius) !important;
  font-weight: 700;
  letter-spacing: .02em;
  transition: var(--apeo-transition) !important;
  padding: .75rem 1.75rem !important;
}
.wp-block-button.is-style-outline .wp-block-button__link {
  border: 2px solid currentColor !important;
}
.apeo-btn-primary {
  background: var(--apeo-blue) !important;
  color: #fff !important;
}
.apeo-btn-primary:hover {
  background: var(--apeo-navy) !important;
  transform: translateY(-1px);
  box-shadow: var(--apeo-shadow);
}
.apeo-btn-accent {
  background: var(--apeo-orange) !important;
  color: #fff !important;
}
.apeo-btn-accent:hover {
  background: #c85e0f !important;
  transform: translateY(-1px);
}

/* ── Navigation ──────────────────────────────────────────────── */
.ast-header-wrap { box-shadow: 0 1px 8px rgba(26,58,92,.08); }
.main-header-menu .menu-item > a {
  font-weight: 500;
  color: var(--apeo-navy);
}
.main-header-menu .menu-item > a:hover,
.main-header-menu .current-menu-item > a {
  color: var(--apeo-blue);
}

/* ── Annuaire Membres ────────────────────────────────────────── */
.membres-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.carte-membre {
  background: var(--apeo-white);
  border: 1px solid var(--apeo-border);
  border-radius: var(--apeo-radius-lg);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--apeo-transition);
  box-shadow: var(--apeo-shadow);
}
.carte-membre:hover {
  box-shadow: var(--apeo-shadow-lg);
  transform: translateY(-3px);
  border-color: var(--apeo-light-blue);
}

.carte-membre .membre-photo img,
.carte-membre .wp-block-post-featured-image img {
  width: 120px !important;
  height: 120px !important;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--apeo-light-blue);
  margin: 0 auto 1rem;
  display: block;
}
.carte-membre .membre-photo .wp-block-post-featured-image--placeholder {
  width: 120px;
  height: 120px;
  background: var(--apeo-light-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border: 3px solid var(--apeo-border);
}

.carte-membre .membre-nom a,
.carte-membre .wp-block-post-title a {
  color: var(--apeo-navy) !important;
  font-size: 1.15rem;
  font-weight: 700;
}
.carte-membre .membre-nom a:hover,
.carte-membre .wp-block-post-title a:hover {
  color: var(--apeo-blue) !important;
  text-decoration: none;
}

.badge-categorie,
.carte-membre .wp-block-post-terms a {
  display: inline-block;
  background: var(--apeo-light-blue);
  color: var(--apeo-navy);
  font-size: .8rem;
  font-weight: 600;
  padding: .25rem .75rem;
  border-radius: 20px;
  margin: .5rem .25rem 0;
  text-decoration: none !important;
  letter-spacing: .02em;
}
.badge-categorie:hover,
.carte-membre .wp-block-post-terms a:hover {
  background: var(--apeo-navy);
  color: #fff !important;
}

.carte-membre .wp-block-post-excerpt p {
  color: var(--apeo-text-muted);
  font-size: .9rem;
  margin: .75rem 0;
  line-height: 1.6;
}

.carte-membre .wp-block-read-more,
.carte-membre .bouton-profil a {
  display: inline-block;
  margin-top: auto;
  padding: .55rem 1.5rem;
  background: var(--apeo-blue);
  color: #fff !important;
  border-radius: var(--apeo-radius);
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none !important;
  transition: var(--apeo-transition);
}
.carte-membre .wp-block-read-more:hover,
.carte-membre .bouton-profil a:hover {
  background: var(--apeo-navy);
  transform: translateY(-1px);
}

/* ── Filtre annuaire (FacetWP) ───────────────────────────────── */
.apeo-filtres-wrap {
  background: var(--apeo-light-bg);
  border: 1px solid var(--apeo-border);
  border-radius: var(--apeo-radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
}
.apeo-filtres-wrap label {
  font-weight: 600;
  color: var(--apeo-navy);
  margin-bottom: .35rem;
  display: block;
}
.facetwp-facet .facetwp-checkbox {
  padding: .4rem .6rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s;
}
.facetwp-facet .facetwp-checkbox:hover,
.facetwp-facet .checked {
  background: var(--apeo-light-blue);
}
.facetwp-facet .facetwp-search {
  width: 100%;
  padding: .6rem 1rem;
  border: 1px solid var(--apeo-border);
  border-radius: var(--apeo-radius);
  font-size: .95rem;
}

/* ── Profil membre (single) ──────────────────────────────────── */
.membre-profil-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.membre-profil-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.membre-profil-header .membre-photo img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--apeo-light-blue);
  flex-shrink: 0;
}
.membre-profil-infos h1 {
  margin-bottom: .25rem;
}
.membre-profil-infos .membre-entreprise {
  font-size: 1.1rem;
  color: var(--apeo-blue);
  font-weight: 600;
  margin-bottom: .5rem;
}

.apeo-membre-liens {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.apeo-membre-liens a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1.2rem;
  border: 1.5px solid var(--apeo-border);
  border-radius: var(--apeo-radius);
  font-size: .9rem;
  font-weight: 600;
  color: var(--apeo-navy);
  transition: var(--apeo-transition);
}
.apeo-membre-liens a:hover {
  background: var(--apeo-navy);
  color: #fff;
  border-color: var(--apeo-navy);
  text-decoration: none;
}
.apeo-membre-liens a.lien-linkedin { border-color: #0077B5; color: #0077B5; }
.apeo-membre-liens a.lien-linkedin:hover { background: #0077B5; color: #fff; border-color: #0077B5; }

/* ── Formulaire contact membre ───────────────────────────────── */
.apeo-formulaire-contact {
  background: var(--apeo-light-bg);
  border: 1px solid var(--apeo-border);
  border-radius: var(--apeo-radius-lg);
  padding: 2rem;
  margin-top: 2.5rem;
}
.apeo-formulaire-contact h3 {
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--apeo-light-blue);
}
.apeo-formulaire-contact input,
.apeo-formulaire-contact textarea,
.wpcf7-form input,
.wpcf7-form textarea {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid var(--apeo-border);
  border-radius: var(--apeo-radius);
  font-size: .95rem;
  color: var(--apeo-text);
  transition: border-color .15s;
  margin-bottom: 1rem;
}
.apeo-formulaire-contact input:focus,
.apeo-formulaire-contact textarea:focus,
.wpcf7-form input:focus,
.wpcf7-form textarea:focus {
  outline: none;
  border-color: var(--apeo-blue);
  box-shadow: 0 0 0 3px rgba(37,111,180,.12);
}
.wpcf7-submit,
.apeo-formulaire-contact [type="submit"] {
  background: var(--apeo-orange) !important;
  color: #fff !important;
  border: none !important;
  padding: .75rem 2rem !important;
  border-radius: var(--apeo-radius) !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  cursor: pointer;
  transition: var(--apeo-transition) !important;
  width: auto !important;
}
.wpcf7-submit:hover,
.apeo-formulaire-contact [type="submit"]:hover {
  background: #c85e0f !important;
  transform: translateY(-1px);
}

/* ── Hero / Cover ────────────────────────────────────────────── */
.apeo-hero .wp-block-cover__inner-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.apeo-hero .wp-block-cover__inner-container h1 {
  color: #fff !important;
  text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.apeo-hero .wp-block-cover__inner-container p {
  color: rgba(255,255,255,.92);
  font-size: 1.15rem;
}

/* ── Section statistiques ────────────────────────────────────── */
.apeo-stats-section .stat-item {
  text-align: center;
  padding: 1.5rem;
}
.apeo-stats-section .stat-nombre {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--apeo-blue);
  line-height: 1;
  display: block;
}
.apeo-stats-section .stat-label {
  font-size: .95rem;
  color: var(--apeo-text-muted);
  margin-top: .35rem;
}

/* ── Section événements ──────────────────────────────────────── */
.carte-evenement {
  background: var(--apeo-white);
  border: 1px solid var(--apeo-border);
  border-radius: var(--apeo-radius-lg);
  overflow: hidden;
  transition: var(--apeo-transition);
  box-shadow: var(--apeo-shadow);
}
.carte-evenement:hover {
  box-shadow: var(--apeo-shadow-lg);
  transform: translateY(-3px);
}
.carte-evenement .date-badge {
  background: var(--apeo-navy);
  color: #fff;
  text-align: center;
  padding: .75rem;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Section CTA ─────────────────────────────────────────────── */
.apeo-cta-section {
  text-align: center;
  padding: 4rem 2rem;
}
.apeo-cta-section h2 { color: inherit; }

/* ── Fil d'Ariane ────────────────────────────────────────────── */
.ast-breadcrumbs-wrapper {
  background: var(--apeo-light-bg);
  padding: .6rem 0;
  font-size: .88rem;
}

/* ── Footer ──────────────────────────────────────────────────── */
.apeo-footer {
  background: var(--apeo-navy);
  color: rgba(255,255,255,.85);
  padding: 3rem 0 1.5rem;
}
.apeo-footer a { color: rgba(255,255,255,.8); }
.apeo-footer a:hover { color: #fff; text-decoration: underline; }
.apeo-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 2rem;
  padding-top: 1.25rem;
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  text-align: center;
}

/* ── Page d'accueil — sections alternées ────────────────────── */
.section-fond-clair { background: var(--apeo-light-bg) !important; }
.section-fond-bleu  { background: var(--apeo-navy) !important; color: #fff; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .membres-grid { grid-template-columns: 1fr !important; }
  .membre-profil-header { flex-direction: column; align-items: center; text-align: center; }
  .apeo-membre-liens { justify-content: center; }
  .carte-membre { padding: 1.5rem 1rem; }
}
@media (max-width: 480px) {
  .membres-grid { grid-template-columns: 1fr !important; }
}

/* ── Accessibilité ───────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--apeo-orange);
  outline-offset: 2px;
}
.screen-reader-text {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
