/* Mobile App Web Lite layer for El Cabezal. Desktop keeps the base style.css layout. */
.app-command-bar,
.app-bottom-nav {
    display: none;
}

@media (max-width: 760px) {
    :root {
        --app-command: 44px;
        --app-top: 0px;
        --app-bottom: 78px;
    }

    html {
        scroll-padding-top: calc(var(--app-top) + 72px);
    }

    body {
        padding-bottom: calc(var(--app-bottom) + var(--app-command) + env(safe-area-inset-bottom));
        background:
            radial-gradient(circle at 18% 0%, rgba(111, 231, 243, 0.36), transparent 18rem),
            linear-gradient(180deg, #d9ecf3 0%, #f7fbfb 52%, #edf6f8 100%);
    }

    .app-command-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: calc(var(--app-bottom) + env(safe-area-inset-bottom));
        z-index: 80;
        height: var(--app-command);
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1px;
        padding: 6px 10px;
        background: rgba(237, 246, 248, 0.94);
        border-top: 1px solid var(--line);
        box-shadow: 0 -10px 22px rgba(16,37,52,.12);
        backdrop-filter: blur(16px);
    }

    .app-command-bar button {
        min-width: 0;
        border: 1px solid rgba(34, 104, 135, 0.18);
        border-radius: 8px;
        background: rgba(255, 250, 240, 0.92);
        color: var(--navy);
        font-size: 1.2rem;
        font-weight: 900;
        line-height: 1;
        cursor: pointer;
    }

    .site-header {
        top: 0;
        min-height: 64px;
        padding: 0.65rem 1rem;
        justify-content: center;
        box-shadow: 0 8px 24px rgba(16, 37, 52, 0.08);
    }

    .site-header .brand {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .brand-mark {
        font-size: 2.6rem;
    }

    .menu-toggle,
    .site-nav,
    .site-nav.is-open,
    .site-header > .js-whatsapp {
        display: none;
    }

    main {
        overflow-x: hidden;
    }

    .section {
        min-height: auto;
        padding: 2.25rem 1rem;
    }

    .hero-section {
        min-height: calc(100svh - var(--app-bottom) - var(--app-command) - 64px);
        display: grid;
        gap: 1.25rem;
        align-content: start;
    }

    h1 {
        font-size: clamp(3.1rem, 17vw, 4.8rem);
    }

    h2 {
        font-size: clamp(2.4rem, 13vw, 3.7rem);
    }

    .lead {
        font-size: 1.02rem;
    }

    .cover-shell {
        transform: none;
        padding: 0.8rem;
    }

    .content-card,
    .form-card,
    .contact-panel,
    .month-card,
    .about-card {
        border-radius: 8px;
        padding: 0.95rem;
    }

    .app-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 80;
        height: calc(var(--app-bottom) + env(safe-area-inset-bottom));
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 6px;
        background: rgba(21, 52, 71, 0.94);
        border-top: 1px solid rgba(255, 255, 255, 0.18);
        box-shadow: 0 -12px 28px rgba(16, 37, 52, 0.24);
        backdrop-filter: blur(18px);
    }

    .app-bottom-nav a {
        min-width: 0;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 1px;
        border-radius: 8px;
        color: rgba(255, 250, 240, 0.74);
        font-weight: 900;
        text-align: center;
    }

    .app-bottom-nav span {
        font-size: 1.15rem;
        line-height: 1;
    }

    .app-bottom-nav small {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.66rem;
        line-height: 1.05;
    }

    .app-bottom-nav a.active {
        background: rgba(111, 231, 243, 0.18);
        color: var(--bone);
        outline: 1px solid rgba(111, 231, 243, 0.32);
    }

    .site-footer {
        margin-bottom: calc(var(--app-bottom) + var(--app-command) + env(safe-area-inset-bottom));
    }

    .reader-modal {
        padding: .75rem .75rem calc(var(--app-bottom) + var(--app-command) + 0.75rem);
    }

    .pdf-flip-shell {
        height: calc(100svh - var(--app-bottom) - var(--app-command) - 180px);
        min-height: 420px;
        box-shadow: 8px 8px 0 rgba(34,104,135,.14), var(--shadow);
    }
}

/* Admin polish: same editorial sky system, with mobile app-like navigation. */
body.admin-body {
    background:
        radial-gradient(circle at 12% 0%, rgba(111, 231, 243, 0.28), transparent 25rem),
        linear-gradient(180deg, #d8ecf3 0%, #f7fbfb 100%);
}

.admin-main {
    background: transparent;
}

.admin-card,
.login-card,
.table-wrap {
    box-shadow: 0 14px 34px rgba(16, 37, 52, 0.1);
}

.admin-heading {
    padding: 0.8rem 0 0.4rem;
}

.admin-heading h1 {
    color: var(--navy);
}

.admin-tab span {
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    margin-right: 0.4rem;
    border-radius: 6px;
    background: rgba(111, 231, 243, 0.14);
    color: var(--cyan);
}

.admin-tab.active span {
    background: rgba(255, 250, 240, 0.24);
    color: var(--bone);
}

.form-stack h2,
.admin-card h2 {
    font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.form-stack label,
.settings-grid label,
.text-row label {
    font-size: 0.9rem;
}

.form-stack select,
.form-stack input,
.form-stack textarea,
.settings-grid input,
.text-row textarea {
    background: rgba(246, 248, 248, 0.92);
}

@media (max-width: 980px) {
    body.admin-body {
        display: block;
        padding-top: 104px;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .admin-sidebar {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        bottom: auto;
        z-index: 90;
        height: auto;
        max-height: 104px;
        display: grid;
        grid-template-columns: repeat(9, minmax(74px, 1fr));
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: calc(8px + env(safe-area-inset-top)) 8px 8px;
        background: rgba(21, 52, 71, 0.95);
        border-bottom: 1px solid rgba(255,255,255,.16);
        box-shadow: 0 12px 28px rgba(16, 37, 52, 0.2);
        backdrop-filter: blur(18px);
    }

    .admin-brand,
    .base-label {
        display: none;
    }

    .admin-tab,
    .admin-logout {
        min-width: 74px;
        height: 66px;
        margin: 0;
        padding: 0.42rem 0.35rem;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 2px;
        text-align: center;
        font-size: 0.72rem;
        line-height: 1.05;
        border-radius: 8px;
    }

    .admin-tab span {
        margin: 0;
        width: 1.35rem;
        height: 1.35rem;
    }

    .admin-main {
        padding: 0.85rem 0.85rem 1rem;
    }

    .admin-heading {
        display: grid;
        gap: 0.7rem;
        align-items: start;
    }

    .admin-heading .btn {
        width: 100%;
    }

    .admin-table {
        min-width: 860px;
    }

    .mini-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .mini-row button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .admin-two-col,
    .admin-grid-forms,
    .admin-lists,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .admin-card,
    .login-card {
        padding: 0.95rem;
    }

    .text-row {
        padding: 0.75rem;
    }
}
