/* ==========================================================================
   SwissSalary Hilfe — Custom Brand Styles
   Brand cues from swisssalary.com (variables.css / base.css / nav height)
   ========================================================================== */

/* -------------------------------------------------------------------------
   1. Font — Myriad Pro via Adobe Typekit (same as swisssalary.com)
   ------------------------------------------------------------------------- */
@import url("https://use.typekit.net/ixp6ptv.css");

/* -------------------------------------------------------------------------
   2. CSS Variables (swisssalary.com/styles/variables.css)
   ------------------------------------------------------------------------- */
:root {
    --sws-navigation-height: 71px;

    --sws-primary-red: #aa0000;
    --sws-primary-red-rgb: 170, 0, 0;
    --sws-secondary-red: #990000;
    --sws-tertiary-red: #770000;

    --sws-primary-gray: #333333;
    --sws-secondary-gray: #444444;
    --sws-tertiary-gray: #777777;

    --sws-primary-light: #aaaaaa;
    --sws-secondary-light: #dddddd;
    --sws-tertiary-light: #f2f2f2;
    --sws-bg-gray-color: #eeeeee;

    --sws-font-color: #0B1215;
    --sws-bg-color: #ffffff;
    --sws-border-grey: var(--sws-secondary-light);
    --sws-success: #4CAF50;
    --sws-warning: #f44336;

    /* Bootstrap / DocFX overrides */
    --bs-primary: var(--sws-primary-red) !important;
    --bs-primary-rgb: var(--sws-primary-red-rgb) !important;
    --bs-link-color: var(--sws-primary-red) !important;
    --bs-link-color-rgb: var(--sws-primary-red-rgb) !important;
    --bs-link-hover-color: var(--sws-secondary-red) !important;
    --bs-link-hover-color-rgb: 153, 0, 0 !important;

    --bs-body-font-family: "myriad-pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    --bs-body-color: var(--sws-font-color) !important;
    --bs-body-color-rgb: 11, 18, 21 !important;
    --bs-body-bg: var(--sws-bg-color) !important;
}

/* Dark mode (swisssalary.com [data-theme="dark"]) */
[data-bs-theme="dark"] {
    --sws-primary-red: #db0000;
    --sws-primary-red-rgb: 219, 0, 0;
    --sws-font-color: #ffffff;
    --sws-bg-color: #0B1215;
    --sws-primary-gray: #e0e0e0;
    --sws-bg-gray-color: #333333;
    --sws-border-grey: #555555;

    --bs-primary: #db0000 !important;
    --bs-primary-rgb: 219, 0, 0 !important;
    --bs-link-color: #ff4d4d !important;
    --bs-link-color-rgb: 255, 77, 77 !important;
    --bs-link-hover-color: #ff6666 !important;
    --bs-link-hover-color-rgb: 255, 102, 102 !important;
    --bs-body-color: #ffffff !important;
    --bs-body-color-rgb: 255, 255, 255 !important;
    --bs-body-bg: #0B1215 !important;
}

/* -------------------------------------------------------------------------
   3. Typography
   ------------------------------------------------------------------------- */
body {
    font-family: "myriad-pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--sws-font-color);
    background-color: var(--sws-bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: "myriad-pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 700;
    color: var(--sws-font-color);
}

article h1 {
    font-size: 2rem;
    font-weight: 700;
    border-bottom: none;
}

article h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

article h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

/* -------------------------------------------------------------------------
   4. Links
   ------------------------------------------------------------------------- */
a {
    color: var(--sws-primary-red);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: var(--sws-primary-red);
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
   5. Header / Navbar — swisssalary.com feel (height + red accent bar)
   ------------------------------------------------------------------------- */
header {
    box-shadow: 0 1px 0 var(--sws-border-grey);
}

body > header,
body[data-layout="landing"] > header {
    height: auto;
    min-height: var(--sws-navigation-height);
}

body > main > .content > article [id],
body[data-layout="landing"] > main > .content > article [id] {
    scroll-margin-top: calc(var(--sws-navigation-height) + 1rem);
}

@media (min-width: 768px) {
    body:not([data-search])[data-layout] > main > .toc-offcanvas,
    body:not([data-search])[data-layout] > main > .affix {
        top: calc(var(--sws-navigation-height) + 1.6rem);
        max-height: calc(100vh - var(--sws-navigation-height) - 1.6rem);
    }
}

.navbar {
    min-height: var(--sws-navigation-height);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-bottom: 3px solid var(--sws-primary-red);
    background-color: var(--sws-bg-color) !important;
}

.navbar .navbar-brand img {
    height: 32px;
    width: auto;
}

.navbar .navbar-brand {
    font-family: "myriad-pro", system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--sws-font-color) !important;
    letter-spacing: 0.01em;
}

.navbar .nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--sws-primary-gray) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--sws-primary-red) !important;
}

