/* Header shell */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(250, 250, 250, 0.8);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(229, 229, 229, 0.7);
}

/* Header internals */
.site-header .container {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

/* Desktop locale switch */
.lang-switch {
    display: none;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.lang-switch a {
    text-decoration: none;
    opacity: 0.62;
    font-weight: 500;
}

.lang-switch a.active {
    opacity: 1;
}

/* Brand and right action cluster */
.brand-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

.site-title {
    text-decoration: none;
    font-family: var(--font-logo);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: calc(clamp(1.06rem, 5.1vw, 2.34rem) * var(--scale-logo, 1));
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--foreground);
    text-decoration: none;
}

/* Mobile slide-over navigation */
.menu-button {
    border: 0;
    background: transparent;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    color: var(--foreground);
}

.menu-button span {
    display: block;
    width: 22px;
    height: 1px;
    background: currentColor;
}

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    z-index: 60;
}

.menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(380px, 100%);
    background: var(--background);
    border-left: 1px solid var(--border);
    padding: 5rem 2rem 1.8rem;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    z-index: 70;
    display: flex;
    flex-direction: column;
}

body.menu-open .menu-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open .menu-panel {
    transform: translateX(0);
}

.menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    color: var(--foreground);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.menu-close:hover {
    background: #e5e5e5;
    border-color: rgba(10, 10, 10, 0.45);
}

.menu-close-glyph {
    font-size: 1.75rem;
    line-height: 1;
    transform: translateY(-1px);
}

.mobile-lang {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.mobile-lang a {
    text-decoration: none;
    opacity: 0.62;
}

.mobile-lang a.active {
    opacity: 1;
    font-weight: 600;
}

.menu-nav {
    display: grid;
    gap: 1.1rem;
}

.menu-nav a {
    text-decoration: none;
    font-family: var(--font-nav);
    font-size: 1.8rem;
    letter-spacing: 0.01em;
    font-weight: 400;
}

.menu-footer-links {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    display: grid;
    gap: 0.4rem;
    font-size: 0.9rem;
}

.menu-footer-links a {
    text-decoration: none;
    color: var(--muted);
}

/* Main spacing and generic UI primitives */
main {
    flex: 1;
    width: 100%;
    padding-top: 84px;
    padding-bottom: calc(2.5rem * var(--spacing-factor, 1));
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.15rem;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

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

.status {
    padding: 0.8rem 0.9rem;
    background: #ecfdf5;
    border: 1px solid #10b981;
    margin-bottom: 1rem;
    border-radius: 10px;
}

.error {
    padding: 0.8rem 0.9rem;
    background: #fff1f2;
    border: 1px solid #ef4444;
    margin-bottom: 1rem;
    border-radius: 10px;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

button {
    padding: 0.62rem 1rem;
    border: 0;
    border-radius: 8px;
    background: var(--foreground);
    color: #fff;
    cursor: pointer;
    font: inherit;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 0.3rem;
    text-align: left;
}

/* Global section wrappers and heading rhythm */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
}

.section-wrap {
    width: min(80%, 1100px);
    margin: 0 auto;
}

.page-title {
    font-family: var(--font-heading);
    font-size: calc(clamp(2rem, 4.6vw, 3rem) * var(--scale-heading, 1));
    margin: 0 0 2rem;
    letter-spacing: 0.01em;
    font-weight: 500;
}

.legal-subheading {
    font-family: var(--font-legal);
    font-weight: 500;
}

.caption-label {
    font-family: var(--font-caption);
}

.page-subtitle {
    margin: 0 0 2.6rem;
    color: var(--muted);
    max-width: 700px;
}
