/* Ideal detail pages — overrides inline <style> (must load after inline block) */

/* Hero taglines — no dark box (override page inline .hero-content p rules) */
.hero-banner .hero-content p,
.hero-banner .hero-content .hero-tagline-en,
.hero-banner .hero-content .hero-tagline-hi {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block !important;
    padding: 1px 6px !important;
    color: #fff !important;
    width: 100% !important;
    max-width: min(94vw, 680px);
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center !important;
    text-shadow:
        0 1px 6px rgba(0, 0, 0, 0.65),
        0 2px 14px rgba(0, 0, 0, 0.45),
        0 0 1px rgba(255, 255, 255, 0.85);
}

@media (max-width: 767px) {
    /* Tighter vertical rhythm between hero → nav → content */
    .hero-banner {
        height: 150px !important;
        padding: 10px 8px !important;
        margin-bottom: 8px !important;
        background-attachment: scroll !important;
    }

    .hero-banner .hero-content h1 {
        font-size: clamp(1.28rem, 5vw, 1.75rem) !important;
        margin-bottom: 3px !important;
    }

    .hero-banner .hero-content .hero-tagline-en,
    .hero-banner .hero-content .hero-tagline-hi,
    .hero-banner .hero-content h1 + p:not(.hero-tagline-hi) {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .hero-banner .hero-content h1::after {
        width: 28px;
        height: 2px;
        margin-top: 3px;
    }

    main.main-content:has(.ideal-detail-section) > .container {
        padding-left: max(6px, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(6px, env(safe-area-inset-right, 0px)) !important;
    }

    main.main-content {
        padding: 2px 0 8px !important;
    }

    .nav-buttons {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        justify-content: space-between !important;
        align-items: stretch !important;
        margin: 4px 0 6px !important;
    }

    /* Fixed equal buttons — text wraps inside */
    .nav-btn {
        flex: 0 0 calc(50% - 3px) !important;
        width: calc(50% - 3px) !important;
        max-width: calc(50% - 3px) !important;
        min-width: 0 !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        padding: 0 5px !important;
        border-radius: 6px !important;
        text-align: center !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 3px !important;
        overflow: hidden !important;
    }

    .nav-btn__text {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: clamp(0.56rem, 2.35vw, 0.68rem);
        line-height: 1.12;
        font-weight: 700;
        text-align: center;
        word-break: break-word;
        hyphens: auto;
        max-width: 100%;
    }

    .nav-btn i {
        flex-shrink: 0;
        font-size: 0.6rem !important;
    }

    .ideal-detail-section {
        padding: 8px 6px 12px !important;
        margin-bottom: 8px !important;
        border-radius: 6px !important;
    }

    .ideal-info-grid {
        gap: 10px !important;
        margin-bottom: 8px !important;
    }

    .ideal-details h2 {
        font-size: 1.25rem !important;
        margin-bottom: 8px !important;
    }

    .ideal-meta {
        margin-bottom: 10px !important;
        padding: 8px !important;
    }

    .ideal-meta p {
        margin-bottom: 6px !important;
    }

    .ideal-description {
        margin-bottom: 10px !important;
    }

    .ideal-description p {
        margin-bottom: 8px !important;
    }

    .ideal-rich-block {
        margin-top: 12px !important;
    }

    .ideal-rich-block h3 {
        margin-bottom: 8px !important;
        padding-bottom: 5px !important;
    }

    .ideal-rich-block p {
        margin-bottom: 8px !important;
    }

    .ideal-sources-block,
    .ideal-yoga-contrib-block,
    .ideal-mpypcp-box {
        padding: 10px 8px !important;
        border-radius: 8px !important;
    }

    .ideal-highlights {
        gap: 8px !important;
        margin: 10px 0 4px !important;
    }

    .ideal-highlights li {
        padding: 8px 10px !important;
    }

    .ideal-popular-intro {
        margin: 10px 0 6px !important;
    }

    .ideal-quote {
        margin: 10px 0 6px !important;
        padding: 10px 8px !important;
        font-size: 14px !important;
        border-radius: 6px !important;
    }

    .back-to-all {
        margin: 8px 0 4px !important;
    }

    .back-to-all a {
        padding: 8px 14px !important;
        font-size: 13px !important;
    }

    .ideal-description p,
    .ideal-rich-block p {
        text-align: left !important;
    }
}

@media (max-width: 480px) {
    .hero-banner {
        height: 125px !important;
    }

    .hero-banner .hero-content h1::after {
        display: none;
    }

    main.main-content:has(.ideal-detail-section) > .container {
        padding-left: max(4px, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(4px, env(safe-area-inset-right, 0px)) !important;
    }

    .ideal-detail-section {
        padding: 6px 4px 10px !important;
        border-radius: 4px !important;
    }

    .ideal-meta {
        padding: 6px !important;
    }

    .ideal-sources-block,
    .ideal-yoga-contrib-block,
    .ideal-mpypcp-box {
        padding: 8px 6px !important;
    }

    .ideal-highlights li {
        padding: 7px 8px !important;
    }

    .ideal-quote {
        padding: 8px 6px !important;
        font-size: 13px !important;
    }

    .nav-btn {
        height: 38px !important;
        min-height: 38px !important;
        max-height: 38px !important;
    }

    .nav-btn__text {
        font-size: clamp(0.52rem, 2.1vw, 0.62rem);
        line-height: 1.1;
    }
}

/* Lang switch — bottom-right above mobile bottom nav (stack like Jan Ayush) */
@media (max-width: 767px) {
    html.mpypcp-mobile-nav-on .ideal-lang-toolbar {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 52px) !important;
    }
}

@media (max-width: 767px) and (min-width: 481px) {
    html:not(.mpypcp-mobile-nav-on) .ideal-lang-toolbar {
        bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 52px) !important;
    }
}
