/*
 * Temple to Temple — phone layout
 * Loaded only when the viewport is 767.98px wide or smaller.
 */

/* ---------- Header and banner ---------- */
.site-header {
    position: relative;
    top: auto;
    background-color: #f3dba5 !important;
}

.site-header .container {
    width: 100%;
    max-width: none;
    padding: 10px 26px 14px;
}

.header-banner {
    display: flex !important;
    width: 100%;
    max-width: none;
    margin: 0;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
}

.header-banner .temple-banner-rotator,
.header-banner .temple-circle-rotator,
.header-banner .temple-banner-rotator__link,
.header-banner .temple-circle-rotator__link {
    width: 100% !important;
}

.temple-banner-rotator__stage {
    /* Slightly taller mobile banner so more of each temple image remains visible. */
    width: 100%;
    aspect-ratio: 2.35 / 1;
    min-height: 0;
}

.temple-banner-rotator__photo {
    object-fit: cover;
    object-position: center;
}

/* ---------- Navigation ---------- */
.header-banner-nav {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    margin-top: 16px;
    padding: 0 20px 16px;
    transform: none;
    background: transparent;
}

/* Phone-only combo-style navigation. Uses native details/summary, so no JavaScript is required. */
.mobile-nav-dropdown {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
}

.mobile-nav-dropdown__button {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 50px;
    padding: 10px 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid #68151d;
    border-radius: 8px;
    color: #f0aa29;
    background-color: #68151d;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    list-style: none;
    box-shadow: 0 8px 16px rgba(87, 49, 12, 0.14);
}

.mobile-nav-dropdown__button::-webkit-details-marker {
    display: none;
}

.mobile-nav-dropdown__button::after {
    position: absolute;
    right: 16px;
    top: 50%;
    width: 24px;
    height: 24px;
    content: "";
    background-image: url("../../app-icons/down.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 24px 24px;
    transform: translateY(-50%);
}

.mobile-nav-dropdown[open] .mobile-nav-dropdown__button::after {
    background-image: url("../../app-icons/up.png");
}

.mobile-nav-dropdown__button:hover,
.mobile-nav-dropdown__button:focus-visible {
    color: #ffd066;
    background-color: #68151d;
    outline: 2px solid rgba(240, 170, 41, 0.45);
    outline-offset: 2px;
}

.mobile-nav-dropdown__menu {
    position: absolute;
    z-index: 1100;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    margin: 0;
    padding: 6px;
    border: 1px solid #9a4d20;
    border-radius: 8px;
    background-color: #fff8eb;
    list-style: none;
    box-shadow: 0 12px 24px rgba(69, 25, 13, 0.22);
}

.mobile-nav-dropdown__menu li + li {
    margin-top: 4px;
}

.mobile-nav-dropdown__item {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border-radius: 5px;
    color: #54210f;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
}

.mobile-nav-dropdown__item:hover,
.mobile-nav-dropdown__item:focus {
    color: #54210f;
    background-color: #f7c35b;
}

.mobile-nav-dropdown__item.active,
.mobile-nav-dropdown__item:active {
    color: #f0aa29;
    background-color: #68151d;
}

/* Hide the regular four-button navigation only on phones. */
.header-banner-nav .navbar-toggler,
.header-banner-nav .navbar-collapse {
    display: none !important;
}

/* Explicit visibility control: do not rely on Bootstrap d-sm-none. */
.site-header .mobile-nav-dropdown {
    display: block !important;
}

.site-header .header-banner-nav .navbar-toggler,
.site-header .header-banner-nav .navbar-collapse {
    display: none !important;
}

/* ---------- Home search area ---------- */
.t2t-hero {
    max-height: none;
    padding-top: 48px !important;
    padding-bottom: 46px !important;
}

.temple-search-form > .bg-white {
    padding: 0.5rem !important;
}

.temple-search-form .searchbox {
    min-height: 38px;
    padding-inline: 0.9rem;
    font-size: 0.82rem;
}

.temple-search-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.18fr);
    width: min(88%, 620px);
    margin: 30px auto 0;
    gap: 12px;
}

.temple-search-controls > [class*="col-"] {
    width: 100%;
    max-width: none;
    padding: 0;
}

