@import url("https://fonts.bunny.net/css?family=Montserrat:400,400i,700,700i|Quicksand:400,700");

:root {
    --main-100: #704900;
    --main-50: #ffb834;
    --main-40: #ffd68a;
    --main-30: #ffe4b3;
    --main-05: #fff8eb;

    --accent-100: #2f650f;
    --accent-50: #5da92a;
    --accent-40: #61b238;
    --accent-30: #a3ce8a;
    --accent-05: #f3fced;

    --gray-100: #262923;
    --gray-50: #657064;
    --gray-40: #92978f;
    --gray-30: #d8dcd6;
    --gray-05: #fff;

    --link-normal: #204e93;
    --link-hover: #0f3773;

    /* Fallbacks for browsers without CSS color-mix() */
    --shadow-20-fallback: rgba(38, 41, 35, 0.2);
    --shadow-22-fallback: rgba(38, 41, 35, 0.22);
    --shadow-25-fallback: rgba(38, 41, 35, 0.25);
    --shadow-45-fallback: rgba(38, 41, 35, 0.45);
    --lightbox-bg-fallback: rgba(11, 13, 10, 0.82);
}

@media (prefers-color-scheme: dark) {
    :root {
        --main-100: #8a5c00;
        --main-50: #d99418;
        --main-40: #b8904d;
        --main-30: #80683f;
        --main-05: #211b12;

        --accent-100: #308407;
        --accent-50: #4f9d22;
        --accent-40: #4e9630;
        --accent-30: #71985a;
        --accent-05: #172414;

        --gray-100: #f3f5f1;
        --gray-50: #5e685e;
        --gray-40: #747c72;
        --gray-30: #aeb6ac;
        --gray-05: #171a16;

        --link-normal: #8eb6f2;
        --link-hover: #b5d0ff;

        --shadow-20-fallback: rgba(243, 245, 241, 0.2);
        --shadow-22-fallback: rgba(243, 245, 241, 0.22);
        --shadow-25-fallback: rgba(243, 245, 241, 0.25);
        --shadow-45-fallback: rgba(243, 245, 241, 0.45);
    }
}

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

body {
    background-color: var(--main-30);
    color: var(--gray-100);
    font-size: 1.5rem;
    line-height: 1.5;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Montserrat, sans-serif;
}
h1, h2, h3, h4, h5, h6, .site-title {
    font-family: Quicksand, sans-serif;
}
a {
    color: var(--link-normal);
}
a:hover {
    color: var(--link-hover);
}

header, main, footer {
    background-color: var(--accent-30);
    padding: 1.5rem;
    width: 100%;
}
header, main {
    max-width: min(1200px, calc(100vw - 3rem));
    border-radius: 1.5rem;
    box-shadow: 0.25em 0.25em 0.375em var(--shadow-20-fallback);
    box-shadow: 0.25em 0.25em 0.375em color-mix(in srgb, var(--gray-100) 20%, transparent);
}
header, footer {
    display: flex;
    justify-content: space-between;
}
header {
    margin: 1.5rem auto 0;
}

.site-title {
    font-weight: bold;
    text-decoration: none;
    color: inherit;
}

/* Barre de navigation */
nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    margin: 0;
    padding: 0;
}
nav li {
    display: flex;
    position: relative;
}
nav a, nav a:hover {
    color: inherit;
    text-decoration: none;
}
nav a.active {
    font-weight: bold;
}
nav a::before {
    content: "";
    background-color: currentColor;
    width: 0;
    height: 1px;
    transition: width 0.3s;
    position: absolute;
    bottom: 0;
    left: 0;
}
nav a:not(.has-children):hover::before, nav a:not(.has-children):focus::before {
    width: 100%;
}
nav a.has-children::after {
    content: "";
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.25em;
    width: 0.6em;
    height: 0.6em;
    background-color: currentColor;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M1.50002 4L6.00002 8L10.5 4" fill="none" stroke="black" stroke-width="1.5"/></svg>');
    mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"><path d="M1.50002 4L6.00002 8L10.5 4" fill="none" stroke="black" stroke-width="1.5"/></svg>');
}
nav ul ul {
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    z-index: 1;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.1s linear;
    padding: 1px;
    background-color: var(--accent-50);
    color: var(--gray-05);
}
nav ul ul ul {
    top: unset;
    left: 100%;
}
nav a:hover ~ ul, nav a:focus ~ ul, nav ul ul:focus-within, nav ul ul:hover {
    visibility: visible;
    opacity: 1;
}
nav ul ul a {
    width: 100%;
    padding: 0.33em 0.66em;
}
nav ul ul a.has-children::after {
    transform: rotate(-90deg) translateX(0.1em);
}