.navbar .nav-link.active {
    color: var(--sws-primary-red) !important;
    font-weight: 700;
}

.navbar .form-control:focus {
    border-color: var(--sws-primary-red);
    box-shadow: 0 0 0 0.15rem rgba(var(--sws-primary-red-rgb), 0.2);
}

/* -------------------------------------------------------------------------
   6. Table of Contents sidebar
   ------------------------------------------------------------------------- */
.toc .nav-link.active,
.toc .nav-link:hover {
    color: var(--sws-primary-red) !important;
    border-left-color: var(--sws-primary-red) !important;
}

.sidetoc {
    border-right: 1px solid var(--sws-border-grey);
}

/* -------------------------------------------------------------------------
   7. Buttons
   ------------------------------------------------------------------------- */
.btn-primary {
    background-color: var(--sws-primary-red) !important;
    border-color: var(--sws-primary-red) !important;
    border-radius: 0.5rem;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--sws-secondary-red) !important;
    border-color: var(--sws-secondary-red) !important;
}

/* -------------------------------------------------------------------------
   8. Alerts / Callouts
   ------------------------------------------------------------------------- */
.alert {
    border-radius: 0.5rem;
    border-left-width: 4px;
}

/* -------------------------------------------------------------------------
   9. Code blocks
   ------------------------------------------------------------------------- */
code {
    color: var(--sws-secondary-red);
}

/* -------------------------------------------------------------------------
   10. Footer — dark gray + red top border (swisssalary.com)
   ------------------------------------------------------------------------- */
footer {
    border-top: 3px solid var(--sws-primary-red);
    background-color: var(--sws-primary-gray) !important;
    color: #fff !important;
    padding: 1.75rem 0;
}

