/*!
 * SIDAMAS — public (guest-facing) pages.
 *
 * Sizes are in px on purpose: Bootstrap 3 sets html { font-size: 10px }, so rem
 * here would render at 62.5% of its intended size. Do not convert these to rem
 * unless that root rule goes away.
 * Loaded via app\assets\PublicAsset by the views under views/site/. Visual rules
 * are namespaced .sd-* so they cannot leak into the admin Bootstrap 3 views.
 */

:root {
    --sd-ink: #12263f;
    --sd-ink-soft: #56677e;
    --sd-paper: #ffffff;
    --sd-mist: #f1f4f8;
    --sd-line: #dce2ea;
    --sd-gold: #8a6214;
}

/* Matches the hero band so the 6px gap the fixed navbar leaves behind
   (body padding-top 56px vs. a 50px navbar) does not read as a stray line. */
body {
    background-color: var(--sd-mist);
}

.sd-ui {
    font-family: "Plus Jakarta Sans", "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--sd-ink);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sd-ui ::selection {
    background: var(--sd-ink);
    color: #fff;
}

.sd-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.sd-ui :focus-visible {
    outline: 2px solid var(--sd-ink);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.sd-hero {
    background-color: var(--sd-mist);
    border-bottom: 1px solid var(--sd-line);
    padding: 72px 0 80px;
}

.sd-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr);
    gap: 64px;
    align-items: start;
}

.sd-issuer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 30px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--sd-ink-soft);
}

.sd-issuer img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.sd-headline {
    margin: 0 0 20px;
    font-size: clamp(36px, 22px + 2.6vw, 56px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.sd-lede {
    margin: 0 0 34px;
    max-width: 52ch;
    font-size: clamp(19px, 17px + 0.35vw, 22px);
    line-height: 1.6;
    color: var(--sd-ink-soft);
}

.sd-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.sd-ui .sd-btn {
    display: inline-block;
    padding: 16px 32px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.sd-ui .sd-btn-primary,
.sd-ui .sd-btn-primary:visited {
    background-color: var(--sd-ink);
    color: var(--sd-paper);
}

.sd-ui .sd-btn-primary:hover,
.sd-ui .sd-btn-primary:focus {
    background-color: #1d3c63;
    color: var(--sd-paper);
    text-decoration: none;
}

.sd-ui .sd-btn-quiet,
.sd-ui .sd-btn-quiet:visited {
    border-color: var(--sd-line);
    background-color: transparent;
    color: var(--sd-ink);
}

.sd-ui .sd-btn-quiet:hover,
.sd-ui .sd-btn-quiet:focus {
    border-color: var(--sd-ink);
    color: var(--sd-ink);
    text-decoration: none;
}

.sd-signin-note {
    margin: 18px 0 0;
    font-size: 15px;
    color: var(--sd-ink-soft);
}

/* ── Service register ─────────────────────────────────────────────── */

.sd-register {
    background-color: var(--sd-paper);
    border: 1px solid var(--sd-line);
    border-radius: 12px;
    padding: 10px 28px;
}

.sd-register-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--sd-line);
}

.sd-register-row:last-child {
    border-bottom: 0;
}

.sd-register-label {
    font-size: 16px;
    color: var(--sd-ink-soft);
}

.sd-register-figure {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.sd-register-row-done .sd-register-figure {
    color: var(--sd-gold);
}

/* ── Knowledge base ───────────────────────────────────────────────── */

.sd-kb {
    background-color: var(--sd-paper);
    padding: 72px 0;
}

.sd-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 28px;
}

.sd-head h2 {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sd-ui .sd-head-link,
.sd-ui .sd-head-link:visited {
    font-size: 17px;
    font-weight: 600;
    color: var(--sd-ink-soft);
    text-decoration: none;
    border-bottom: 1px solid var(--sd-line);
    padding-bottom: 2px;
}

.sd-ui .sd-head-link:hover,
.sd-ui .sd-head-link:focus {
    color: var(--sd-ink);
    border-bottom-color: var(--sd-ink);
    text-decoration: none;
}

/* Own grid rather than Bootstrap 3 floats: equal-height cards, no clearfix. */
.sd-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 22px;
}

.sd-ui a.sd-card,
.sd-ui a.sd-card:visited {
    display: flex;
    flex-direction: column;
    padding: 28px;
    border: 1px solid var(--sd-line);
    border-radius: 12px;
    background-color: var(--sd-paper);
    color: var(--sd-ink);
    text-decoration: none;
    transition: border-color 150ms ease, background-color 150ms ease;
}

.sd-ui a.sd-card:hover,
.sd-ui a.sd-card:focus {
    border-color: var(--sd-ink);
    background-color: #fafbfd;
    color: var(--sd-ink);
    text-decoration: none;
}

.sd-card-category {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--sd-gold);
}