main {
    margin: 1.5rem auto auto;
}

h1, h2, h3, h4, h5, h6 {
    margin: 1rem 0;
}

main > :first-child {
    margin-top: 0;
}

main > :last-child {
    margin-bottom: 0;
}

/* Champs de formulaire */
input, textarea {
    -webkit-appearance: initial;
    -moz-appearance: initial;
    appearance: none;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-transform: inherit;
    min-width: 2em;
    background-color: var(--main-40);
    border: 1px solid var(--gray-50);
    flex-grow: 1;
    margin-left: 0;
    margin-right: 0;
    text-decoration: unset !important;
    border-radius: 1em;
    padding: 0.25em 0.65em;
}
/* Boutons */
input[type="submit"], input[type="button"], .button {
    cursor: pointer;
    background-color: var(--main-50);
    color: var(--gray-100);
    font-size: 0.75em;
    font-weight: bold;
    padding: 0.6em 0.9em;
    border: none;
    border-radius: 0.5em;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s, color 0.3s;
}
input[type="submit"]:hover, input[type="button"]:hover, .button:hover {
    background-color: var(--main-100);
    color: var(--gray-30);
}
.has-icon, input.has-icon {
    padding: 0.6em;
    border-radius: 50%;
    min-width: 2.7em;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}
th, td {
    padding: 0.375em 0.8125em;
    border: 1px solid var(--gray-30);
}
th {
    background-color: var(--main-50);
}
tbody > tr:nth-child(2n) {
    background-color: var(--main-30);
}
iframe, img, video {
    max-width: 100%;
    border-radius: 0.5em;
    margin: 0 auto;
    display: block;
}

/* Pied de page */
footer {
    margin-top: 1.5rem;
    font-size: 0.75em;
}
footer > p {
    margin: 0;
}

/* Styles pour téléphones */
@media (max-width: 599px) {
    header, footer {
        flex-direction: column;
        gap: 1em;
    }
    nav ul {
        gap: 0.5em;
    }
    header, main, footer {
        margin-top: 1rem;
        padding: 1rem;
    }
    header, main {
        max-width: calc(100vw - 2rem);
        border-radius: 1rem;
    }
}

