/*
  Mobile responsiveness overrides.

  This file is intended to be linked AFTER each page's inline <style> block so
  it can safely fix mobile issues without changing desktop design.
@media (min-width: 577px) and (max-width: 768px) {
    .gt-wrap {
        right: 56px;
    }
}
*/

/* ----------------------------
   Google Translate (Home only UI)
   - Does NOT change navbar layout (absolute positioned)
   - Shows a Google "G" icon button; clicking opens a language list panel
   ---------------------------- */

.container-header {
    position: relative;
}

.gt-wrap {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
}

/* Home page header inline CSS sets overflow:hidden; allow dropdown to escape */
.container-header.gt-openable {
    overflow: visible !important;
}

.gt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border, #e0e0e0);
    background: var(--bg, #fff);
    border-radius: 14px;
    cursor: pointer;
}

.gt-btn:focus {
    outline: none;
}

.gt-btn:focus-visible {
    outline: 2px solid var(--brand-blue, #0077b6);
    outline-offset: 2px;
    border-radius: 10px;
}

.gt-g {
    width: 22px;
    height: 22px;
    display: block;
}

.gt-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(280px, calc(100vw - 24px));
    background: var(--bg, #fff);
    border: 1px solid var(--border, #e0e0e0);
    border-radius: 14px;
    box-shadow: var(--shadow, 0 2px 8px rgba(0, 0, 0, .06));
    overflow: hidden;
}

.gt-panel[hidden] {
    display: none;
}

.gt-lang-list {
    max-height: min(60vh, 420px);
    overflow: auto;
}

.gt-lang-status {
    padding: 12px 14px;
    color: #555;
    font: inherit;
    font-weight: 600;
}

.gt-lang-item {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: #555;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.gt-lang-item:hover,
.gt-lang-item:focus-visible {
    color: var(--brand-blue, #0077b6);
    outline: none;
}

/* Keep Google's widget present but visually hidden (we use it as the engine) */
.gt-google {
    position: fixed;
    left: -10000px;
    top: 0;
    width: 220px;
    height: 60px;
    overflow: hidden;
}

/* Hide Google Translate banner bar + tooltip */
.goog-te-banner-frame.skiptranslate {
    display: none !important;
}

body {
    top: 0 !important;
	height: 100%;
}

#goog-gt-tt,
.goog-te-balloon-frame {
    display: none !important;
}

.goog-text-highlight {
    background: inherit !important;
    box-shadow: none !important;
}

/* Hide Google widget branding text inside the hidden gadget */
.goog-te-gadget,
.goog-logo-link {
    display: none !important;
}

img,
video,
canvas,
svg {
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
}

/* MOBILE FIX - Language Switch */
@media (max-width: 576px) {

    /* Keep the button in the same spot, but avoid `transform` on the wrapper.
       Some mobile browsers treat fixed-position children incorrectly when an
       ancestor is transformed, causing the panel to not appear. */
    .gt-wrap {
        top: 0;
        bottom: 0;
        transform: none;
        display: flex;
        align-items: center;
    }

    .gt-btn {
        width: 38px;        /* smaller button */
        height: 38px;
        border-radius: 10px;
    }

    .gt-g {
        width: 18px;
        height: 18px;
    }

    .gt-panel {
        position: fixed;
        top: 56px;
        top: calc(56px + env(safe-area-inset-top));
        right: 0;
        left: auto;
        bottom: 0;
        width: min(360px, 86vw);
        border-radius: 14px 0 0 0;
        max-height: none;
        z-index: 1100;
    }

    .gt-lang-list {
        height: 100%;
        max-height: none;
        -webkit-overflow-scrolling: touch;
    }

    .gt-lang-item {
        padding: 12px;
        font-size: 14px;
    }

    .gt-lang-status {
        font-size: 14px;
        padding: 10px;
    }
}

@media (max-width: 768px) {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    /* Clamp overly-wide blocks caused by per-page fixed widths */
    * {
        max-width: 100%;
    }

    html,
    body {
        overflow-x: hidden;
    }

    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        overflow-wrap: anywhere;
    }

    /* Common layout containers */
    .container,
    .container-header {
        width: calc(100% - 24px);
        height: auto;
    }


    /* Keep the G button from overlapping the hamburger (tablet widths only) */
    /* On phones (<=576px) we use the dedicated rule above. */

    .gt-wrap{
        right: 56px;
    }
    /* Header: keep brand + hamburger aligned and prevent overflow */
    .header-inner {
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        margin-top: 0;
    }

    /* Ensure header + hamburger stay clickable above overlapping sections */
    .container-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: var(--bg, #fff);
    }

    #menuBtn,
    .menu-btn {
        position: relative;
        z-index: 1001;
        pointer-events: auto;
    }

    #mobilePanel,
    .mobile-panel {
        position: relative;
        z-index: 1000;
    }

    .brand {
        min-width: 0;
        margin-right: 0;
        gap: 12px;
    }

    .brand-title strong {
        font-size: 16px;
    }

    /* If a page forgets to hide/show nav correctly, force a safe mobile state */
    .header-inner > .nav {
        display: none;
    }

    #menuBtn,
    .menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile menu: avoid 2-column overflow on narrow phones */
    .mobile-panel .nav {
        grid-template-columns: 1fr;
    }

    .mobile-panel .nav a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Common grids used across pages */
    .hero-grid,
    .grid-2,
    .grid-3,
    .two-col,
    .form-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* Forms: prevent input overflow on narrow screens */
    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }

    /* Long content should scroll instead of forcing page overflow */
    pre,
    code {
        max-width: 100%;
        overflow-x: auto;
    }

    table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Video embeds (YouTube) */
    .video-container {
        height: auto;
        padding: 0;
    }

    .video-wrapper-full {
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .video-wrapper-full iframe {
        width: 100%;
        height: 100%;
    }

    iframe[src*="youtube"],
    iframe[src*="youtu.be"] {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
    }

    /* Footers: many pages use fixed margins/heights that break mobile */
    .footer {
        margin-left: 12px;
        margin-right: 12px;
        height: auto;
    }

    .footer-bottom {
        margin-left: 0;
        margin-right: 0;
    }

    .footer-column .site-logo,
    .brand-title1,
    .social-links {
        margin-left: 0;
    }

    .social-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* About page: center the CTA and prevent horizontal scrolling */
    .discover-more {
        margin: 20px auto;
        display: flex;
        justify-content: center;
    }

    /* Why sections (multiple pages): remove wide widths/negative margins on mobile */
    .why-section,
    .why-sl,
    .contact-map {
        margin-top: 0 !important;
    }

    .tours-text {
        margin-top: 24px !important;
    }

    .why-grid,
    .why-grid1 {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        grid-template-columns: 1fr !important;
    }

    .why-text,
    .why-text p {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    .why-image,
    .why-image img {
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
    }

    .why-image img {
        width: 100% !important;
        height: auto !important;
        display: block;
    }

    .why-grid1 {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .why-image img {
        width: 100%;
        margin-left: 0;
    }

    /* Home page inspirational cards: prevent overflow from 110% images */
    .inspirational-image {
        margin-left: 0;
        margin-right: 0;
    }

    .inspirational-container {
        flex-direction: column;
        padding-left: 0;
        padding-right: 0;
        gap: 24px;
    }

    .inspirational-content {
        margin-right: 0;
        max-width: 100%;
    }

    .inspirational-image img {
        width: 100%;
        height: auto;
    }

    /* Benefits cards (packages/tours pages): avoid fixed-width cards on mobile */
    .benefits-section {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 12px;
        padding-right: 12px;
    }

    .benefits-grid {
        grid-template-columns: 1fr !important;
    }

    .benefit-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Hero banners on many pages: fixed widths + negative margins break mobile */
    .about-hero img,
    .packages-hero img,
    .tours-hero img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin-top: 0 !important;
    }

    .about-hero h1,
    .packages-hero h1,
    .tours-hero h1 {
        margin-top: 0 !important;
        font-size: 28px;
        line-height: 1.2;
    }

    .about-hero img {
        width: 100%;
        margin-top: 0;
    }

    .about-hero h1 {
        margin-top: 0;
    }

    .about-text {
        margin-top: 24px;
    }

    .founder-section {
        margin-top: 0;
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .founder-content {
        margin-left: 0 !important;
        max-width: 100% !important;
    }

    .founder-image img {
        width: 100% !important;
    }

    /* Contact page map */
    .contact-map-iframe {
        height: 280px;
    }

    /* Contact page: content section + promoter box */
    .contact-section {
        padding: 28px 16px !important;
    }

    .contact-container {
        gap: 18px !important;
        align-items: stretch;
    }

    .contact-info {
        min-width: 0 !important;
        margin-top: 0 !important;
    }

    .contact-info h2 {
        font-size: 28px !important;
        margin-bottom: 12px !important;
    }

    .contact-info p {
        font-size: 16px !important;
        line-height: 1.65;
    }

    .contact-info h3 {
        margin-left: 0 !important;
        font-size: 20px !important;
    }

    .check-list div {
        margin-left: 0 !important;
        font-size: 16px !important;
    }

    .contact-details {
        gap: 12px !important;
    }

    .contact-details div {
        font-size: 15px !important;
        line-height: 1.5;
        display: flex;
        gap: 10px;
        align-items: flex-start;
    }

    .contact-details i {
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 2px;
        flex: 0 0 auto;
    }

    .promoter-box {
        width: 100% !important;
        max-width: 580px;
        height: auto !important;
        padding: 24px !important;
        margin-top: 8px !important;
        margin-left: auto;
        margin-right: auto;
        border-radius: 22px;
    }

    .promoter-box h2 {
        font-size: 24px !important;
    }

    .promoter-box h3 {
        font-size: 16px !important;
    }

    .promoter-box p {
        font-size: 16px !important;
        line-height: 1.55;
    }

    .apply-btn {
        width: 100%;
        padding: 14px 16px;
    }

    .contact-map {
        padding: 32px 12px !important;
    }

    .contact-map h2 {
        font-size: 22px !important;
        margin-bottom: 16px !important;
    }

    .map-container {
        border-radius: 14px;
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
    }

    /* Tour pages Leaflet map modal */
    #tourMap {
        width: 92%;
        height: 70vh;
    }

    .close-map {
        top: 18px;
        right: 18px;
    }
}

/* Header stickiness for wider mobile/tablet widths */
@media (max-width: 980px) {
    .container-header {
        width: calc(100% - 24px);
        height: auto;
    }

    .container-header {
        position: sticky;
        top: 0;
        z-index: 20000;
        background: var(--bg, #fff);
    }

    .header-inner {
        margin-top: 0;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
    }

    .brand {
        min-width: 0;
        margin-right: 0;
        gap: 12px;
    }

    .brand-title strong {
        font-size: 16px;
    }

    .header-inner > .nav {
        display: none;
    }

    #menuBtn,
    .menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: relative;
        z-index: 20001;
        pointer-events: auto;
    }

    #mobilePanel,
    .mobile-panel {
        position: relative;
        z-index: 20000;
    }

    /* If the opened mobile menu is taller than the screen, allow scrolling */
    #mobilePanel.open,
    .mobile-panel.open {
        max-height: calc(100vh - 96px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}