/* Deferred CSS - Non-critical styles loaded after first paint */

:root {
  --primary-green-dark: #5ba373;
  --accent-green: #c4e6d1;
  --dark-green: #2d5a3d;
  --mint-green: #e8f5e8;
  --text-light: #6b6b6b;
  --shadow-medium: 0 8px 30px rgba(115, 196, 142, 0.15);
  --shadow-strong: 0 15px 40px rgba(115, 196, 142, 0.2);
  --border-radius-small: 12px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { 
    animation: none !important; 
    transition: none !important; 
  }
}

/* Mobile overflow prevention - additional styles */
@media (max-width: 768px) {
  /* Safari iOS - prevent phone number detection and styling */
  .section-footer strong {
    font-family: Arial, sans-serif !important;
    font-weight: bold !important;
    font-size: 18px !important;
    color: #ffffff !important;
    background: none !important;
    border: none !important;
    text-shadow: none !important;
    -webkit-text-stroke: none !important;
    transform: none !important;
    -webkit-transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    font-style: normal !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    line-height: normal !important;
    -webkit-font-smoothing: auto !important;
    -moz-osx-font-smoothing: auto !important;
    text-rendering: auto !important;
  }
  
  /* Disable rotating background animation on mobile Safari */
  .section-footer::before {
    animation: none !important;
    display: none !important;
  }
  
  /* Simplify the section footer background for Safari */
  .section-footer {
    background: #73c48e !important;
    position: relative !important;
  }
}

.skip-link { 
  position: absolute; 
  left: -9999px; 
  top: auto; 
  width: 1px; 
  height: 1px; 
  overflow: hidden; 
  background: var(--primary-green);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-small);
  font-weight: 600;
  z-index: 1000;
}

.skip-link:focus { 
  position: fixed; 
  top: 1rem; 
  left: 1rem; 
  width: auto; 
  height: auto; 
}

/* Enhanced header animations */
.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

.site-header .logo {
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Enhanced section styling */
.section-alt::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
  clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
  opacity: 0.1;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
}

.section-header h2 { 
  margin: 0 0 1.5rem; 
  font-size: clamp(2.2rem, 4vw, 3rem); 
  font-weight: 800;
  color: var(--text-dark);
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-green), var(--primary-green-light));
  border-radius: 2px;
}

/* Enhanced card styling */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-green), var(--primary-green-light), var(--secondary-green));
}

.card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(115, 196, 142, 0.05) 0%, transparent 70%);
  transition: var(--transition);
  opacity: 0;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-strong);
}

.card:hover::after {
  opacity: 1;
}

.card .image { 
  display: block; 
  width: 160px; 
  max-width: 100%; 
  margin: 0 auto 2rem; 
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  position: relative;
}

.card .image::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
  opacity: 0;
  transition: var(--transition);
  border-radius: 50%;
}

.card:hover .image::before {
  opacity: 0.2;
}

.card .image img { 
  border-radius: 50%; 
  transition: var(--transition);
  width: 100%;
  height: 160px;
  object-fit: cover;
}

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

.card h3 {
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  font-weight: 700;
  text-align: center;
  font-size: 1.4rem;
}

/* Enhanced button styling */
.cta .button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: var(--transition);
}

.cta .button:hover::before {
  left: 100%;
}

/* Section footer */
.section-footer {
  text-align: center;
  margin-top: 4rem;
  padding: 3rem 2rem;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
  color: white;
  position: relative;
  overflow: hidden;
}

.section-footer::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.section-footer p {
  margin: 0.75rem 0;
  position: relative;
  z-index: 2;
}

.section-footer strong {
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-text-stroke: 0;
  color: white;
  letter-spacing: 0.5px;
}

/* Tables */
.horaires { 
  font-weight: 700; 
  color: var(--text-dark);
  font-size: 1.2rem;
  text-align: center;
  line-height: 1.8;
}

.price { 
  width: 100%; 
  border-collapse: collapse; 
  margin-top: 2rem;
  background: var(--bg-white);
  border-radius: var(--border-radius-small);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.price td { 
  padding: 1.5rem; 
  border-bottom: 1px solid var(--accent-green); 
  transition: var(--transition);
}

.price tr:hover td {
  background: var(--mint-green);
}

.price td:first-child {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.price td:last-child {
  font-weight: 800;
  color: var(--primary-green);
  text-align: right;
  font-size: 1.2rem;
  white-space: nowrap;
}

/* Amenities */
.amenities { 
  color: var(--text-medium); 
  display: flex; 
  align-items: center; 
  justify-content: center;
  gap: 2rem; 
  margin: 3rem 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.amenities i {
  color: var(--primary-green);
  font-size: 1.5rem;
  margin-right: 0.5rem;
}

/* Maps */
#gmaps { 
  margin-top: 3rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  position: relative;
}

#gmaps::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-green-light));
  opacity: 0.1;
  pointer-events: none;
}

#gmaps iframe { 
  width: 100%; 
  height: min(70vh, 500px); 
  border: 0; 
  position: relative;
  z-index: 1;
}

/* Desktop responsive design */
@media (min-width: 640px) {
  .card { 
    grid-column: span 6; 
  }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards .card { grid-column: auto; }
  .cards .card:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 600px;
    width: 100%;
  }
}

@media (min-width: 960px) {
  .card { 
    grid-column: span 6; 
  }
  
  .section {
    padding: 6rem 1rem;
  }
  
  .site-header {
    padding: 8rem 1rem 6rem;
  }
}

/* Print styles */
@media print {
  .section {
    page-break-inside: avoid;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* Extra spacing between intro paragraph and cards in L'équipe */
#equipe .container > p {
  margin-bottom: 2.5rem;
}
