/* ========================================
   RESPONSIVE/TABLET.CSS
   Tablet only : 768px–1024px
   Tablet + Mobile : max-width: 1024px
   ======================================== */

/* Tablet uniquement */
@media (min-width: 768px) and (max-width: 1024px) {
  .sc-cards-grille {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Titre du site masqué par défaut par Kadence sur tablette (logo_layout.include.tablet vide) —
   plage alignée sur le breakpoint réel de la classe .vs-md-false de Kadence (720px, pas 768px) */
@media screen and (min-width: 720px) and (max-width: 1024px) {
  .site-title.vs-md-false {
    display: flex !important;
  }
}

/* Tablet + Mobile (max-width: 1024px) */
@media (max-width: 1024px) {
  /* Footer */
  .sc-footer__container:first-child {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }

  /* Grilles */
  .sc-agenda-services__grille {
    grid-template-columns: 1fr;
  }
  .sc-asso-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sc-com-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sc-projets-grille {
    grid-template-columns: 1fr;
  }
  .sc-projet-layout {
    grid-template-columns: 1fr;
  }
  .sc-projet-sidebar {
    position: static;
  }
  .sc-projet-header__inner {
    flex-direction: column;
  }
  .sc-comm__grille {
    grid-template-columns: repeat(2, 1fr);
  }
  .sc-elus__grille--4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .sc-elus__grille--3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .sc-elus__maire-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-5);
  }

  /* Layout */
  .sc-com-layout {
    grid-template-columns: 1fr;
  }
  .sc-com-layout__sidebar {
    position: static;
  }
  .sc-com-single__layout {
    grid-template-columns: 1fr;
  }
  .sc-com-single__map-wrap {
    position: static;
    order: -1;
  }
  .sc-com-single__map {
    height: 260px;
  }
  .sc-com-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
  .sc-com-item__name {
    min-width: 0;
  }

  .sc-article-layout {
    grid-template-columns: 1fr;
  }
  .sc-article__sidebar {
    order: -1;
  }

  .sc-page-sidebar-layout,
  .sc-page-sidebar-layout--gauche {
    grid-template-columns: 1fr;
  }
  .sc-page-sidebar-layout__sidebar {
    order: -1;
  }

  /* Projet phare */
  .sc-projet-phare__inner {
    grid-template-columns: 1fr;
  }
  .sc-projet-phare__image,
  .sc-projet-phare__image-placeholder {
    height: 220px;
    order: -1;
  }

  /* Mot du Maire */
  .sc-mot-maire__inner {
    grid-template-columns: 1fr;
  }
  .sc-mot-maire__photo,
  .sc-mot-maire__photo-placeholder {
    width: 140px;
    height: 170px;
  }

  /* Événements */
  .sc-event {
    flex-wrap: wrap;
  }
  .sc-event__thumb {
    width: 100%;
    height: 180px;
  }
  .sc-event__date-box {
    width: 72px;
    min-width: 72px;
  }

  /* FB Feed */
  .sc-fb-feed--cols-3 .sc-fb-feed__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Header mobile sticky */
  #mobile-header .site-branding a.brand img {
    transition: opacity 0.2s ease, max-width 0.2s ease;
  }
  #mobile-header .site-branding .site-title {
    transition: transform 0.2s ease;
    transform-origin: left center;
  }
  #mobile-header.item-is-stuck .site-branding a.brand img,
  #mobile-header .item-is-stuck .site-branding a.brand img {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
  }
  #mobile-header.item-is-stuck .site-branding .site-title,
  #mobile-header .item-is-stuck .site-branding .site-title {
    transform: scale(0.8);
  }

  /* Hero */
  .sc-hero {
    min-height: 55vh;
  }
  .sc-hero__boutons {
    flex-direction: column;
  }
  .sc-btn {
    width: 100%;
    justify-content: center;
  }
  .sc-section__header {
    flex-wrap: wrap;
    gap: var(--space-3);
  }
}
