/* =====================================================================
   DALTON ENERGIES - RESPONSIVE LAYER
   Loaded LAST in layouts/app.blade.php so it wins over custom.css,
   the Neotix CSS and the inline header styles in the layout.
   Breakpoints follow Bootstrap: xl 1200 / lg 992 / md 768 / sm 576.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. TOP BAR
   --------------------------------------------------------------------- */
/* Opening hours no longer fit next to the social icons below 1280px */
@media (max-width: 1279.98px) {
    .header-top-wrapper .header-left .topbar-info-list li.topbar-hours {
        display: none !important;
    }
}

/* Phones & small tablets: top bar hidden, its info lives in the drawer */
@media (max-width: 991.98px) {
    .header-top-section,
    .gsap-topbar {
        display: none !important;
    }
}

/* ---------------------------------------------------------------------
   2. MAIN HEADER (below 1200px the desktop menu becomes a drawer)
   --------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    .header-top-section .container-fluid,
    .header-1 .container-fluid {
        padding-left: 32px !important;
        padding-right: 32px !important;
    }

    .header-1 .mean__menu-wrapper {
        display: none !important;
    }

    .header-1 .header-main {
        min-height: 72px;
        padding: 12px 0;
        gap: 16px;
    }

    .header-1 .header-main .header-right,
    .header-1 .header-main .header-right .header-btn {
        gap: 14px;
    }
}

/* Tablets: room for the CTA button next to the menu button */
@media (min-width: 576px) and (max-width: 1199.98px) {
    .header-1 .header-main .header-right .header-btn .header-button {
        display: block !important;
    }

    .header-1 .header-main .header-right .header-btn .header-button .theme-btn {
        padding: 12px 24px 11px;
        font-size: 15px;
    }
}

@media (max-width: 575.98px) {
    .header-top-section .container-fluid,
    .header-1 .container-fluid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .header-1 .header-main {
        min-height: 64px;
        padding: 10px 0;
    }

    .header-logo img,
    .logo.gsap-header-logo img {
        max-height: 34px !important;
        max-width: 140px !important;
    }
}

/* Menu (hamburger) button */
.dalton-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.dalton-nav-toggle:hover,
.dalton-nav-toggle:focus-visible {
    background: #d92338;
    border-color: #d92338;
    color: #ffffff;
    outline: none;
}

.dalton-nav-toggle__bars {
    position: relative;
    display: block;
    width: 20px;
    height: 14px;
}

.dalton-nav-toggle__bars span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.3s ease, opacity 0.2s ease, width 0.3s ease;
}

.dalton-nav-toggle__bars span:nth-child(1) { top: 0; }
.dalton-nav-toggle__bars span:nth-child(2) { top: 6px; width: 70%; }
.dalton-nav-toggle__bars span:nth-child(3) { top: 12px; }

.dalton-nav-toggle:hover .dalton-nav-toggle__bars span:nth-child(2) { width: 100%; }

/* ---------------------------------------------------------------------
   3. NAVIGATION DRAWER
   --------------------------------------------------------------------- */
html.dalton-drawer-open,
html.dalton-drawer-open body {
    overflow: hidden !important;
}

.dalton-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000010;
    background: rgba(15, 23, 42, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.dalton-drawer-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.dalton-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10000011;
    display: flex;
    flex-direction: column;
    width: min(88vw, 380px);
    height: 100%;
    height: 100dvh;
    background: #ffffff;
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.35s;
}

.dalton-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s;
}

.dalton-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
    border-bottom: 1px solid #eef2f6;
    border-top: 3px solid #d92338;
}

.dalton-drawer__logo img {
    display: block;
    width: auto;
    max-width: 150px;
    max-height: 36px;
    object-fit: contain;
}

.dalton-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.dalton-drawer__close:hover,
.dalton-drawer__close:focus-visible {
    background: #d92338;
    color: #ffffff;
    transform: rotate(90deg);
    outline: none;
}

.dalton-drawer__body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 6px 20px calc(28px + env(safe-area-inset-bottom, 0px));
}

/* Menu list */
.dalton-drawer__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dalton-drawer__nav li {
    position: relative;
    display: block;
    margin: 0;
}

.dalton-drawer__nav > ul > li {
    border-bottom: 1px solid #eef2f6;
}

.dalton-drawer__nav a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 54px;
    padding: 12px 48px 12px 0;
    color: #0f172a !important;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.dalton-drawer__nav a:hover,
.dalton-drawer__nav a:focus-visible {
    color: #d92338 !important;
    padding-left: 6px;
    outline: none;
}

.dalton-drawer__nav li.active > a {
    color: #d92338 !important;
    padding-left: 14px;
}

.dalton-drawer__nav li.active > a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 22px;
    border-radius: 4px;
    background: #d92338;
    transform: translateY(-50%);
}

/* Sub menus (accordion) */
.dalton-drawer__nav .submenu {
    display: none;
    margin: 0 0 10px 4px;
    padding-left: 14px;
    border-left: 2px solid #fbd5da;
}

.dalton-drawer__nav li.is-expanded > .submenu {
    display: block;
}

