/* ****************************************************

Titre :     Thème AGREG interne — version responsive
Base :      thème GetSimple d'origine par Chris Cagle
Objectif :  conserver l'identité visuelle existante tout en ajoutant
            une mise en page fluide, un menu mobile et des contenus adaptatifs.

**************************************************** */

/** RÉINITIALISATION **/
:link,
:visited {
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6,
pre,
code {
    font-size: 1em;
    font-weight: 400;
}

ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
form,
body,
html,
p,
blockquote,
fieldset,
input {
    margin: 0;
    padding: 0;
}

a img,
:link img,
:visited img {
    border: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/** RÈGLES GÉNÉRALES **/
.clear {
    clear: both;
}

body {
    min-width: 0;
    text-align: center;
    font-family: Arial, "Lucida Grande", Verdana, Helvetica, sans-serif;
    font-size: 14px;
    background: #fff url(images/headerbg.png) top left repeat-x;
    color: #222;
}

.wrapper {
    width: 950px;
    max-width: calc(100% - 32px);
    margin-right: auto;
    margin-left: auto;
}

.skip-link {
    position: fixed;
    z-index: 1000;
    top: 8px;
    left: 8px;
    padding: 10px 14px;
    color: #111;
    background: #fff;
    border: 2px solid #111;
    transform: translateY(-150%);
    transition: transform 0.15s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #f4c34f;
    outline-offset: 3px;
}

/** EN-TÊTE **/
#header {
    position: relative;
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    grid-template-rows: 130px 70px;
    height: 200px;
    text-align: left;
}

.brand-mark {
    grid-column: 1;
    grid-row: 1;
    width: 96px;
    height: 100px;
    margin-top: 14px;
    margin-left: 10px;
}

.brand-mark img {
    display: block;
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-copy {
    min-width: 0;
    padding-top: 22px;
    padding-left: 10px;
}

#header .logo {
    display: inline-block;
    color: #fff;
    font-family: Arial, sans-serif;
    font-weight: bold;
    font-size: 45px;
    line-height: 1.15;
}

#header .tagline {
    margin-top: 1px;
    color: #ccc;
    font-family: Georgia, serif;
    font-size: 18px;
    line-height: 1.25;
}

.primary-navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    align-self: start;
}

#header #nav {
    display: flex;
    align-items: stretch;
    color: #fff;
    font-size: 13px;
    text-transform: uppercase;
    list-style: none;
}

#header #nav li {
    float: none;
    border-right: 1px solid #481e27;
}

#header #nav li:first-child {
    border-left: 1px solid #481e27;
}

#header #nav li a {
    display: block;
    min-height: 40px;
    padding: 0 20px;
    color: #fff;
    line-height: 40px;
    white-space: nowrap;
}

#header #nav li.current a,
#header #nav li a:hover,
#header #nav li a:focus-visible {
    background: transparent url(images/navbg.png) top left repeat-x;
}

.nav-toggle {
    display: none;
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 4px;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    font: inherit;
    cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    content: "";
}

.nav-toggle-icon {
    position: relative;
}

.nav-toggle-icon::before {
    position: absolute;
    top: -6px;
    left: 0;
}

.nav-toggle-icon::after {
    position: absolute;
    top: 6px;
    left: 0;
}

/** CORPS **/
#main-content {
    min-width: 0;
}

#bodycontent {
    float: left;
    width: 880px;
    max-width: 100%;
    text-align: left;
}

#bodycontent .post {
    padding: 0 0 55px;
}

#bodycontent .post h1 {
    margin: 0 0 15px;
    padding: 0 0 15px;
    border-bottom: 1px dotted #ccc;
    color: #000;
    font-family: Georgia, serif;
    font-size: 36px;
    line-height: 1;
}

#bodycontent .post p {
    margin: 0 0 18px;
    line-height: 20px;
}

#bodycontent .post ul,
#bodycontent .post ol {
    margin: 0 0 18px 25px;
    line-height: 20px;
}

#bodycontent .post ul ul,
#bodycontent .post ol ul,
#bodycontent .post ul ol,
#bodycontent .post ol ol {
    margin: 0 0 0 25px;
}

