/* ==========================================================
 * PN - Compatibilite anciennes tablettes Android / Chrome
 * Active uniquement quand le script ajoute .pn-legacy-device.
 * ========================================================== */

html.pn-legacy-device,
html.pn-legacy-device body {
  max-width: 100%;
  overflow-x: hidden;
}

html.pn-legacy-device *,
html.pn-legacy-device *::before,
html.pn-legacy-device *::after {
  box-sizing: border-box;
}

html.pn-legacy-device img,
html.pn-legacy-device svg,
html.pn-legacy-device iframe,
html.pn-legacy-device video {
  max-width: 100%;
}

/* Footer : le fond ne doit pas dependre uniquement d'un pseudo-element. */
html.pn-legacy-device #pn-site-footer.pn-footer {
  background: #759739 !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  clear: both !important;
}

html.pn-legacy-device #pn-site-footer.pn-footer::before {
  background: #759739 !important;
  background: linear-gradient(to bottom, #759739 0%, #678335 100%) !important;
}

html.pn-legacy-device #pn-site-footer .pn-footer-cta {
  background: #ffd21a !important;
  color: #000 !important;
}

/* Secours si les espacements flex/grid gap ne sont pas geres. */
@supports not (gap: 1rem) {
  html.pn-legacy-device .pn-agenda-header > * + *,
  html.pn-legacy-device .pn-mobile-bar > * + *,
  html.pn-legacy-device .pn-loop-format-buttons > * + *,
  html.pn-legacy-device .pn-active-filters > * + *,
  html.pn-legacy-device .categories-scroll > * + *,
  html.pn-legacy-device .pn-header-actions > * + *,
  html.pn-legacy-device .pn-header-left > * + *,
  html.pn-legacy-device #pn-site-footer .pn-footer-social > * + * {
    margin-left: 10px !important;
  }

  html.pn-legacy-device #pn-site-footer .pn-footer-mini ul > * + * {
    margin-left: 16px !important;
  }

  html.pn-legacy-device .pn-agenda-filters > * + *,
  html.pn-legacy-device #pn-site-footer .pn-footer-links li + li,
  html.pn-legacy-device .pn-filter-panel .pn-agenda-filters > * + * {
    margin-top: 10px !important;
  }
}

/* Secours si CSS Grid ne passe pas correctement. */
@supports not (display: grid) {
  html.pn-legacy-device .pn-agenda-layout,
  html.pn-legacy-device .post-type-archive-lieux .pn-agenda-layout,
  html.pn-legacy-device .pn-list,
  html.pn-legacy-device .post-type-archive-lieux .pn-list,
  html.pn-legacy-device .yarpp-thumbnails-responsive,
  html.pn-legacy-device .pn-lieu-layout,
  html.pn-legacy-device .pn-lieu-related-grid,
  html.pn-legacy-device #pn-site-footer .pn-footer-wrap {
    display: flex !important;
    flex-wrap: wrap !important;
  }

  html.pn-legacy-device .pn-agenda-sidebar,
  html.pn-legacy-device .post-type-archive-lieux .pn-agenda-sidebar {
    flex: 0 0 320px !important;
  }

  html.pn-legacy-device .pn-agenda-layout > main,
  html.pn-legacy-device .post-type-archive-lieux .pn-agenda-layout > main,
  html.pn-legacy-device .pn-lieu-main {
    flex: 1 1 520px !important;
  }

  html.pn-legacy-device .pn-list > *,
  html.pn-legacy-device .post-type-archive-lieux .pn-list > *,
  html.pn-legacy-device .yarpp-thumbnails-responsive > *,
  html.pn-legacy-device .pn-lieu-related-grid > * {
    flex: 1 1 280px !important;
    margin: 0 16px 18px 0 !important;
  }

  html.pn-legacy-device #pn-site-footer .pn-footer-col {
    flex: 1 1 260px !important;
    margin: 0 28px 28px 0 !important;
  }
}

@supports not (aspect-ratio: 1 / 1) {
  html.pn-legacy-device .pn-card img,
  html.pn-legacy-device .post-type-archive-lieux .pn-card img,
  html.pn-legacy-device .yarpp-thumbnail-item img,
  html.pn-legacy-device .pn-lieu-hero-media,
  html.pn-legacy-device .pn-lieu-related-card img {
    height: auto !important;
  }
}