.sd-card-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.sd-card-excerpt {
    margin: 0 0 20px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--sd-ink-soft);
}

.sd-card-views {
    margin: auto 0 0;
    font-size: 15px;
    color: var(--sd-ink-soft);
    font-variant-numeric: tabular-nums;
}

.sd-empty {
    margin: 0;
    padding: 32px 0;
    color: var(--sd-ink-soft);
}

/* ── Handling flow ────────────────────────────────────────────────── */

.sd-flow {
    background-color: var(--sd-mist);
    border-top: 1px solid var(--sd-line);
    padding: 72px 0 80px;
}

.sd-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
    margin-top: 28px;
}

.sd-step {
    border-top: 2px solid var(--sd-ink);
    padding-top: 16px;
}

.sd-step-number {
    display: block;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--sd-gold);
    font-variant-numeric: tabular-nums;
}

.sd-step h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
}

.sd-step p {
    margin: 0;
    font-size: 17px;
    line-height: 1.6;
    color: var(--sd-ink-soft);
}

/* Public-page footer seam; this file is not registered on admin pages.
   site.css offsets .wrap by 60px for an old sticky-footer hack, which leaves a
   band of body background under sections that end on white. Zeroing both keeps
   the total height identical and lets the footer sit against the last section. */
.wrap {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* frontend.php nests content as .wrap > div > .sd-ui, and .wrap keeps a
   min-height of 100%. Stretching the last section stops a short page from
   showing the body ground as a stray band above the footer. */
.wrap,
.wrap > div,
.sd-ui {
    display: flex;
    flex-direction: column;
}

.wrap > div,
.sd-ui,
.sd-ui > section:last-child {
    flex: 1 0 auto;
}

.footer {
    height: auto;
    padding: 26px 0;
    background-color: var(--sd-mist);
    border-top: 1px solid var(--sd-line);
    color: var(--sd-ink-soft);
}

.footer p {
    margin: 0;
    font-size: 16px;
}

/* ── Page header (about, alur, knowledge base) ─────────────── */

.sd-page-head {
    background-color: var(--sd-mist);
    border-bottom: 1px solid var(--sd-line);
    padding: 64px 0 56px;
}

.sd-page-title {
    margin: 0;
    font-size: clamp(32px, 22px + 1.9vw, 46px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.sd-page-deck {
    margin: 18px 0 0;
    max-width: 56ch;
    font-size: clamp(18px, 16px + 0.4vw, 22px);
    line-height: 1.6;
    color: var(--sd-ink-soft);
}

.sd-body {
    background-color: var(--sd-paper);
    padding: 64px 0 80px;
}

.sd-ui .sd-backlink,
.sd-ui .sd-backlink:visited {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 16px;
    font-weight: 600;
    color: var(--sd-ink-soft);
    text-decoration: none;
}

.sd-ui .sd-backlink:hover,
.sd-ui .sd-backlink:focus {
    color: var(--sd-ink);
    text-decoration: none;
}

/* ── Prose ───────────────────────────────────────── */

/* Styles the HTML that admins store in Setting / KbArticle. Headings are sized
   by level, not by position, because that content can change at any time. */
.sd-prose {
    max-width: 68ch;
    font-size: 18px;
    line-height: 1.75;
}

.sd-prose > *:first-child {
    margin-top: 0;
}

.sd-prose > *:last-child {
    margin-bottom: 0;
}

.sd-prose h1,
.sd-prose h2,
.sd-prose h3,
.sd-prose h4,
.sd-prose h5,
.sd-prose h6 {
    margin: 2em 0 0.6em;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--sd-ink);
}

.sd-prose h1 { font-size: 32px; }
.sd-prose h2 { font-size: 26px; }
.sd-prose h3 { font-size: 22px; }
.sd-prose h4 { font-size: 19px; }
.sd-prose h5,
.sd-prose h6 { font-size: 18px; }

.sd-prose p {
    margin: 0 0 1.3em;
}

.sd-prose ul,
.sd-prose ol {
    margin: 0 0 1.3em;
    padding-left: 1.4em;
}

.sd-prose li {
    margin-bottom: 0.45em;
}

.sd-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.sd-prose table {
    width: 100%;
    margin: 0 0 1.3em;
    border-collapse: collapse;
}

.sd-prose th,
.sd-prose td {
    padding: 10px 12px;
    border: 1px solid var(--sd-line);
    text-align: left;
}

.sd-prose blockquote {
    margin: 0 0 1.3em;
    padding-left: 1.25em;
    border-left: 2px solid var(--sd-line);
    color: var(--sd-ink-soft);
}

.sd-ui .sd-prose a,
.sd-ui .sd-prose a:visited {
    color: var(--sd-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.sd-ui .sd-prose a:hover,
.sd-ui .sd-prose a:focus {
    color: var(--sd-gold);
}

/* ── Closing call to action ───────────────────────────── */

.sd-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    max-width: 68ch;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--sd-line);
}

.sd-cta p {
    margin: 0;
    font-size: 17px;
    color: var(--sd-ink-soft);
}

/* ── Flow diagrams (alur) ─────────────────────────────── */

.sd-figures {
    display: grid;
    gap: 28px;
    max-width: 920px;
}

/* The stored markup carries width="60%"; a presentational attribute, so this
   plain declaration wins without !important. */
.sd-figures img {
    display: block;
    width: 100%;
    height: auto;
    padding: 12px;
    border: 1px solid var(--sd-line);
    border-radius: 12px;
    background-color: var(--sd-paper);
}

/* ── Knowledge base filters ──────────────────────────── */

.sd-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 240px) auto;
    gap: 12px;
    margin-bottom: 20px;
}

