/*
Theme Name: Extend 2020 Child
Theme URI: https://extend.no/
Description: Child theme for Extend 2020 with a modern, responsive header and demo CTA.
Author: Confirma Central Marketing
Template: extend2020
Version: 1.2.0
Text Domain: extend2020-child
*/

/* Parent theme styles are loaded explicitly in header.php before this file. */

/* =========================================================
   EXTEND MODERN HEADER
   Everything is scoped to x-header/x-mobile so the old
   theme header CSS cannot interfere with the new layout.
   ========================================================= */

.x-header,
.x-header *,
.x-mobile,
.x-mobile * {
    box-sizing: border-box;
}

.x-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: #fff;
    border-top: 1px solid #1f2528;
    font-family: 'Open Sans', sans-serif;
    box-shadow: 0 0 0 rgba(0,0,0,0);
    transition: box-shadow .22s ease;
}

.x-header.x-header--scrolled {
    box-shadow: 0 4px 18px rgba(0,0,0,.12);
}

.x-header__container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
}

.x-header__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
    min-height: 104px;
    transition: min-height .22s ease;
}

.x-header__logo {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
}

.x-header__logo img {
    display: block;
    width: auto;
    height: 58px;
    max-width: none;
    transition: height .22s ease;
}

/* ---------------- Desktop navigation ---------------- */
.x-header__nav {
    min-width: 0;
}

.x-header__menu,
.x-header__menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.x-header__menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0;
}

.x-header__menu > li {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    line-height: normal;
    white-space: nowrap;
}

.x-header__menu > li > a {
    display: flex;
    align-items: center;
    min-height: 104px;
    padding: 0 13px;
    color: #111;
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: min-height .22s ease, font-size .22s ease;
}

.x-header__menu > li:first-child > a {
    padding-left: 0;
}

.x-header__menu > li > a:hover,
.x-header__menu > li.current-menu-item > a,
.x-header__menu > li.current-menu-ancestor > a {
    color: #d52023;
    text-decoration: none;
}

.x-header__menu > .menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 6px;
    margin-left: 8px;
    background: url('../extend2020/images/dropdown.svg') no-repeat 50% 50%;
    background-size: contain;
    transition: transform .15s ease;
}

.x-header__menu > .menu-item-has-children:hover > a::after,
.x-header__menu > .x-submenu-open > a::after {
    transform: rotate(180deg);
}

.x-header__menu .sub-menu {
    display: none;
    position: absolute;
    top: calc(100% - 12px);
    left: 0;
    z-index: 1100;
    min-width: 250px;
    padding: 10px 0;
    background: #d52023;
    box-shadow: 0 8px 20px rgba(0,0,0,.14);
}

.x-header__menu > li:hover > .sub-menu,
.x-header__menu > li.x-submenu-open > .sub-menu {
    display: block;
}

.x-header__menu .sub-menu li {
    margin: 0;
    padding: 0;
}

.x-header__menu .sub-menu a {
    display: block;
    padding: 8px 20px;
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.35;
    text-decoration: none;
    white-space: nowrap;
}

.x-header__menu .sub-menu a:hover,
.x-header__menu .sub-menu .current-menu-item > a {
    background: rgba(0,0,0,.10);
    color: #fff;
    text-decoration: none;
}

/* Hide the old menu-based CTA: CTA is rendered separately at the right. */
.x-header__menu .menu-demo-button,
.x-mobile__menu .menu-demo-button {
    display: none !important;
}

/* ---------------- Search / language / CTA ---------------- */
.x-header__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex: 0 0 auto;
    white-space: nowrap;
}

.x-header__search {
    position: relative;
    display: flex;
    align-items: center;
    width: 144px;
    margin: 0;
}

.x-header__search input[type='search'] {
    display: block;
    width: 100%;
    height: 36px;
    margin: 0;
    padding: 4px 0 5px;
    border: 0;
    border-bottom: 1px solid #aaa;
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: #222;
    font-family: 'Open Sans', sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.2;
    -webkit-appearance: none;
}

.x-header__search input[type='search']:focus {
    border-bottom-color: #d52023;
}

.x-header__search button {
    display: none;
}

.x-header__language {
    display: flex;
    align-items: center;
    gap: 3px;
    color: #8d8d8d;
    font-family: 'Open Sans', sans-serif;
    font-size: 17px;
    line-height: 1;
    white-space: nowrap;
}

.x-header__language .langselector {
    color: #8d8d8d;
    text-transform: uppercase;
}

.x-header__language a.langselector {
    color: #111;
    text-decoration: none;
}

.x-header__language a.langselector:hover {
    color: #d52023;
}

.x-header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 15px;
    border-radius: 4px;
    background: #e63232;
    color: #fff !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background-color .18s ease, transform .18s ease;
}

.x-header__cta:hover,
.x-header__cta:focus {
    background: #c92525;
    color: #fff !important;
    text-decoration: none !important;
}