#bodycontent .post blockquote {
    margin: 0 0 18px 30px;
    color: #666;
    font-size: 13px;
    font-style: italic;
    line-height: 19px;
}

#bodycontent .post code {
    padding: 2px;
    border: 1px solid #eee;
    color: #666;
    background: #fafafa;
    font-size: 12px;
}

#bodycontent .post pre {
    max-width: 100%;
    overflow-x: auto;
}

#bodycontent .post pre code {
    display: block;
    margin-bottom: 18px;
    padding: 8px;
    border: 1px solid #eee;
    color: #666;
    background: #fafafa;
    font-size: 12px;
}

#bodycontent .post h2 {
    padding: 8px 0;
    font-size: 20px;
    font-weight: bold;
}

#bodycontent .post h3 {
    padding: 8px 0;
    font-size: 17px;
    font-weight: bold;
}

#bodycontent .post h4 {
    padding: 8px 0;
    font-size: 14px;
    font-weight: bold;
}

#bodycontent .post a:link,
#bodycontent .post a:visited {
    color: #009865;
    text-decoration: underline;
}

#bodycontent .post a:hover {
    text-decoration: underline;
}

#bodycontent .post .meta {
    margin-top: 20px;
    padding: 8px;
    border: 1px dotted #ccc;
    color: #555;
    background: #f9f9f9;
    font-size: 11px;
    line-height: 18px;
}

.postcontent {
    min-width: 0;
}

/*
 * Les coupures de secours sont réservées aux blocs de texte. Les appliquer au
 * conteneur entier modifie le calcul de largeur intrinsèque des tableaux et
 * peut réduire une cellule à un seul caractère.
 */
.postcontent p,
.postcontent li,
.postcontent dd,
.postcontent blockquote,
.postcontent figcaption {
    overflow-wrap: break-word;
}

.postcontent > a,
.postcontent p a,
.postcontent li a,
.postcontent dd a,
.postcontent blockquote a,
.postcontent figcaption a {
    overflow-wrap: anywhere;
}

.postcontent img,
.postcontent video,
.postcontent canvas,
.postcontent svg {
    max-width: 100%;
    height: auto;
}

.postcontent iframe,
.postcontent embed,
.postcontent object {
    max-width: 100%;
}

.postcontent table {
    max-width: 100%;
    border-collapse: collapse;
    overflow-wrap: normal;
    word-break: normal;
}

/* Les cellules d’un tableau ne doivent jamais être coupées caractère par caractère. */
.postcontent th,
.postcontent td,
.postcontent th a,
.postcontent td a {
    overflow-wrap: normal;
    word-break: normal;
}

/*
 * La version en tuiles est générée uniquement pour les tableaux qui portent
 * .js-archive-cards. Une fois générée,
 * elle reste active à toutes les largeurs de fenêtre.
 */
.archive-cards {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    margin: 8px 0 24px;
}

.archive-cards.archive-cards-active {
    display: grid;
}

.postcontent table.archive-table-enhanced.archive-table-collapsed {
    display: none;
}

.archive-card {
    min-width: 0;
    padding: 10px;
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    background: #fafafa;
    text-align: center;
}

.archive-card-title {
    display: block;
    margin-bottom: 8px;
    color: #541f2d;
    font-weight: bold;
    line-height: 1.2;
}

.archive-card-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
}

.archive-card-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

.archive-card-row-single {
    grid-template-columns: minmax(0, 1fr);
}

.archive-card-item {
    display: block;
    min-width: 0;
    width: 100%;
}

.postcontent .archive-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 44px;
    min-height: 40px;
    box-sizing: border-box;
    padding: 5px 8px;
    border: 1px solid #cdb8c0;
    border-radius: 3px;
    background: #fff;
    line-height: 1.15;
    text-decoration: underline;
}


/** ACCORDÉONS GÉNÉRIQUES — activés explicitement par .js-accordion **/
.accordion-group {
    margin: 6px 0 28px;
}

details.js-accordion,
.accordion-item {
    margin: 0 0 12px;
    overflow: hidden;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    background: #fff;
}

