/* ==========================================================================
   template.css — Restaurant de La Maurette
   Template Joomla autonome, sans dépendance à un framework tiers.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&display=swap');

/* --------------------------------------------------------------------------
   0. Reset léger
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
a { text-decoration: none; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: 0.5em 1em;
  z-index: 1000;
}
.skip-link:focus { left: 0; }

/* --------------------------------------------------------------------------
   1. Palette & typographie
   -------------------------------------------------------------------------- */
:root {
  --vigne: #6b2c39;
  --vigne-dark: #4d1f28;
  --olive: #6b7a4f;
  --terre: #b78a52;
  --terre-dark: #fff;
  --sable: #f5f0e6;
  --anthracite: #2e2a26;
  --blanc-casse: #fffdf8;
 
  --container-width: 1140px;
  --radius: 8px;
}


body {
  background-color: var(--blanc-casse);
  font-size: 0.85em;
  color: #2C3013;
  font-family: 'Helvetica', sans-serif;
  line-height: 1.6;
}

h1, h2, h3, h4, .site-title {
  font-family: 'Raleway', sans-serif;
  letter-spacing: 0.02em;
  color: var(--vigne);
  line-height: 1.25;
}

h1, .componentheading, .blog > h1, .blog > h2 {
  font-family: 'Raleway', sans-serif;
  font-size: 220%;
}

a { color: var(--vigne); transition: color .2s ease; }
a:hover, a:focus { color: var(--olive); }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --------------------------------------------------------------------------
   2. En-tête
   -------------------------------------------------------------------------- */
#site-header {
  background-color: var(--blanc-casse);
  border-bottom: 3px solid var(--terre);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  flex-wrap: wrap;
}

.site-brand a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.site-brand img,
.logo-img {
  max-height: 62px;
  width: auto;
}

.site-title {
  font-weight: bold;
  font-size: 1.3rem;
}

.phone-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.55em 1.15em;
  background-color: transparent;
  border: 1.5px solid var(--vigne);
  border-radius: 8px;
  color: var(--vigne) !important;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.phone-cta-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.phone-cta:hover,
.phone-cta:focus-visible {
  background-color: var(--vigne);
  color: var(--blanc-casse) !important;
  box-shadow: 0 4px 14px rgba(107, 44, 57, 0.25);
  transform: translateY(-1px);
}

/* Bouton hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 3px;
  background: var(--vigne);
  border-radius: 2px;
}

/* --------------------------------------------------------------------------
   3. Navigation
   -------------------------------------------------------------------------- */
.main-nav {
  background: linear-gradient(135deg, var(--terre) 0%, var(--terre-dark) 100%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
 
.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: var(--container-width);
  margin: 0 auto;
}
 
.main-nav a {
  position: relative;
  display: block;
  padding: 1rem 1.4rem;
  color: rgba(46, 42, 38, 0.8); /* anthracite atténué */
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: color .2s ease;
}
 
.main-nav a::after {
  content: '';
  position: absolute;
  left: 1.4rem;
  right: 1.4rem;
  bottom: 0.65rem;
  height: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
}
 
.main-nav li:hover > a,
.main-nav a.active,
.main-nav a:focus {
  color: var(--anthracite);
  background-color: transparent;
}
 
.main-nav li:hover > a::after,
.main-nav a.active::after,
.main-nav a:focus::after {
  transform: scaleX(1);
}
 
/* Sous-menus (si menu à niveaux) */
.main-nav li { position: relative; }
.main-nav ul ul {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  min-width: 220px;
  background-color: var(--terre-dark);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 50;
}
.main-nav li:hover > ul { display: block; }
.main-nav ul ul a { padding: 0.75rem 1rem; color: var(--vigne); }
 

/* --------------------------------------------------------------------------
   3bis. Pages avec diaporama — plein écran, contenu en bloc superposé
   -------------------------------------------------------------------------- */
.page-layout {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: calc(100vh - 130px); /* déduit approx. la hauteur du header */
  overflow: hidden;
  background-color: var(--vigne-dark); /* secours tant qu'aucune photo n'est ajoutée */
  padding: 3rem 4rem;
}

.page-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-slider-module {
  position: absolute;
  inset: 0;
}

.page-slider-module img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition-property: opacity;
  transition-timing-function: ease;
  /* transition-duration réglée en ligne par le JS, selon le paramètre du module */
}

.page-slider-module img.is-active {
  opacity: 1;
}

/* Chaque page a son propre module (mod_maurette_slider) en position
   "page-slider", pointant vers un dossier d'images qui lui est propre,
   assigné uniquement à cette page (assignation de menu). */

.page-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  max-height: calc(100% - 2rem);
  overflow-y: auto;
  padding: 2.25rem 2.5rem;
  background-color: rgba(255, 253, 248, 0.8); /* --blanc-casse en semi-transparent */
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.page-content h1 {
  margin-top: 0;
}

.page-content .sidebar {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--terre);
}