@supports not (font-size: clamp(1rem, 2vw, 2rem)) {
  html.pn-legacy-device .pn-hero-title,
  html.pn-legacy-device .pn-article-title,
  html.pn-legacy-device body.single-post .entry-title {
    font-size: 2rem !important;
  }

  @media (max-width: 640px) {
    html.pn-legacy-device .pn-hero-title,
    html.pn-legacy-device .pn-article-title,
    html.pn-legacy-device body.single-post .entry-title {
      font-size: 1.55rem !important;
    }
  }
}

@media (max-width: 1024px) {
  html.pn-legacy-device .site,
  html.pn-legacy-device .site-content,
  html.pn-legacy-device #content,
  html.pn-legacy-device .ast-container,
  html.pn-legacy-device .page-template-page-articles .ast-container,
  html.pn-legacy-device .post-type-archive-lieux .ast-container,
  html.pn-legacy-device .archive .ast-container,
  html.pn-legacy-device .author .ast-container,
  html.pn-legacy-device .single-post .ast-container,
  html.pn-legacy-device .single-lieux .ast-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* Header mobile/tablette : espacement stable sur vieux Chrome. */
  html.pn-legacy-device .pn-site-header {
    width: 100% !important;
    max-width: 100% !important;
    background: #759739 !important;
    overflow: visible !important;
  }

  html.pn-legacy-device .pn-header-inner {
    width: 100% !important;
    max-width: 100% !important;
    height: 68px !important;
    min-height: 68px !important;
    padding: 0 14px !important;
    overflow: visible !important;
  }

  html.pn-legacy-device .pn-header-left,
  html.pn-legacy-device .pn-header-actions {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 88px !important;
    min-width: 88px !important;
    max-width: 88px !important;
    gap: 0 !important;
  }

  html.pn-legacy-device .pn-header-left {
    justify-content: flex-start !important;
  }

  html.pn-legacy-device .pn-header-actions {
    justify-content: flex-end !important;
    padding-left: 0 !important;
    border-left: 0 !important;
  }

  html.pn-legacy-device .pn-header-left > * + *,
  html.pn-legacy-device .pn-header-actions > * + * {
    margin-left: 14px !important;
  }

  html.pn-legacy-device .pn-brand-zone {
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 148px !important;
    max-width: 42vw !important;
    min-width: 0 !important;
    height: 68px !important;
  }

  html.pn-legacy-device .pn-logo,
  html.pn-legacy-device .pn-logo img {
    display: block !important;
    width: 148px !important;
    max-width: 42vw !important;
    height: auto !important;
  }

  html.pn-legacy-device .pn-latest-issue,
  html.pn-legacy-device .pn-latest-issue img {
    display: none !important;
  }

  html.pn-legacy-device .pn-site-header .pn-icon,
  html.pn-legacy-device .pn-site-header .pn-icon svg,
  html.pn-legacy-device .pn-site-header .pn-menu-toggle svg,
  html.pn-legacy-device .pn-site-header .pn-search-toggle svg,
  html.pn-legacy-device .pn-site-header .pn-account-link svg,
  html.pn-legacy-device .pn-site-header .pn-cart-link svg {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
  }

  html.pn-legacy-device .pn-account-link,
  html.pn-legacy-device .pn-cart-link,
  html.pn-legacy-device .pn-menu-toggle,
  html.pn-legacy-device .pn-search-toggle {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }

  html.pn-legacy-device .pn-cart-count {
    right: -9px !important;
    top: -9px !important;
    min-width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    font-size: 12px !important;
  }

  html.pn-legacy-device .pn-site-header.is-open {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    z-index: 2147483000 !important;
  }

  html.pn-legacy-device .pn-site-header.is-open .pn-header-inner {
    position: relative !important;
    z-index: 2147483001 !important;
    background: #759739 !important;
  }

  html.pn-legacy-device .pn-site-header.is-open .pn-menu-panel {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 68px !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    background: rgba(255, 255, 255, .97) !important;
    z-index: 2147482999 !important;
  }

  html.pn-legacy-device .pn-desktop-panel,
  html.pn-legacy-device .pn-search-bar {
    background: rgba(255, 255, 255, .97) !important;
  }

  /* Archives et listes : revenir a un flux simple si les cartes sautent. */
  html.pn-legacy-device .pn-list,
  html.pn-legacy-device .post-type-archive-lieux .pn-list,
  html.pn-legacy-device .yarpp-thumbnails-responsive,
  html.pn-legacy-device .pn-lieu-related-grid,
  html.pn-legacy-device .ast-row,
  html.pn-legacy-device .site-main .posts-container {
    display: block !important;
    width: 100% !important;
  }

  html.pn-legacy-device .pn-list > *,
  html.pn-legacy-device .post-type-archive-lieux .pn-list > *,
  html.pn-legacy-device .yarpp-thumbnails-responsive > *,
  html.pn-legacy-device .pn-lieu-related-grid > *,
  html.pn-legacy-device .ast-row > article,
  html.pn-legacy-device .site-main .posts-container > article {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 18px !important;
    float: none !important;
  }

  html.pn-legacy-device .pn-card,
  html.pn-legacy-device .ast-article-post,
  html.pn-legacy-device .yarpp-thumbnail-item,
  html.pn-legacy-device .pn-lieu-related-card {
    background: #fff !important;
    color: #222 !important;
    overflow: hidden !important;
  }

  html.pn-legacy-device .pn-card img,
  html.pn-legacy-device .ast-article-post img,
  html.pn-legacy-device .yarpp-thumbnail-item img,
  html.pn-legacy-device .pn-lieu-related-card img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }

  html.pn-legacy-device .pn-card h1,
  html.pn-legacy-device .pn-card h2,
  html.pn-legacy-device .pn-card h3,
  html.pn-legacy-device .ast-article-post .entry-title,
  html.pn-legacy-device .yarpp-thumbnail-title,
  html.pn-legacy-device .pn-lieu-related-card h3 {
    color: #111 !important;
    line-height: 1.22 !important;
  }

  html.pn-legacy-device .pn-card p,
  html.pn-legacy-device .pn-card .excerpt-text,
  html.pn-legacy-device .ast-article-post .entry-content,
  html.pn-legacy-device .ast-article-post .entry-summary,
  html.pn-legacy-device .yarpp-thumbnail-item p {
    color: #333 !important;
    line-height: 1.55 !important;
  }

  html.pn-legacy-device .pn-mobile-bar {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Articles : tailles fixes lisibles quand clamp/variables sont mal interpretes. */
  html.pn-legacy-device body.single-post,
  html.pn-legacy-device body.single-post .site-content,
  html.pn-legacy-device article.pn-article,
  html.pn-legacy-device .pn-article,
  html.pn-legacy-device .single-post .entry-content,
  html.pn-legacy-device .single-post .ast-article-single,
  html.pn-legacy-device .pn-article-content,
  html.pn-legacy-device .pn-article-body {
    color: #222 !important;
  }

  html.pn-legacy-device .single-post article.pn-article .pn-article-title,
  html.pn-legacy-device .single-pn-article article.pn-article .pn-article-title,
  html.pn-legacy-device body.single-post h1.entry-title,
  html.pn-legacy-device body.single-post .entry-title,
  html.pn-legacy-device .single-lieux .pn-article-title {
    font-size: 30px !important;
    line-height: 1.16 !important;
    color: #111 !important;
    letter-spacing: 0 !important;
  }

  html.pn-legacy-device .pn-article-subtitle,
  html.pn-legacy-device .pn-article-subtitle p {
    font-size: 19px !important;
    line-height: 1.45 !important;
    color: #333 !important;
  }

  html.pn-legacy-device .single-post .entry-content,
  html.pn-legacy-device .pn-article-content,
  html.pn-legacy-device .pn-article-body,
  html.pn-legacy-device .single-post .entry-content p,
  html.pn-legacy-device .single-post .entry-content li,
  html.pn-legacy-device article.pn-article p,
  html.pn-legacy-device article.pn-article li {
    font-size: 17px !important;
    line-height: 1.7 !important;
    color: #222 !important;
  }

  html.pn-legacy-device .single-post .entry-content h2,
  html.pn-legacy-device article.pn-article h2 {
    font-size: 24px !important;
    line-height: 1.25 !important;
    color: #111 !important;
  }

  html.pn-legacy-device .single-post .entry-content h3,
  html.pn-legacy-device article.pn-article h3 {
    font-size: 21px !important;
    line-height: 1.3 !important;
    color: #111 !important;
  }

  html.pn-legacy-device .pn-image-caption,
  html.pn-legacy-device figcaption,
  html.pn-legacy-device .wp-caption-text {
    color: #555 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }

  html.pn-legacy-device .meta-publication,
  html.pn-legacy-device .pn-article-meta,
  html.pn-legacy-device .pn-article-date,
  html.pn-legacy-device .pn-article-author,
  html.pn-legacy-device .entry-meta {
    color: #4b5563 !important;
  }

  /* Footer mobile/tablette : fond et colonnes visibles. */
  html.pn-legacy-device #pn-site-footer.pn-footer {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  html.pn-legacy-device #pn-site-footer .pn-footer-wrap,
  html.pn-legacy-device #pn-site-footer .pn-footer-main,
  html.pn-legacy-device #pn-site-footer .pn-footer-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  html.pn-legacy-device #pn-site-footer .pn-footer-col,
  html.pn-legacy-device #pn-site-footer .pn-footer-brand,
  html.pn-legacy-device #pn-site-footer .pn-footer-nav {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 22px !important;
    padding: 0 !important;
  }

  html.pn-legacy-device #pn-site-footer a,
  html.pn-legacy-device #pn-site-footer p,
  html.pn-legacy-device #pn-site-footer li,
  html.pn-legacy-device #pn-site-footer h2,
  html.pn-legacy-device #pn-site-footer h3 {
    color: #fff !important;
  }

  html.pn-legacy-device #pn-site-footer .pn-footer-cta {
    color: #000 !important;
  }

  /* Panier WooCommerce classique : secours lisible sur tablettes anciennes. */
  html.pn-legacy-device body.woocommerce-cart .site-content > .ast-container,
  html.pn-legacy-device body.woocommerce-checkout .site-content > .ast-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  html.pn-legacy-device body.woocommerce-cart form.woocommerce-cart-form,
  html.pn-legacy-device body.woocommerce-cart .cart-collaterals,
  html.pn-legacy-device body.woocommerce-cart .cart_totals,
  html.pn-legacy-device body.woocommerce-checkout form.checkout {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.shop_table,
  html.pn-legacy-device body.woocommerce-cart table.shop_table tbody,
  html.pn-legacy-device body.woocommerce-cart table.shop_table tfoot,
  html.pn-legacy-device body.woocommerce-cart table.shop_table tr,
  html.pn-legacy-device body.woocommerce-cart table.shop_table td,
  html.pn-legacy-device body.woocommerce-cart table.shop_table th {
    width: 100% !important;
    max-width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.shop_table thead {
    display: none !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.shop_table,
  html.pn-legacy-device body.woocommerce-cart table.shop_table tbody,
  html.pn-legacy-device body.woocommerce-cart table.shop_table tr,
  html.pn-legacy-device body.woocommerce-cart table.shop_table td {
    display: block !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.shop_table tr.cart_item {
    margin: 0 0 16px !important;
    padding: 14px !important;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.shop_table td {
    padding: 8px 0 !important;
    border: 0 !important;
    text-align: left !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.shop_table td::before {
    content: attr(data-title);
    display: block;
    margin: 0 0 4px;
    font-weight: 700;
    color: #759739;
  }

  html.pn-legacy-device body.woocommerce-cart table.shop_table td.product-remove::before,
  html.pn-legacy-device body.woocommerce-cart table.shop_table td.product-thumbnail::before,
  html.pn-legacy-device body.woocommerce-cart table.shop_table td.actions::before {
    content: "";
    display: none;
  }

  html.pn-legacy-device body.woocommerce-cart table.cart .product-thumbnail {
    display: block !important;
    text-align: left !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.cart img {
    width: 92px !important;
    height: auto !important;
    max-width: 92px !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.cart .quantity,
  html.pn-legacy-device body.woocommerce-cart table.cart .quantity input.qty {
    display: inline-flex !important;
    width: auto !important;
    max-width: 92px !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.cart td.actions,
  html.pn-legacy-device body.woocommerce-cart table.cart td.actions .coupon {
    display: block !important;
    width: 100% !important;
  }

  html.pn-legacy-device body.woocommerce-cart table.cart td.actions .coupon input,
  html.pn-legacy-device body.woocommerce-cart table.cart td.actions .coupon button,
  html.pn-legacy-device body.woocommerce-cart table.cart td.actions > button {
    width: 100% !important;
    margin: 0 0 10px !important;
  }

  /* Panier WooCommerce Blocks : secours si le layout moderne ne passe pas. */
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart,
  html.pn-legacy-device body.woocommerce-cart .wc-block-components-sidebar-layout,
  html.pn-legacy-device body.woocommerce-cart .wc-block-components-sidebar-layout-main,
  html.pn-legacy-device body.woocommerce-cart .wc-block-components-sidebar,
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-items,
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-items tbody,
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-items tr,
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-items td {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
  }

  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-items__header {
    display: none !important;
  }

  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-items__row,
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-item__wrap {
    display: block !important;
    min-height: 1px !important;
    margin: 0 0 16px !important;
    padding: 14px !important;
    border: 1px solid #e5e7eb !important;
    background: #fff !important;
  }

  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-item__image {
    float: left !important;
    width: 92px !important;
    margin: 0 12px 8px 0 !important;
  }

  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-item__image img {
    width: 92px !important;
    height: auto !important;
  }

  html.pn-legacy-device body.woocommerce-cart .wc-block-components-product-name,
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-item__prices,
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart-item__quantity,
  html.pn-legacy-device body.woocommerce-cart .wc-block-components-product-metadata {
    display: block !important;
    overflow: visible !important;
  }

  html.pn-legacy-device body.woocommerce-cart .wc-block-components-sidebar,
  html.pn-legacy-device body.woocommerce-cart .wc-block-cart__submit-container,
  html.pn-legacy-device body.woocommerce-cart .wc-block-components-totals-wrapper {
    clear: both !important;
    margin-top: 16px !important;
  }
}

@media (max-width: 480px) {
  html.pn-legacy-device .pn-header-inner,
  html.pn-legacy-device .pn-brand-zone {
    height: 64px !important;
    min-height: 64px !important;
  }

  html.pn-legacy-device .pn-header-left,
  html.pn-legacy-device .pn-header-actions {
    flex-basis: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
  }

  html.pn-legacy-device .pn-header-left > * + *,
  html.pn-legacy-device .pn-header-actions > * + * {
    margin-left: 12px !important;
  }

  html.pn-legacy-device .pn-logo,
  html.pn-legacy-device .pn-logo img {
    width: 134px !important;
    max-width: 38vw !important;
  }

  html.pn-legacy-device .pn-site-header .pn-icon,
  html.pn-legacy-device .pn-site-header .pn-icon svg,
  html.pn-legacy-device .pn-site-header .pn-menu-toggle svg,
  html.pn-legacy-device .pn-site-header .pn-search-toggle svg,
  html.pn-legacy-device .pn-site-header .pn-account-link svg,
  html.pn-legacy-device .pn-site-header .pn-cart-link svg {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
  }

  html.pn-legacy-device .pn-site-header.is-open .pn-menu-panel {
    top: 64px !important;
  }

  html.pn-legacy-device .single-post article.pn-article .pn-article-title,
  html.pn-legacy-device .single-pn-article article.pn-article .pn-article-title,
  html.pn-legacy-device body.single-post h1.entry-title,
  html.pn-legacy-device body.single-post .entry-title,
  html.pn-legacy-device .single-lieux .pn-article-title {
    font-size: 26px !important;
    line-height: 1.18 !important;
  }

  html.pn-legacy-device .pn-article-subtitle,
  html.pn-legacy-device .pn-article-subtitle p {
    font-size: 17px !important;
  }

  html.pn-legacy-device .single-post .entry-content,
  html.pn-legacy-device .pn-article-content,
  html.pn-legacy-device .pn-article-body,
  html.pn-legacy-device .single-post .entry-content p,
  html.pn-legacy-device .single-post .entry-content li,
  html.pn-legacy-device article.pn-article p,
  html.pn-legacy-device article.pn-article li {
    font-size: 16px !important;
    line-height: 1.65 !important;
  }

  html.pn-legacy-device .single-post .entry-content h2,
  html.pn-legacy-device article.pn-article h2 {
    font-size: 22px !important;
  }
}