details.js-accordion > summary,
.accordion-item > .accordion-summary {
    position: relative;
    display: block;
    min-height: 52px;
    padding: 15px 50px 15px 17px;
    color: #541f2d;
    background: #f8f8f8;
    font-size: 17px;
    font-weight: bold;
    line-height: 1.35;
    cursor: pointer;
    list-style: none;
}

details.js-accordion > summary::-webkit-details-marker,
.accordion-summary::-webkit-details-marker {
    display: none;
}

details.js-accordion > summary::after,
.accordion-item > .accordion-summary::after {
    position: absolute;
    top: 50%;
    right: 17px;
    width: 24px;
    height: 24px;
    border: 1px solid #b9b9b9;
    border-radius: 50%;
    color: #541f2d;
    background: #fff;
    content: "+";
    font-size: 21px;
    font-weight: normal;
    line-height: 21px;
    text-align: center;
    transform: translateY(-50%);
}

details.js-accordion[open] > summary,
.accordion-item[open] > .accordion-summary {
    border-bottom: 1px solid #dedede;
    background: #f5edf0;
}

details.js-accordion[open] > summary::after,
.accordion-item[open] > .accordion-summary::after {
    content: "−";
}

details.js-accordion > summary:hover,
.accordion-item > .accordion-summary:hover {
    background: #f5edf0;
}

.accordion-content {
    padding: 16px 18px 1px;
}

.accordion-content > :first-child {
    margin-top: 0;
}

.accordion-content > :last-child,
.accordion-content > .archive-cards:last-child {
    margin-bottom: 16px;
}

.accordion-content .archive-cards {
    margin-top: 0;
}

.postcontent input,
.postcontent select,
.postcontent textarea,
.postcontent button {
    max-width: 100%;
    font: inherit;
}

/** PIED DE PAGE **/
#footer {
    width: 880px;
    max-width: 100%;
    padding: 10px 0 20px;
    border-top: 1px solid #ccc;
    color: #666;
    text-align: left;
    font-size: 12px;
    line-height: 18px;
}

#footer p.left-footer {
    float: left;
    width: 450px;
    max-width: 100%;
    text-align: left;
}

#footer p.right-footer {
    float: right;
    width: 450px;
    max-width: 100%;
    text-align: right;
}

#footer a:link,
#footer a:visited {
    color: #666;
    text-decoration: underline;
}

#footer a:hover {
    color: #000;
    text-decoration: underline;
}

