/* Livret d'accueil - layout and components, from Figma "Livret d'accueil" (971:2587). */

:root {
    --livret-fond: var(--wp--preset--color--fond, #f8f7f4);
    --livret-blanc: var(--wp--preset--color--blanc, #ffffff);
    --livret-texte: var(--wp--preset--color--texte, #5c4d5c);
    --livret-attenue: var(--wp--preset--color--texte-attenue, #5c4d5cb2);
    --livret-violet: var(--wp--preset--color--violet, #8865ff);
    --livret-violet-clair: var(--wp--preset--color--violet-clair, #c6bcf0);
    --livret-violet-fond: var(--wp--preset--color--violet-fond, #f1effc);
    --livret-dash: linear-gradient(to right, var(--livret-violet) 50%, transparent 0) left bottom / 8px 1px repeat-x;
    --livret-dash-texte: linear-gradient(to right, var(--livret-texte) 50%, transparent 0) left bottom / 8px 1px repeat-x;
    --livret-arrow-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1.5v10.5M2.5 7.5 7 12l4.5-4.5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --livret-arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M1.5 7h10.5M7.5 2.5 12 7l-4.5 4.5' fill='none' stroke='%238865ff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/*
 * The Figma frames are 1920px wide. Every size below is in rem, and the root size
 * scales with the window: 100% at 1920px, down to 80% on a laptop.
 * Percentages keep the reader's own browser text size setting.
 */
html {
    font-size: clamp(80%, 0.8334vw, 100%);
}

@media (max-width: 960px) {
    html {
        font-size: 90%;
    }
}

/* Template parts sit flush; each part handles its own spacing. */
.wp-site-blocks > * {
    margin-block-start: 0;
}

body {
    font-variant-numeric: lining-nums;
    -webkit-font-smoothing: antialiased;
}

:where(a, summary, button, input, select, textarea):focus-visible {
    outline: 2px solid var(--livret-violet);
    outline-offset: 0.1875rem;
    border-radius: 0.25rem;
}

/* ---------- Header ---------- */

.livret-header {
    padding: 1.9375rem 3.125rem 0;
}

.livret-logo {
    display: inline-block;
    line-height: 0;
}

.livret-logo img {
    width: 5.6875rem;
    height: auto;
}

/* ---------- Page layout: breadcrumb + sommaire | section ---------- */

.livret-layout {
    display: grid;
    grid-template-columns: minmax(16.25rem, 28.8125rem) minmax(0, 60.25rem);
    grid-template-rows: auto 1fr;
    column-gap: clamp(2rem, 5vw, 4.4375rem);
    row-gap: 2.25rem;
    max-width: 93.5rem;
    margin: 0.5rem auto 0;
    padding: 0 1.5rem 7.5rem;
}

.livret-layout > * {
    margin-block: 0;
}

.livret-breadcrumb {
    grid-column: 1;
    grid-row: 1;
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 0.95;
    color: var(--livret-texte);
}

.livret-breadcrumb a {
    color: inherit;
    font-weight: 400;
    text-decoration: none;
}

.livret-breadcrumb a:hover {
    text-decoration: underline;
}

.livret-breadcrumb strong {
    font-weight: 700;
}

.livret-sommaire {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: 1.5rem;
    background: var(--livret-blanc);
    border-radius: 1.25rem;
    padding: 1.9375rem 2.8125rem 2.3125rem;
}

.livret-content {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding-top: 0.4375rem;
}

/* ---------- Sommaire ---------- */

.livret-sommaire > * {
    margin-block: 0;
}

.livret-sommaire__title {
    font-size: 1.625rem;
    font-weight: 800;
    line-height: 1.23;
}

.livret-search {
    margin-top: 0.6875rem !important;
}

.livret-search .wp-block-search__inside-wrapper {
    background: var(--livret-fond);
    border: 0;
    border-radius: 2.0625rem;
    padding: 0 0.5rem 0 0.875rem;
    min-height: 2.5625rem;
}

.livret-search .wp-block-search__input {
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--livret-texte);
    padding: 0.5rem 0;
}

.livret-search .wp-block-search__input::placeholder {
    color: var(--livret-attenue);
    opacity: 1;
}

.livret-search .wp-block-search__button {
    background: transparent;
    color: var(--livret-violet);
    border: 0;
    padding: 0.25rem;
    margin: 0;
}

.livret-search .wp-block-search__button svg {
    width: 1.3125rem;
    height: 1.3125rem;
    fill: currentColor;
}

.livret-toc {
    margin-top: 1.375rem;
}

.livret-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--livret-dash);
    background-position: left top;
}

.livret-toc li {
    padding: 1rem 0;
    background: var(--livret-dash);
}

.livret-toc a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    font-size: 1.375rem;
    font-weight: 500;
    line-height: 1.23;
    color: var(--livret-attenue);
    text-decoration: none;
}

.livret-toc a::after {
    content: "";
    flex: 0 0 0.875rem;
    height: 0.875rem;
    background: var(--livret-arrow-right) center / contain no-repeat;
}

.livret-toc a:hover {
    color: var(--livret-texte);
}

.livret-toc .is-current a {
    background: var(--livret-violet-fond);
    color: var(--livret-texte);
    font-weight: 800;
}

/* ---------- Section ---------- */

.livret-section-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.23;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--livret-violet-clair);
    margin: 0 0 1.5rem;
}

.livret-accordions > .wp-block-details {
    margin: 0;
    padding: 1.375rem 0;
    background: var(--livret-dash);
}

.livret-accordions > .wp-block-details:first-child {
    padding-top: 0;
}

.wp-block-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    list-style: none;
    cursor: pointer;
    font-size: 1.5625rem;
    font-weight: 800;
    line-height: 1.23;
    color: var(--livret-texte);
}

.wp-block-details > summary::-webkit-details-marker {
    display: none;
}

.wp-block-details > summary::after {
    content: "";
    flex: 0 0 1.875rem;
    height: 1.875rem;
    border-radius: 50%;
    background: var(--livret-violet) var(--livret-arrow-down) center / 0.875rem no-repeat;
    transition: transform 0.2s ease;
}

.wp-block-details[open] > summary::after {
    transform: rotate(180deg);
}

.wp-block-details[open] > summary {
    margin-bottom: 1.375rem;
}

.wp-block-details > :not(summary) {
    max-width: 75ch;
}

.wp-block-details a {
    color: var(--livret-violet);
    font-weight: 700;
}

.wp-block-details h3 {
    font-size: 1.375rem;
    margin-top: 2rem;
}

.wp-block-details h4 {
    font-size: 1.125rem;
    margin-top: 1.625rem;
}

.wp-block-details ul,
.wp-block-details ol {
    padding-left: 1.2em;
}

.wp-block-details li::marker {
    color: var(--livret-violet);
}

/* Quote: big violet quotation marks, as in "Mission & philosophie". */
.wp-block-quote {
    position: relative;
    border: 0;
    margin: 2rem 0;
    padding: 1.625rem 4.9375rem 0 2.6875rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1.23;
    color: var(--livret-texte);
}

.wp-block-quote::before,
.wp-block-quote::after {
    position: absolute;
    font-size: 4rem;
    font-weight: 700;
    font-style: italic;
    line-height: 1;
    color: var(--livret-violet);
}

.wp-block-quote::before {
    content: "‘‘";
    left: 0;
    top: 0;
}

.wp-block-quote::after {
    content: "’’";
    right: 0;
    bottom: -1.5rem;
}

.wp-block-quote p {
    margin: 0;
}

/* Tables carried over from Automne (raw HTML blocks). */
.wp-block-details table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    margin: 1.375rem 0;
}

