/*
 * Przewodnik „Dynamiczna wymiana oleju ATF" (dynamic-atf-exchange-guide).
 *
 * Strona-kompendium: hero z kroplą SVG, spis treści w kafelkach, rozwijane
 * sekcje (akordeon) z układem osi czasu (timeline) i przyciskiem „do góry".
 *
 * Tylko tryb ciemny — tryb jasny wykluczony z projektu ([[project_light_mode_excluded]]),
 * brak reguł [data-theme="light"]. Wszystko scope'owane pod .dwo-guide, żeby
 * przykryć reset.css (m.in. a{color:#c36}, button{border/color:#c36}) i nie
 * wyciekać do reszty motywu. Font = Manrope (var(--font-base)) dla spójności,
 * żółty akcent = var(--theme-accent) (#FECB0E).
 */

.dwo-guide {
    /* Lokalna paleta strony (ciemne panele + żółty akcent motywu). */
    --dwo-panel: #161616;
    --dwo-panel-2: #111111;
    --dwo-tile: #1c1c1c;
    --dwo-tile-head: #393939;
    --dwo-aside: #393939;
    --dwo-yellow: var(--theme-accent);
    --dwo-yellow-ink: #111111;
    --dwo-text: var(--theme-text);
    --dwo-text-dim: var(--theme-text-secondary);
    --dwo-line: #444444;
    --dwo-section-head: #393939;
    --dwo-section-head-hover: #454545;
    --dwo-radius: 22px;

    background: var(--theme-bg);
    color: var(--dwo-text);
    font-family: var(--font-base);
    font-size: 14px;
    line-height: 1.6;
    padding: 2rem 0 5rem;
    overflow: clip;
}

.dwo-guide__wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Reset typografii reset.css w obrębie strony */
.dwo-guide h1,
.dwo-guide h2,
.dwo-guide h3,
.dwo-guide h4 {
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}
.dwo-guide p {
    margin: 0;
}
.dwo-guide ul,
.dwo-guide ol {
    margin: 0;
    padding: 0;
    list-style: none;
}
.dwo-guide a {
    color: inherit;
    text-decoration: none;
}

/* ===================== HERO ===================== */
.dwo-hero {
    position: relative;
    background: var(--dwo-panel);
    border-radius: var(--dwo-radius);
    padding: 48px 52px;
    display: grid;
    /* Trzy kolumny: intro | kropla | aside. Kropla siedzi w środkowej kolumnie
       (nie nachodzi na tekst), ale jest przesunięta w prawo i z-index 1, więc
       kafelka aside (z-index 2) zachodzi na jej prawą część — wg projektu grafika. */
    grid-template-columns: 1fr auto 0.85fr;
    gap: 40px;
    align-items: center;
    overflow: hidden;
}
.dwo-hero__intro {
    position: relative;
    z-index: 2;
}
.dwo-hero__title {
    color: var(--dwo-yellow);
    font-size: 38px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
}
.dwo-hero__lead {
    color: var(--dwo-text-dim);
    margin-bottom: 16px !important;
}
.dwo-hero__lead:last-child {
    margin-bottom: 0 !important;
}
.dwo-hero__drop {
    position: relative;
    z-index: 1;            /* pod kafelką aside — częściowo schowana po prawej */
    width: 240px;
    align-self: center;
    justify-self: center;
    /* przesunięcie w prawo, żeby prawa część kropli weszła pod kafelkę aside */
    transform: translateX(72px);
    pointer-events: none;
}
.dwo-hero__drop svg {
    width: 100%;
    height: auto;
    display: block;
    fill: var(--dwo-yellow);
}
.dwo-hero__aside {
    position: relative;
    z-index: 2;            /* nad kroplą — zachodzi na jej prawą część */
    background: var(--dwo-aside);
    border-radius: var(--dwo-radius);
    padding: 32px 30px;
}
.dwo-hero__aside p {
    margin-bottom: 14px !important;
}
.dwo-hero__aside p:last-child {
    margin-bottom: 0 !important;
}
.dwo-hero__list {
    counter-reset: dwo-n;
    margin: 18px 0 !important;
}
.dwo-hero__list li {
    counter-increment: dwo-n;
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    color: var(--dwo-text-dim);
}
.dwo-hero__list li:last-child {
    margin-bottom: 0;
}
/* Numeracja w żółtym akcencie (bez separatora — same cyfry) */
.dwo-hero__list li::before {
    content: "0" counter(dwo-n);
    color: var(--dwo-yellow);
    font-weight: 600;
    white-space: nowrap;
}