/** TABLETTES ET PETITS ÉCRANS **/
@media (max-width: 860px) {
    body {
        background: #fff;
    }

    .wrapper {
        width: 100%;
        max-width: none;
        padding-right: 16px;
        padding-left: 16px;
    }

    #header {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr) auto;
        grid-template-rows: auto auto;
        gap: 0;
        height: auto;
        min-height: 0;
        margin-right: -16px;
        margin-bottom: 28px;
        margin-left: -16px;
        padding: 12px 16px 14px;
        background: linear-gradient(to bottom, #3a1420 0, #4e212d 96px, #481e27 126px, #481e27 100%);
    }

    .brand-mark {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        width: 68px;
        height: 72px;
        margin: 0;
    }

    .brand-copy {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        padding: 0 10px;
    }

    #header .logo {
        font-size: clamp(24px, 5.5vw, 34px);
        line-height: 1.08;
    }

    #header .tagline {
        margin-top: 5px;
        font-size: clamp(13px, 3.2vw, 16px);
    }

    .nav-toggle {
        display: inline-flex;
        grid-column: 3;
        grid-row: 1;
        align-self: center;
        align-items: center;
        gap: 9px;
        min-height: 44px;
        padding: 0 12px;
    }

    .primary-navigation {
        grid-column: 1 / -1;
        grid-row: 2;
        margin-top: 12px;
    }

    #header #nav {
        display: flex;
        flex-direction: column;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.25);
    }

    #header.nav-ready #nav {
        display: none;
    }

    #header.nav-ready.nav-open #nav {
        display: flex;
    }

    #header #nav li,
    #header #nav li:first-child {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
        border-left: 0;
    }

    #header #nav li a {
        min-height: 44px;
        padding: 0 12px;
        line-height: 44px;
        white-space: normal;
    }

    #header #nav li.current a,
    #header #nav li a:hover,
    #header #nav li a:focus-visible {
        background-color: #a11953;
        background-image: url(images/navbg.png);
    }

    #bodycontent,
    #footer {
        float: none;
        width: 100%;
    }

    #bodycontent .post {
        padding-bottom: 42px;
    }

    /*
     * Repli de sécurité pour les tableaux ordinaires : le texte peut revenir
     * à la ligne et un défilement horizontal reste disponible uniquement si
     * la structure du tableau l'exige réellement.
     */
    .postcontent table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: normal;
        -webkit-overflow-scrolling: touch;
    }

    .postcontent th,
    .postcontent td,
    .postcontent th a,
    .postcontent td a {
        white-space: normal;
        overflow-wrap: normal;
        word-break: normal;
    }

    /*
     * Seuls les tableaux explicitement activés par .js-archive-cards ou par
     * la classe de page .page-archive-cards sont
     * transposés en tuiles. Le tableau original reste disponible sans JavaScript.
     */
    .postcontent table.archive-table-enhanced.archive-table-collapsed {
        display: none;
    }

    .archive-cards.archive-cards-active {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        gap: 10px;
        margin: 8px 0 24px;
    }

    .archive-card {
        min-width: 0;
        padding: 10px;
        border: 1px solid #d8d8d8;
        border-radius: 4px;
        background: #fafafa;
        text-align: center;
    }

    .archive-card-title {
        display: block;
        margin-bottom: 8px;
        color: #541f2d;
        font-weight: bold;
        line-height: 1.2;
    }

    .archive-card-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 7px;
    }

    .archive-card-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .archive-card-row-single {
        grid-template-columns: minmax(0, 1fr);
    }

    .archive-card-item {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .postcontent .archive-card a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 40px;
        padding: 5px 8px;
        border: 1px solid #cdb8c0;
        border-radius: 3px;
        background: #fff;
        line-height: 1.15;
        text-decoration: underline;
    }

    #footer p.left-footer,
    #footer p.right-footer {
        float: none;
        width: 100%;
        text-align: left;
    }
}

/** TÉLÉPHONES **/
@media (max-width: 560px) {
    .wrapper {
        padding-right: 12px;
        padding-left: 12px;
    }

    #header {
        grid-template-columns: 62px minmax(0, 1fr) auto;
        margin-right: -12px;
        margin-left: -12px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .brand-mark {
        width: 56px;
        height: 60px;
    }

    .brand-copy {
        padding-right: 8px;
        padding-left: 8px;
    }

    #header .logo {
        font-size: clamp(20px, 6.3vw, 28px);
    }

    #header .tagline {
        font-size: 13px;
        line-height: 1.2;
    }

    .nav-toggle {
        width: 44px;
        padding: 0;
        justify-content: center;
    }

    .nav-toggle-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }

    #bodycontent .post h1 {
        font-size: clamp(27px, 9vw, 34px);
        line-height: 1.08;
    }

    #bodycontent .post blockquote {
        margin-left: 16px;
    }

    #bodycontent .post ul,
    #bodycontent .post ol {
        margin-left: 22px;
    }

    .archive-cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .archive-card {
        padding: 9px 7px;
    }

    details.js-accordion > summary,
    .accordion-item > .accordion-summary {
        min-height: 50px;
        padding: 13px 44px 13px 13px;
        font-size: 15px;
    }

    details.js-accordion > summary::after,
    .accordion-item > .accordion-summary::after {
        right: 12px;
        width: 22px;
        height: 22px;
        font-size: 19px;
        line-height: 19px;
    }

    .accordion-content {
        padding: 14px 13px 1px;
    }

    .postcontent img[align="left"],
    .postcontent img[align="right"] {
        float: none;
        display: block;
        margin-right: auto;
        margin-bottom: 18px;
        margin-left: auto;
    }
}


@media print {
    details.js-accordion,
    .accordion-item {
        break-inside: avoid;
    }

    details.js-accordion:not([open]) > .accordion-content,
    .accordion-item:not([open]) > .accordion-content {
        display: block !important;
    }

    details.js-accordion > summary::after,
    .accordion-item > .accordion-summary::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
