/* ==========================================================================
   Ver 1.3
   OPRANIC — Front page (home hero + news flash bar + hero-rubrik)
   --------------------------------------------------------------------------
   Laddas via opranic_conditional_styles() i functions.php på front page
   för aktivt språk (WPML-aware via opranic_is_localized_home()).

   Innehåll:
     1. Home hero (.opr-home-hero + sub-element)
     2. News flash bar (.opr-news-flash-wrap + sub-element)
     3. Hero-rubrik (.opr-home-hero__title)

   v2.5.1 (2026-04-30): News-flash refactor.
   - Kräver wrapper .opr-news-flash-wrap i Raw HTML (lades tillbaka).
   - Bredd-fixet flyttat från vc_custom_1776164574819 till .opr-news-flash-wrap.
   - Tar bort sköra beroendet till WPBakery-genererade klasser.

   OBS: Hero-rubrik-blocket finns även i opr-guides.css med selektorn
   .opr-guides-hero__title. Att duplicera är accepterat eftersom filerna
   laddas på OLIKA sidor (home vs guides) - ingen extra payload på samma
   sidvisning.
   ========================================================================== */

/* ==========================================================================
   1. HOME HERO — opr-home-hero
   ========================================================================== */

.opr-home-hero {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    border-radius: 2px;
}

.opr-home-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    z-index: 0;
}

/* Diagonal mörk overlay vänster */
.opr-home-hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 5, 0.55);
    clip-path: polygon(0 0, 46% 0, 35% 100%, 0 100%);
    z-index: 1;
}

/* Textblock */
.opr-home-hero__text {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    padding: 0 52px;
    max-width: 480px;
}

/* Overline */
.opr-home-hero__overline {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #EE9305;
    margin: 0 0 10px 0;
}

/* Orange accentlinje */
.opr-home-hero__accent {
    width: 48px;
    height: 3px;
    background: #EE9305;
    margin: 14px 0 16px;
}

/* Tagline */
.opr-home-hero__sub {
    font-family: Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: clamp(14px, 1.2vw, 18px);
    color: rgba(255, 255, 255, 0.82);
    margin: 0;
    line-height: 1.4;
}

/* Tablet */
@media (max-width: 1024px) {
    .opr-home-hero {
        height: 360px;
    }
    .opr-home-hero__overlay {
        clip-path: polygon(0 0, 54% 0, 38% 100%, 0 100%);
    }
    .opr-home-hero__text {
        padding: 0 36px;
    }
}

/* Mobil */
@media (max-width: 768px) {
    .opr-home-hero {
        height: 240px;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        width: 100vw !important;
        max-width: 100vw !important;
        border-radius: 0 !important;
    }
    .opr-home-hero__overlay {
        clip-path: polygon(0 0, 58% 0, 40% 100%, 0 100%);
    }
    .opr-home-hero__text {
        padding: 0 20px;
        max-width: 65%;
    }
    .opr-home-hero__overline {
        font-size: 9px;
        letter-spacing: 2px;
        margin-bottom: 6px;
    }
    .opr-home-hero__accent {
        width: 28px;
        height: 2px;
        margin: 8px 0 10px;
    }
    .opr-home-hero__sub {
        font-size: 12px;
    }
}

/* ==========================================================================
   2. NEWS FLASH BAR — opr-news-flash
   --------------------------------------------------------------------------
   Struktur (kräver i Raw HTML):
     <div class="opr-news-flash-wrap">
       <div class="opr-news-flash-row">
         <div class="opr-news-flash">...</div>
         <div class="opr-news-flash">...</div>
       </div>
     </div>
   ========================================================================== */

/* Wrapper: bryter ut ur WPBakery-container, full bredd inom innehållsytan */
.opr-news-flash-wrap {
    width: 100%;
    margin-top: 15px;
    margin-bottom: 0;
    background: transparent;
}

/* Desktop: matcha hero/products bredd (bryter WPBakery padding) */
@media (min-width: 768px) {
    .opr-news-flash-wrap {
        margin-left: -15px;
        margin-right: -15px;
        width: calc(100% + 30px);
        max-width: calc(100% + 30px);
    }
}

.opr-news-flash-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #ffffff;
    gap: 12px;
}

.opr-news-flash {
    background: #0F0F0F;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0;
    width: 100%;
    overflow: hidden;
    border: none;
    box-sizing: border-box;
}

.opr-news-flash__badge {
    background: #EE9305;
    color: #0F0F0F;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0 18px;
    height: 48px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.opr-news-flash__divider {
    width: 1px;
    height: 16px;
    background: #333;
    margin: 0 18px;
    flex-shrink: 0;
}

.opr-news-flash__text {
    font-size: 14px;
    color: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.opr-news-flash__text strong {
    color: #fff;
    font-weight: 500;
}

.opr-news-flash__link {
    font-size: 13px;
    font-weight: 500;
    color: #EE9305;
    text-decoration: none;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
    border-bottom: none;
    padding-right: 20px;
}

.opr-news-flash__link:hover {
    color: #EE9305;
}

/* Mobil: stapla, full viewport-bredd */
@media (max-width: 768px) {
    .opr-news-flash-wrap {
        margin-top: 0;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        width: 100vw;
        max-width: 100vw;
    }
    .opr-news-flash-row {
        grid-template-columns: 1fr;
        gap: 6px;
        background: #ffffff;
    }
    .opr-news-flash {
        min-height: 44px;
    }
    .opr-news-flash__badge {
        padding: 0 12px;
        font-size: 10px;
        height: 44px;
    }
    .opr-news-flash__divider {
        margin: 0 12px;
    }
    .opr-news-flash__text {
        font-size: 11px;
    }
    .opr-news-flash__link {
        padding-right: 14px;
    }
}

/* ==========================================================================
   3. HERO-RUBRIK
   --------------------------------------------------------------------------
   Strategi: word-break:keep-all tvingar långa ord ("INFRAVÄRMARE",
   "STROMVERBRAUCH", "TERRASVERWARMERS") att aldrig brytas mitt i ordet.
   Max-font anpassad (32px) så att även de längsta orden får plats
   på en rad i container-bredden.
   ========================================================================== */

.opr-home-hero__title {
    font-size: clamp(20px, 2vw, 32px);
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
    white-space: normal;
}

@media (max-width: 1024px) {
    .opr-home-hero__title {
        font-size: clamp(18px, 2.6vw, 26px);
        letter-spacing: 0.06em;
    }
}

@media (max-width: 768px) {
    .opr-home-hero__title {
        font-size: clamp(14px, 4.5vw, 20px);
        letter-spacing: 0.05em;
    }
}
/* ==========================================================================
   News-flash full bredd: matchar hero exakt
   --------------------------------------------------------------------------
   Använder :has() för att target:a den vc_row som innehåller news-flash-wrap.
   Nollställer WPBakery's container-restriktion så raden fyller hela hero-bredden.
   ========================================================================== */
@media (min-width: 768px) {
    .vc_row:has(> .wpb_column > .vc_column-inner > .wpb_wrapper > .wpb_raw_code .opr-news-flash-wrap),
    .vc_row:has(.opr-news-flash-wrap) {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* === SLUT på home page CSS =============================================== */