/* ---------------------------------
       RESET & STYLES GLOBAUX
    --------------------------------- */
    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      padding: 0;
      font-family: 'Roboto', Arial, sans-serif;
      background-color: #f8f9fa;
      color: #333;
    }


    a {
      text-decoration: none;
      color: inherit;
    }

    h1, h2 {
      margin: 0;
      padding: 0;
    }

    .passed {
      text-decoration: line-through;
      opacity: 0.55;
    }

    /* "feedback-form"  */
    .feedback-form {
      max-width: 600px;
      margin: 15px auto;
      padding: 30px;
      background: #fff; 
      border-radius: 8px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    }

    .feedback-form textarea {
      min-height: 250px; /* agrandit la hauteur */
      width: 100%;
      padding: 12px;
      margin-top: 8px;
      border: 1px solid #ccc;
      border-radius: 4px;
      font: inherit;
      resize: vertical; /* Permet uniquement le redimensionnement vertical */
      transition: border-color 0.3s;
      box-sizing: border-box;
    }    

    /* Titre de la section */
    .feedback-form h2 {
      margin-top: 0;
      color: #014655;
      font-size: 1.5em;
      border-bottom: 2px solid #014655;
      padding-bottom: 10px;
    }

    /* Styles généraux pour les labels et champs */
    .feedback-form label {
      display: block;
      margin-top: 20px;
      font-weight: 500;
      color: #333;
    }

    .feedback-form input[type="text"],
    .feedback-form input[type="email"],
    .feedback-form textarea {
      width: 100%;
      padding: 12px;
      margin-top: 8px;
      border: 1px solid #ccc;
      border-radius: 4px;
      font: inherit; /* hérite de la police globale */
      transition: border-color 0.3s;
      box-sizing: border-box;
    }

    /* Effet focus pour mettre en avant le champ sélectionné */
    .feedback-form input[type="text"]:focus,
    .feedback-form input[type="email"]:focus,
    .feedback-form textarea:focus {
      outline: none;
      border-color: #014655;
      box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
    }

    /* Bouton d’envoi */
    .feedback-form button {
      margin-top: 20px;
      padding: 12px 20px;
      background: #014655;
      color: #fff;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 1em;
      font-weight: 500;
      transition: background 0.3s;
    }

    .feedback-form button:hover {
      background: #0a6579;
      color: #dcdcdce8;
    }

    /* Message de statut (succès / erreur) */
    .status-message {
      margin-top: 15px;
      font-size: 0.95em;
    }

    .status-message.success {
      color: #238b3b;
    }

    .status-message.error {
      color: #ad2633;
    }
    
    /* Bloc d'information sur la dernière mise à jour */
    #last-update {
      text-align: center;
      color: #555;
      font-size: 0.9em;
      font-style: italic;
      max-width: 90%;
    }

    /* ---------------------------------
       Motif
    --------------------------------- */
    body {
      position: relative; /* pour que ::before soit bien calé */
      z-index: 0;
    }

    body::before {
      content: "";
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: url('motif-vague.png') center/cover no-repeat;
      opacity: 0.05;      /* très discret */
      z-index: -1;        /* derrière tout le contenu */
      pointer-events: none;
    }
    /* ——— Header ——— */
    :root{
      --header-h: 48px;   /* change à 44/56 si besoin */
      --icon-h: 24px;
      --title-fs: 26px;
    }

    .site-header{
      position: sticky;
      top: 0;
      z-index: 1000;
      background-color: rgba(0, 86, 166, 0.85); /* bleu 85% */
      color: #fff;
      padding-top: max(env(safe-area-inset-top), 0px); /* iPhone notch */
    }

    .site-header .header-inner{
      display: grid;
      grid-template-columns: 1fr auto 1fr;  /* logo | titre | motif */
      align-items: center;
      height: var(--header-h) !important;   /* hauteur fixe */
      padding: 0 14px;                      /* pas de padding vertical */
      gap: 8px;
      backface-visibility: hidden;
      transform: translateZ(0);
    }

    .header-left, .header-right{
      display: flex;
      align-items: center;
    }
    .header-left{ justify-content: flex-start; }
    .header-right{ justify-content: flex-end; }

    .site-logo, .header-decor{
      height: var(--icon-h) !important;
      width: auto;
      display: block;
    }

    .site-title{
      margin: 0;
      font-family: "Marcellus", serif;
      font-weight: 400;
      font-size: var(--title-fs);
      line-height: 1;
      text-align: center;
      color: #fff;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      letter-spacing: 0.2px;
      text-rendering: optimizeLegibility;
      -webkit-font-smoothing: antialiased;
    }

    @media (min-width: 768px){
      .site-header .header-inner{ height: var(--header-h) !important; padding: 0 14px; }
      .site-logo, .header-decor{ height: var(--icon-h) !important; }
      .site-title{ font-size: var(--title-fs); }
    }

    .site-header{
      position: sticky;
      top: 0;
      z-index: 1000;
      /* avant: background-color: rgba(0, 86, 166, 0.85); */
      background: linear-gradient(
        to bottom,
        rgba(0,86,166,0.92),
        rgba(0,86,166,0.85)
      );
      color: #fff;
      padding-top: max(env(safe-area-inset-top), 0px);
    }

    /* éviter les press/menus sur les visuels décoratifs */
    .header-decor {
      opacity: 0.82;         /* un poil plus discret */
      pointer-events: none;  /* pas de tap/clic fantôme */
    }

    /* pas de sélection texte au tap */
    .site-title, .site-logo {
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
    }  

    /* — Tweaks logo header — */
    .site-logo{
      height: 30px !important;   /* ← plus grand (mets 32px si tu veux) */
      margin-left: 8px;           /* ← décale un peu vers la droite */
      width: auto;
    }

    /* Option : un poil plus grand sur ordi */
    @media (min-width: 768px){
      .site-logo{
        height: 35px !important;  
        margin-left: 20px;  
      }
    }

    .header-right{ padding-right: 2px; } /* ← motif plus vers le centre sur mobile */
    @media (min-width:768px){ .header-right{ padding-right: 4px; } }

    .header-decor{
      height: 40px !important;   /* ← taille visible du motif (mets 36/38 si tu veux plus) */
      width: auto;
      opacity: 0.85;
      margin-right: 6px;         /* ← avance un peu vers l’intérieur */
      transform: translateX(8px); /* ← pousse vers la droite */
    }

    /* garder la même logique sur ordi */
    @media (min-width: 768px){
      .header-decor{
        height: 45px !important;
        margin-right: 10px;
        }
    }


    /* ---------------------------------
       GESTION DES SECTIONS
    --------------------------------- */
    section {
      padding: 50px 20px;
      max-width: 1200px;
      margin: 0 auto;
      border-bottom: 1px solid #ddd;
    }
    section:last-of-type {
      border-bottom: none;
    }
    .title-section {
      text-align: center;
      margin-bottom: 30px;
    }

    /* Bouton de retour en haut de page */
    .floating-button {
      position: fixed;
      bottom: 20px;
      right: 20px;
      background-color: #2c5697;
      color: white;

      width: 50px;
      height: 50px;
      border-radius: 999px;

      border: none;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.25);
      font-size: 1.1em;
      cursor: pointer;
      z-index: 999;

      display: flex;
      align-items: center;
      justify-content: center;

      opacity: 0;
      pointer-events: none;
      transform: translateY(132px);
      transition:
        opacity 0.8s ease,
        transform 0.8s ease,
        background 0.8s ease;
    }


    .floating-button:hover {
      background-color: #163057;
    }

    /* État visible quand on a scrollé */
    .floating-button--visible {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
    }

    table caption {
      caption-side: top; /* affiche le titre au-dessus du tableau */
      font-weight: bold;
      font-size: 1.1em;
      margin-bottom: 0.5em;
    }

    /* ---------------------------------
       1) PROCHAIN BATEAU
    --------------------------------- */
    .prochain-bateau-container .table-container {
      display: flex;
      justify-content: space-around;
      flex-wrap: wrap;
      gap: 20px;
    }
    .prochain-bateau-container table {
      border-collapse: collapse;
      width: 100%;
      max-width: 500px;
      background-color: #ffffff;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      border-radius: 8px;
      overflow: hidden;
    }
    .prochain-bateau-container th,
    .prochain-bateau-container td {
      border: 1px solid #ddd;
      padding: 10px;
      text-align: center;
    }
    .prochain-bateau-container th {
      background-color: #003865;
      color: white;
      font-weight: 500;
    }
    .prochain-bateau-container tbody tr:nth-child(even) {
      background-color: #f2f2f2;
    }

    /* ---------------------------------
      2) BATEAU DU JOUR
    --------------------------------- */
    .bateau-jour-container .navigation {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      gap: 10px;
      margin-bottom: 20px;
    }

    /* masquer le datepicker */
    #calendar { display: none; }

    /* boutons J-1 / J+1 */
    .bateau-jour-container .navigation button {
      width: 40px;
      height: 40px;
      padding: 0;
      border-radius: 50%;
      background-color: #2c5697;
      color: #fff;
      border: none;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background .3s;
      cursor: pointer;
      font-size: 1em;
    }
    .bateau-jour-container .navigation button:hover {
      background-color: #163057;
    }

    /* titre de jour */
    #selectedDate {
      font-size: 1.50rem;
      line-height: 1.2;
      margin: .5em 0;
    }
    @media (max-width: 480px){
      #selectedDate { font-size: 1.20rem; }
    }

    /* tableau (style commun) */
    .bateau-jour-container .table {
      border: 1px solid #ddd;
      border-collapse: collapse;
      background-color: #fff;
      box-shadow: 0 2px 4px rgba(0,0,0,0.1);
      border-radius: 5px;
      overflow: hidden;
    }
    .bateau-jour-container .table th,
    .bateau-jour-container .table td {
      border: 1px solid #ddd;
      padding: 10px;
      text-align: center;
      font-size: 1em;
    }
    .bateau-jour-container .table th {
      background-color: #003865;
      color: #fff;
      font-weight: 500;
    }
    .bateau-jour-container .table tbody tr:nth-child(odd){
      background-color: #f2f2f2;
    }

    /* ====== DESKTOP (≥ 601px) : 2 tables en flex ====== */
    @media (min-width: 601px){
      .bateau-jour-container .table-container{
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 20px;
        overflow-x: visible;
        width: 100%;
      }
      .bateau-jour-container .table{
        flex: 1 1 45%;
        min-width: 300px;
        max-width: 100%;
        margin: 0;
      }
    }
    /* ====== Très petits écrans (≤ 380px) ====== */
    @media (max-width: 380px){
      .bateau-jour-container .table th,
      .bateau-jour-container .table td{
        padding: 6px 4px;
        font-size: .9rem;
      }
    }

    /* ====== Anti-scroll vertical (optionnel si #bateau-du-jour existe) ====== */
    @media (max-width: 600px){
      #bateau-du-jour,
      #bateau-du-jour .bateau-jour-container,
      #bateau-du-jour .table-container{
        overflow: visible !important;
        height: auto !important;
        -webkit-overflow-scrolling: auto !important;
      }
    }
    /* ====== Mobile (≤ 600px) : 2 tableaux côte à côte ====== */
    @media (max-width: 600px) {
      section {
        padding-left: 0;
        padding-right: 0;
      }

      /* Conteneur des tableaux en 2 colonnes */
      .bateau-jour-container .table-container {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 colonnes égales */
        gap: 8px;                       /* petit espace entre */
        overflow-x: hidden;             /* empêche tout scroll */
      }

      /* Chaque tableau s’adapte parfaitement */
      .bateau-jour-container .table {
        flex: none;
        min-width: 0;
        width: 100%;
        border-radius: 6px;
      }

      /* Ajuste un peu la taille du texte et les espacements */
      .bateau-jour-container .table caption {
        font-size: 1rem;
        margin-bottom: 4px;
      }
      .bateau-jour-container .table th,
      .bateau-jour-container .table td {
        padding: 8px 6px;
        font-size: 0.95rem;
      }
    }
    /* Message "horaires indicatifs" sous les boutons J-1 / J+1 */
    .indicative-info {
      max-width: 600px;
      margin: 0 auto 15px auto;
      padding: 10px 12px;
      border-radius: 6px;
      background: #012d6a53;
      border: 1px solid #54a7ff;
      
      display: flex;
      align-items: flex-start;
      gap: 8px;
      font-size: 0.95rem;
      color: #303030;

      /* État caché par défaut (sans .is-visible) */
      opacity: 0;
      transform: translateX(-120px);       /* un peu en dehors à gauche */
      max-height: 0;
      overflow: hidden;
      pointer-events: none;

      transition:
        opacity 0.7s cubic-bezier(.4, 0, .2, 1),
        transform 0.7s cubic-bezier(.4, 0, .2, 1),
        max-height 0.7s cubic-bezier(.4, 0, .2, 1);
      }

    .indicative-info .icon {
      flex-shrink: 0;
    }

    .indicative-info .text {
      line-height: 1.3;
    }

    /* Quand le message doit apparaître */
    .indicative-info.is-visible {
      opacity: 1;
      transform: translateX(0);          /* revient à sa place */
      max-height: 200px;                 /* assez grand pour le contenu */
      pointer-events: auto;
    }
    /* ---------------------------------
       3) HORAIRE DE LA SEMAINE
    --------------------------------- */
    .horaires-semaine-container label {
      display: block;
      margin: 5px 0;
      cursor: pointer;
    }
    .horaires-semaine-container #tables-container {
      margin: 0 auto;
      max-width: 1000px;
    }

    .horaires-semaine-container .compagnie {
      width: 100%;
      margin: 10px 0 4px 0;
      border-collapse: collapse;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    }
    .horaires-semaine-container .compagnie th,
    .horaires-semaine-container .compagnie td {
      padding: 10px 15px;
      text-align: center;
      border: 1px solid #ddd;
    }
    .horaires-semaine-container .compagnie th {
      background-color: #003865;
      color: white;
      font-weight: 500;
    }
    .horaires-semaine-container .compagnie tr:nth-child(even) {
      background-color: #f9f9f9;
    }
    .horaires-semaine-container .compagnie td strong {
      font-weight: 600;
    }
    
    .horaire {
      display: inline-block;
      margin: 4px 20px 4px 0;   /* espace horizontal + un peu de vertical */
      font-variant-numeric: tabular-nums;
      line-height: 1.4;
    }

    @media (max-width:480px){
      .horaire { margin: 1px 10px 3px 0; }
    }

    .meta-line{
      display:flex;
      flex-wrap:wrap;
      gap:.5rem;
      align-items:center;
    }
    .meta-item{ white-space:nowrap; }
    .sep{ opacity:.45; }
    .meta-note-small{
      margin-top:4px;
      font-size:.92em;
      opacity:.75;
    }

    /* 2e colonne = alignée + chiffres alignés */
    .horaires-semaine-container .compagnie td:nth-child(2){
      text-align: left;
      font-variant-numeric: tabular-nums;
    }


    /* ligne d'infos sous chaque section */
    .meta-info td {
      background: #e4eaedb5;
      font-style: italic;
      padding: 7px;
      text-align: center;
      font-style: normal; /* annule l’italique du parent */

    }

    /* annule le style global pour CE lien */
    .meta-info a.ext-link{
      color:#2c5697;
      text-decoration: underline;
      text-underline-offset: 2px;
      text-decoration-thickness: 2px;
      font-weight:600;
      display:inline-flex;            /* ← au lieu de inline-block */
      align-items:center;
      gap:.35rem;                     /* ← espace entre texte et icône */
      font-style: normal;             /* annule l’italique du parent */
    }

    /* icône externe */
    .meta-info a.ext-link::after{
      content:"↗";
      font-size:.9em;
      opacity:.9;
    }

    .meta-info a.ext-link:hover{
      color:#163057;
    }

    .meta-info a.ext-link:focus-visible{
      outline: 3px solid rgba(44,86,151,.35);
      outline-offset: 2px;
      border-radius: 4px;
    }

    .alert-note {
      margin-top: .5rem;
      padding: .5rem .75rem;
      border-radius: .5rem;
      background: #fff4e5;
      border: 1px solid #ffd8a8;
      font-weight: 600;
    }
    .meta-info td { padding-bottom: .25rem; }
    .meta-note td { padding-top: .25rem; }

    .horaires-semaine-container .compagnie td:nth-child(2),
    .horaires-semaine-container .compagnie th:nth-child(2) {
      text-align: left;
    }