/* Explain: Layout and structural styles. */
.container-x {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
}

.topbar {
    background: var(--primary-color);
    color: #d3d6da;
    font-size: 0.78rem;
}

.topbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.25rem;
    padding-block: 0.55rem;
}

.topbar-item,
.topbar-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar a {
    color: #d3d6da;
    text-decoration: none;
    transition: color 0.2s ease;
}

.topbar a:hover {
    color: #ffffff;
}

.mainnav {
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.mainnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-block: 0.8rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 9px;
    background: var(--accent-color);
    color: #1b1200;
    font-size: 1.05rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary-color);
}

.brand-text small {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-links {
    display: none;
    align-items: center;
    gap: 1.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    display: inline-block;
    padding-block: 0.35rem;
    border-bottom: 2px solid transparent;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--accent-color);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-cta {
    display: none;
}

.menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--primary-color);
    font-size: 1.1rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.menu-btn:hover {
    border-color: var(--primary-color);
    background: var(--surface-color);
}

/* ---------- Mobile drawer ---------- */
.mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(15, 23, 42, 0.5);
}

.mobile-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: min(88vw, 360px);
    padding: 1.25rem;
    overflow-y: auto;
    background: #ffffff;
    box-shadow: -14px 0 44px rgba(15, 23, 42, 0.2);
}

.mobile-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-links {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-links a {
    display: block;
    padding: 0.9rem 0.25rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
}

.mobile-links a:hover {
    color: var(--primary-color);
}

.mobile-contact {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: auto;
    font-size: 0.9rem;
}

.mobile-contact a {
    color: var(--text-muted);
    text-decoration: none;
}

.mobile-contact a:hover {
    color: var(--primary-color);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--primary-color);
    color: #cdd1d5;
}

.site-footer a {
    color: #cdd1d5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #ffffff;
}

.footer-heading {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffffff;
}

/* ---------- Utility ---------- */
.is-hidden {
    display: none !important;
}

@media (min-width: 640px) {
    .nav-cta {
        display: inline-flex;
    }
}

@media (min-width: 1024px) {
    .nav-links {
        display: flex;
    }

    .menu-btn {
        display: none;
    }
}