/* ===========================================================
   rorsjo overrides — applied after style.css/responsive.css
   Loaded last via <link> in app/layout.tsx so these rules win.
   =========================================================== */

/* ========== MOBILE HEADER + DRAWER =========================
   A custom, simple header that replaces the template's
   complex mobile markup on screens < 992px.  The desktop
   header (#header_main) is hidden on mobile via
   .desktop-only-header below.
   ========================================================== */

/* By default the new mobile components are hidden — the
   responsive block at the bottom enables them. */
.mobile-header,
.mobile-drawer {
    display: none;
}

@media (max-width: 991px) {
    .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 68px;
        padding: 0 20px;
        align-items: center;
        justify-content: space-between;
        background-color: rgba(250, 241, 227, 0.96);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 2px 14px rgba(45, 39, 35, 0.12);
        border-bottom: 1px solid rgba(45, 39, 35, 0.08);
        z-index: 1000;
    }

    .mobile-header-logo {
        display: flex;
        align-items: center;
        height: 100%;
    }

    .mobile-header-logo img {
        height: 44px;
        width: auto;
        object-fit: contain;
    }

    .mobile-header-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 38px;
        height: 38px;
        padding: 8px;
        background: transparent;
        border: 1px solid rgba(45, 39, 35, 0.25);
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease;
    }

    .mobile-header-toggle:hover,
    .mobile-header-toggle:focus-visible {
        background: rgba(45, 39, 35, 0.06);
        border-color: rgba(45, 39, 35, 0.4);
        outline: none;
    }

    .mobile-header-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background-color: #2d2723;
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.2s ease;
    }

    .mobile-header-toggle.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-header-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    .mobile-header-toggle.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Drawer ----------------------------------------------- */
    .mobile-drawer {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1100;
        pointer-events: none;
    }

    .mobile-drawer-overlay {
        position: absolute;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.55);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-drawer-panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 86vw);
        height: 100%;
        max-height: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        background-color: #FAF1E3;
        color: #2d2723;
        padding: 24px;
        display: flex;
        flex-direction: column;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
    }

    .mobile-drawer.open {
        pointer-events: auto;
    }

    .mobile-drawer.open .mobile-drawer-overlay {
        opacity: 1;
    }

    .mobile-drawer.open .mobile-drawer-panel {
        transform: translateX(0);
    }

    .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 18px;
        border-bottom: 1px solid rgba(45, 39, 35, 0.15);
        margin-bottom: 18px;
        flex-shrink: 0;
    }

    .mobile-drawer-logo img {
        height: 48px;
        width: auto;
        object-fit: contain;
    }

    .mobile-drawer-close {
        background: transparent;
        border: 1px solid rgba(45, 39, 35, 0.25);
        border-radius: 8px;
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #2d2723;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease;
    }

    .mobile-drawer-close:hover {
        background: rgba(45, 39, 35, 0.06);
        border-color: rgba(45, 39, 35, 0.4);
    }

    .mobile-drawer-nav {
        flex: 1;
    }

    .mobile-drawer-nav ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .mobile-drawer-nav a {
        display: block;
        padding: 11px 4px;
        font-family: 'Oswald', sans-serif;
        font-size: 16px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: #2d2723;
        border-bottom: 1px solid rgba(45, 39, 35, 0.08);
        transition: color 0.2s ease, padding-left 0.2s ease;
    }

    .mobile-drawer-nav a:hover,
    .mobile-drawer-nav a:active {
        color: #C3A27C;
        padding-left: 10px;
    }

    .mobile-drawer-footer {
        padding-top: 18px;
        margin-top: 18px;
        border-top: 1px solid rgba(45, 39, 35, 0.15);
        display: flex;
        flex-direction: column;
        gap: 14px;
        flex-shrink: 0;
    }

    .mobile-drawer-cta {
        display: block;
        text-align: center;
        padding: 14px 18px;
        background-color: #2d2723;
        color: #FAF1E3;
        font-family: 'Oswald', sans-serif;
        font-size: 14px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        border-radius: 8px;
        transition: background 0.2s ease, color 0.2s ease;
    }

    .mobile-drawer-cta:hover {
        background-color: #C3A27C;
        color: #2d2723;
    }

    .mobile-drawer-contact {
        display: flex;
        flex-direction: column;
        gap: 4px;
        text-align: center;
        font-family: 'DM Sans', sans-serif;
        font-size: 13px;
        color: #6b6259;
    }

    .mobile-drawer-contact a {
        color: #2d2723;
        font-weight: 600;
        font-size: 15px;
        letter-spacing: 0.4px;
    }

    .mobile-drawer-contact a:hover {
        color: #C3A27C;
    }

    /* Push the rest of the page below the fixed mobile header
       so the hero doesn't sit underneath it. */
    body {
        padding-top: 0;
    }
}