/* ===================== SPIS TREŚCI (kafelki) ===================== */
.dwo-toc {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 36px;
    /* Kafelki naturalnej wysokości, wyrównane do góry (jak w projekcie grafika) */
    align-items: start;
}
.dwo-tile {
    background: var(--dwo-panel-2);
    border-radius: var(--dwo-radius);
    padding: 26px 24px 30px;
}
/* Układ wg projektu grafika (sekcje 7–11):
 *   wiersz: [7 — szeroki, 2 kol.] [8]
 *   wiersz: [9 — szeroki, 2 kol., 2 rzędy] [10]
 *                                          [11]
 * Kafelek 7 ma dodatkowo żółty nagłówek (--feature). */
.dwo-tile--wide {
    grid-column: span 2;
}
.dwo-tile--tall {
    grid-row: span 2;
}
.dwo-tile--col3 {
    grid-column: 3;
}
.dwo-tile__head {
    /* flex + osobny span numeru → zawijany tekst tworzy wcięcie wiszące
       (kolejne linie wyrównane do tekstu, nie pod cyfrą) — wg projektu grafika */
    display: flex;
    gap: 0.5em;
    align-items: baseline;
    background: var(--dwo-tile-head);
    border-radius: 14px;
    padding: 12px 18px;
    color: var(--dwo-yellow) !important;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 20px;
    transition: background 0.2s, color 0.2s;
}
.dwo-tile__head-no {
    flex-shrink: 0;
}
.dwo-tile__head:hover,
.dwo-tile__head:focus-visible {
    background: var(--dwo-yellow);
    color: var(--dwo-yellow-ink) !important;
    outline: none;
}
.dwo-tile--feature .dwo-tile__head {
    background: var(--dwo-yellow);
    color: var(--dwo-yellow-ink) !important;
}
.dwo-tile--feature .dwo-tile__head:hover,
.dwo-tile--feature .dwo-tile__head:focus-visible {
    filter: brightness(1.08);
}
.dwo-tile__list li {
    display: flex;
    gap: 12px;
    margin-bottom: 11px;
    color: var(--dwo-text-dim);
}
.dwo-tile__list li:last-child {
    margin-bottom: 0;
}
.dwo-tile__no {
    font-weight: 600;
    color: var(--dwo-text);
    white-space: nowrap;
    min-width: 26px;
}
.dwo-tile__list a {
    color: inherit;
}
.dwo-tile__list a:hover,
.dwo-tile__list a:focus-visible {
    color: var(--dwo-yellow) !important;
    outline: none;
}

/* ===================== SEKCJE (akordeon) ===================== */
.dwo-section {
    margin-top: 28px;
    /* Sticky header (.atfpro-header) — odsuń kotwicę, by tytuł sekcji nie chował się pod nim */
    scroll-margin-top: 96px;
}
.dwo-section__head {
    background: var(--dwo-section-head);
    border-radius: 24px;
    padding: 30px 44px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}
.dwo-section__head:hover {
    background: var(--dwo-section-head-hover);
}
.dwo-section__head:focus-visible {
    outline: 2px solid var(--dwo-yellow);
    outline-offset: 2px;
}
.dwo-section__head h2 {
    color: var(--dwo-yellow);
    font-size: 22px;
    font-weight: 700;
    /* Sekcja zwinięta — sam tytuł, bez odstępu pod spodem */
    margin-bottom: 0;
    padding-right: 50px;
}
/* Opis pod tytułem widoczny dopiero po rozwinięciu belki */
.dwo-section.is-open .dwo-section__head h2 {
    margin-bottom: 10px;
}
.dwo-section__desc {
    color: var(--dwo-text-dim);
    padding-right: 50px;
    display: none;
}
.dwo-section.is-open .dwo-section__desc {
    display: block;
}
.dwo-section__chev {
    position: absolute;
    /* Wyrównanie w pionie do linii tytułu (sekcja zwinięta = sam tytuł) */
    top: 30px;
    right: 38px;
    color: var(--dwo-yellow);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.25s;
}
.dwo-section.is-open .dwo-section__chev {
    transform: rotate(90deg);
}
.dwo-section__body {
    display: none;
    padding-top: 24px;
}
.dwo-section.is-open .dwo-section__body {
    display: block;
}