footer a {
    color: #fff !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

footer a:hover {
    color: var(--sws-secondary-light) !important;
}

[data-bs-theme="dark"] footer {
    background-color: #191919 !important;
}

/* -------------------------------------------------------------------------
   11. Breadcrumbs
   ------------------------------------------------------------------------- */
.breadcrumb-item a {
    color: var(--sws-primary-red);
}

.breadcrumb-item a:hover {
    color: var(--sws-secondary-red);
}

/* -------------------------------------------------------------------------
   12. Search results
   ------------------------------------------------------------------------- */
.search-results .search-result a {
    color: var(--sws-primary-red);
}

/* -------------------------------------------------------------------------
   13. Right-hand "In this article" sidebar
   ------------------------------------------------------------------------- */
.affix .nav-link.active {
    color: var(--sws-primary-red) !important;
    border-left-color: var(--sws-primary-red) !important;
}

/* -------------------------------------------------------------------------
   14. Heading anchor links
   ------------------------------------------------------------------------- */
article h2,
article h3,
article h4 {
    position: relative;
}

.anchorjs-link {
    font-family: bootstrap-icons !important;
    font-style: normal !important;
    font-weight: 400 !important;
    font-size: 0.75em !important;
    color: var(--bs-secondary-color) !important;
    text-decoration: none !important;
    transition: opacity 0.15s ease-in-out;
}

.anchorjs-link:hover {
    color: var(--sws-primary-red) !important;
    text-decoration: none !important;
}

/* -------------------------------------------------------------------------
   15. Selection highlight
   ------------------------------------------------------------------------- */
::-moz-selection {
    color: #fff;
    background: var(--sws-primary-red);
}

::selection {
    color: #fff;
    background: var(--sws-primary-red);
}

/* -------------------------------------------------------------------------
   16. Scrollbar accent
   ------------------------------------------------------------------------- */
* {
    scrollbar-color: var(--sws-secondary-light) transparent;
}

/* -------------------------------------------------------------------------
   17. Previous / Next article links
   ------------------------------------------------------------------------- */
.prev-next-link:hover {
    color: var(--sws-primary-red);
    border-color: var(--sws-primary-red);
}

/* -------------------------------------------------------------------------
   18. Tables — light gray header band
   ------------------------------------------------------------------------- */
article table thead th {
    background: var(--sws-tertiary-light);
    border-bottom: 2px solid var(--sws-primary-red);
    font-weight: 700;
}

[data-bs-theme="dark"] article table thead th {
    background: var(--sws-bg-gray-color);
}

/* -------------------------------------------------------------------------
   19. Landing page
   ------------------------------------------------------------------------- */
body[data-layout="landing"] article > h1:first-child {
    font-size: 2.5rem;
    text-align: center;
    margin: 2.5rem 0 0.75rem;
}

body[data-layout="landing"] article > h1:first-child + p {
    text-align: center;
    font-size: 1.15rem;
    color: var(--bs-secondary-color);
    max-width: 700px;
    margin: 0 auto 2rem;
}

body[data-layout="landing"] article > h2 {
    border-bottom: 2px solid var(--sws-primary-red);
    padding-bottom: 0.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

body[data-layout="landing"] article table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 1.5rem 0;
}

body[data-layout="landing"] article table thead th {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--bs-border-color);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0 0 0.5rem;
    color: var(--bs-heading-color);
}

body[data-layout="landing"] article table tbody td {
    border: none;
    padding: 0.35rem 0;
    vertical-align: top;
    background: transparent;
}

body[data-layout="landing"] article table tbody td a {
    color: var(--sws-primary-red);
}

body[data-layout="landing"] article table tbody td a:hover {
    color: var(--sws-secondary-red);
    text-decoration: underline;
}

body[data-layout="landing"] article > hr:last-of-type {
    margin-top: 3rem;
}

body[data-layout="landing"] article > hr:last-of-type + p {
    text-align: center;
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

/* -------------------------------------------------------------------------
   20. Content cards / blockquotes — subtle brand edge
   ------------------------------------------------------------------------- */
article blockquote {
    border-left: 4px solid var(--sws-primary-red);
    background: var(--sws-tertiary-light);
    padding: 0.75rem 1rem;
    border-radius: 0 0.35rem 0.35rem 0;
}

[data-bs-theme="dark"] article blockquote {
    background: rgba(255, 255, 255, 0.04);
}

/* -------------------------------------------------------------------------
   Landing hub — topic grid (Read mode, no icon cards)
   ------------------------------------------------------------------------- */
body[data-layout="landing"] .content,
body[data-layout="landing"] article {
    max-width: none;
    width: 100%;
    margin-inline: 0;
}

body[data-layout="landing"] article > h1:first-child {
    font-size: clamp(1.85rem, 2.5vw + 1rem, 2.5rem);
    text-align: left;
    margin: 1.75rem 0 0.65rem;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

body[data-layout="landing"] article > h1:first-child + p {
    text-align: left;
    font-size: 1.125rem;
    line-height: 1.55;
    color: var(--sws-secondary-gray);
    max-width: 65ch;
    margin: 0 0 1.5rem;
    text-wrap: pretty;
}

.sws-start {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    margin: 0 0 2rem;
}

.sws-start-primary,
.sws-start-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.55rem 1.15rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.25;
    text-decoration: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sws-start-primary {
    color: #fff !important;
    background: var(--sws-primary-red);
    border: 1px solid var(--sws-primary-red);
    box-shadow: 0 4px 14px rgba(var(--sws-primary-red-rgb), 0.22);
}

.sws-start-primary:hover,
.sws-start-primary:focus-visible {
    color: #fff !important;
    background: var(--sws-secondary-red);
    border-color: var(--sws-secondary-red);
    outline: none;
}

.sws-start-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(var(--sws-primary-red-rgb), 0.28);
}

.sws-start-secondary {
    color: var(--sws-font-color) !important;
    background: var(--sws-bg-color);
    border: 1px solid var(--sws-secondary-light);
}

.sws-start-secondary:hover,
.sws-start-secondary:focus-visible {
    color: var(--sws-primary-red) !important;
    border-color: rgba(var(--sws-primary-red-rgb), 0.45);
    outline: none;
}

.sws-start-secondary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(var(--sws-primary-red-rgb), 0.18);
}

