/* ==========================================================================
   Yasal metinler (Policies/KVKKDisclosure, UserAgreement, DistanceSalesAgreement)
   Önek: .akl-  ·  Partial'lar: Views/Policies/_LegalHero, _LegalToc, _LegalHeading
   Sade okuma: tek sütun kâğıt, masaüstünde yapışkan içindekiler.
   ========================================================================== */

/* ------------------------------ Başlık bandı ------------------------------ */
.akl-hero__title { max-width: 20ch; }
.akl-docs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.akl-docs__link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    padding: 8px 16px;
    border-radius: var(--ak-radius-pill);
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .86);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.akl-docs__link i { color: var(--ak-sun); font-size: .8125rem; }
.akl-docs__link:hover { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .1); }
.akl-docs__link.is-active { background: var(--ak-sun); border-color: var(--ak-sun); color: var(--ak-plum-950); }
.akl-docs__link.is-active i { color: var(--ak-plum-800); }

/* ------------------------------ Gövde ------------------------------ */
.akl-body { position: relative; background: var(--ak-bg); padding-block: clamp(40px, 5vw, 72px) var(--ak-section-y); }
.akl-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: clamp(32px, 4vw, 64px);
    align-items: start;
}
.akl-main { display: grid; gap: 32px; min-width: 0; }