/* ===================== TIMELINE ===================== */
.dwo-timeline {
    position: relative;
    padding: 20px 0 10px;
}
.dwo-timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--dwo-line);
    transform: translateX(-50%);
}
.dwo-item {
    position: relative;
    width: 46%;
    margin-bottom: 48px;
}
.dwo-item:last-child {
    margin-bottom: 0;
}
.dwo-item--right {
    margin-left: 54%;
}
.dwo-item--left {
    margin-right: 54%;
}
.dwo-item::before {
    content: "";
    position: absolute;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--dwo-yellow);
    z-index: 2;
}
.dwo-item--left::before {
    right: calc(-8.7% - 7px);
}
.dwo-item--right::before {
    left: calc(-8.7% - 7px);
}
.dwo-item h3 {
    color: var(--dwo-yellow);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    gap: 18px;
}
.dwo-item__no {
    flex-shrink: 0;
}
.dwo-item__body {
    padding-left: 42px;
    color: var(--dwo-text-dim);
    text-align: justify;
}
.dwo-item__body p {
    margin-bottom: 12px !important;
}
.dwo-item__body p:last-child {
    margin-bottom: 0 !important;
}
.dwo-item__body ul {
    margin-bottom: 12px !important;
}
.dwo-item__body ul:last-child {
    margin-bottom: 0 !important;
}
.dwo-item__body ul li {
    padding-left: 16px;
    position: relative;
    margin-bottom: 6px;
}
.dwo-item__body ul li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: var(--dwo-yellow);
}
.dwo-item__body b {
    color: var(--dwo-text);
}
.dwo-item__body h4 {
    color: var(--dwo-text);
    font-size: 14px;
    margin: 16px 0 6px;
}

/* ===================== PRZYCISK „DO GÓRY" ===================== */
.dwo-totop {
    position: fixed;
    right: 28px;
    bottom: 28px;
    background: var(--dwo-yellow) !important;
    color: var(--dwo-yellow-ink) !important;
    font-family: var(--font-base);
    font-weight: 700;
    font-size: 14px;
    padding: 13px 24px;
    border: none !important;
    border-radius: 10px;
    cursor: pointer;
    z-index: 50;
    width: auto;
    /* Płynne pojawianie/znikanie sterowane przez .is-visible (JS) */
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, filter 0.15s;
}
.dwo-totop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* Stany — reset.css narzuca #c36 na każdym stanie buttona ([[feedback_button_all_states_reset]]) */
.dwo-totop:hover,
.dwo-totop:focus,
.dwo-totop:active,
.dwo-totop:focus-visible {
    background: var(--dwo-yellow) !important;
    color: var(--dwo-yellow-ink) !important;
    filter: brightness(1.1);
    outline: none;
}
.dwo-totop:focus-visible {
    outline: 2px solid var(--theme-heading);
    outline-offset: 2px;
}

/* ===================== RESPONSYWNOŚĆ ===================== */
@media (max-width: 1024px) {
    .dwo-toc {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Na węższych ekranach spany 3-kolumnowe nie mają sensu — naturalny przepływ */
    .dwo-tile--wide,
    .dwo-tile--tall,
    .dwo-tile--col3 {
        grid-column: auto;
        grid-row: auto;
    }
}

@media (max-width: 860px) {
    .dwo-guide__wrap {
        padding: 0 16px;
    }
    .dwo-hero {
        grid-template-columns: 1fr;
        padding: 32px 24px;
        gap: 28px;
    }
    .dwo-hero__title {
        font-size: 30px;
    }
    .dwo-hero__drop {
        display: none;
    }
    .dwo-toc {
        grid-template-columns: 1fr;
    }
    .dwo-section__head {
        padding: 24px 22px;
    }
    .dwo-section__chev {
        right: 22px;
        top: 26px;
    }
    .dwo-section__head h2,
    .dwo-section__desc {
        padding-right: 36px;
    }
    /* Timeline → jedna kolumna z osią po lewej */
    .dwo-timeline::before {
        left: 8px;
    }
    .dwo-item,
    .dwo-item--left,
    .dwo-item--right {
        width: auto;
        margin: 0 0 40px 32px;
    }
    .dwo-item--left::before,
    .dwo-item--right::before {
        left: -31px;
        right: auto;
    }
    .dwo-item__body {
        padding-left: 0;
        text-align: left;
    }
    .dwo-totop {
        right: 16px;
        bottom: 16px;
        padding: 11px 18px;
    }
}