.wp-block-details th,
.wp-block-details td {
    padding: 0.5rem 0.625rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--livret-violet-fond);
}

.wp-block-details th {
    font-weight: 800;
}

/* Search results */
.livret-results .wp-block-post {
    padding: 1.375rem 0;
    background: var(--livret-dash);
}

.livret-result__title {
    font-size: 1.375rem;
    margin: 0 0 0.5rem;
}

.livret-result__title a {
    color: var(--livret-texte);
    text-decoration: none;
}

.livret-result__title a:hover {
    color: var(--livret-violet);
}

/* ---------- Footer ---------- */

.livret-footer {
    padding: 1.5rem 1.5rem 1.5625rem;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
}

.livret-footer p {
    margin: 0;
}

.livret-footer a {
    color: inherit;
    font-weight: 500;
    text-decoration: none;
}

.livret-footer a:hover {
    text-decoration: underline;
}

.livret-footer__sep {
    margin: 0 0.6em;
}

/* ---------- Login page ---------- */

.livret-login {
    max-width: 93.5rem;
    margin: 0 auto;
    padding: clamp(3rem, 11vh, 8.75rem) 1.5rem 5rem;
}

.livret-login > * {
    margin-block: 0;
}

.livret-login__title {
    font-family: var(--wp--preset--font-family--kanit);
    font-size: clamp(2.25rem, 4vw, 4.75rem);
    font-weight: 300;
    line-height: 0.99;
    text-align: center;
    color: var(--livret-texte);
}

.livret-login__title strong {
    font-weight: 500;
}

.livret-login__row {
    display: grid;
    grid-template-columns: minmax(0, 45.1875rem) minmax(0, 46.5rem);
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    margin-top: clamp(2rem, 7vh, 5rem) !important;
}

