/**
 * Formes des boutons d'action — panel, archives, hover inversé, pastille PDF.
 * Variables : --astre-btn-r (repos), --astre-btn-r-hover (survol / focus).
 */

:root {
  --astre-btn-r-round: 9999px;
  --astre-btn-r-square: 0;
  --astre-btn-shape-duration: 0s;
  --astre-btn-shape-easing: ease;
}

/* —— Panel : .button--rounded | .button--square (alias .btn--*) —— */
.button--round,
.button--rounded,
.btn--rounded,
.btn--rounded.action-download__label {
  --astre-btn-r: var(--astre-btn-r-round);
  --astre-btn-r-hover: var(--astre-btn-r-square);
}

.button--square,
.btn--square,
.btn--square.action-download__label {
  --astre-btn-r: var(--astre-btn-r-square);
  --astre-btn-r-hover: var(--astre-btn-r-round);
}

/* Cibles forme (bouton simple + libellé PDF) */
:is(.button, a.button, button.button).button--round,
:is(.button, a.button, button.button).button--rounded,
:is(.button, a.button, button.button).button--square,
:is(.button, a.button, button.button).btn--rounded,
:is(.button, a.button, button.button).btn--square,
.action-download__label.button--rounded,
.action-download__label.button--square,
.action-download__label.btn--rounded,
.action-download__label.btn--square,
.archived-event-btn.button--rounded,
.archived-event-btn.button--square {
  border-radius: var(--astre-btn-r, var(--astre-btn-r-round));
  transition:
    border-radius var(--astre-btn-shape-duration) var(--astre-btn-shape-easing),
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    outline-color 0.15s ease,
    box-shadow 0.15s ease;
}

:is(.button, a.button, button.button).button--round:not(.button--referentiel):not(.menu-search__toggle):is(:hover, :focus-visible, :active, .is-home-exergue-hover),
:is(.button, a.button, button.button).button--rounded:not(.button--referentiel):not(.menu-search__toggle):is(:hover, :focus-visible, :active, .is-home-exergue-hover),
:is(.button, a.button, button.button).button--square:not(.button--referentiel):not(.menu-search__toggle):is(:hover, :focus-visible, :active, .is-home-exergue-hover),
:is(.button, a.button, button.button).btn--rounded:not(.button--referentiel):is(:hover, :focus-visible, :active),
:is(.button, a.button, button.button).btn--square:not(.button--referentiel):is(:hover, :focus-visible, :active),
.archived-event-btn.button--rounded:is(:hover, :focus-visible),
.archived-event-btn.button--square:is(:hover, :focus-visible) {
  border-radius: var(--astre-btn-r-hover, var(--astre-btn-r-square));
}

/* PDF : libellé (forme panel / archives) */
a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label.button--rounded,
a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label.btn--rounded {
  border-radius: var(--astre-btn-r-hover);
}

a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label.button--square,
a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label.btn--square {
  border-radius: var(--astre-btn-r-hover);
}