.temple-search-controls .form-select {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding-left: 0.55rem;
    padding-right: 2.15rem;
    background-position: right 0.65rem center;
    font-size: clamp(0.68rem, 2.45vw, 0.88rem);
    text-align: center;
    text-align-last: center;
    white-space: nowrap;
}

/* ---------- Results ---------- */
.temple-catalogue-heading {
    margin-bottom: 1.25rem;
}

.temple-results-toolbar {
    align-items: stretch;
    flex-direction: column;
}

.clear-pilgrimage-btn,
.temple-search-controls .btn {
    width: 100%;
}

.clear-pilgrimage-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-align: center !important;
}

/* ---------- Pilgrimage page ---------- */
.pilgrimage-temple-content {
    align-items: flex-start;
    flex-direction: column;
}

.pilgrimage-temple-actions,
.journey-heading-actions,
.journey-action-button {
    width: 100%;
}

.section-heading-row,
.journey-heading-actions {
    align-items: stretch;
    flex-direction: column;
}

.journey-totals {
    grid-template-columns: 1fr;
}

/* ---------- Human verification ---------- */
.human-verification {
    padding: 40px 12px 16px;
}

.human-verification-grid {
    grid-template-columns: 1fr;
    gap: 28px;
}

.human-verification-label {
    text-align: center;
}

.human-verification-answer {
    width: 170px;
}

/* ---------- Temple details page ---------- */

/*
 * On phones the temple information columns stack vertically.
 * The Visit Information card must therefore return to normal
 * document flow instead of behaving as a desktop sticky panel.
 */
.temple-visit-sticky,
.sticky-top.temple-visit-sticky {
    position: static !important;
    top: auto !important;
}

/* ---------- Footer ---------- */
.footer-links-layout {
    gap: 1rem;
}

.footer-links-row-top {
    gap: 2rem;
}

.footer-links-row-bottom {
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.footer-credit {
    margin-top: 1.25rem;
}

@media (max-width: 560px) {
    .temple-search-controls {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.28fr);
        width: 94%;
        gap: 8px;
    }

    .temple-search-controls .form-select {
        padding-left: 0.4rem;
        padding-right: 1.85rem;
        background-position: right 0.5rem center;
        font-size: 0.75rem;
    }
}

@media (max-width: 420px) {
    .site-header .container {
        padding-inline: 12px;
    }

    .header-banner-nav {
        padding-inline: 0;
    }

    .mobile-nav-dropdown__button {
        min-height: 48px;
        padding-inline: 42px;
        font-size: 0.9rem;
    }

    .temple-search-controls {
        width: 96%;
        gap: 6px;
    }

    .temple-search-controls .form-select {
        padding-left: 0.35rem;
        padding-right: 1.65rem;
        background-position: right 0.42rem center;
        font-size: 0.66rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .temple-banner-rotator__photo {
        transition: none;
        transform: none;
    }
}

/* =========================================================
   MOBILE: show ONLY the custom dropdown menu
   ========================================================= */

@media (max-width: 767.98px) {

    /* Keep the custom mobile dropdown */
    .site-header .mobile-nav-dropdown {
        display: block !important;
    }

    /* Completely disable Bootstrap desktop/tablet nav on phones */
    .site-header .header-banner-nav .navbar-toggler,
    .site-header .header-banner-nav .navbar-collapse,
    .site-header .header-banner-nav .navbar-collapse.show,
    .site-header .header-banner-nav .navbar-collapse.collapsing,
    .site-header .header-banner-nav .navbar-nav {
        display: none !important;
    }

    /* Prevent Bootstrap collapse from leaving space */
    .site-header .header-banner-nav .navbar-collapse {
        width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    /* =========================================================
   MOBILE NAVIGATION
   Use only the custom top dropdown.
   Hide the second Bootstrap navigation completely.
   ========================================================= */

@media (max-width: 767.98px) {

    /* Hide Bootstrap hamburger */
    .site-header .navbar-toggler {
        display: none !important;
    }

    /* Hide the duplicate Bootstrap menu */
    .site-header #mainNav,
    .site-header .navbar-collapse,
    .site-header .header-banner-nav > .navbar-collapse {
        display: none !important;
    }

    /* Keep our mobile dropdown */
    .site-header .mobile-nav-dropdown {
        display: block !important;
        width: 100% !important;
    }

}
}