@media (max-width: 900px) {
  .page-layout {
    padding: 1.5rem;
    justify-content: center;
    min-height: 60vh;
  }
  .page-content {
    max-width: 100%;
    max-height: none;
    padding: 1.5rem 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   3ter. Pages sans diaporama — texte en pleine largeur
   S'affiche automatiquement quand aucun module n'est publié en position
   "page-slider" pour la page courante ($hasSlider dans index.php).
   -------------------------------------------------------------------------- */
.page-full {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  padding: 2.5rem 1.25rem;
}

.page-content-full {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
}

.page-full .sidebar {
  flex: 0 0 280px;
}

@media (max-width: 720px) {
  .page-full { flex-direction: column; }
  .page-full .sidebar { flex: 1 1 auto; width: 100%; }
}

/* --------------------------------------------------------------------------
   5. Composants de contenu
   -------------------------------------------------------------------------- */
.card {
  background-color: var(--blanc-casse);
  border: 1px solid var(--terre);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.page-header h1,
.item-page h1 {
  border-bottom: 2px solid var(--terre);
  padding-bottom: 0.4rem;
  margin-bottom: 1rem;
}

.btn-primary {
  display: inline-block;
  background-color: var(--olive);
  color: var(--blanc-casse) !important;
  padding: 0.65em 1.4em;
  border-radius: var(--radius);
  font-family: "Trebuchet MS", sans-serif;
  font-weight: bold;
}
.btn-primary:hover { background-color: var(--vigne); }

/* --------------------------------------------------------------------------
   6. Galerie photos
   Ajouter la classe "photo-grid" sur le conteneur des images
   (module personnalisé, article, ou champ HTML brut de l'éditeur).
   -------------------------------------------------------------------------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.photo-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--terre);
  transition: transform .25s ease, box-shadow .25s ease;
}

.photo-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

/* --------------------------------------------------------------------------
   6bis. Avis Google (mod_maurette_reviews)
   -------------------------------------------------------------------------- */
.google-reviews-notice {
  font-style: italic;
  color: #777;
}

.google-reviews-summary {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.google-reviews-stars { color: #f2a541; font-size: 1.3rem; letter-spacing: 0.05em; }
.google-review-stars  { color: #f2a541; font-size: 0.95rem; }

.google-reviews-score { font-weight: 700; }
.google-reviews-count { color: #777; font-size: 0.9rem; }

.google-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.google-review-card {
  border: 1px solid var(--terre);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background-color: var(--blanc-casse);
}

.google-review-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.google-review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.google-review-author { display: block; font-size: 0.95rem; }

.google-review-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #777;
}

.google-review-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.google-reviews-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.google-reviews-write {
  font-weight: 600;
  text-decoration: underline;
}

.google-reviews-attribution {
  font-size: 0.75rem;
  color: #999;
  margin: 0;
}

/* --------------------------------------------------------------------------
   6ter. Bandeau d'équipements/services (animaux, CB, wifi, motards...)
   -------------------------------------------------------------------------- */
.amenities {
	display: flex;
	flex-wrap: wrap;
	gap: 1.75rem;
	margin: 1.5rem 0;
	justify-content: center;
}

.amenity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 84px;
  text-align: center;
}

.amenity-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: var(--sable);
  border: 1.5px solid var(--terre);
  color: var(--vigne);
  transition: background-color .2s ease, transform .2s ease;
}

.amenity-icon svg {
  width: 26px;
  height: 26px;
}

.amenity:hover .amenity-icon {
  background-color: var(--vigne);
  color: var(--blanc-casse);
  transform: translateY(-2px);
}

.amenity-label {
  font-size: 0.72rem;
  color: var(--anthracite);
  line-height: 1.3;
}

#site-footer .amenity-label {
  color: var(--sable);
}

/* --------------------------------------------------------------------------
   6quater. Carte OpenStreetMap (module personnalisé)
   -------------------------------------------------------------------------- */
.osm-embed {
  position: relative;
  width: 100%;
  padding-bottom: 70%; /* ratio ~16:9, ajuste si besoin */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--terre);
  margin: 1rem 0 0.6rem;
}
 
.osm-embed iframe,
.osm-embed .osm-leaflet {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
 
/* Discrétiser l'attribution Leaflet sans la supprimer (obligation de licence
   OpenStreetMap — ne pas retirer entièrement, juste rendre plus sobre). */
.osm-embed .leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.75);
  padding: 1px 4px;
}
 
.osm-popup-links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
}
 
.osm-links {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
 
.osm-link-btn {
  flex: 1 1 0;
  display: block;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--vigne);
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--vigne);
}
.osm-link-btn:hover {
  background-color: var(--vigne);
  color: var(--blanc-casse);
}
 
@media (max-width: 480px) {
  .osm-links { flex-direction: column; }
}

/* --------------------------------------------------------------------------
   7. Pied de page
   -------------------------------------------------------------------------- */
#site-footer {
  background-color: var(--anthracite);
  color: var(--sable);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 2.5rem 1.25rem;
}

.footer-col { flex: 1 1 220px; }

.footer-inner a { color: var(--sable); }
.footer-inner a:hover { color: var(--terre); }

.footer-bottom {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,.15);
}

.footer-bottom a{
  color:#fff;
}

.footer-bottom a:hover{
  color:#b78a52;
}

/* --------------------------------------------------------------------------
   8. Page d'erreur
   -------------------------------------------------------------------------- */
.error-wrapper {
  text-align: center;
  padding: 5rem 1.25rem;
}
.error-wrapper h1 { font-size: 4rem; }

/* --------------------------------------------------------------------------
   9. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 720px) {
  .nav-toggle { display: flex; }

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

  .main-nav ul { flex-direction: column; }
  .main-nav ul ul { position: static; display: block; }

  .site-title { font-size: 1.1rem; }
  .phone-cta { order: 3; width: 100%; justify-content: center; }

  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}