/* Grandpix — site-wide responsive & performance helpers */

:root {
    --gp-nav-h: 72px;
    --gp-sticky-top: 72px;
    --gp-section-pad: clamp(3rem, 8vw, 6rem);
    --gp-container-pad: clamp(1rem, 3vw, 1.5rem);
}

@media (max-width: 991.98px) {
    :root {
        --gp-nav-h: 64px;
        --gp-sticky-top: 64px;
    }
}

html {
    scroll-padding-top: calc(var(--gp-sticky-top) + 12px);
    -webkit-text-size-adjust: 100%;
}

img,
video,
svg,
iframe {
    max-width: 100%;
}

img {
    height: auto;
    display: block;
}

.container,
.container-fluid {
    padding-left: max(var(--gp-container-pad), env(safe-area-inset-left, 0px));
    padding-right: max(var(--gp-container-pad), env(safe-area-inset-right, 0px));
}

.gp-section {
    padding-top: var(--gp-section-pad);
    padding-bottom: var(--gp-section-pad);
}

/* —— Navbar —— */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .gp-nav-home .nav-link {
        font-size: 0.7rem;
        letter-spacing: 0.12em;
        padding: 0.5rem 0.55rem !important;
        min-height: 48px;
        min-width: 0;
    }
}

@media (max-width: 991.98px) {
    body {
        cursor: auto;
    }

    .gp-cursor {
        display: none !important;
    }

    .gp-navbar {
        padding: 0.85rem 0;
    }

    .gp-navbar .navbar-collapse {
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(12px);
        margin-top: 0.75rem;
        padding: 1rem 1.25rem 1.25rem;
        border: 1px solid var(--gp-border);
        border-radius: 4px;
        max-height: min(75vh, 520px);
        overflow-y: auto;
    }

    .gp-navbar .navbar-nav {
        gap: 0.25rem;
    }

    .gp-navbar .nav-link {
        padding: 0.75rem 1rem !important;
        min-height: 48px;
        min-width: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gp-navbar .dropdown-item {
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1rem;
    }

    .gp-navbar .dropdown-menu {
        background: rgba(17, 17, 17, 0.98);
        border: 1px solid var(--gp-border);
        text-align: center;
    }

    .gp-navbar .gp-btn-consult--mobile {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin-top: 0.75rem;
        min-height: 48px;
    }

    .gp-logo {
        height: 36px;
    }
}

/* —— Heroes (all pages) —— */
.gp-hero-ui,
.gp-hero,
.gp-about-hero,
.gp-portfolio-hero,
.gp-stories-hero,
.gp-films-hero,
.gp-blog-hero,
.gp-contact-hero,
.gp-page-hero {
    min-height: min(100dvh, 920px);
}

@media (max-width: 991.98px) {
    .gp-hero-ui,
    .gp-hero-ui .gp-hero-swiper,
    .gp-hero-ui .gp-hero-swiper .swiper-slide {
        min-height: min(100svh, 800px);
    }

    .gp-hero-content,
    .gp-portfolio-hero-content,
    .gp-stories-hero-content,
    .gp-stories-hero-photo,
    .gp-portfolio-hero-photo,
    .gp-films-hero-content,
    .gp-blog-hero-content,
    .gp-contact-hero-content,
    .gp-contact-hero-photo {
        padding-top: calc(var(--gp-nav-h) + env(safe-area-inset-top, 0px) + 1.5rem) !important;
        padding-bottom: 2.5rem !important;
    }

    .gp-films-hero-content,
    .gp-blog-hero-content,
    .gp-contact-hero-content {
        max-width: 100%;
    }

    .gp-about-hero {
        min-height: 100svh;
    }

    .gp-page-hero {
        min-height: 40vh;
        padding-bottom: 2.5rem;
        align-items: flex-end;
    }
}

@media (max-width: 575.98px) {
    .gp-hero-ui .gp-hero-watch-text {
        line-height: 1.35;
    }
}

/* —— Sticky filter bars —— */
.gp-portfolio-filter-bar,
.gp-stories-filter-bar,
.gp-films-filter-bar,
.gp-blog-filter-bar {
    top: var(--gp-sticky-top);
}

@media (max-width: 767.98px) {
    .gp-portfolio-filter-bar .container,
    .gp-stories-filter-bar .container,
    .gp-films-filter-bar .container,
    .gp-blog-filter-bar .container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.75rem;
        padding-bottom: 0.25rem;
    }

    .gp-portfolio-filter-bar .container::-webkit-scrollbar,
    .gp-stories-filter-bar .container::-webkit-scrollbar,
    .gp-films-filter-bar .container::-webkit-scrollbar,
    .gp-blog-filter-bar .container::-webkit-scrollbar {
        display: none;
    }

    .gp-portfolio-ui-filters,
    .gp-portfolio-filters,
    .gp-stories-filters,
    .gp-films-filters,
    .gp-blog-filters {
        flex-wrap: nowrap;
        flex-shrink: 0;
    }

    .gp-portfolio-filter-meta,
    .gp-stories-filter-more,
    .gp-films-filter-meta {
        flex-shrink: 0;
    }
}

/* —— Stats —— */
@media (max-width: 991.98px) {
    .gp-stat-item {
        border-right: none;
        border-bottom: 1px solid var(--gp-border);
        padding: 1.25rem 0.5rem;
    }

    .gp-stat-item:nth-last-child(-n+2) {
        border-bottom: none;
    }

    .gp-stat-count {
        font-size: clamp(1.75rem, 6vw, 2.5rem);
    }
}