/* ------------------------------ İçindekiler ------------------------------ */
.akl-toc {
    position: sticky;
    top: calc(var(--navbar-height) + var(--top-banner-height, 0px) + 24px);
    min-width: 0;
}
.akl-toc__desk {
    position: relative;
    max-height: calc(100vh - var(--navbar-height) - var(--top-banner-height, 0px) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 18px 12px 12px;
    border-radius: 24px;
    border: 1px solid var(--ak-line);
    background: #fff;
}
.akl-toc__head {
    display: grid;
    gap: 2px;
    margin: 0 8px 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--ak-line-strong);
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ak-muted);
}
.akl-toc__head .ak-kufi { justify-self: start; font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--ak-sand); }
.akl-toc__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.akl-toc__list a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    min-height: 40px;
    padding: 8px 10px;
    border-radius: 12px;
    color: var(--ak-ink-2);
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
}
.akl-toc__list a:hover { background: var(--ak-plum-25); color: var(--ak-plum-700); }
.akl-toc__list a.is-active { background: var(--ak-plum-50); color: var(--ak-plum-800); font-weight: 700; }
.akl-toc__num {
    min-width: 26px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 7px;
    background: var(--ak-surface-2);
    color: var(--ak-muted);
    font-size: .75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.akl-toc__list a.is-active .akl-toc__num { background: var(--ak-plum-600); color: #fff; }
.akl-toc__name { overflow-wrap: anywhere; }
.akl-toc__group {
    margin: 14px 8px 4px;
    padding-top: 12px;
    border-top: 1px dashed var(--ak-line-strong);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ak-plum-600);
}
.akl-toc__mob { display: none; }

/* ------------------------------ Belge (kâğıt) ------------------------------ */
.akl-doc {
    position: relative;
    isolation: isolate;
    padding: clamp(24px, 4vw, 56px);
    border-radius: 28px;
    border: 1px solid var(--ak-line);
    background: #fff;
}
.akl-doc::before {
    content: "";
    position: absolute;
    top: -1px;
    inset-inline: 40px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--ak-plum-600), var(--ak-sun));
}
.akl-doc::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    inset-inline-end: 0;
    width: 220px;
    height: 220px;
    background-image: var(--ak-pattern-plum);
    background-size: 88px 88px;
    -webkit-mask-image: radial-gradient(circle at 100% 0%, #000, transparent 70%);
    mask-image: radial-gradient(circle at 100% 0%, #000, transparent 70%);
    border-start-end-radius: 28px;
    pointer-events: none;
}
html[dir="rtl"] .akl-doc::after {
    -webkit-mask-image: radial-gradient(circle at 0% 0%, #000, transparent 70%);
    mask-image: radial-gradient(circle at 0% 0%, #000, transparent 70%);
}

.akl-doc__head { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--ak-line); }
.akl-doc__seal {
    width: 56px;
    height: 68px;
    flex: none;
    display: grid;
    place-items: center;
    padding-top: 6px;
    border-radius: 50% 50% 12px 12px / 40% 40% 12px 12px;
    background: var(--ak-plum-900);
    color: var(--ak-sun);
    font-size: 1.25rem;
}
.akl-doc__title { margin: 0 0 4px; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.15; }
.akl-doc__meta { margin: 0; font-size: .875rem; color: var(--ak-muted); }

.akl-section { min-width: 0; }
.akl-section + .akl-section { margin-top: 36px; padding-top: 36px; border-top: 1px solid var(--ak-line); }
.akl-section--intro + .akl-section { margin-top: 28px; }

/* Bölüm başlığı: Arapça rakamlı kemer + "Madde 1" etiketi + başlık */
.akl-h {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 18px;
    scroll-margin-top: calc(var(--navbar-height) + var(--top-banner-height, 0px) + 24px);
}
.akl-h__arch {
    width: 44px;
    height: 54px;
    flex: none;
    display: grid;
    place-items: center;
    padding-top: 5px;
    border-radius: 50% 50% 10px 10px / 40% 40% 10px 10px;
    background: var(--ak-plum-50);
    border: 1px solid var(--ak-plum-100);
    color: var(--ak-plum-700);
    font-family: var(--ak-font-naskh);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
}
.akl-h__text { display: grid; gap: 2px; min-width: 0; }
.akl-h__label { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ak-plum-500); }
.akl-h__name { font-size: clamp(1.1875rem, 1.05rem + .5vw, 1.4375rem); font-weight: 700; line-height: 1.3; letter-spacing: -.02em; color: var(--ak-ink); overflow-wrap: anywhere; }
.akl-h--sub { margin-top: 26px; gap: 12px; }
.akl-h--sub .akl-h__arch { width: 36px; height: 44px; font-size: 1rem; background: var(--ak-sand-50); border-color: var(--ak-sand-100); color: #8a5a32; }
.akl-h--sub .akl-h__name { font-size: 1.0625rem; }

/* Metin */
.akl-p { max-width: 72ch; margin: 0 0 1em; color: var(--ak-ink-2); font-size: 1.0625rem; line-height: 1.8; }
.akl-p:last-child { margin-bottom: 0; }
.akl-p--lead { font-size: 1.1875rem; line-height: 1.75; color: var(--ak-ink); }
.akl-list,
.akl-olist { max-width: 72ch; margin: 0 0 1em; color: var(--ak-ink-2); font-size: 1.0625rem; line-height: 1.75; }
.akl-list:last-child, .akl-olist:last-child { margin-bottom: 0; }
.akl-list { list-style: none; padding: 0; display: grid; gap: 12px; }
.akl-list li { position: relative; padding-inline-start: 28px; }
.akl-list li::before {
    content: "";
    position: absolute;
    top: .55em;
    inset-inline-start: 4px;
    width: 12px;
    height: 12px;
    background: var(--ak-sand);
    clip-path: polygon(50% 0%, 63% 18%, 85% 15%, 82% 37%, 100% 50%, 82% 63%, 85% 85%, 63% 82%, 50% 100%, 37% 82%, 15% 85%, 18% 63%, 0% 50%, 18% 37%, 15% 15%, 37% 18%);
}
.akl-list strong { color: var(--ak-ink); }
.akl-olist { padding-inline-start: 1.6em; display: grid; gap: 10px; }
.akl-olist li { padding-inline-start: .3em; }
.akl-olist li::marker { color: var(--ak-plum-600); font-weight: 800; }

/* Tablolar */
.akl-table-wrap {
    margin: 22px 0 24px;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid var(--ak-line);
}
.akl-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9875rem; line-height: 1.6; color: var(--ak-ink-2); }
.akl-table th,
.akl-table td { padding: 14px 18px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--ak-line); }
.akl-table tr:last-child > * { border-bottom: 0; }
.akl-table thead th { background: var(--ak-plum-25); color: var(--ak-plum-800); font-size: .8125rem; font-weight: 700; letter-spacing: .04em; }
.akl-table tbody td:first-child { font-weight: 600; color: var(--ak-ink); }
.akl-table--info th { width: 34%; background: var(--ak-bg); color: var(--ak-plum-800); font-weight: 700; border-inline-end: 1px solid var(--ak-line); }
.akl-table--info td { font-weight: 500 !important; color: var(--ak-ink-2) !important; overflow-wrap: anywhere; }