/* Compléments légers pour blocs Markdown, formulaire de contact et code */
h1.has-avatar {
    text-align: center;
}
img.avatar {
    display: inline-block;
    vertical-align: middle;
    border-radius: 50%;
    height: 2em;
    width: 2em;
    object-fit: cover;
    margin: 0 0.25em 0 0;
    box-shadow: 0 0 0.5em var(--shadow-45-fallback);
    box-shadow: 0 0 0.5em color-mix(in srgb, var(--gray-100) 45%, transparent);
}
img.inline-icon {
    display: inline-block;
    vertical-align: middle;
    margin: 0 0.25em 0 0;
    border-radius: 0.25em;
}
.columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    column-gap: 2em;
    row-gap: 1.5rem;
    margin: 1.25rem 0;
}
.columns.columns-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: start;
}
.columns.columns-2 figure {
    margin: 0;
}
.column {
    flex: 0 1 auto;
    max-width: 100%;
}
.column > h3:first-child {
    margin-top: 0;
    text-align: center;
}
.columns ul {
    padding-left: 2.5em;
    list-style: none;
    margin: 0.75rem 0 0;
}
.columns li {
    margin-bottom: 0.35rem;
}
.columns li img.inline-icon {
    vertical-align: middle;
    height: 2em;
    width: 2em;
    margin: 0 0.35em 0 -2.35em;
}
figure {
    margin: 1.5rem 0;
    text-align: center;
}
figcaption {
    font-size: 0.75em;
    opacity: 0.85;
    margin-top: 0.4rem;
}
pre {
    background-color: var(--main-05);
    border: 1px solid var(--gray-30);
    border-radius: 0.75rem;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.7em;
    line-height: 1.45;
}
code {
    font-size: 0.85em;
    background-color: var(--main-05);
    padding: 0.1em 0.35em;
    border-radius: 0.3em;
}
pre code {
    background: none;
    padding: 0;
}
.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}
.contact-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}
.contact-fieldset:disabled {
    opacity: 0.65;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 680px;
}
.contact-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85em;
}
.contact-status {
    margin-top: 0.5rem;
    padding: 0.65em 0.9em;
    border-radius: 0.5em;
    font-size: 0.8em;
    display: none;
}
.contact-status.is-sending {
    display: block;
    background-color: var(--main-05);
    border: 1px solid var(--gray-40);
}
.contact-status.is-ok {
    display: block;
    background-color: var(--accent-05);
    border: 1px solid var(--accent-50);
}
.contact-status.is-err {
    display: block;
    background-color: var(--main-05);
    border: 1px solid var(--main-100);
}
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 520px;
    margin: 1rem 0;
}
.article-thumb {
    max-height: 360px;
    object-fit: cover;
}
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-30);
    font-size: 0.8em;
}
.pdf-viewer iframe {
    width: 100%;
    height: 760px;
    border: 1px solid var(--gray-30);
    margin-bottom: 0.75rem;
}
.article-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.article-list li {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--gray-30);
}
.article-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Page Max&Tom (pleine largeur, sans fond vert sur <main>) */
main.maxetom-main {
    background-color: transparent;
    max-width: 100%;
    width: 100%;
    margin: 1.5rem 0 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    overflow: hidden;
    --maxetom-yellow: #ffcf3d;
    --maxetom-blue: #007affed;
    --maxetom-purple: #8300e9ab;
    --maxetom-green: #5fc053;
    --maxetom-navy: #00208a;
}
body.page-maxetom footer {
    margin-top: 0;
}
.columns.maxetom-hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 2rem;
    max-width: min(1200px, calc(100vw - 3rem));
    margin: 0 auto;
    padding: 2rem 0 1.25rem;
}
.columns.maxetom-hero .column > h1:first-child {
    margin-top: 0;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    line-height: 1.2;
}
.columns.maxetom-hero p {
    margin: 0.75rem 0;
}
.columns.maxetom-hero img {
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.25rem var(--shadow-22-fallback);
    box-shadow: 0 0.5rem 1.25rem color-mix(in srgb, var(--gray-100) 22%, transparent);
}
.maxetom-fade {
    height: 4.5rem;
    width: 100%;
}
.fade-to-yellow {
    background: linear-gradient(180deg, transparent 0%, var(--maxetom-yellow) 100%);
    margin-top: 0.5rem;
}
.fade-yellow-blue {
    background: linear-gradient(180deg, var(--maxetom-yellow) 0%, var(--maxetom-blue) 100%);
}
.fade-blue-purple {
    background: linear-gradient(180deg, var(--maxetom-blue) 0%, var(--maxetom-purple) 100%);
}
.fade-purple-green {
    background: linear-gradient(180deg, var(--maxetom-purple) 0%, var(--maxetom-green) 100%);
}
.fade-green-yellow {
    background: linear-gradient(180deg, var(--maxetom-green) 0%, var(--maxetom-yellow) 100%);
}
.fade-yellow-navy {
    background: linear-gradient(180deg, var(--maxetom-yellow) 0%, var(--maxetom-navy) 100%);
}
.fade-navy-out {
    background: linear-gradient(180deg, var(--maxetom-navy) 0%, var(--accent-30) 100%);
    height: 4rem;
}
.maxetom-band {
    width: 100%;
    padding: 2.25rem 1.5rem;
    text-align: center;
}
.maxetom-band > * {
    max-width: min(1200px, calc(100vw - 3rem));
    margin-inline: auto;
}
.maxetom-band > h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
}
.maxetom-band .band-subtitle {
    max-width: 46rem;
    margin: 0.25rem auto 1.25rem;
    font-size: 0.92em;
}
.band-yellow {
    background-color: var(--maxetom-yellow);
    color: #161815;
}
.band-blue {
    background-color: var(--maxetom-blue);
    color: #fff;
}
.band-purple {
    background-color: var(--maxetom-purple);
    color: #fff;
}
.band-green {
    background-color: var(--maxetom-green);
    color: #fff;
}
.band-navy {
    background-color: var(--maxetom-navy);
    color: #fff;
}
.columns.maxetom-cards,
.columns.maxetom-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    align-items: stretch;
    margin: 1.5rem auto 0.5rem;
}
.maxetom-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
    padding: 1.5rem 1.25rem;
    border: 1.5px solid #000;
    border-radius: 0.85rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.14);
}
.maxetom-card h3 {
    margin: 0.25rem 0;
    font-size: 1.1em;
}
.maxetom-card h3 a {
    color: inherit;
    text-decoration: none;
}
.maxetom-card h3 a:hover {
    text-decoration: underline;
}
.maxetom-card p {
    margin: 0;
    font-size: 0.85em;
}
.maxetom-card > :last-child {
    margin-top: auto;
    padding-top: 0.35rem;
}
.card-blue {
    background-color: var(--maxetom-blue);
    color: #fff;
}
.card-purple {
    background-color: var(--maxetom-purple);
    color: #fff;
}
.card-green {
    background-color: var(--maxetom-green);
    color: #fff;
}
.card-white {
    background-color: #fff;
    color: #161815;
}
.columns.maxetom-features .column {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0.25rem 0.5rem;
}
.columns.maxetom-features h3 {
    font-size: 1.05em;
    margin: 0.6rem 0 0.35rem;
}
.columns.maxetom-features p {
    margin: 0;
    font-size: 0.85em;
}
img.feature-icon {
    width: 2.6em;
    height: 2.6em;
    object-fit: contain;
    border-radius: 0;
    margin: 0 auto;
    display: block;
}
.star-row {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}
img.star-icon {
    width: 1.15em;
    height: 1.15em;
    border-radius: 0;
    margin: 0;
    display: inline-block;
}
.align-center {
    text-align: center;
    margin: 1.25rem auto 0;
}
.button-green {
    background-color: var(--accent-40);
    color: #fff;
}
.button-green:hover {
    background-color: var(--accent-100);
    color: #fff;
}
.button-white {
    background-color: #fff;
    color: #161815;
    transition: transform 0.2s, background-color 0.2s, color 0.2s;
}
.button-white:hover {
    background-color: #f3f5f1;
    transform: translateY(-1px);
}
.button-white.text-blue,
.button-white.text-blue:hover {
    color: #0066d6;
}
.button-white.text-purple,
.button-white.text-purple:hover {
    color: #6e00c4;
}
.button-white.text-green,
.button-white.text-green:hover {
    color: #1c920c;
}
.button-white.text-navy,
.button-white.text-navy:hover {
    color: #00208a;
}

