/*
Theme Name: RÉPAR'ACTION
Theme URI: https://reparaction.org/
Author: MonsieurPAL
Author URI: https://monsieurpal.com/
Description: Thème officiel du site RÉPAR'ACTION — ateliers communautaires gratuits de réparation au Saguenay–Lac-Saint-Jean et en Mauricie, et programme scolaire RÉPAR'ACTION LABS. Reproduction fidèle du site statique d'origine, avec une vraie page par rubrique.
Version: 1.3.21
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: reparation
Tags: one-column, custom-logo, custom-colors, threaded-comments, translation-ready
*/

/* ============================================================
   RÉPAR'ACTION — feuille de style du thème
   Reprise fidèle du styles.css du site statique d'origine.
   La couleur primaire est pilotée par la variable
   --reparation-primary (réglable dans le Customizer).
   ============================================================ */

:root {
  --reparation-primary: #569b6d;
  --reparation-primary-dark: #4a8760;
}

body {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100%;
}

html {
  height: 100%;
}

* {
  box-sizing: border-box;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-header {
  background-color: var(--reparation-primary);
  color: white;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-img,
.custom-logo-link .custom-logo {
  height: 100px;
  width: auto;
  filter: brightness(0) invert(1);
  padding: 8px 16px;
}

.site-title-fallback {
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 1px;
}

.site-title-fallback:hover {
  color: #fff;
  text-decoration: none;
}

.main-nav .nav-list {
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav .nav-list a {
  display: inline-block;
  background-color: rgba(255,255,255,0.2);
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.main-nav .nav-list a:hover {
  background-color: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.main-nav .nav-list .current-menu-item a,
.main-nav .nav-list .current-page-item a {
  background-color: white;
  color: var(--reparation-primary);
  font-weight: bold;
}

/* Bouton hamburger : caché sur ordinateur, visible sur mobile. */
.menu-toggle {
  display: none;
}

.site-main {
  padding: 60px 0;
  min-height: calc(100% - 200px);
}

a {
  color: green;
  background-color: transparent;
  text-decoration: underline;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  background-color: white;
  padding: 60px 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  color: var(--reparation-primary);
  font-size: 48px;
  margin: 0 0 20px 0;
}

.hero p {
  color: #666;
  font-size: 20px;
  margin: 0;
  line-height: 1.6;
}

/* Article seul (v1.3.5+) : titre et contenu dans le même encadré,
   titre 34 px (2 lignes max), date hors du titre, texte justifié 12 pt. */
.hero.article-single {
  text-align: left;
}

.hero.article-single .article-title {
  color: var(--reparation-primary);
  font-size: 34px;
  line-height: 1.25;
  margin: 0 0 24px 0;
}

.hero.article-single .article-content,
.hero.article-single .article-content p,
.hero.article-single .article-content li,
.hero.article-single .article-content figcaption {
  font-size: 12pt;
  color: #666;
}

.hero.article-single .article-content p,
.hero.article-single .article-content li,
.hero.article-single .article-content figcaption {
  text-align: justify;
}

.hero.article-single .article-date {
  text-align: right;
  color: #999;
  font-size: 15px;
  margin: 28px 0 0 0;
}

.hero.article-single .article-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 24px 0 0 0;
  flex-wrap: wrap;
}

.hero.article-single .article-nav-prev {
  text-align: left;
}

.hero.article-single .article-nav-retour {
  text-align: center;
}

.hero.article-single .article-nav-next {
  text-align: right;
}

/* Tableaux des articles (v1.3.6) : retour à la ligne dans les cellules,
   zébrure gris pâle sur les lignes impaires, taille de police uniforme. */
.hero.article-single .article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 12pt;
}

.hero.article-single .article-content th,
.hero.article-single .article-content td {
  border: 1px solid #ddd;
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  font-size: 12pt;
  color: #666;
}

.hero.article-single .article-content thead th {
  background-color: var(--reparation-primary);
  color: #fff;
}

.hero.article-single .article-content tbody tr:nth-child(odd) {
  background-color: #f5f5f5;
}

/* Vidéos intégrées (v1.3.20) : pleine largeur du contenu, 16:9 responsive. */
.hero.article-single .article-content .wp-block-embed {
  max-width: 100%;
  margin: 24px 0;
}

.hero.article-single .article-content .wp-block-embed__wrapper {
  position: relative;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  max-width: 100%;
}

.hero.article-single .article-content .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.card {
  background-color: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.card-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.card-icon img {
  height: auto;
}

.card h3 {
  color: var(--reparation-primary);
  font-size: 24px;
  margin: 0 0 15px 0;
}

.card p {
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.card iframe {
  max-width: 100%;
}

audio {
  max-width: 100%;
}

/* Formulaire de contact (désactivé par défaut, comme sur le site d'origine) */
.contact-form {
  background-color: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.08);
  max-width: 600px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  color: var(--reparation-primary);
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 16px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--reparation-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  background-color: var(--reparation-primary);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.submit-btn:hover {
  background-color: var(--reparation-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(86,155,109,0.3);
}

.success-message {
  display: none;
  background-color: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.success-message.show {
  display: block;
}

.site-footer {
  background-color: var(--reparation-primary);
  color: white;
  text-align: center;
  padding: 30px 0;
  margin-top: 60px;
}

.site-footer p {
  margin: 0 0 8px 0;
  opacity: 0.9;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: #fff;
  text-decoration: underline;
}

.site-footer a:hover {
  opacity: 0.85;
}

/* Accessibilité : cible visible au clavier */
.main-nav .nav-list a:focus-visible,
a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  /* En-tête condensé : logo à gauche, hamburger à droite. */
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: relative;
  }

  .logo-img,
  .custom-logo-link .custom-logo {
    height: 60px;
    padding: 4px 8px;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.7);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
  }

  .menu-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .menu-toggle.is-open span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }

  .menu-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.is-open span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }

  /* Panneau de navigation déroulant. */
  .main-nav {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 100;
  }

  .main-nav.nav-open {
    display: block;
  }

  .main-nav .nav-list {
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: stretch;
    gap: 8px;
    background: var(--reparation-primary);
    border-radius: 12px;
    padding: 12px;
    margin: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  }

  .main-nav .nav-list a {
    display: block;
    text-align: center;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero.article-single .article-title {
    font-size: 26px;
  }

  .hero p {
    font-size: 16px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}