@media (max-width: 575.98px) {
    .gp-stats .col-6:nth-child(odd) .gp-stat-item {
        border-right: 1px solid var(--gp-border);
    }

    .gp-stats .col-6:nth-child(even) .gp-stat-item {
        border-bottom: 1px solid var(--gp-border);
    }

    .gp-stats .row > .col-6:last-child .gp-stat-item,
    .gp-stats .row > .col-6:nth-last-child(2) .gp-stat-item {
        border-bottom: none;
    }
}

/* —— Welcome / about images —— */
@media (max-width: 991.98px) {
    .gp-welcome-img,
    .gp-welcome-img img {
        min-height: 320px;
    }

    .gp-about-img img {
        min-height: 280px;
    }
}

/* —— Services strip —— */
@media (max-width: 575.98px) {
    .gp-service-vertical {
        flex: 0 0 min(72vw, 260px);
        height: 360px;
    }
}

/* —— Testimonials —— */
@media (max-width: 767.98px) {
    .gp-testimonial-ui .gp-t-quote-lg {
        font-size: 3rem;
    }

    .gp-testimonial-quote {
        font-size: 2.5rem;
    }

    .gp-testimonial-ui .swiper-button-prev,
    .gp-testimonial-ui .swiper-button-next {
        display: none;
    }
}

/* —— Touch devices: show overlays without hover —— */
@media (hover: none) {
    .gp-masonry-item .gp-masonry-overlay,
    .gp-portfolio-ui-item .gp-portfolio-ui-overlay,
    .gp-portfolio-ui-card .gp-portfolio-ui-overlay,
    .gp-works-item::after {
        opacity: 1;
    }
}

/* —— Split CTAs —— */
@media (max-width: 991.98px) {
    .gp-portfolio-cta,
    .gp-stories-cta-inner,
    .gp-films-cta-inner,
    .gp-blog-sidebar-cta,
    .gp-contact-map-cta-inner,
    .gp-about-cta {
        flex-direction: column;
    }

    .gp-stories-cta-photo,
    .gp-films-cta-photo,
    .gp-contact-map,
    .gp-about-cta-photo {
        flex: none;
        min-height: 260px;
    }

    .gp-stories-cta-body,
    .gp-films-cta-body,
    .gp-contact-meet,
    .gp-about-cta-body {
        padding: 2rem 1.25rem;
        text-align: center;
    }

    .gp-stories-cta-body .text-lg-end,
    .gp-films-cta-body .text-lg-end,
    .gp-contact-meet .btn {
        width: 100%;
        max-width: 320px;
    }
}

/* —— Contact page —— */
@media (max-width: 991.98px) {
    .gp-contact-panel {
        margin-top: 0;
    }

    .gp-contact-info {
        border-right: none;
        border-bottom: 1px solid var(--gp-border);
    }
}

@media (max-width: 575.98px) {
    .gp-contact-submit,
    .gp-contact-map-cta-inner .btn {
        width: 100%;
    }
}

/* —— Blog —— */
@media (max-width: 1199.98px) {
    .gp-blog-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .gp-blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.5rem;
    }

    .gp-blog-sidebar-cta {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767.98px) {
    .gp-blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }

    .gp-blog-sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .gp-blog-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* —— Grids: stories, films, portfolio —— */
@media (max-width: 991.98px) {
    .gp-stories-grid,
    .gp-films-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .gp-stories-grid,
    .gp-films-grid {
        grid-template-columns: 1fr;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* —— Footer —— */
@media (max-width: 767.98px) {
    .gp-footer {
        padding: 3rem 0 1.5rem;
        text-align: center;
    }

    .gp-footer .col-lg-4 {
        margin-bottom: 0.5rem;
    }

    .gp-footer .d-flex.gap-3 {
        justify-content: center;
    }

    .gp-footer ul {
        margin-bottom: 0;
        align-items: center;
    }

    .gp-footer ul a {
        justify-content: center;
        width: 100%;
        max-width: 280px;
    }
}

/* —— Buttons & forms —— */
@media (max-width: 575.98px) {
    .btn-gp-gold,
    .btn-gp-outline,
    .btn-gp-outline-gold,
    .gp-portfolio-load-more {
        min-height: 48px;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .gp-contact-input,
    .gp-contact-form-wrap select,
    .gp-contact-form-wrap textarea,
    .form-control {
        font-size: 16px; /* prevents iOS zoom on focus */
    }
}

/* —— Tables / pagination —— */
.gp-blog-pagination .pagination,
.gp-stories-pagination .pagination {
    flex-wrap: wrap;
}

/* —— Reduced motion —— */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .gp-hero-bg,
    .gp-service-card-bg,
    .gp-masonry-item img {
        transform: none !important;
    }
}

/* —— Detail / inner pages —— */
@media (max-width: 767.98px) {
    .gp-story-gallery,
    .gp-portfolio-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 575.98px) {
    .gp-story-gallery,
    .gp-portfolio-gallery {
        grid-template-columns: 1fr !important;
    }
}

/* —— Overflow guard —— */
body {
    overflow-x: hidden;
}

/* Prevent horizontal filter scroll from hijacking vertical page scroll */
@media (max-width: 767.98px) {
    .gp-portfolio-filter-bar .container,
    .gp-stories-filter-bar .container,
    .gp-films-filter-bar .container,
    .gp-blog-filter-bar .container {
        overscroll-behavior-x: contain;
    }
}

table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}
@media print {
    .gp-navbar,
    .gp-cursor,
    #gp-preloader,
    .gp-hero-pagination,
    .gp-portfolio-filter-bar,
    .gp-stories-filter-bar,
    .gp-films-filter-bar,
    .gp-blog-filter-bar {
        display: none !important;
    }
}
