/* =========================================================
   ABHANG ADVERTISING — RESPONSIVE.CSS
   Progressive enhancement from the mobile-first base.
   Fully updated to prevent horizontal overflow on mobile.
   ========================================================= */

/* ---------------------------------------------------------
   >= 576px
   --------------------------------------------------------- */
@media (min-width: 576px) {
    .container {
        width: min(calc(100% - 44px), var(--container));
    }

    .section-pad {
        padding: 78px 0;
    }

    .hero-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .hero-actions .btn {
        width: auto;
        min-width: 170px;
    }

    .hero-proof {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hero-proof div {
        padding: 16px 14px 0;
        border-bottom: 0;
        min-width: 0;
    }

    .hero-proof div:first-child {
        padding-left: 0;
    }

    .hero-proof div + div {
        border-left: 1px solid var(--line);
    }

    .service-grid,
    .updates-grid,
    .value-grid,
    .work-grid,
    .gallery-grid,
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .field.full {
        grid-column: 1 / -1;
    }

    .contact-form-card {
        padding: 30px;
    }

    .footer-main {
        grid-template-columns: 1.4fr 1fr;
    }

    .footer-address {
        grid-column: 1 / -1;
    }
}

/* ---------------------------------------------------------
   >= 768px
   --------------------------------------------------------- */
@media (min-width: 768px) {
    :root {
        --header-h: 76px;
    }

    .nav-shell {
        width: min(calc(100% - 40px), var(--container));
    }

    .brand-logo {
        width: 72px;
        height: 38px;
    }

    .brand-words strong {
        font-size: 15px;
    }

    .brand-words small {
        font-size: 8px;
    }

    .section-pad {
        padding: 92px 0;
    }

    .hero-grid {
        gap: 48px;
    }

    .hero-copy h1 {
        font-size: clamp(62px, 9vw, 82px);
    }

    .hero-visual {
        min-height: 500px;
    }

    .campaign-poster,
    .poster-copy {
        min-height: 470px;
    }

    .poster-copy {
        padding: 38px;
    }

    .poster-note {
        right: 22px;
        bottom: 24px;
    }

    .service-grid,
    .large-service-grid,
    .updates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .value-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .section-heading {
        flex-direction: row;
        align-items: end;
        justify-content: space-between;
    }

    .statement-grid,
    .editorial-grid,
    .owner-grid {
        grid-template-columns: 220px minmax(0, 1fr);
        gap: 54px;
    }

    .detail-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
    }

    .contact-grid {
        grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
        gap: 24px;
    }

    .footer-main {
        grid-template-columns: 1.6fr .8fr .9fr;
        gap: 34px;
    }

    .footer-address {
        grid-column: auto;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* ---------------------------------------------------------
   Desktop >= 901px
   --------------------------------------------------------- */
@media (min-width: 901px) {
    :root {
        --header-h: 82px;
    }

    .nav-shell {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 28px;
    }

    .brand {
        min-width: 185px;
    }

    .brand-logo {
        width: 80px;
        height: 42px;
    }

    .brand-words strong {
        font-size: 16px;
    }

    .brand-words small {
        font-size: 8px;
    }

    .menu-toggle,
    .mobile-nav-header,
    .mobile-nav-footer,
    .mobile-only-link,
    .nav-backdrop {
        display: none !important;
    }

    .header-contact-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 46px;
        padding: 0 17px;
        border-radius: 13px;
        background: linear-gradient(135deg, var(--orange), #ff8b00);
        color: #fff;
        text-decoration: none;
        font-size: 13px;
        font-weight: 900;
        box-shadow: 0 10px 24px rgba(255, 98, 8, .18);
    }

    .header-contact-button.active {
        background: var(--blue);
    }

    .main-navigation {
        position: static !important;
        inset: auto !important;

        width: auto !important;
        max-width: none !important;
        height: auto !important;

        padding: 0 !important;
        margin: 0;

        display: block !important;

        overflow: visible !important;

        transform: none !important;
        visibility: visible !important;
        pointer-events: auto !important;

        background: transparent;
        box-shadow: none;

        justify-self: center;
        will-change: auto;
    }

    .navigation-list {
        width: auto;
        margin: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 2px;
    }

    .navigation-link {
        min-height: 44px;
        padding: 0 11px;
        border: 0;
        border-radius: 10px;
        color: #4d5a70;
        font-size: 13px;
        font-weight: 800;
    }

    .navigation-link > span {
        display: none;
    }

    .navigation-link:hover {
        background: #edf3fb;
        color: var(--navy);
    }

    .navigation-link.active {
        background: #e9f1ff;
        color: var(--blue);
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1.05fr) minmax(380px, .95fr);
        align-items: center;
        min-height: 640px;
        gap: 64px;
    }

    .hero-copy h1 {
        font-size: clamp(70px, 6.2vw, 96px);
        letter-spacing: -5px;
    }

    .hero-copy > p {
        font-size: 18px;
    }

    .campaign-poster,
    .poster-copy {
        min-height: 520px;
    }

    .poster-copy h2 {
        font-size: 82px;
    }

    .poster-note {
        width: 160px;
    }

    .service-grid,
    .large-service-grid,
    .updates-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .work-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .work-card:first-child:nth-last-child(n + 3) {
        grid-row: span 2;
    }

    .work-card:first-child:nth-last-child(n + 3) .work-media {
        aspect-ratio: 4 / 5;
        height: 100%;
    }

    .project-cover {
        min-height: 500px;
    }

    .project-cover img {
        min-height: 500px;
    }

    .map-section {
        height: 420px;
    }
}

/* ---------------------------------------------------------
   Large desktop >= 1200px
   --------------------------------------------------------- */
@media (min-width: 1200px) {
    .section-pad {
        padding: 112px 0;
    }

    .hero-grid {
        min-height: 690px;
    }

    .service-card {
        min-height: 290px;
        padding: 26px;
    }

    .service-card h3 {
        font-size: 29px;
    }

    .page-hero {
        padding-top: 90px;
        padding-bottom: 76px;
    }

    .page-hero h1,
    .detail-grid h1,
    .project-hero h1,
    .update-hero h1 {
        font-size: clamp(64px, 5.5vw, 86px);
        letter-spacing: -4px;
    }

    .updates-grid {
        gap: 20px;
    }

    .footer-main {
        grid-template-columns: 1.6fr .65fr .8fr 1fr;
    }

    .footer-address {
        grid-column: auto;
    }
}

/* =========================================================
   MOBILE NAVIGATION / SMALL-SCREEN FINAL OVERRIDES
   ========================================================= */

@media (max-width: 900px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
    }

    .site-header {
        height: var(--header-h);
        max-width: 100%;
    }

    .nav-shell {
        min-width: 0;
        max-width: 100%;
    }

    .brand {
        max-width: calc(100% - 58px);
        min-width: 0;
    }

    .brand-words {
        min-width: 0;
    }

    .brand-words strong,
    .brand-words small {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .menu-toggle {
        flex: 0 0 44px;
        touch-action: manipulation;
    }

    /* IMPORTANT:
       Keep the off-canvas panel inside the document width.
       Do not use >100% transforms or 100vw here. */
    .main-navigation {
        position: fixed !important;

        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;

        width: min(90%, 420px) !important;
        max-width: 100% !important;

        height: 100vh !important;
        height: 100svh !important;
        height: 100dvh !important;

        margin: 0 !important;

        display: flex !important;
        flex-direction: column !important;
        justify-self: auto !important;

        overflow-y: auto !important;
        overflow-x: hidden !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;

        transform: translate3d(100%, 0, 0) !important;

        visibility: hidden;
        pointer-events: none;

        will-change: transform;
    }

    .main-navigation.is-open {
        transform: translate3d(0, 0, 0) !important;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-nav-header {
        flex: 0 0 auto;
    }

    .navigation-list {
        width: 100%;
        min-width: 0;
        margin: 16px 0 20px;
    }

    .navigation-link {
        width: 100%;
        min-width: 0;
        min-height: 56px;
        padding: 0 6px;
        font-size: 19px;
        line-height: 1.2;
    }

    .mobile-nav-footer {
        margin-top: auto;
    }

    .hero-grid,
    .detail-grid,
    .contact-grid,
    .service-grid,
    .work-grid,
    .updates-grid,
    .value-grid,
    .statement-grid,
    .editorial-grid,
    .owner-grid {
        min-width: 0;
        max-width: 100%;
    }

    .hero-grid > *,
    .detail-grid > *,
    .contact-grid > *,
    .service-grid > *,
    .work-grid > *,
    .updates-grid > *,
    .value-grid > *,
    .statement-grid > *,
    .editorial-grid > *,
    .owner-grid > * {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    :root {
        --header-h: 68px;
    }

    .nav-shell {
        width: calc(100% - 24px);
        max-width: 100%;
        gap: 8px;
    }

    .brand-logo {
        width: 56px;
        height: 32px;
    }

    .brand-words strong {
        font-size: 13px;
    }

    .brand-words small {
        font-size: 7px;
        letter-spacing: 1.2px;
    }

    /* Full-screen phone menu without 100vw.
       left + right + width:auto avoids mobile horizontal overflow. */
    .main-navigation {
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;

        width: auto !important;
        max-width: 100% !important;

        height: 100vh !important;
        height: 100svh !important;
        height: 100dvh !important;

        margin: 0 !important;

        padding:
            max(14px, env(safe-area-inset-top))
            max(16px, env(safe-area-inset-right))
            max(16px, env(safe-area-inset-bottom))
            max(16px, env(safe-area-inset-left)) !important;

        border-radius: 0;
        box-shadow: none;

        overflow-y: auto !important;
        overflow-x: hidden !important;

        transform: translate3d(100%, 0, 0) !important;
    }

    .main-navigation.is-open {
        transform: translate3d(0, 0, 0) !important;
    }

    .mobile-nav-header {
        top: calc(-1 * max(14px, env(safe-area-inset-top)));

        margin-inline:
            calc(-1 * max(16px, env(safe-area-inset-left)))
            calc(-1 * max(16px, env(safe-area-inset-right)));

        padding-inline:
            max(16px, env(safe-area-inset-left))
            max(16px, env(safe-area-inset-right));

        padding-bottom: 13px;
    }

    .mobile-nav-brand img {
        width: 58px;
        height: 32px;
    }

    .navigation-list {
        margin-top: 10px;
    }

    .navigation-link {
        min-height: 54px;
        font-size: 18px;
    }

    .mobile-nav-footer {
        padding-top: 14px;
    }

    /* Full-screen phone menu does not need a page backdrop. */
    .nav-backdrop {
        display: none !important;
    }

    .floating-whatsapp {
        width: 54px;
        height: 54px;

        right: max(14px, env(safe-area-inset-right));
        bottom: max(14px, env(safe-area-inset-bottom));
    }

    .floating-whatsapp svg {
        width: 29px;
        height: 29px;
    }

    .floating-whatsapp > span {
        display: none;
    }

    .hero-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .section-heading {
        gap: 16px;
    }

    .contact-form-card {
        border-radius: 20px;
    }

    .container,
    .hero-section,
    .hero-grid,
    .hero-copy,
    .hero-visual,
    main,
    section,
    footer {
        max-width: 100%;
    }
}

/* ---------------------------------------------------------
   Extra-small phones <= 380px
   --------------------------------------------------------- */
@media (max-width: 380px) {
    .container {
        width: calc(100% - 28px);
    }

    .brand-logo {
        width: 56px;
    }

    .brand-words strong {
        font-size: 13px;
    }

    .brand-words small {
        letter-spacing: 1px;
    }

    .hero-copy h1 {
        font-size: 42px;
    }

    .poster-copy {
        padding: 22px;
    }

    .poster-copy h2 {
        font-size: 52px;
    }

    .poster-note {
        width: 120px;
    }

    .navigation-link {
        font-size: 18px;
    }

    /* Do not set 92vw here; <=600px already provides the
       safer full-screen left/right/width:auto solution. */
}

/* ---------------------------------------------------------
   Very small phones <= 360px
   --------------------------------------------------------- */
@media (max-width: 360px) {
    .container {
        width: calc(100% - 24px);
    }

    .nav-shell {
        width: calc(100% - 20px);
    }

    .brand-logo {
        width: 50px;
        height: 30px;
    }

    .brand-words strong {
        font-size: 12px;
    }

    .brand-words small {
        font-size: 6.5px;
        letter-spacing: 1px;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .hero-copy h1 {
        font-size: 40px;
        letter-spacing: -2.2px;
    }

    .page-hero h1,
    .detail-grid h1,
    .project-hero h1,
    .update-hero h1 {
        font-size: 40px;
        letter-spacing: -2px;
    }

    .navigation-link {
        min-height: 52px;
        font-size: 17px;
    }
}

/* =========================================================
   FINAL HORIZONTAL-OVERFLOW PROTECTION
   Keep this at the very END of responsive.css.
   ========================================================= */

@media (max-width: 900px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden !important;
    }

    .site-header,
    .nav-shell,
    main,
    footer,
    section,
    .container,
    .hero-section,
    .hero-grid,
    .hero-copy,
    .hero-visual,
    .page-hero,
    .detail-grid,
    .project-hero,
    .update-hero,
    .contact-grid,
    .service-grid,
    .work-grid,
    .updates-grid,
    .value-grid {
        max-width: 100%;
    }

    .hero-grid > *,
    .detail-grid > *,
    .contact-grid > *,
    .service-grid > *,
    .work-grid > *,
    .updates-grid > *,
    .value-grid > * {
        min-width: 0;
    }

    img,
    svg,
    video,
    iframe,
    canvas {
        max-width: 100%;
    }

    h1,
    h2,
    h3,
    h4,
    p,
    a,
    span {
        overflow-wrap: break-word;
    }
}
