/*
Theme Name: Tan Services
Theme URI: https://madebysteph.dev
Author: Stephane Donna
Author URI: https://tanorient.com
Description: Thème personnalisé pour le site catalogue de bâteaux de l'entreprise Tan Services
Tags: blog, one-column, custom-background, custom-colors, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, block-styles, wide-blocks, accessibility-ready
Version: 0.1
Requires at least: 6.6
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tan-services
*/

:root {
  --color-1: #4db9f5;
  --color-2: #0b234b;
  --color-3: #212121;
  --color-4: rgba(33, 33, 33, 0.5);
  --color-5: rgba(202, 234, 252, 0.3);
  --font-1: "Red Hat Display", sans-serif;
}

/* Smooth scroll pour toute la page */
html {
  scroll-behavior: smooth;
}

/* Vidéo responsive */
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Amélioration de la lisibilité des paragraphes */
p {
  hyphens: auto;
  word-break: break-word;
}

/* Lazy loading placeholder (si utilisé) */
/* img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
} */

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

body {
  font-family: var(--font-1);
}

.bg-glass {
  /* From https://css.glass */
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Alternance des couleurs pour les titres de bénéfices */
/* 1er, 3e, 5e... → color-1 (bleu clair) */
.benefits-container > div:nth-child(odd) .benefits-title {
  color: var(--color-1);
}

/* 2e, 4e, 6e... → color-2 (bleu foncé) */
.benefits-container > div:nth-child(even) .benefits-title {
  color: var(--color-2);
}

/* ============================================
   BLOC NEWS - FILTRAGE PAR CATÉGORIES
   ============================================ */

/* Boutons de filtrage de catégories */
.category-filter-btn {
  position: relative;
  overflow: hidden;
}

/* État actif du bouton de filtrage */
.category-filter-btn.active {
  background-color: var(--color-1) !important;
  color: white !important;
  border-color: var(--color-1) !important;
}

/* État de chargement du bouton */
.category-filter-btn.loading {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Animation de pulse pendant le chargement */
.category-filter-btn.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.7;
  }
}

/* Cartes d'articles de news */
.news-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Animation de chargement des articles */
.news-articles-container {
  transition: opacity 0.3s ease;
}

/* Ellipsis pour les extraits (limiter à 3 lignes) */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loader spinner animation */
.news-loader .animate-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.underline-effect {
  text-decoration: none;
  position: relative;
  transition: all 0.3s ease;
}

.underline-effect:hover {
  transform: translateY(-3px);
}

.underline-effect::before {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: -5px;
  left: 0;
  right: 0;
  height: 5px;
  background-color: var(--color-1);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s ease;
}

.underline-effect:hover::before {
  transform: scaleY(1);
}

/* ============================================
   BLOC BOAT LIST - LISTE DES BATEAUX
   ============================================ */

.boat-card {
  box-shadow: 8px 8px 32px 0 rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease-in-out;
}
.boat-card:hover {
  box-shadow: 8px 8px 32px 0 rgba(0, 0, 0, 0.12);
}
.boat-card:hover .boat-card-title {
  color: var(--color-1);
  background-color: var(--color-1);
  color: white;
  transition: background-color 0.3s ease-in-out;
}

/* ============================================
   NAVIGATION - SOUS-MENUS (DROPDOWN)
   ============================================ */

/* Menu principal - Réinitialisation */
#nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

#nav-links li {
  list-style: none;
}

/* Sous-menus */
.sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* État ouvert du sous-menu (via JavaScript) */
.sub-menu.submenu-open {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* Effet hover sur les liens de sous-menu */
.sub-menu a:first-child {
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
}

.sub-menu a:last-child {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* Séparateur subtil entre les items du sous-menu */
.sub-menu li:not(:last-child) {
  border-bottom: 1px solid #f3f4f6;
}

/* Animation d'apparition du sous-menu */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.group:hover .sub-menu {
  animation: fadeInUp 0.2s ease-out;
}

/* Mobile - Sous-menus */
@media (max-width: 767px) {
  /* Conteneur du menu mobile */
  #mobile-menu-links {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  #mobile-menu-links li {
    list-style: none;
  }

  /* Items avec sous-menu */
  .mobile-submenu-parent {
    position: relative;
  }

  /* Sous-menus mobile */
  .mobile-submenu {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* État ouvert du sous-menu */
  .mobile-submenu.mobile-submenu-open,
  .mobile-submenu:not(.hidden) {
    max-height: 1000px; /* Augmenté pour supporter les menus longs */
    opacity: 1;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  /* État fermé */
  .mobile-submenu.hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Indentation progressive pour les sous-niveaux */
  .mobile-submenu[data-level="1"] {
    padding-left: 1.5rem;
  }

  .mobile-submenu[data-level="2"] {
    padding-left: 2rem;
  }

  .mobile-submenu[data-level="3"] {
    padding-left: 2.5rem;
  }

  /* Liens dans les sous-menus mobile */
  .mobile-submenu a {
    position: relative;
    padding-left: 1rem;
  }

  /* Hover sur les liens de sous-menu */
  .mobile-submenu a:hover {
    padding-left: 1.25rem;
  }

  .mobile-submenu a:hover::before {
    opacity: 1;
  }

  /* Styles pour les items avec sous-sous-menus */
  .mobile-submenu .mobile-submenu-parent a {
    font-weight: 500;
  }

  /* Animation du bouton toggle */
  .mobile-submenu-parent button {
    transition: all 0.3s ease;
  }

  .mobile-submenu-parent button:active {
    transform: scale(0.95);
  }

  /* Séparateur visuel entre les items de premier niveau */
  #mobile-menu-links > li:not(:last-child) {
    padding-bottom: 0.5rem;
  }

  #mobile-menu-links > li:not(:first-child) {
    padding-top: 0.5rem;
  }
}
