/* Explain: Core layout styles: header, footer, mobile menu, to-top button, and ad rails/inline slots. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}

.header-col--start {
    text-align: left;
}

.header-col--center {
    text-align: center;
}

.header-col--end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.header-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.header-link {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
}

.header-link:hover {
    color: var(--text-muted);
}

.menu-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-color);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
}

.menu-btn:hover {
    border-color: #c9c9c9;
}

.mobile-menu {
    display: none;
    border-top: 1px solid var(--border-color);
    background: var(--surface-color);
}

.mobile-menu.is-open {
    display: block;
}

@media (min-width: 768px) {
    .mobile-menu.is-open {
        display: none;
    }
}

.mobile-menu__inner {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0.6rem;
    color: var(--text-color);
    font-weight: 500;
    border-radius: 10px;
    transition: background 0.2s;
}

.mobile-link:hover {
    background: var(--surface-2-color);
}

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

.to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 40;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s, background 0.2s, border-color 0.2s, color 0.2s;
    box-shadow: var(--shadow-card);
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.to-top:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ---------- Advertising rails ---------- */
.ad-rail {
    display: none;
}

.ad-rail__slot {
    width: 100%;
    height: 50rem;
    max-height: calc(100vh - 9rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem;
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-muted);
}

.ad-rail__slot i {
    font-size: 1.35rem;
}

.ad-rail__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ad-rail__size {
    font-size: 0.72rem;
}

@media (min-width: 1760px) {
    .ad-rail {
        display: block;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
        width: 12.5rem;
        z-index: 30;
    }

    .ad-rail--left {
        left: calc(50% - 54rem);
    }

    .ad-rail--right {
        right: calc(50% - 54rem);
    }
}

/* ---------- Inline advertising (mobile / tablet) ---------- */
.ad-inline {
    width: 100%;
    max-width: 30rem;
    margin-inline: auto;
}

.ad-inline__slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 100px;
    padding: 1rem;
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
    color: var(--text-muted);
}

.ad-inline__slot i {
    font-size: 1.35rem;
}

.ad-inline__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.ad-inline__size {
    font-size: 0.72rem;
}

@media (min-width: 768px) {
    .ad-inline {
        max-width: 100%;
    }

    .ad-inline__slot {
        min-height: 90px;
    }
}

@media (min-width: 1760px) {
    .ad-inline {
        display: none;
    }
}