/* Mémorandum 2018 — adaptations des styles originaux. */

/* Couleurs de la page */
.bgcolor,.main-content li:before,.centered-button a {
    background-color: var(--memo-color);
}

.color,.main-content a,.main-content h2,.main-content h3,.main-content h4,.main-content h5 {
    color: var(--memo-color);
}

.stroke-color {
    stroke: var(--memo-color);
}

.border-color {
    border-color: var(--memo-color);
}

/* Boutons et accessibilité */
button {
    font: inherit;
    cursor: pointer;
    border: 0;
}

button.icon {
    padding: 0;
}

.accordion-title {
    background: none;
    color: inherit;
    text-align: left;
    padding: 0;
    font: inherit;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 99999;
    background: #fff;
    padding: 1rem;
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

/* Navigation illustrée */
.card-placeholder {
    display: block;
    aspect-ratio: 1/1;
}

.theme-listing a:has(.card-placeholder) .hover,.nav a:has(.card-placeholder) .hover {
    opacity: 1;
    transform: none;
}

.nav a:focus .hover,.theme-listing a:focus .hover {
    opacity: 1;
    transform: none;
}

.nav a:focus .hover-bg,.theme-listing a:focus .hover-bg {
    opacity: .8;
}

.nav {
    overflow-y: auto;
    max-height: 100dvh;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    align-content: start;
    align-items: stretch;
    height: auto;
}

.nav[inert] {
    visibility: hidden;
}

.nav a {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 700 / 842;
    margin: 0;
    padding: 0;
}

.nav a img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.nav a .hover {
    width: 100%;
}

/* Header et accueil */
.scroll-title {
    pointer-events: none;
}

header.homepage .menu {
    display: block;
}

header.homepage .arrow {
    background: #da5161;
}

header .title.no-image {
    padding: 5rem 0 2rem;
}

header.for-page .title.no-image {
    margin-top: 0;
}

body.admin-bar header:not(.homepage) {
    top: 32px;
}

header .top-section .menu,
header.homepage .top-section .menu,
header.for-page .top-section .menu {
    background-color: transparent;
}

header a.cal-logo > img {
    position: static;
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
}

header.homepage .title-wrapper {
    padding-top: 40px;
}

header.homepage .title.no-image {
    padding: 0;
}

header.homepage .intro p:last-child {
    margin-bottom: 0;
}

header.homepage .actions {
    margin-top: 20px;
}

header .top-section .scroll-title {
    font-family: 'PT Serif', serif;
    font-weight: 700;
}

header .arrow {
    width: 50px;
    height: 25px;
    bottom: -25px;
    transform: translateX(-50%);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    pointer-events: none;
}

/* Contenu et encadrés Gutenberg */
.main-content img {
    max-width: 100%;
    height: auto;
}

.main-content ol {
    list-style: decimal;
    padding-left: 1.5rem;
}

.main-content ol li:before {
    display: none;
}

.main-content iframe {
    max-width: 100%;
}

.sub-thematic {
    scroll-margin-top: 140px;
}

body:not(.memo-js) .sub-thematic .content {
    display: block;
}

.main-content .wp-block-quote {
    margin: 0 0 2rem;
    padding: 40px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    color: #3f3f3f;
    font-family: inherit;
    font-size: inherit;
    font-style: normal;
    line-height: inherit;
}

.main-content .wp-block-quote::before,
.main-content .wp-block-quote::after {
    content: none;
}

.main-content .wp-block-quote > :last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.main-content .wp-block-quote li:last-child {
    margin-bottom: 0;
}

/* Navigation entre thématiques */
.pager {
    border-top: 2px solid var(--memo-color);
    padding-top: 32px;
}

.pager .pager-item.next {
    margin-left: auto;
}

/* Bloc brochure */
.brochure-section .brochure-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid currentColor;
    color: var(--memo-color);
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    line-height: 1.3;
    text-decoration: none;
    text-transform: uppercase;
}

.brochure-section .brochure-download svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

/* Interactions */
.dropdown li:focus-within>ul,.share-thematic li:focus-within>ul {
    display: flex;
}

/* Mobile : menu, contenu et footer */
@media (max-width: 500px) {
    body {
        padding-bottom: 0;
    }

    .nav {
        max-height: calc(100dvh - 80px);
    }

    body.admin-bar header:not(.homepage) {
        top: 0;
    }

    header .title.no-image {
        padding-top: 4rem;
    }

    .actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .nav a img {
        height: 140px;
        display: block;
        flex: 0 0 140px;
        width: 100%;
        object-fit: contain;
        object-position: center;
    }

    .nav a {
        min-height: 0;
        display: flex;
        flex-direction: column;
        aspect-ratio: auto;
        height: auto;
        text-decoration: none;
    }

    .nav a .hover {
        padding-bottom: 12px;
        position: relative;
        top: auto;
        display: block;
        flex: 1;
        width: 100%;
        height: auto;
        padding: 10px 12px 16px;
        opacity: 1;
        transform: none;
        font-size: 15px;
        line-height: 1.2;
        z-index: 1;
    }

    .main-content .wp-block-quote {
        padding: 24px;
    }

    footer {
        margin-bottom: 0;
        padding-bottom: calc(80px + 1rem);
    }

    header .top-section .menu {
        background-color: var(--memo-color);
    }

    header.homepage .top-section .menu {
        background-color: #da5161;
    }

    header.for-page .top-section .menu {
        background-color: #f1eae5;
    }

}

/* Réduction des animations */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }

}