.privacy-optout {
    background-color: var(--accent-05);
    border: 1px solid var(--accent-50);
    border-radius: 0.85rem;
    padding: 1.25rem;
    margin: 1.25rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.privacy-optout p {
    margin: 0;
    font-size: 0.88em;
}
.privacy-optout .button {
    align-self: flex-start;
}

@media (max-width: 860px) {
    .columns.maxetom-hero,
    .columns.maxetom-cards,
    .columns.maxetom-features {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 599px) {
    main.maxetom-main {
        margin-top: 1rem;
    }
    .columns.maxetom-hero,
    .maxetom-band > * {
        max-width: calc(100vw - 2rem);
    }
    .columns.columns-2 {
        grid-template-columns: 1fr;
    }
    .columns.maxetom-hero {
        padding: 1.25rem 0;
    }
    .maxetom-band {
        padding: 1.5rem 1rem;
    }
}

/* Conteneurs Easter Eggs compatibles CSP stricte */
.ee-dock {
    z-index: 100000;
    flex-flow: row-reverse wrap-reverse;
    align-items: end;
    gap: 1em;
    display: flex;
    position: fixed;
    bottom: 1.5em;
    right: 1.5em;
}
.ee-spinner {
    box-sizing: border-box;
    border: 4px solid #adf;
    border-top-color: #39d;
    border-radius: 50%;
    width: 2em;
    height: 2em;
    position: fixed;
    bottom: 1em;
    right: 1em;
    box-shadow: 0 0 4px #ccc, inset 0 0 4px #ccc;
}
.ee-hidden {
    display: none;
}

/* Lightbox d'agrandissement d'image (sans blocage de défilement) */
img.zoomable {
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
img.zoomable:hover,
img.zoomable:focus-visible {
    box-shadow: 0 0.25rem 1rem var(--shadow-25-fallback);
    box-shadow: 0 0.25rem 1rem color-mix(in srgb, var(--gray-100) 25%, transparent);
}
img.lightbox-source-hidden {
    opacity: 0;
}
.lightbox-overlay[hidden] {
    display: none;
}
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 90000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 3.5rem;
    pointer-events: none;
    background-color: var(--lightbox-bg-fallback);
    background-color: color-mix(in srgb, #0b0d0a 82%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.lightbox-frame {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(88vw, 1100px);
    max-height: 88vh;
    pointer-events: auto;
}
.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.6rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.55);
    cursor: zoom-out;
    will-change: transform;
}
.lightbox-caption {
    color: #f3f5f1;
    margin-top: 0.75rem;
    font-size: 0.85em;
    opacity: 0.95;
    max-width: 65ch;
}
.lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background-color: rgba(23, 26, 22, 0.75);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s;
}
.lightbox-close:hover {
    background-color: rgba(23, 26, 22, 0.95);
}
@media (max-width: 599px) {
    .lightbox-overlay {
        padding: 3rem 0.75rem;
    }
}