/* ---------------- Sticky compact state ---------------- */
@media (min-width: 1200px) {
    .x-header.x-header--scrolled .x-header__inner {
        min-height: 76px;
    }

    .x-header.x-header--scrolled .x-header__logo img {
        height: 46px;
    }

    .x-header.x-header--scrolled .x-header__menu > li > a {
        min-height: 76px;
        font-size: 17px;
    }

    .x-header.x-header--scrolled .x-header__search {
        width: 122px;
    }

    .x-header.x-header--scrolled .x-header__cta {
        min-height: 34px;
        padding: 7px 13px;
        font-size: 15px;
    }

    .x-header.x-header--scrolled .x-header__menu .sub-menu {
        top: calc(100% - 8px);
    }
}

/* ---------------- Mobile toggle ---------------- */
.x-header__toggle {
    display: none;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.x-header__toggle-lines,
.x-header__toggle-lines span {
    display: block;
}

.x-header__toggle-lines span {
    width: 24px;
    height: 2px;
    margin: 5px 0;
    background: #111;
    transition: transform .18s ease, opacity .18s ease;
}

.x-header__toggle[aria-expanded='true'] .x-header__toggle-lines span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.x-header__toggle[aria-expanded='true'] .x-header__toggle-lines span:nth-child(2) {
    opacity: 0;
}

.x-header__toggle[aria-expanded='true'] .x-header__toggle-lines span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------------- Mobile panel ---------------- */
.x-mobile {
    background: #d52023;
    color: #fff;
    border-top: 1px solid rgba(255,255,255,.2);
}

.x-mobile[hidden] {
    display: none !important;
}

.x-mobile__inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 22px 24px 28px;
}

.x-mobile__top {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
}

.x-mobile__search {
    flex: 1 1 auto;
    margin: 0;
}

.x-mobile__search input {
    display: block;
    width: 100%;
    height: 40px;
    margin: 0;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.65);
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 17px;
}

.x-mobile__search input::placeholder {
    color: rgba(255,255,255,.8);
}

.x-mobile__language {
    flex: 0 0 auto;
    color: rgba(255,255,255,.65);
    font-size: 16px;
    white-space: nowrap;
}

.x-mobile__language .langselector {
    color: rgba(255,255,255,.65);
}

.x-mobile__language a.langselector {
    color: #fff;
    text-decoration: none;
}

.x-mobile__menu,
.x-mobile__menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.x-mobile__menu > li {
    border-top: 1px solid rgba(255,255,255,.22);
}

.x-mobile__menu > li:last-child {
    border-bottom: 1px solid rgba(255,255,255,.22);
}

.x-mobile__menu a {
    display: block;
    padding: 13px 2px;
    color: #fff;
    font-family: 'Open Sans', sans-serif;
    font-size: 18px;
    line-height: 1.25;
    text-decoration: none;
}

.x-mobile__menu > .menu-item-has-children > a {
    position: relative;
    padding-right: 32px;
}

.x-mobile__menu > .menu-item-has-children > a::after {
    content: '+';
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    font-weight: 400;
}

.x-mobile__menu > .x-submenu-open > a::after {
    content: '\2212';
}

.x-mobile__menu .sub-menu {
    display: none;
    padding: 0 0 10px 16px;
}

.x-mobile__menu .x-submenu-open > .sub-menu {
    display: block;
}

.x-mobile__menu .sub-menu a {
    padding: 8px 2px;
    font-size: 15px;
    color: rgba(255,255,255,.9);
}

.x-mobile__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    margin-top: 20px;
    padding: 10px 16px;
    border-radius: 4px;
    background: #fff;
    color: #d52023 !important;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none !important;
}

body.x-menu-open {
    overflow: hidden;
}

/* =========================================================
   RESPONSIVE
   Switch cleanly to mobile before the desktop items have
   any chance to wrap onto a second line.
   ========================================================= */

.x-header__search,
.x-header__cta {
    transition: width .22s ease, min-height .22s ease, padding .22s ease, font-size .22s ease;
}

@media (max-width: 1199px) {
    .x-header__container {
        padding-left: 22px;
        padding-right: 22px;
    }

    .x-header__inner {
        grid-template-columns: auto 1fr auto;
        min-height: 82px;
    }

    .x-header__logo img {
        height: 52px;
    }

    .x-header__nav,
    .x-header__tools {
        display: none !important;
    }

    .x-header__toggle {
        display: block;
        justify-self: end;
    }

    .x-header.x-header--scrolled .x-header__inner {
        min-height: 68px;
    }

    .x-header.x-header--scrolled .x-header__logo img {
        height: 44px;
    }
}

@media (min-width: 1200px) and (max-width: 1320px) {
    .x-header__container {
        padding-left: 22px;
        padding-right: 22px;
    }

    .x-header__inner {
        gap: 20px;
    }

    .x-header__logo img {
        height: 54px;
    }

    .x-header__menu > li > a {
        padding-left: 9px;
        padding-right: 9px;
        font-size: 16px;
    }

    .x-header__tools {
        gap: 12px;
    }

    .x-header__search {
        width: 105px;
    }

    .x-header__search input[type='search'],
    .x-header__language {
        font-size: 15px;
    }

    .x-header__cta {
        padding-left: 11px;
        padding-right: 11px;
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .x-header__container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .x-header__logo img {
        height: 46px;
    }

    .x-mobile__inner {
        padding-left: 18px;
        padding-right: 18px;
    }

    .x-mobile__top {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }
}
