/* ============================================================
   Centre Équestre du Mas de Cournon — Feuille de style
   ============================================================ */

:root {
  --green:       #2e7d32;
  --green-dark:  #1b5e20;
  --green-light: #4caf50;
  --yellow:      #fdd835;
  --yellow-light:#ffeb3b;
  --bg:          #fafdfb;
  --card-bg:     #ffffff;
  --text:        #2c3e2f;
  --text-light:  #5a6b5c;
  --shadow:      rgba(46, 125, 50, 0.12);
  --radius:      16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; }

/* ---- En-tête ---- */
header {
  background:
    linear-gradient(135deg, rgba(27,94,32,0.85), rgba(46,125,50,0.75)),
    url('../images/hero.jpg') center/cover no-repeat;
  color: white;
  padding: 6rem 2rem;
  text-align: center;
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg), transparent);
}

header h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
}

header p {
  font-size: 1.2rem;
  opacity: 0.95;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.logo-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--green-dark);
  padding: 0.5rem 1.5rem;
  border-radius: 30px;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ---- Navigation ---- */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background: var(--card-bg);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px var(--shadow);
  border-bottom: 3px solid var(--yellow);
}

nav a {
  color: var(--green-dark);
  padding: 1.2rem 2rem;
  text-decoration: none;
  font-weight: 600;
  position: relative;
  cursor: pointer;
  transition: color 0.3s;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 3px;
  background: var(--green);
  transition: all 0.3s;
  transform: translateX(-50%);
}

nav a:hover                { color: var(--green); }
nav a:hover::after,
nav a.active::after        { width: 60%; }

/* ---- Sections ---- */
section {
  display: none;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: auto;
  animation: fadeIn 0.4s ease;
}

section.active { display: block; }

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

h2 {
  color: var(--green);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

h2::after {
  content: '';
  display: block;
  width: 60px; height: 4px;
  background: var(--yellow);
  margin-top: 0.5rem;
  border-radius: 2px;
}

.section-intro {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

/* ---- Grille ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* ---- Cartes ---- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(46,125,50,0.2);
}

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

.card-image img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.4s;
}

.card:hover .card-image img { transform: scale(1.08); }

.card-image::after {
  content: '\002B'; /* + */
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0);
  font-size: 2rem;
  background: var(--yellow);
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
  opacity: 0.95;
}

.card:hover .card-image::after { transform: translate(-50%, -50%) scale(1); }

.card-content { padding: 1.5rem; }

.card-content h3 {
  color: var(--green-dark);
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.card-content p { color: var(--text-light); font-size: 0.95rem; }

.card-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.card-date {
  color: var(--green);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* ---- Boutons ---- */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-light));
  color: var(--green-dark);
  border-radius: 30px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  font-size: 1rem;
  box-shadow: 0 4px 15px rgba(253,216,53,0.4);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(253,216,53,0.6);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green);
  box-shadow: none;
}

.btn-outline:hover { background: var(--green); color: white; }

/* ---- Section Accueil ---- */
.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-top: 2rem;
}

.hero-text h3 {
  color: var(--green-dark);
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

.hero-text p { margin-bottom: 1.5rem; color: var(--text-light); }

.hero-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 20px 50px var(--shadow);
}

.hero-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.4s;
}

.hero-image:hover img { transform: scale(1.03); }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature {
  text-align: center;
  padding: 2rem 1rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px var(--shadow);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature h4   { color: var(--green-dark); margin-bottom: 0.5rem; }
.feature p    { font-size: 0.9rem; color: var(--text-light); }

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

.contact-info {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  padding: 2.5rem;
  border-radius: var(--radius);
  color: white;
}

.contact-info h3 { margin-bottom: 1.5rem; font-size: 1.5rem; }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.contact-item span { font-size: 1.5rem; }
.contact-item a    { color: white; text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }

.contact-form { display: flex; flex-direction: column; gap: 1.2rem; }
.form-group   { position: relative; }

input, textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: var(--card-bg);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(46,125,50,0.1);
}

textarea { resize: vertical; min-height: 150px; }

/* ---- Lightbox générique ---- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  animation: fadeIn 0.3s;
}

.lightbox.active { display: flex; }

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  position: relative;
}

.lightbox-content > img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -50px; right: 0;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  transition: transform 0.2s;
  line-height: 1;
  z-index: 10;
}

.lightbox-close:hover { transform: scale(1.2); }

/* Boutons précédent / suivant */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  font-size: 2.5rem;
  width: 50px; height: 80px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  z-index: 10;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-nav:hover        { background: rgba(255,255,255,0.3); }
.lb-prev             { left: -60px; }
.lb-next             { right: -60px; }

/* Compteur d'images (ex: 2 / 5) */
.lb-counter {
  text-align: center;
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* Masquer les flèches quand une seule image */
.lb-nav.hidden { display: none; }

/* ---- Lightbox Actualité ---- */
.lightbox-news {
  background: var(--card-bg);
  border-radius: var(--radius);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.lb-news-gallery {
  position: relative;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.lb-news-gallery img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

/* Compteur en overlay sur la photo */
.lb-news-gallery .lb-counter {
  position: absolute;
  bottom: 8px; right: 12px;
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: 20px;
  margin: 0;
}

/* Boutons nav dans la galerie actualité */
.lb-news-gallery .lb-prev { left: 8px; }
.lb-news-gallery .lb-next { right: 8px; }

.lightbox-news-content  { padding: 2rem; }

.lightbox-news-content h3 {
  color: var(--green-dark);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

/* ---- Pied de page ---- */
footer {
  text-align: center;
  padding: 2.5rem;
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: white;
  margin-top: 4rem;
}

footer p { opacity: 0.9; }

.footer-links { margin-top: 1rem; }

.footer-links a {
  color: var(--yellow);
  margin: 0 1rem;
  text-decoration: none;
  font-weight: 600;
}

.footer-links a:hover { text-decoration: underline; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .hero-content,
  .contact-grid   { grid-template-columns: 1fr; }
  .features       { grid-template-columns: 1fr; }
  nav a           { padding: 1rem; font-size: 0.9rem; }
  .lb-prev        { left: 4px; }
  .lb-next        { right: 4px; }
}

@media (max-width: 600px) {
  header          { padding: 4rem 1rem; }
  section         { padding: 3rem 1rem; }
  .grid           { grid-template-columns: 1fr; }
  .lightbox       { padding: 0; }
  .lightbox-content { max-width: 100%; max-height: 100%; }
  .lightbox-content > img { max-height: 100vh; width: 100%; object-fit: contain; }
}
