/* ==========================================================================
   Sintesys Student — Pusat Legal / Legal Center
   Universitas Siliwangi

   Palet diturunkan dari dua hijau logo Unsil:
   #08774B (struktur: masthead, judul, tautan, tombol)
   #189A4B (aksen: garis, penanda, hover, fokus)

   Tema: :root = terang (bawaan). Gelap dipakai bila OS minta gelap DAN
   pengguna belum memilih terang, atau bila pengguna menekan tombol tema
   (atribut data-theme di <html>, disimpan ke localStorage).
   Dipakai oleh Modules/SintesysStudent/Resources/legal/**.html
   ========================================================================== */

:root {
    color-scheme: light dark;

    --brand: #08774b;
    --brand-deep: #096843;
    --brand-bright: #189a4b;
    --brand-tint: #e7f5ed;
    --brand-tint-strong: #d3ecdf;

    --masthead-bg: #08774b;

    --paper: #f4f9f6;
    --surface: #ffffff;
    --surface-alt: #f7fcf9;
    --ink: #14251d;
    --muted: #59695f;
    --line: #dfece4;
    --line-strong: #c2dccf;

    --on-brand: #ffffff;
    --on-brand-soft: #d8efe3;

    --btn-bg: #08774b;
    --btn-bg-hover: #096843;
    --btn-ink: #ffffff;

    --radius: 16px;
    --radius-sm: 10px;

    --wrap: 44rem;
    --pad: clamp(1rem, 0.55rem + 2vw, 2rem);
    --gutter: clamp(1.1rem, 0.85rem + 1.2vw, 1.9rem);

    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Gelap mengikuti OS — kecuali pengguna sudah memilih terang lewat tombol. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand: #4ecb8b;
        --brand-deep: #6fd8a2;
        --brand-bright: #189a4b;
        --brand-tint: #16281f;
        --brand-tint-strong: #1d3628;

        --masthead-bg: #065536;

        --paper: #0d1512;
        --surface: #131c17;
        --surface-alt: #18231d;
        --ink: #e6ede9;
        --muted: #97a89e;
        --line: #24322b;
        --line-strong: #35473c;

        --on-brand: #ffffff;
        --on-brand-soft: #cfe9db;

        --btn-bg: #4ecb8b;
        --btn-bg-hover: #6fd8a2;
        --btn-ink: #06241a;
    }
}

/* Gelap dipilih pengguna lewat tombol, apa pun setelan OS. */
:root[data-theme="dark"] {
    --brand: #4ecb8b;
    --brand-deep: #6fd8a2;
    --brand-bright: #189a4b;
    --brand-tint: #16281f;
    --brand-tint-strong: #1d3628;

    --masthead-bg: #065536;

    --paper: #0d1512;
    --surface: #131c17;
    --surface-alt: #18231d;
    --ink: #e6ede9;
    --muted: #97a89e;
    --line: #24322b;
    --line-strong: #35473c;

    --on-brand: #ffffff;
    --on-brand-soft: #cfe9db;

    --btn-bg: #4ecb8b;
    --btn-bg-hover: #6fd8a2;
    --btn-ink: #06241a;
}

/* Samakan warna kontrol bawaan browser (scrollbar, form) dengan pilihan. */
:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 1rem/1.7 var(--sans);
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--pad);
}

:focus-visible {
    outline: 2px solid var(--brand-bright);
    outline-offset: 3px;
    border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead {
    background: var(--masthead-bg);
    color: var(--on-brand);
    border-bottom: 4px solid var(--brand-bright);
    padding-block: clamp(1.6rem, 1.1rem + 3vw, 3rem);
}

.masthead__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font: 700 0.7rem/1.2 var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--on-brand-soft);
}

.masthead__eyebrow::before {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 2px;
    background: var(--brand-bright);
}

.masthead h1 {
    margin: 0.6rem 0 0;
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(1.55rem, 1.05rem + 2.2vw, 2.3rem);
    line-height: 1.18;
    letter-spacing: -0.012em;
    text-wrap: balance;
}

.masthead__sub {
    margin: 0.55rem 0 0;
    color: var(--on-brand-soft);
    font-size: 0.95rem;
}

.docket {
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.55rem;
    font: 600 0.72rem/1.5 var(--mono);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--on-brand-soft);
}

.docket li + li::before {
    content: "·";
    margin-right: 0.55rem;
    opacity: 0.6;
}

.navlinks,
.navlinks__group,
.lang {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.navlinks,
.lang {
    margin-top: 1.25rem;
    align-items: center;
}

.pill,
.lang a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.44rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    color: var(--on-brand);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pill:hover,
.lang a:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.62);
}

/* --------------------------------------------------------------------------
   Tombol tema — hanya muncul bila JavaScript aktif
   -------------------------------------------------------------------------- */

