/*
 * Avocats Wilson — structure des pages juridiques.
 * Scoped : aucun style hors du modele .awl-legal.
 * Bronze repris des composants existants du theme.
 */

.awl-legal {
    --awl-bronze: #947554;
    --awl-ink: #1b1a19;
    --awl-border: #e6dfd8;
    --awl-canvas: #faf8f5;

    background: var(--awl-canvas);
    color: var(--awl-ink);
    min-height: 70vh;
}

.awl-legal,
.awl-legal * {
    box-sizing: border-box;
}

.awl-legal__container {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

/* Bandeau de titre */

.awl-legal__masthead {
    background: linear-gradient(
        125deg,
        #fbf9f6 0%,
        #f1ebe3 100%
    );
    border-bottom: 1px solid var(--awl-border);
    padding: clamp(54px, 6vw, 88px) 0 62px;
}

.awl-legal__eyebrow {
    color: var(--awl-bronze);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .17em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.awl-legal__title {
    max-width: 850px;
    margin: 0;
    color: var(--awl-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(38px, 4.4vw, 66px);
    font-weight: 700;
    line-height: 1.09;
    letter-spacing: -.035em;
}

.awl-legal__title-line {
    width: 64px;
    height: 3px;
    background: var(--awl-bronze);
    margin-top: 25px;
}

/* Structure en deux colonnes */

.awl-legal__layout {
    display: grid;
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    padding-block: 43px 96px;
}

.awl-legal__sidebar-inner {
    position: sticky;
    top: 28px;
    padding: 25px 17px;
    background: #fff;
    border: 1px solid var(--awl-border);
    border-radius: 12px;
}

body.admin-bar .awl-legal__sidebar-inner {
    top: 60px;
}

.awl-legal__sidebar-title {
    margin: 0 9px 20px;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .12em;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--awl-bronze);
}

.awl-legal__toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 4px;
    counter-reset: awl-toc;
}

.awl-legal__toc-list li {
    counter-increment: awl-toc;
    margin: 0;
}

.awl-legal__toc-list a {
    display: flex;
    gap: 10px;
    padding: 11px 12px;
    border-left: 3px solid transparent;
    border-radius: 5px;
    color: #3f3a36;
    font-size: 13px;
    line-height: 1.45;
    text-decoration: none;
    transition: background .18s, border-color .18s;
}

.awl-legal__toc-list a::before {
    content: counter(awl-toc, decimal-leading-zero) ".";
    color: var(--awl-bronze);
    font-size: 11px;
    font-weight: 750;
}

.awl-legal__toc-list a:hover,
.awl-legal__toc-list a[aria-current="location"] {
    background: #f5f0e9;
    border-left-color: var(--awl-bronze);
    color: #241e19;
}

.awl-legal__toc-list a:focus-visible {
    outline: 2px solid var(--awl-bronze);
    outline-offset: 2px;
}

/* Carte de contenu */

.awl-legal__article {
    min-width: 0;
    min-height: 520px;
    background: #fff;
    border: 1px solid var(--awl-border);
    border-radius: 12px;
    padding: clamp(28px, 4vw, 58px);
    box-shadow: 0 14px 36px rgba(43, 30, 17, .035);
}

.awl-legal__body {
    counter-reset: awl-section;
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.85;
}

.awl-legal__body h2 {
    counter-increment: awl-section;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--awl-ink);
    font-size: clamp(25px, 2.4vw, 33px);
    line-height: 1.22;
    letter-spacing: -.02em;
    margin: 42px 0 20px;
    padding-top: 39px;
    border-top: 1px solid var(--awl-border);
    scroll-margin-top: 35px;
}

.awl-legal__body h2::before {
    content: counter(awl-section, decimal-leading-zero) ".";
    display: block;
    margin-bottom: 12px;
    color: var(--awl-bronze);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
}

.awl-legal__body h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.awl-legal__body h3 {
    color: var(--awl-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    line-height: 1.3;
    margin: 28px 0 12px;
}

.awl-legal__body p,
.awl-legal__body ul,
.awl-legal__body ol {
    margin: 0 0 19px;
}

.awl-legal__body a {
    color: var(--awl-bronze);
    text-underline-offset: 3px;
}

.awl-legal__body img,
.awl-legal__body table {
    max-width: 100%;
}

.awl-legal__body table {
    display: block;
    overflow-x: auto;
}

/* Apercu strictement structurel, sans contenu juridique */

.awl-legal__nav-skeleton {
    display: grid;
    gap: 15px;
    padding: 6px 12px;
}

.awl-legal__nav-skeleton span {
    display: block;
    height: 13px;
    width: 90%;
    border-left: 3px solid var(--awl-bronze);
    background: #f2ede7;
    border-radius: 3px;
}

.awl-legal__nav-skeleton span:nth-child(2) {
    width: 75%;
}

.awl-legal__nav-skeleton span:nth-child(3) {
    width: 87%;
}

.awl-legal__nav-skeleton span:nth-child(4) {
    width: 63%;
}

.awl-legal__skeleton-section {
    display: grid;
    gap: 13px;
    padding: 0 0 39px;
    margin-bottom: 39px;
    border-bottom: 1px solid var(--awl-border);
}

.awl-legal__skeleton-section:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

.awl-legal__skeleton-number {
    width: 27px;
    height: 8px;
    background: var(--awl-bronze);
    opacity: .85;
    border-radius: 2px;
}

.awl-legal__skeleton-heading {
    height: 24px;
    width: 65%;
    background: #e3dad0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.awl-legal__skeleton-line {
    display: block;
    height: 10px;
    background: #f0ede9;
    border-radius: 4px;
}

.awl-legal__skeleton-line:nth-last-child(2) {
    width: 91%;
}

.awl-legal__skeleton-line:last-child {
    width: 73%;
}

/* Tablettes et mobiles */

@media (max-width: 900px) {
    .awl-legal__layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
        padding-block: 25px 60px;
    }

    .awl-legal__sidebar-inner,
    body.admin-bar .awl-legal__sidebar-inner {
        position: static;
    }

    .awl-legal__toc-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .awl-legal__container {
        width: calc(100% - 28px);
    }

    .awl-legal__masthead {
        padding: 45px 0 42px;
    }

    .awl-legal__layout {
        gap: 15px;
        padding-bottom: 42px;
    }

    .awl-legal__sidebar-inner {
        padding: 20px 14px;
    }

    .awl-legal__toc-list {
        grid-template-columns: 1fr;
    }

    .awl-legal__article {
        padding: 25px 20px;
        min-height: 360px;
    }

    .awl-legal__body h2 {
        padding-top: 30px;
        margin-top: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .awl-legal__toc-list a {
        transition: none;
    }
}