.dalton-drawer__nav .submenu a {
    min-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
    color: #475569 !important;
    font-size: 15px;
    font-weight: 500;
}

.dalton-drawer__nav .dd-sub-toggle {
    position: absolute;
    top: 7px;
    right: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 13px;
    cursor: pointer;
}

.dalton-drawer__nav .submenu .dd-sub-toggle {
    top: 2px;
}

.dalton-drawer__nav .dd-sub-toggle i {
    transition: transform 0.25s ease;
}

.dalton-drawer__nav li.is-expanded > .dd-sub-toggle {
    background: #fdecee;
    color: #d92338;
}

.dalton-drawer__nav li.is-expanded > .dd-sub-toggle i {
    transform: rotate(180deg);
}

/* CTA */
.dalton-drawer__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 26px;
    padding: 15px 20px;
    border-radius: 100px;
    background: linear-gradient(135deg, #e8465f, #d92338);
    box-shadow: 0 10px 24px rgba(217, 35, 56, 0.25);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.dalton-drawer__cta:hover,
.dalton-drawer__cta:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(217, 35, 56, 0.32);
    color: #ffffff !important;
    outline: none;
}

/* Contact info */
.dalton-drawer__contact h6 {
    margin: 0 0 14px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.dalton-drawer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    color: #334155 !important;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    word-break: break-word;
}

.dalton-drawer__contact-item > span:last-child {
    padding-top: 7px;
}

a.dalton-drawer__contact-item:hover {
    color: #d92338 !important;
}

.dalton-drawer__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fdecee;
    color: #d92338;
    font-size: 14px;
}

/* Social */
.dalton-drawer__social {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid #eef2f6;
}

.dalton-drawer__social:empty {
    display: none;
}

.dalton-drawer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0f172a;
    color: #ffffff !important;
    font-size: 15px;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.dalton-drawer__social a:hover {
    background: #d92338;
    transform: translateY(-2px);
}

/* Never show the drawer on desktop, even if left open while resizing */
@media (min-width: 1200px) {
    .dalton-drawer,
    .dalton-drawer-overlay {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dalton-drawer,
    .dalton-drawer.is-open,
    .dalton-drawer-overlay,
    .dalton-nav-toggle__bars span {
        transition: none !important;
    }
}

/* ---------------------------------------------------------------------
   4. PAGE CONTENT ON SMALL SCREENS
   --------------------------------------------------------------------- */
/* Porto "appear" animations need Porto JS, which the site does not load:
   without this those blocks stay invisible (e.g. /case-studies). */
.appear-animation {
    opacity: 1 !important;
}

@media (max-width: 767.98px) {
    .contact-wrapper-inner .contact-map iframe {
        height: 340px;
    }

    /* Homepage hero (sizes are inline in sections/hero_homepage) */
    .hero-homepage {
        padding-top: 110px !important;
        padding-bottom: 90px !important;
    }

    .hero-homepage h1 {
        font-size: clamp(36px, 11vw, 52px) !important;
    }

    .hero-homepage p {
        font-size: 17px !important;
        margin-bottom: 28px !important;
    }
}

@media (max-width: 575.98px) {
    .section-padding {
        padding-top: 64px;
        padding-bottom: 64px;
    }

    /* Bootstrap .g-5 rows are wider than the phone container */
    .row.g-5,
    .row.gx-5 {
        --bs-gutter-x: 1.5rem;
    }

    /* Pills/badges with long text must wrap instead of running off-screen */
    .badge {
        max-width: 100%;
        white-space: normal;
        line-height: 1.4;
    }

    /* Blog cards: date + author on one line is too wide for phones */
    .post-meta-row {
        flex-wrap: wrap;
        justify-content: flex-start !important;
        row-gap: 6px;
        white-space: normal !important;
    }

    .contact-wrapper-inner .contact-box-items {
        padding: 32px 22px;
    }

    /* Contact page info boxes: less padding, smaller icon circle */
    .contact-info-box {
        padding: 16px 12px;
        gap: 16px;
    }

    .contact-info-box .icon {
        flex-shrink: 0;
        max-width: 60px;
        height: 60px;
        line-height: 60px;
        font-size: 20px;
    }

    /* Stack hero buttons full-width */
    .hero-homepage .btn {
        display: block;
        width: 100%;
        margin: 0 0 12px !important;
    }
}

/* ---------------------------------------------------------------------
   5. TEMPLATE FIXES (all screen sizes)
   --------------------------------------------------------------------- */
/* Neotix news cards expect TWO stacked pictures: the first one is hidden
   (transparent, blurred) and swapped in on hover. Our blog cards have one
   picture, so it only appeared while the mouse was over the card.
   Show a single picture normally, with a gentle zoom on hover. */
.news-card-items .news-image img:only-of-type {
    position: static;
    opacity: 1;
    filter: none;
    transform: none;
    transition: transform 0.5s ease;
}

.news-card-items:hover .news-image img:only-of-type {
    opacity: 1;
    filter: none;
    transform: scale(1.06);
}