/* ========== DESKTOP-ONLY rules (>= 992px) ==================
   Everything in this block is positioning/sizing calibrated
   for a wide viewport.  Below 992px the template's own
   responsive.css already hides the main nav, stacks the
   layout, shrinks the logo, etc., so we don't want our rules
   to fight those.
   ========================================================== */
@media (min-width: 992px) {

    /* 1a. Nav alignment: anchor both navs absolutely to the
          page horizontal center, equidistant from the logo. */
    .header-inner-wrap {
        padding-left: 77px;
        padding-right: 77px;
        position: relative;
    }

    #site-logo {
        transform: translate(-73.5px, -84px) !important;
    }

    .main-nav.left,
    .main-nav.right {
        position: absolute;
        top: 0;
        bottom: 0;
        flex-grow: 0;
        padding: 0;
    }

    .main-nav.left {
        right: 50%;
        margin-right: 110px;
        justify-content: flex-end;
    }

    .main-nav.right {
        left: 50%;
        margin-left: 110px;
        justify-content: flex-start;
    }

    .header-right {
        position: absolute;
        right: 77px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* 1b. Logo image: shrink so it fits within the 147px
          circle without crowding the nav links. */
    #site-logo #logo_header,
    #site-logo .main-logo img {
        max-width: 95px;
        max-height: 95px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    /* Logo image inside the fixed circle: smaller cap so the
       circle fits inside the floating pill cleanly. */
    .header.is-fixed #site-logo #logo_header,
    .header.is-fixed #site-logo .main-logo img {
        max-width: 60px;
        max-height: 60px;
    }

    /* 1c. Fixed header dressing.
          When the header slides into view we want it to look
          like a floating pill: inset from the top edge, not
          full-bleed across the viewport.  We make
          .header-inner transparent and let .header-inner-wrap
          carry the dark background, with a max-width and
          horizontal margins so the bar floats centered. */
    .header.is-fixed .header-inner {
        background-color: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        top: 16px !important;
        margin-top: 16px;
    }

    .header.is-fixed.is-small .header-inner {
        top: 16px !important;
        margin-top: 0;
    }

    .header.is-fixed .header-inner-wrap {
        max-width: 1320px;
        margin-left: auto;
        margin-right: auto;
        background-color: rgba(20, 16, 12, 0.96);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
        border-radius: 14px;
    }

    /* The top contact bar is position:relative, so it scrolls
       away with the page. Hide it once the header is fixed
       so the slid-in bar is just the main row. */
    .header.is-fixed .header-top {
        display: none;
    }

    /* In the fixed/floating-pill state we shrink the circle
       to 88×88 and recenter it inside the pill (translate by
       half the circle on both axes from the wrap's center).
       The navlinks anchor to 50% of .header-inner-wrap with
       symmetric ±NAV_GAP margins, so they remain equidistant
       from the centered logo regardless of its size. */
    .header.is-fixed #site-logo {
        transform: translate(-44px, -50%) !important;
        top: 50% !important;
        width: 88px;
        height: 88px;
        padding: 0;
    }

    /* Tighten the navlink gap to match the smaller circle so
       the bar feels balanced.  Same value on both sides. */
    .header.is-fixed .main-nav.left {
        margin-right: 70px;
    }
    .header.is-fixed .main-nav.right {
        margin-left: 70px;
    }

    /* 3. Choose-us: the template's `.choose-us .image` is
          fixed width:740px but no height. rorsjo's photos are
          1024×1024, so without an explicit height the image
          renders ~1024px tall and pushes the box-infor. */
    .choose-us .right .image > img.w-full,
    .choose-us .right .image > img {
        width: 100%;
        height: 720px;
        object-fit: cover;
        border-radius: 10px;
    }

    /* 4. Catering / private-event: rein in the two collage
          photos. Template originals ~270×360; rorsjo's are
          1024² squares. */
    .private-event .image .img-1,
    .private-event .image .img-2 {
        width: 280px;
        height: 380px;
        object-fit: cover;
    }

    /* 5. Coffee-post grid: cap image heights so 1024² photos
          don't dominate. Center-grid items shorter, side items
          taller (template parity).  Use object-fit: contain so
          rorsjo product PNGs (which have transparent edges /
          framing) aren't cropped. */
    .coffee-post-item .image img {
        width: 100%;
        object-fit: contain;
        display: block;
    }

    .wg-coffee-post .center .coffee-post-item .image img,
    .wg-coffee-post .center .coffee-post-item:last-child .image img {
        height: 270px;
    }

    .wg-coffee-post .left .coffee-post-item .image img,
    .wg-coffee-post .right .coffee-post-item .image img {
        height: 540px;
    }

    /* 6. wg-about hero image */
    .wg-about .wrap > .image > img {
        width: 100%;
        max-width: 720px;
        height: 640px;
        object-fit: cover;
    }

    /* 7. Services cards: constrain the 1024² squares. */
    .wg-service .service-item > img {
        width: 100%;
        height: 320px;
        object-fit: cover;
    }

    /* 8. Special-menu: template's avatar circle is 75px which
          looks tiny next to our square product PNGs.  Bump it
          to ~140px and keep the circle crop. */
    .special-menu-item .image {
        width: 140px;
        min-width: 140px;
        height: 140px;
    }

    .special-menu-item .image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* ========== ALWAYS-ON rules (all breakpoints) ==============
   Rules that should apply on both desktop and mobile.
   ========================================================== */