.sd-ui .sd-input,
.sd-ui .sd-select {
    width: 100%;
    height: auto;
    padding: 15px 16px;
    border: 1px solid var(--sd-line);
    border-radius: 8px;
    background-color: var(--sd-paper);
    color: var(--sd-ink);
    font-family: inherit;
    font-size: 17px;
    line-height: 1.3;
    box-shadow: none;
}

.sd-ui .sd-input:focus,
.sd-ui .sd-select:focus {
    border-color: var(--sd-ink);
}

.sd-ui .sd-input::placeholder {
    color: var(--sd-ink-soft);
    opacity: 1;
}

.sd-result-count {
    margin: 0 0 28px;
    font-size: 16px;
    color: var(--sd-ink-soft);
}

/* ── Pagination ───────────────────────────────────── */

.sd-pager:empty {
    display: none;
}

.sd-ui .sd-pager .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0 0;
    padding: 0;
    border-radius: 0;
    list-style: none;
}

.sd-ui .sd-pager .pagination > li {
    display: block;
    float: none;
}

.sd-ui .sd-pager .pagination > li > a,
.sd-ui .sd-pager .pagination > li > span {
    display: block;
    float: none;
    margin: 0;
    padding: 11px 17px;
    border: 1px solid var(--sd-line);
    border-radius: 8px;
    background-color: var(--sd-paper);
    color: var(--sd-ink);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
}

.sd-ui .sd-pager .pagination > li > a:hover,
.sd-ui .sd-pager .pagination > li > a:focus {
    border-color: var(--sd-ink);
    background-color: var(--sd-paper);
    color: var(--sd-ink);
}

.sd-ui .sd-pager .pagination > .active > a,
.sd-ui .sd-pager .pagination > .active > span {
    border-color: var(--sd-ink);
    background-color: var(--sd-ink);
    color: var(--sd-paper);
}

.sd-ui .sd-pager .pagination > .disabled > a,
.sd-ui .sd-pager .pagination > .disabled > span {
    opacity: 0.45;
}

/* ── Article ──────────────────────────────────────── */

.sd-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    font-size: 16px;
    color: var(--sd-ink-soft);
}

.sd-article-meta .sd-article-category {
    font-weight: 600;
    color: var(--sd-gold);
}

/* ── Shared navbar, public pages only ─────────────────── */

/* Bootstrap's .container is 1170px wide with 15px gutters, so the brand sat 34px
   left of the page content. Giving it .sd-shell's box lines the brand and the
   right-hand links up with the content column: the brand's -15px margin and its
   own 15px padding cancel out, so its text starts exactly at this padding edge.
   width:auto defeats Bootstrap's fixed per-breakpoint widths. */
.navbar-fixed-top > .container {
    width: auto;
    max-width: 1120px;
    padding-left: 24px;
    padding-right: 24px;
}

/* Sized up to match the page type. line-height is pinned to Bootstrap's 20px so
   the fixed navbar keeps its 50px height and body's 56px offset still clears it. */
.navbar-default .navbar-brand {
    font-size: 22px;
    font-weight: 700;
    line-height: 21px;
    letter-spacing: -0.02em;
}

.navbar-default .navbar-nav > li > a {
    font-size: 16px;
    line-height: 21px;
}

/* ── Narrow viewports ─────────────────────────────────────────────── */

@media (max-width: 900px) {
    .sd-hero-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 40px;
    }
}

@media (max-width: 760px) {
    .sd-filters {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .sd-shell {
        padding: 0 20px;
    }

    .navbar-fixed-top > .container {
        padding-left: 20px;
        padding-right: 20px;
    }

    .sd-hero {
        padding: 48px 0 56px;
    }

    .sd-kb,
    .sd-flow {
        padding: 56px 0;
    }

    .sd-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .sd-page-head {
        padding: 48px 0 40px;
    }

    .sd-body {
        padding: 48px 0 56px;
    }

    .sd-ui .sd-btn {
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sd-ui * {
        transition: none !important;
    }
}