/* Uyarı kutusu */
.akl-callout {
    margin: 22px 0 4px;
    padding: 20px 22px;
    border-radius: 18px;
    background: var(--ak-sun-50);
    border: 1px solid var(--ak-sun-100);
    border-inline-start: 4px solid var(--ak-sun-600);
}
.akl-callout__title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-weight: 700; color: var(--ak-plum-900); }
.akl-callout__title i { color: var(--ak-sun-600); }
.akl-callout .akl-p { font-size: 1rem; }

/* Son güncelleme */
.akl-doc__foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 44px;
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--ak-bg);
    color: var(--ak-muted);
    font-size: .875rem;
    font-weight: 600;
}
.akl-doc__foot i { color: var(--ak-plum-400); }

@media (prefers-reduced-motion: no-preference) {
    .akl-toc__list a, .akl-docs__link { transition: background-color .2s var(--ak-ease), color .2s var(--ak-ease), border-color .2s !important; }
    html:has(.akl-body) { scroll-behavior: smooth !important; }
}

/* ------------------------------ Duyarlı ------------------------------ */
@media (max-width: 991.98px) {
    .akl-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .akl-toc { position: sticky; top: calc(var(--navbar-height) + var(--top-banner-height, 0px) + 8px); z-index: 30; }
    .akl-toc__desk { display: none; }
    .akl-toc__mob {
        display: block;
        border-radius: 18px;
        border: 1px solid var(--ak-line);
        background: rgba(255, 255, 255, .96);
        -webkit-backdrop-filter: blur(12px);
        backdrop-filter: blur(12px);
        box-shadow: var(--ak-shadow-sm);
    }
    .akl-toc__mob summary {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 54px;
        padding: 10px 16px;
        list-style: none;
        cursor: pointer;
        font-weight: 700;
        color: var(--ak-ink);
    }
    .akl-toc__mob summary::-webkit-details-marker { display: none; }
    .akl-toc__mob summary > i:first-child { color: var(--ak-plum-500); }
    .akl-toc__mob-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .akl-toc__mob .ak-kufi { color: var(--ak-sand); font-size: .9375rem; }
    .akl-toc__chev { margin-inline-start: auto; font-size: .75rem; color: var(--ak-muted); }
    .akl-toc__mob[open] .akl-toc__chev { transform: rotate(180deg); }
    .akl-toc__mob { position: relative; }
    .akl-toc__mob .akl-toc__list {
        position: absolute;
        top: calc(100% + 6px);
        inset-inline: 0;
        max-height: 60vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 8px;
        border-radius: 18px;
        border: 1px solid var(--ak-line);
        background: #fff;
        box-shadow: var(--ak-shadow-lg);
    }
    .akl-toc__mob .akl-toc__list a { min-height: 44px; }

    .akl-docs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--ak-gutter) * -1); padding-inline: var(--ak-gutter); }
    .akl-docs::-webkit-scrollbar { display: none; }
}

@media (max-width: 767.98px) {
    .akl-body { padding-top: 24px; }
    .akl-doc { padding: 24px 18px 22px; border-radius: 22px; }
    .akl-doc::before { inset-inline: 24px; }
    .akl-section + .akl-section { margin-top: 28px; padding-top: 28px; }
    .akl-h { gap: 12px; align-items: flex-start; }
    .akl-h__arch { width: 38px; height: 46px; font-size: 1.125rem; }
    .akl-p, .akl-list, .akl-olist { font-size: 1rem; line-height: 1.75; }
    .akl-p--lead { font-size: 1.0625rem; }
    .akl-doc__head { gap: 14px; }
    .akl-doc__seal { width: 46px; height: 56px; font-size: 1rem; }

    .akl-table th, .akl-table td { padding: 12px 14px; }
    .akl-table { font-size: .9375rem; }

    /* Bilgi tablosu: başlık üstte, değer altta */
    .akl-table--info,
    .akl-table--info tbody,
    .akl-table--info tr,
    .akl-table--info th,
    .akl-table--info td { display: block; width: auto; }
    .akl-table--info th { border-inline-end: 0; border-bottom: 0; padding: 12px 16px 2px; font-size: .8125rem; background: transparent; }
    .akl-table--info td { padding: 0 16px 12px; }
}