/* 2. Phone number white in the top bar. */
.header-top .wg-information.call .content p,
.header-top .wg-information.call .content p a {
    color: #FFF;
}
.header-top .wg-information.call .content p a:hover {
    color: #C3A27C;
}

/* 2a-bg. Replace the low-res bg-about.png (1920×662, ~20KB,
       heavily compressed) with a procedural SVG so the torn-paper
       edge stays crisp at any viewport width / pixel density. */
.choose-us {
    background-image: url(../images/box-item/bg-about.svg) !important;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 100% auto;
}

/* On narrow screens the SVG would be horizontally squashed,
   which exaggerates the torn-edge waves. Force it to render at
   a fixed minimum width (wider than the viewport) so the
   aspect ratio — and the noise frequency — stays consistent. */
@media (max-width: 991px) {
    .choose-us {
        background-size: 1600px auto !important;
        background-position: center center !important;
    }
}

/* 2b. Hide the choose-us decorative corner blocks.
       The template references item-1.png (707×309, bottom-right)
       and item-2.png (217×238, bottom-left) via ::after / ::before
       on .choose-us — but those PNGs are flat solid grey
       rectangles in the bundle, so they read as random grey
       blocks below the torn-paper background. */
.choose-us::before,
.choose-us::after {
    display: none !important;
    content: none !important;
}

/* 2c. Hide the wg-coffee-time .center decorative ornament
       (coffee-time-1.png, anchored bottom-center, translated
       60% below the panel). */
.wg-coffee-time .center::after {
    display: none !important;
    content: none !important;
}

/* 2d. wg-about: force z-index 0 so its background / decorative
       layers don't sit above neighboring sections. */
.wg-about {
    z-index: 0;
    position: relative;
}

/* 2e. Footer link color: the global reset sets `a { color:
       #051028 }` (near-black), so the tel:/mailto: links in
       the footer's contact column render black on the dark
       brown background. Force them to inherit the surrounding
       light grey text color. */
.footer .contact .text a,
.footer .contact a,
.footer .text a {
    color: #dedede;
}
.footer .contact .text a:hover,
.footer .contact a:hover,
.footer .text a:hover {
    color: #C3A27C;
}

/* 2f. Footer logo: shrink so it doesn't dominate the column. */
.footer .logo-footer img,
.footer #logo_footer {
    max-width: 130px;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* ========== MOBILE rules (< 992px) =========================
   The template's responsive.css does most of the heavy lifting
   at 991/820/768/700px.  These are fixes for things our own
   components introduced that the template couldn't anticipate.
   ========================================================== */
@media (max-width: 991px) {

    /* Hide the desktop header markup entirely on mobile —
       the custom .mobile-header below takes over. */
    #header_main.desktop-only-header {
        display: none !important;
    }

    /* The 1024² rorsjo images look fine stacked on mobile at
       their natural ratio, but we still want max-heights so
       they never dominate the viewport. */
    .wg-service .service-item > img,
    .wg-about .wrap > .image > img,
    .choose-us .right .image > img {
        width: 100%;
        height: auto;
        max-height: 420px;
        object-fit: cover;
    }

    .coffee-post-item .image img {
        width: 100%;
        height: auto;
        max-height: 320px;
        object-fit: contain;
        display: block;
    }

    /* Private-event collage: template already flex-wraps the
       .image at max-width:991, just make sure our 1024² jpgs
       don't blow out. */
    .private-event .image .img-1,
    .private-event .image .img-2 {
        width: 100%;
        max-width: 300px;
        height: auto;
        max-height: 360px;
        object-fit: cover;
    }

    /* Special-menu: bigger avatar on mobile too. */
    .special-menu-item .image {
        width: 110px;
        min-width: 110px;
        height: 110px;
    }
    .special-menu-item .image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* ---- Hero (HeroSwiper) mobile fixes ---- */