.sws-topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.85rem;
    margin: 0 0 0.5rem;
}

.sws-topics a {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-height: 6.5rem;
    padding: 1rem 1.05rem 1.1rem;
    border: 1px solid var(--sws-secondary-light);
    border-radius: 0.65rem;
    background: var(--sws-bg-color);
    color: var(--sws-font-color) !important;
    text-decoration: none !important;
    box-shadow: 0 1px 0 rgba(11, 18, 21, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sws-topics a:hover,
.sws-topics a:focus-visible {
    border-color: rgba(var(--sws-primary-red-rgb), 0.55);
    box-shadow: 0 8px 22px rgba(var(--sws-primary-red-rgb), 0.1);
    transform: translateY(-1px);
    outline: none;
    text-decoration: none !important;
}

.sws-topics a:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(var(--sws-primary-red-rgb), 0.2), 0 8px 22px rgba(var(--sws-primary-red-rgb), 0.1);
}

.sws-topics strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--sws-primary-red);
    letter-spacing: -0.01em;
}

.sws-topics span {
    display: block;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--sws-tertiary-gray);
    font-weight: 400;
}

body[data-layout="landing"] article > ol {
    max-width: 65ch;
    padding-left: 1.25rem;
    margin-bottom: 1.75rem;
}

body[data-layout="landing"] article > ol li {
    margin: 0.35rem 0;
    line-height: 1.45;
}

body[data-layout="landing"] article table {
    border-spacing: 0;
}

body[data-layout="landing"] article table tbody td {
    padding: 0.55rem 0.75rem 0.55rem 0;
    border-bottom: 1px solid var(--sws-tertiary-light);
}

[data-bs-theme="dark"] .sws-topics a,
[data-bs-theme="dark"] .sws-start-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: #555;
}

[data-bs-theme="dark"] .sws-topics span {
    color: #aaa;
}

[data-bs-theme="dark"] body[data-layout="landing"] article > h1:first-child + p {
    color: #bbb;
}

@media (max-width: 640px) {
    .sws-start {
        flex-direction: column;
    }

    .sws-start-primary,
    .sws-start-secondary {
        width: 100%;
    }
}

/* -------------------------------------------------------------------------
   21. Language switcher — hidden until all four locale pages exist
   ------------------------------------------------------------------------- */
.sws-lang {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 0.75rem;
}

.sws-lang[hidden] {
    display: none !important;
}

.sws-lang-list {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.sws-lang-list a {
    color: var(--sws-tertiary-gray) !important;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    text-decoration: none !important;
}

.sws-lang-list a:hover,
.sws-lang-list a:focus-visible {
    color: var(--sws-primary-red) !important;
    background: var(--sws-tertiary-light);
}

.sws-lang-list a:focus-visible {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(var(--sws-primary-red-rgb), 0.28);
}

.sws-lang-list a[aria-current="true"] {
    color: #fff !important;
    background: var(--sws-primary-red);
}

.sws-lang-list a[aria-current="true"]:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(var(--sws-primary-red-rgb), 0.28);
}

[data-bs-theme="dark"] .sws-lang-list a:hover,
[data-bs-theme="dark"] .sws-lang-list a:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 767.98px) {
    .sws-lang {
        margin: 0.5rem 0 0;
        width: 100%;
    }
}