.theme-toggle {
    display: none;
    margin: 0;
    font-family: inherit;
    line-height: 1.2;
    background: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.has-js .theme-toggle {
    display: inline-flex;
}

/* Lingkaran separuh terisi — penanda kontras terang/gelap. */
.theme-toggle__icon {
    flex: none;
    width: 0.85rem;
    height: 0.85rem;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    background: linear-gradient(90deg, currentColor 50%, transparent 50%);
}

/* --------------------------------------------------------------------------
   Lembar dokumen — kartu berurutan yang menyatu jadi satu sheet
   -------------------------------------------------------------------------- */

.doc {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--pad);
    padding-block: clamp(1.35rem, 1rem + 1.8vw, 2.25rem) clamp(2.25rem, 1.6rem + 3vw, 3.75rem);
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top-width: 0;
    padding: clamp(1.2rem, 0.95rem + 1vw, 1.7rem) var(--gutter);
}

.card:first-child {
    border-top-width: 1px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 18px 30px -28px rgba(8, 119, 75, 0.45);
}

.card > :first-child {
    margin-top: 0;
}

.card > :last-child {
    margin-bottom: 0;
}

h1,
h2,
h3 {
    text-wrap: balance;
}

.card h2 {
    margin: 0 0 0.7rem;
    font-size: 1.075rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.005em;
    color: var(--brand);
}

.card h3 {
    margin: 1.4rem 0 0.45rem;
    font-size: 0.98rem;
    font-weight: 700;
}

p {
    margin: 0 0 0.85rem;
}

.lead {
    font-size: 1.06rem;
    color: var(--ink);
}

ul,
ol {
    margin: 0 0 0.9rem;
    padding-left: 1.3rem;
}

li {
    margin-bottom: 0.4rem;
}

li::marker {
    color: var(--brand-bright);
}

a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 0.07em;
}

a:hover {
    color: var(--brand-bright);
    text-decoration-thickness: 0.12em;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 0.875rem;
}

.placeholder {
    padding: 0.05em 0.35em;
    border-radius: 5px;
    background: var(--brand-tint);
    color: var(--ink);
    font-weight: 600;
    overflow-wrap: anywhere;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.notice {
    margin: 1rem 0 0.9rem;
    padding: 0.9rem 1.05rem;
    background: var(--brand-tint);
    border: 1px solid var(--brand-tint-strong);
    border-left: 4px solid var(--brand-bright);
    border-radius: var(--radius-sm);
}

.notice > :last-child {
    margin-bottom: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0;
    padding: 0.72rem 1.2rem;
    background: var(--btn-bg);
    color: var(--btn-ink);
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.button:hover {
    background: var(--btn-bg-hover);
    color: var(--btn-ink);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Daftar dokumen (halaman indeks)
   -------------------------------------------------------------------------- */

.doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.doc-item {
    position: relative;
    padding: 0.95rem 1.05rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.doc-item:hover,
.doc-item:focus-within {
    border-color: var(--brand-bright);
    background: var(--brand-tint);
}

.doc-item__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.doc-item__title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--brand);
    text-decoration: none;
}

.doc-item__title::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.doc-item__alt {
    position: relative;
    z-index: 1;
    flex: none;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font: 700 0.68rem/1 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
}

.doc-item__alt:hover {
    color: var(--brand-bright);
    border-color: var(--brand-bright);
}

.doc-item__desc {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Daftar tautan sederhana antar dokumen */
.toc {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.toc li {
    margin: 0;
}

/* --------------------------------------------------------------------------
   Tabel — tabel penuh di layar lebar, kartu bertumpuk di layar sempit
   -------------------------------------------------------------------------- */

.table-wrap {
    margin: 1rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    background: var(--surface);
}

th,
td {
    padding: 0.7rem 0.85rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

thead th {
    background: var(--brand-tint);
    color: var(--brand);
    border-bottom: 2px solid var(--brand-bright);
    font: 700 0.7rem/1.4 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody tr:nth-child(even) td {
    background: var(--surface-alt);
}

tbody tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 46rem) {
    .table-wrap {
        border: 0;
        border-radius: 0;
        overflow: visible;
    }

    .table-wrap table,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap td {
        display: block;
        width: 100%;
    }

    .table-wrap thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .table-wrap tr {
        margin-bottom: 0.7rem;
        padding: 0.35rem 0.95rem 0.6rem;
        border: 1px solid var(--line);
        border-left: 3px solid var(--brand-bright);
        border-radius: var(--radius-sm);
        background: var(--surface);
    }

    .table-wrap tr:last-child {
        margin-bottom: 0;
    }

    .table-wrap td,
    .table-wrap tbody tr:nth-child(even) td {
        padding: 0.55rem 0;
        border: 0;
        background: transparent;
    }

    .table-wrap td + td {
        border-top: 1px dashed var(--line);
    }

    .table-wrap td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.15rem;
        font: 700 0.67rem/1.5 var(--mono);
        letter-spacing: 0.09em;
        text-transform: uppercase;
        color: var(--muted);
    }
}

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

.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
}

.site-footer .wrap {
    padding-block: 1.6rem 2.4rem;
}

.site-footer p {
    margin: 0 0 0.4rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.site-footer .updated {
    margin: 0.9rem 0 0;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--line);
    font: 600 0.7rem/1.6 var(--mono);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
