/* ===========================
   Layout: background, header, nav, newsletter, footer
   =========================== */
.page, .sidebar {
    display: unset !important;
    padding: 0;
    margin: 0;
}

/* --site-bg is set from data/site.json (early by index.html, then by MainLayout.razor).
   No default image here, so the browser never downloads a background that isn't used. */
.main-layout {
    --bg-tint: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(var(--bg-tint), var(--bg-tint)), var(--site-bg, none) no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
}

body.light-mode .main-layout {
    --bg-tint: rgba(255, 255, 255, 0.6);
}

/* Fixed backgrounds jump around on phones; let them scroll there */
@media (max-width: 767px), (hover: none) {
    .main-layout {
        background-attachment: scroll;
    }
}

.header-banner {
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 0;
    text-align: center;
    color: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
}

.logo-img {
    width: 600px;
    height: auto;
    max-width: 100%;
    display: block;
}

@media (max-width: 842px) {
    .logo-img {
        width: 90%;
        max-width: 300px;
        margin: 0 auto;
    }
}

@media (max-width: 500px) {
    .logo-img {
        max-width: 220px;
    }
}

.nav-btn {
    width: 100px !important;
}

/* Theme toggle (left) and newsletter (right) sit in the header corners */
.newsletter-header,
.light-button {
    position: absolute;
    top: 10px;
    display: flex;
    gap: 6px;
    z-index: 5;
}

.newsletter-header {
    right: 20px;
}

.light-button {
    left: 20px;
}

/* On phones: leave room above the logo for the corner buttons, two columns of nav buttons */
@media (max-width: 767px) {
    .header-banner {
        padding-top: 3.5rem;
    }

    .newsletter-header {
        right: 10px;
        left: 70px;
        justify-content: flex-end;
    }

    .light-button {
        left: 10px;
    }

    .nav-btn {
        width: 140px !important;
    }

    .newsletter-header .ml-block-form > div:first-child {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .newsletter-header input[type=email] {
        width: 160px !important;
    }
}

.newsletter-btn .btn-text {
    display: inline;
}

.newsletter-btn .btn-icon {
    display: none;
}

@media (max-width: 1086px) {
    .newsletter-btn .btn-text {
        display: none;
    }

    .newsletter-btn .btn-icon {
        display: inline;
    }
}

.success-card {
    z-index: 2;
    flex: 1;
    width: fit-content;
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 0 0.5rem;
    text-align: center;
}

.success-text {
    display: block;
    color: #000;
}

.success-text b,
.success-text p {
    color: #000 !important;
}

.success-icon {
    display: none !important;
}

@media (max-width: 1306px) {
    .success-icon {
        display: inline-flex !important;
        font-size: 2rem;
        color: green;
    }

    .success-text {
        display: none !important;
    }

    .success-card {
        background: none !important;
        border-radius: 0;
        width: auto;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Main content panel */
.body-content {
    flex: 1;
    padding: 2rem;
    background-color: #232429;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
    border-radius: 0.5rem;
    margin: 1rem auto;
    width: 85%;
    max-width: 1600px;
}

@media (max-width: 991px) {
    .body-content {
        width: calc(100% - 1.5rem);
        padding: 1.25rem;
    }
}

@media (max-width: 575px) {
    .body-content {
        width: calc(100% - 1rem);
        margin: 0.5rem auto;
        padding: 0.75rem;
    }
}

footer.footer-banner {
    background: rgba(0, 0, 0, 0.7);
    color: #ccc;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ---------- Light mode ---------- */
body.light-mode {
    background-color: #fff;
    color: #000;
}

body.light-mode .header-banner {
    background: rgba(255, 255, 255, 0.8);
    color: #222;
}

body.light-mode .body-content {
    background-color: #f8f9fa;
    color: #222;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

body.light-mode footer.footer-banner {
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}