.livret-login__card {
    background: var(--livret-blanc);
    border-radius: 1.25rem;
    padding: 1.875rem 3.3125rem 2.5rem;
}

.livret-login__card > * {
    margin-block: 0;
}

.livret-login__card-title {
    font-family: var(--wp--preset--font-family--kanit);
    font-size: 2.375rem;
    font-weight: 500;
    line-height: 0.99;
    color: var(--livret-violet);
    margin-bottom: 1.75rem !important;
}

.livret-login__error {
    margin: 0 0 1.125rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.375rem;
    background: var(--livret-violet-fond);
    font-weight: 700;
}

.livret-login form p {
    margin: 0 0 0.9375rem;
}

.livret-login .login-username label,
.livret-login .login-password label {
    display: block;
    font-weight: 700;
}

.livret-login .login-username label::after,
.livret-login .login-password label::after {
    content: "*";
    color: var(--livret-violet);
}

.livret-login .login-username input,
.livret-login .login-password input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0.5625rem;
    padding: 0 0 0.5625rem;
    border: 0;
    border-radius: 0;
    background: var(--livret-dash-texte);
    font: inherit;
    font-weight: 400;
    color: var(--livret-texte);
}

.livret-login .login-username input::placeholder,
.livret-login .login-password input::placeholder {
    color: var(--livret-attenue);
    opacity: 1;
}

.livret-login .login-remember label {
    display: inline-flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--livret-attenue);
    cursor: pointer;
}

.livret-login .login-remember input {
    width: 0.6875rem;
    height: 0.6875rem;
    margin: 0;
    accent-color: var(--livret-violet);
}

.livret-login .login-submit {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.livret-login .login-submit input[type="submit"] {
    appearance: none;
    background: transparent;
    border: 1px solid var(--livret-texte);
    border-radius: 6.25rem;
    padding: 0.375rem 1.5625rem;
    font: inherit;
    font-weight: 700;
    line-height: 1.75rem;
    color: var(--livret-texte);
    cursor: pointer;
}

.livret-login .login-submit input[type="submit"]:hover {
    background: var(--livret-texte);
    color: var(--livret-blanc);
}

.livret-login__visual img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- Small screens ---------- */

@media (max-width: 960px) {
    .livret-header {
        padding: 1.25rem 1.25rem 0;
    }

    .livret-logo img {
        width: 4rem;
    }

    .livret-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto;
        row-gap: 1.5rem;
        margin-top: 1rem;
        padding: 0 1.25rem 5rem;
    }

    .livret-breadcrumb,
    .livret-sommaire,
    .livret-content {
        grid-column: 1;
        grid-row: auto;
    }

    .livret-sommaire {
        position: static;
        padding: 1.5rem 1.375rem;
    }

    .livret-toc a {
        font-size: 1.1875rem;
    }

    .wp-block-details > summary {
        font-size: 1.3125rem;
    }

    .wp-block-quote {
        padding: 1.5rem 2.25rem 0 1.875rem;
        font-size: 1.25rem;
    }

    .wp-block-quote::before,
    .wp-block-quote::after {
        font-size: 3rem;
    }

    .wp-block-details table {
        display: block;
        overflow-x: auto;
    }

    .livret-login__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .livret-login__card {
        padding: 1.625rem 1.375rem 1.875rem;
    }

    .livret-login__visual {
        max-width: 26.25rem;
        margin: 0 auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wp-block-details > summary::after {
        transition: none;
    }
}

/* ---------- Login layout adjustments (match Figma proportions) ---------- */

.livret-login {
    padding-inline: clamp(1.25rem, 6vw, 13.25rem);
}

.livret-login__row {
    max-width: 94.1875rem;
    margin-inline: auto !important;
    grid-template-columns: minmax(0, 723fr) minmax(0, 744fr);
    align-items: start;
    gap: clamp(1.5rem, 3vw, 2.5rem);
}

/* The sticker PNG has empty space above and below the artwork: let it overlap, as in the Figma. */
.livret-login__visual {
    margin-top: -27%;
    margin-bottom: -22%;
    pointer-events: none;
}

@media (max-width: 960px) {
    .livret-login__row {
        grid-template-columns: minmax(0, 1fr);
    }

    .livret-login__visual {
        margin: 0 auto;
    }
}

/* ---------- Logout button (header, logged-in users only) ---------- */

.livret-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.livret-logout a {
    display: inline-block;
    padding: 0.375rem 1.25rem;
    border: 1px solid var(--livret-texte);
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--livret-texte);
    text-decoration: none;
}

.livret-logout a:hover {
    background: var(--livret-texte);
    color: var(--livret-blanc);
}