@media (max-width: 991px) {
    /* Shrink hero text on mobile */
    .page-title-home .page-title .sub-title {
        font-size: 28px;
        line-height: 38px;
    }
    .page-title-home .page-title .title,
    .page-title .content .title {
        font-size: 32px !important;
        line-height: 40px !important;
        letter-spacing: 1px;
    }
    .page-title-home .page-title .text {
        font-size: 14px;
        line-height: 22px;
        padding: 0 16px;
        margin-bottom: 28px;
    }
    .page-title-home .page-title .buttons .button-style-2 {
        padding: 10px 16px;
        font-size: 12px;
    }
    .page-title {
        padding-top: 140px;
        padding-bottom: 140px;
    }

    /* Overlay must cover the entire hero/video area on mobile.
       Add a dedicated overlay on the home wrapper that always
       spans the full height regardless of inner content. */
    .page-title-home {
        position: relative;
        overflow: hidden;
    }
    .page-title-home > .hero-bg-video {
        z-index: 0 !important;
    }
    .page-title-home::before {
        content: '';
        position: absolute;
        inset: 0;
        background-color: rgba(18, 15, 12, 0.55);
        z-index: 1;
        pointer-events: none;
    }
    /* Hide the per-slide overlay so we don't double-darken */
    .page-title-home .page-title::before {
        display: none;
    }
    .page-title-home .swiper-container {
        z-index: 2 !important;
    }
}

/* ---- About heading mobile size ---- */
@media (max-width: 991px) {
    .wg-about .heading-section .main,
    .heading-section .main {
        font-size: 28px;
        line-height: 36px;
        letter-spacing: 0.6px;
    }
    .heading-section .sub-after::after {
        display: none;
    }
}

/* ---- Services cards: always show "hovered" state on mobile ---- */
@media (max-width: 991px) {
    .wg-service .service-item::after {
        opacity: 1 !important;
        visibility: visible !important;
    }
    .wg-service .service-item::before {
        backdrop-filter: blur(2px);
        background-color: rgba(18, 15, 12, 0.65) !important;
    }
    .wg-service .service-item .content {
        bottom: 50% !important;
        transform: translateY(50%) !important;
        padding-bottom: 0 !important;
    }
    .wg-service .service-item .content .title span {
        opacity: 1 !important;
        visibility: visible !important;
    }
    .wg-service .service-item .content p {
        opacity: 1 !important;
        visibility: visible !important;
        margin-top: 17px !important;
    }
}

/* ---- SpecialMenu: dedicated mobile layout ---------------------
   Image on the left, name + price on one row to the right,
   description below — image and content all on one line. */
@media (max-width: 991px) {
    .special-menu .row > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .special-menu-item {
        padding: 0 12px;
        gap: 14px;
        margin-bottom: 22px;
        flex-wrap: nowrap;
        align-items: center;
    }

    .special-menu-item .image {
        width: 84px;
        min-width: 84px;
        height: 84px;
        border-radius: 50%;
        overflow: hidden;
        flex-shrink: 0;
    }
    .special-menu-item .image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .special-menu-item .content {
        flex: 1 1 auto;
        min-width: 0;
        padding-top: 0;
    }

    .special-menu-item .content > .flex {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .special-menu-item .content .name {
        font-size: 16px;
        line-height: 22px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-shrink: 1;
        min-width: 0;
    }
    .special-menu-item .content .name a {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: inline-block;
        max-width: 100%;
    }

    .special-menu-item .content .line {
        flex: 1 1 auto;
        min-width: 12px;
        margin-left: 6px;
        margin-right: 6px;
    }

    .special-menu-item .content .price {
        font-size: 16px;
        line-height: 22px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .special-menu-item .content p {
        font-size: 13px;
        line-height: 19px;
        margin-top: 4px;
    }
}

@media (max-width: 700px) {
    /* At the smallest breakpoint the template hides the top
       bar (.header-top) entirely, which is fine — that frees
       up space and keeps the header minimal. We just need our
       Beställ-online button compact. */
    .header .header-right .button-style-2 {
        padding: 8px 12px;
        font-size: 11px;
    }

    /* Special-menu cards stack the image above the text at
       the template's own break. Our 1024² rorsjo product PNGs
       are fine at the template's 75px avatar circle. Nothing
       to do here. */

    /* Coffee-post grid: shorter caps on the smallest screens. */
    .coffee-post-item .image img {
        max-height: 260px;
    }

    /* wg-coffee-time map should still be tall enough to be
       usable on a phone. */
    .wg-coffee-time .right iframe {
        min-height: 300px;
    }
}