/* PDF : pastille = forme inverse du libellé au repos et au survol */
a.action-download:has(.action-download__label.button--rounded, .action-download__label.btn--rounded) .action-download-icon,
a.action-download:has(.action-download__label.button--square, .action-download__label.btn--square) .action-download-icon {
  transition:
    border-radius var(--astre-btn-shape-duration) var(--astre-btn-shape-easing),
    opacity 0.15s ease,
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

a.action-download:has(.action-download__label.button--rounded, .action-download__label.btn--rounded) .action-download-icon {
  border-radius: var(--astre-btn-r-square);
}

a.action-download:has(.action-download__label.button--square, .action-download__label.btn--square) .action-download-icon {
  border-radius: var(--astre-btn-r-round);
}

a.action-download:has(.action-download__label.button--rounded, .action-download__label.btn--rounded):is(:hover, :focus-visible, :focus-within) .action-download-icon {
  border-radius: var(--astre-btn-r-round);
}

a.action-download:has(.action-download__label.button--square, .action-download__label.btn--square):is(:hover, :focus-visible, :focus-within) .action-download-icon {
  border-radius: var(--astre-btn-r-square);
}

/* Exclusions (pas d’inversion forme) */
.button--referentiel,
.menu-search__toggle {
  --astre-btn-r: var(--astre-btn-r-round);
  --astre-btn-r-hover: var(--astre-btn-r-round);
}

/* Référentiel : squircle 20 % fixe au repos, au survol et au clic (header + ailleurs) */
:is(.button, a.button, button.button).button--referentiel,
:is(.button, a.button, button.button).button--referentiel:is(:hover, :focus-visible, :active, :focus) {
  border-radius: 20% !important;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    outline-color 0.15s ease,
    box-shadow 0.15s ease !important;
}

header .actions-wrapper .action-item > :is(.button, a.button).button--referentiel,
header .actions-wrapper .action-item > :is(.button, a.button).button--referentiel:is(:hover, :focus-visible, :active),
footer .actions-wrapper .action-item > :is(.button, a.button).button--referentiel,
footer .actions-wrapper .action-item > :is(.button, a.button).button--referentiel:is(:hover, :focus-visible, :active) {
  border-radius: 20% !important;
  transition:
    background-color 0s ease-out,
    color 0s ease-out,
    border-color 0s ease-out,
    outline-color 0s ease-out,
    outline-width 0s ease-out,
    transform 0s ease-out !important;
}

/* Blocs layout pleine largeur (ex. page Le réseau — téléchargements PDF) */
.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > :is(.button, a.button, button.button).button--rounded,
.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > :is(.button, a.button, button.button).button--square,
.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > .action-download .action-download__label.button--rounded,
.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > .action-download .action-download__label.button--square {
  border-radius: var(--astre-btn-r) !important;
}

.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > :is(.button, a.button, button.button).button--rounded:is(:hover, :focus-visible),
.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > :is(.button, a.button, button.button).button--square:is(:hover, :focus-visible),
.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > .action-download:is(:hover, :focus-visible, :focus-within) .action-download__label.button--rounded,
.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > .action-download:is(:hover, :focus-visible, :focus-within) .action-download__label.button--square {
  border-radius: var(--astre-btn-r-hover) !important;
}

.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > .action-download:has(.action-download__label.button--rounded) .action-download-icon {
  border-radius: var(--astre-btn-r-square) !important;
}

.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > .action-download:has(.action-download__label.button--square) .action-download-icon {
  border-radius: var(--astre-btn-r-round) !important;
}

.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > .action-download:has(.action-download__label.button--rounded):is(:hover, :focus-visible, :focus-within) .action-download-icon {
  border-radius: var(--astre-btn-r-round) !important;
}

.layout-section .block-type-actions:is(.is-fullwidth, [data-layout-actions-fullwidth="1"])
  .actions-wrapper .action-item > .action-download:has(.action-download__label.button--square):is(:hover, :focus-visible, :focus-within) .action-download-icon {
  border-radius: var(--astre-btn-r-square) !important;
}

/* Header / menu : inversion des coins immédiate au survol (sauf référentiel) */
header .actions-wrapper .action-item > :is(.button, a.button).button--rounded:not(.button--referentiel),
header .actions-wrapper .action-item > :is(.button, a.button).button--square:not(.button--referentiel),
footer .actions-wrapper .action-item > :is(.button, a.button).button--rounded:not(.button--referentiel),
footer .actions-wrapper .action-item > :is(.button, a.button).button--square:not(.button--referentiel),
header .actions-wrapper .action-item > a.action-download .action-download__label.button--rounded,
header .actions-wrapper .action-item > a.action-download .action-download__label.button--square {
  transition:
    border-radius 0s linear,
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    outline-color 0.15s ease,
    transform 0.15s ease !important;
}

/* —— Alternance auto : tableaux + liste plate démo (.events-archived__actions) —— */
.events-archived__actions > .action-item:nth-child(odd) > :is(.archived-event-btn, a.archived-event-btn):not(.action-download),
.events-archived__actions > .action-item:nth-child(odd) > a.action-download .action-download__label,
.concertation-events-table .concertation-events-row:nth-child(odd) a.action-download .action-download__label,
.concertation-events-table .concertation-events-row:nth-child(odd) a.concertation-events-text-link.button,
.astroide-archived-events-table .astroide-archived-events-row:nth-child(odd) a.action-download .action-download__label {
  --astre-btn-r: var(--astre-btn-r-round);
  --astre-btn-r-hover: var(--astre-btn-r-square);
  border-radius: var(--astre-btn-r);
}

.events-archived__actions > .action-item:nth-child(even) > :is(.archived-event-btn, a.archived-event-btn):not(.action-download),
.events-archived__actions > .action-item:nth-child(even) > a.action-download .action-download__label,
.concertation-events-table .concertation-events-row:nth-child(even) a.action-download .action-download__label,
.concertation-events-table .concertation-events-row:nth-child(even) a.concertation-events-text-link.button,
.astroide-archived-events-table .astroide-archived-events-row:nth-child(even) a.action-download .action-download__label {
  --astre-btn-r: var(--astre-btn-r-square);
  --astre-btn-r-hover: var(--astre-btn-r-round);
  border-radius: var(--astre-btn-r);
}

.events-archived__actions > .action-item:nth-child(odd) > :is(.archived-event-btn, a.archived-event-btn):not(.action-download):is(:hover, :focus-visible),
.events-archived__actions > .action-item:nth-child(odd) > a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label,
.concertation-events-table .concertation-events-row:nth-child(odd) a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label,
.concertation-events-table .concertation-events-row:nth-child(odd) a.concertation-events-text-link.button:is(:hover, :focus-visible),
.astroide-archived-events-table .astroide-archived-events-row:nth-child(odd) a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label {
  border-radius: var(--astre-btn-r-hover);
}

.events-archived__actions > .action-item:nth-child(even) > :is(.archived-event-btn, a.archived-event-btn):not(.action-download):is(:hover, :focus-visible),
.events-archived__actions > .action-item:nth-child(even) > a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label,
.concertation-events-table .concertation-events-row:nth-child(even) a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label,
.concertation-events-table .concertation-events-row:nth-child(even) a.concertation-events-text-link.button:is(:hover, :focus-visible),
.astroide-archived-events-table .astroide-archived-events-row:nth-child(even) a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label {
  border-radius: var(--astre-btn-r-hover);
}

/* Pastille PDF — zones alternance */
.events-archived__actions > .action-item:nth-child(odd) > a.action-download .action-download-icon,
.concertation-events-table .concertation-events-row:nth-child(odd) a.action-download .action-download-icon,
.astroide-archived-events-table .astroide-archived-events-row:nth-child(odd) a.action-download .action-download-icon {
  border-radius: var(--astre-btn-r-square);
}

.events-archived__actions > .action-item:nth-child(odd) > a.action-download:is(:hover, :focus-visible, :focus-within) .action-download-icon,
.concertation-events-table .concertation-events-row:nth-child(odd) a.action-download:is(:hover, :focus-visible, :focus-within) .action-download-icon,
.astroide-archived-events-table .astroide-archived-events-row:nth-child(odd) a.action-download:is(:hover, :focus-visible, :focus-within) .action-download-icon {
  border-radius: var(--astre-btn-r-round);
}

.events-archived__actions > .action-item:nth-child(even) > a.action-download .action-download-icon,
.concertation-events-table .concertation-events-row:nth-child(even) a.action-download .action-download-icon,
.astroide-archived-events-table .astroide-archived-events-row:nth-child(even) a.action-download .action-download-icon {
  border-radius: var(--astre-btn-r-round);
}

.events-archived__actions > .action-item:nth-child(even) > a.action-download:is(:hover, :focus-visible, :focus-within) .action-download-icon,
.concertation-events-table .concertation-events-row:nth-child(even) a.action-download:is(:hover, :focus-visible, :focus-within) .action-download-icon,
.astroide-archived-events-table .astroide-archived-events-row:nth-child(even) a.action-download:is(:hover, :focus-visible, :focus-within) .action-download-icon {
  border-radius: var(--astre-btn-r-square);
}

/* Événement à la une — un seul PDF : rond → carré ; pastille carrée → ronde */
.featured-event-pdf-wrap > a.action-download .action-download__label {
  --astre-btn-r: var(--astre-btn-r-round);
  --astre-btn-r-hover: var(--astre-btn-r-square);
  border-radius: var(--astre-btn-r);
  transition: border-radius var(--astre-btn-shape-duration) var(--astre-btn-shape-easing);
}

.featured-event-pdf-wrap > a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label {
  border-radius: var(--astre-btn-r-hover);
}

.featured-event-pdf-wrap > a.action-download .action-download-icon {
  border-radius: var(--astre-btn-r-square);
  transition: border-radius var(--astre-btn-shape-duration) var(--astre-btn-shape-easing);
}

.featured-event-pdf-wrap > a.action-download:is(:hover, :focus-visible, :focus-within) .action-download-icon {
  border-radius: var(--astre-btn-r-round);
}

@media (prefers-reduced-motion: reduce) {
  :is(.button, .action-download__label, .action-download-icon).button--rounded,
  :is(.button, .action-download__label, .action-download-icon).button--square,
  :is(.button, .action-download__label, .action-download-icon).btn--rounded,
  :is(.button, .action-download__label, .action-download-icon).btn--square {
    transition-duration: 0.01ms;
  }
}

/* Calculatrice : bordure 1px noire au survol / focus (aligné blocs actions PDF) */
:is(.button, a.button, button.button).button--calculatrice:is(:hover, :focus-visible, :active),
header .actions-wrapper .action-item > :is(.button, a.button).header-nav-button.button--calculatrice:is(:hover, :focus-visible, :active),
footer .actions-wrapper .action-item > :is(.button, a.button).header-nav-button.button--calculatrice:is(:hover, :focus-visible, :active),
.actions-wrapper .action-item > :is(.button, a.button).button--calculatrice:is(:hover, :focus-visible, :active),
a.action-download:is(:hover, :focus-visible, :focus-within) .action-download__label.button--calculatrice {
  border: 1px solid #000000 !important;
  border-color: #000000 !important;
  outline: none !important;
  outline-width: 0 !important;
  --border-width: 1px !important;
}
