/* ==========================================================================
   Documents page (DocumentsPage) — also the base for ConnectionGuidePage.
   Layout: a plain intro column on the left (no frame), sticky while the
   content scrolls, separated from it by a full-height vertical rule.
   On phones the intro becomes a simple block on a light background.
   Colour comes from the site's palette: ESTC blue for structure and actions,
   the top-bar gold for small accents, conventional per-format file colours.
   Built on the estc_theme.css tokens.
   ========================================================================== */

.page:has(.estc-docs) .page-title {
    margin-bottom: 0;
}

/* The legacy theme sets overflow:hidden on .page, which makes it the scroll container
   and stops position:sticky from sticking to the window. clip crops the same way. */
.page:has(.estc-docs) {
    overflow: clip;
}

.estc-docs {
    --docs-gold: #f2b705;           /* top-bar icon gold */
    --docs-gold-ink: #8a6500;       /* gold dark enough for text on light backgrounds */
    padding: 80px 0 104px;
    background: #fff;
}

.estc-docs__layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: stretch;           /* the column (and its rule) runs the full height */
}

/* ---------- Intro column ---------- */

.estc-docs__aside {
    padding-right: 48px;
    border-right: 1px solid var(--estc-border);
}

.estc-docs__aside-inner {
    position: sticky;
    top: calc(var(--estc-header-h-compact) + 40px);
}

/* Short gold rule above the label */
.estc-docs__aside-inner::before {
    content: '';
    display: block;
    width: 32px;
    height: 3px;
    margin-bottom: 20px;
    background: var(--docs-gold);
}

.estc-docs__eyebrow {
    margin: 0 0 12px;
    font-family: var(--estc-font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--estc-primary);
}

.estc-docs__heading {
    margin: 0;
    font-family: var(--estc-font-heading);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.3px;
    color: var(--estc-heading);
}

.estc-docs__intro {
    margin: 16px 0 0;
    font-size: 15px;
    line-height: 1.75;
    color: var(--estc-muted);
}

.estc-docs__aside-block {
    margin-top: 36px;
}

.estc-docs__aside-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--docs-gold-ink);
}

/* "Sur cette page" index (Documents) */
.estc-docs__toc {
    margin: 0;
    padding: 0;
    list-style: none;
}

.estc-docs__toc a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid var(--estc-line);
    font-size: 15px;
    font-weight: 500;
    color: var(--estc-heading);
    transition: color .2s ease, padding-left .2s ease;
}

.estc-docs__toc a:hover,
.estc-docs__toc a:focus-visible {
    padding-left: 6px;
    color: var(--estc-primary);
}

.estc-docs__count {
    min-width: 28px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    color: var(--estc-primary);
    background: var(--estc-primary-light);
}

/* ---------- Main column ---------- */

.estc-docs__main {
    min-width: 0;
    padding-left: 64px;
}

/* ---------- Sections ---------- */

.estc-docs__section + .estc-docs__section {
    margin-top: 72px;
}

/* Anchor jumps land below the fixed header */
.estc-docs__section {
    scroll-margin-top: calc(var(--estc-header-h-compact) + 32px);
}

.estc-docs__section-head {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--estc-primary);
}

.estc-docs__num {
    font-family: var(--estc-font-heading);
    font-size: 54px;
    font-weight: 500;
    line-height: .85;
    font-variant-numeric: lining-nums;
    color: var(--estc-primary);
}

.estc-docs__section-title {
    flex: 1;
    min-width: 0;
}

.estc-docs__section-head .estc-docs__eyebrow {
    margin-bottom: 8px;
    color: var(--docs-gold-ink);
}

.estc-docs__section-head h3 {
    margin: 0;
    font-family: var(--estc-font-heading);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--estc-heading);
}

.estc-docs__total {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--estc-muted);
}

/* ---------- Document rows ---------- */

.estc-docs__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.estc-doc {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 24px;
    align-items: start;
    padding: 28px 0;
    border-bottom: 1px solid var(--estc-border);
}

/* File-type badge: a small document glyph with the extension */
.estc-doc__type {
    --type-ink: var(--estc-primary);           /* default: any other format */
    --type-bg: var(--estc-primary-light);
    --type-fold: rgba(0, 75, 130, .25);
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 38px;
    height: 46px;
    padding-bottom: 7px;
    font-family: var(--estc-font-body);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--type-ink);
    background: var(--type-bg);
    clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%);
}

.estc-doc__type::before {      /* folded corner */
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 22%;
    background: var(--type-fold);
}

/* Conventional per-format colours */
.estc-doc__type--pdf  { --type-ink: #b42318; --type-bg: #fdecea; --type-fold: rgba(180, 35, 24, .28); }
.estc-doc__type--doc,
.estc-doc__type--docx { --type-ink: #1f5fbf; --type-bg: #e8f0fc; --type-fold: rgba(31, 95, 191, .28); }
.estc-doc__type--xls,
.estc-doc__type--xlsx,
.estc-doc__type--csv  { --type-ink: #1d7a46; --type-bg: #e6f4ec; --type-fold: rgba(29, 122, 70, .28); }
.estc-doc__type--ppt,
.estc-doc__type--pptx { --type-ink: #c4501b; --type-bg: #fcefe7; --type-fold: rgba(196, 80, 27, .28); }

.estc-doc__title {
    margin: 0;
    font-family: var(--estc-font-heading);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--estc-heading);
    transition: color .2s ease;
}

.estc-doc:hover .estc-doc__title {
    color: var(--estc-primary);
}

.estc-doc__desc {
    margin: 8px 0 0;
    max-width: 620px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--estc-text);
}

/* Highlighted note (e.g. link to the boarding form): warm gold = "attention" */
.estc-doc__note {
    display: flex;
    gap: 12px;
    max-width: 620px;
    margin-top: 16px;
    padding: 14px 16px;
    background: #fdf7e4;
    border-left: 3px solid var(--docs-gold);
    font-size: 14px;
    line-height: 1.65;
    color: #4a3b10;
}

.estc-doc__note > i {
    margin-top: 4px;
    color: var(--docs-gold-ink);
}

.estc-doc__note p {
    margin: 0;
}

.estc-doc__note p + p {
    margin-top: 6px;
}

.estc-doc__note a {
    font-weight: 700;
    color: var(--estc-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.estc-doc__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    padding-top: 2px;
}

.estc-doc__size {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: var(--estc-muted);
    white-space: nowrap;
}

.estc-doc__download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    border: 1px solid var(--estc-primary);
    background: var(--estc-primary);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    transition: background-color .2s ease, border-color .2s ease;
}

.estc-doc__download i {
    font-size: 12px;
    transition: transform .2s ease;
}

.estc-doc__download:hover,
.estc-doc__download:focus-visible {
    background: var(--estc-primary-deep);
    border-color: var(--estc-primary-deep);
    color: #fff;
}

.estc-doc__download:hover i {
    transform: translateY(2px);
}

/* ---------- Responsive ---------- */

/* Tablets and phones: the intro column becomes a simple full-width intro block */
@media (max-width: 1024px) {
    .estc-docs {
        padding-top: 0;
    }

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

    .estc-docs__aside {
        margin: 0 -24px 48px;           /* bleed to the screen edges (container gutter) */
        padding: 40px 24px 36px;
        background: #f6f8fb;
        border-right: 0;
        border-bottom: 1px solid var(--estc-line);
    }

    .estc-docs__aside-inner {
        position: static;
        max-width: 640px;
    }

    .estc-docs__main {
        padding-left: 0;
    }
}

@media (max-width: 640px) {
    .estc-docs {
        padding-bottom: 64px;
    }

    .estc-docs__aside {
        padding: 32px 24px 28px;
        margin-bottom: 36px;
    }

    .estc-docs__heading {
        font-size: 26px;
    }

    .estc-docs__aside-block {
        margin-top: 28px;
    }

    /* Section head: label on its own line, then number (or icon) + title; count hidden */
    .estc-docs__section-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 14px;
        align-items: end;
        padding-bottom: 16px;
    }

    .estc-docs__section-title {
        display: contents;
    }

    .estc-docs__section-head .estc-docs__eyebrow {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: 10px;
        line-height: 1.6;
    }

    .estc-docs__section-head > :first-child {     /* number or device icon */
        grid-row: 2;
    }

    .estc-docs__section-head h3 {
        grid-row: 2;
        font-size: 24px;
    }

    .estc-docs__total {
        display: none;
    }

    .estc-docs__num {
        font-size: 38px;
    }

    /* Badge + title side by side; description, note and button use the full width */
    .estc-doc {
        grid-template-columns: 38px minmax(0, 1fr);
        column-gap: 16px;
        row-gap: 0;
        align-items: center;
    }

    .estc-doc__body {
        display: contents;
    }

    .estc-doc__desc,
    .estc-doc__note,
    .estc-doc__aside {
        grid-column: 1 / -1;
        max-width: none;
    }

    .estc-doc__desc {
        margin-top: 14px;
    }

    .estc-doc__aside {
        flex-direction: row-reverse;
        justify-content: flex-end;
        align-items: center;
        gap: 14px;
        margin-top: 18px;
        padding-top: 0;
    }
}
