/*
 Theme Name:     Divi Child
 Theme URI:      https://www.elegantthemes.com/gallery/divi/
 Description:    Divi Child Theme
 Author:         FÆRD
 Author URI:     https://xn--frd-yla.no/
 Template:       Divi
 Version:        1.0.0
*/

/* FONTS & FONT NOTES
==================== */

/*  Font-sizes Desktop Tablet Mobile
    Body:   24px X 18px;    Theme Customizer
    H1:     44px X X;       Text Module Global Defaults
    H2:     40px X 30px;    Text Module Global Defaults

 *  Explanation
    H1
        Kjøpe og Kontakt headers are 44px
    H2
        Map header on contact is 34px
        Call-to-action headers are 38px on Selge
        Text bubble on Selge is 40px
        Footer slogan is 42px
*/

/*  Line-height
    Body: 1.6; Child Theme CSS
    H1, H2: 1em; Divi CSS
*/

@font-face {
    font-family: 'Apex New';
    src: url('fonts/apexnew/ApexNew-Book.woff2') format('woff2'),
         url('fonts/apexnew/ApexNew-Book.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}
@font-face {
    font-family: 'Apex New';
    src: url('fonts/apexnew/ApexNew-Medium.woff2') format('woff2'),
         url('fonts/apexnew/ApexNew-Medium.woff') format('woff');
    font-weight: 600; /* Divi's "Semi-Bold" is 600, it's not possible to select 500 */
    font-style: normal;
}

@font-face {
    font-family: 'Apex New';
    src: url('fonts/apexnew/ApexNew-Bold.woff2') format('woff2'),
         url('fonts/apexnew/ApexNew-Bold.woff') format('woff');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Apex New';
    src: url('fonts/apexnew/ApexNew-Medium.woff2') format('woff2'),
         url('fonts/apexnew/ApexNew-Medium.woff') format('woff');
    font-weight: 500; /* Divi's "Semi-Bold" is 600, it's not possible to select 500 */
    font-style: normal;
}
@font-face {
    font-family: 'ApexNew-Medium';
    src: url('fonts/apexnew/ApexNew-Medium.woff2') format('woff2'),
         url('fonts/apexnew/ApexNew-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
}

body
{
    font-family: 'Apex New', 'Open Sans', sans-serif;
    font-weight: 400; /* Divi sets this to 500 in its style.css, who knows why */
    line-height: 1.6; /* https://developer.mozilla.org/en-US/docs/Web/CSS/line-height#Prefer_unitless_numbers_for_line-height_values */
}

h1, h2, h3, h4, h5, h6
{
    line-height: 1.4;
}

.entry-content ul
{
    line-height: 1.6; /* Divi sets this to 26px in its style.css, ¯\_(ツ)_/¯ */
}

/* =Theme customization starts here
------------------------------------------------------- */

/* TABLE OF CONTENTS

    CSS VARIABLES
    CUSTOM UTILITY CLASSES
    HEADER
    HOMEPAGE
    SELGE
    KJØPE
    KONTAKT
    OM OSS
    FOOTER
    DIVI TWEAKS
*/

/* CSS VARIABLES
==================== */

:root
{
    --easy-yellow: #F8B029;
    --text-gray: #5D5D5D;
}

/* Row gutters
------------------------------ */

:root
{
    --row-gutter: 55px;
}

@media all and ( max-width: 767px )
{
    :root
    {
        --row-gutter: 35px;
    }
}

/* CUSTOM UTILITY CLASSES
==================== */

.text-transform-uppercase
{
    text-transform: uppercase;
}

.align-bottom /* apply to COLUMNS */
{ /* used, for example, on equal-height columns containing buttons to push the button to the bottom */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.row-align-vertical-center /* apply to ROWS */
{ /* vertically centers column content */
    align-items: center;
}

.inline-buttons .et_pb_button_module_wrapper /* apply to containers (usually ROWS or COLUMNS) */
{
    display: inline-block;
}

.screen-reader-only
{
    position: absolute;
    left: -10000px;
    top: auto;

    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Google Maps embed

Apply to code block
------------------------------ */

.google-maps-embed iframe
{
    display: block;
}

@media all and ( min-width: 981px )
{
    .et_pb_equal_columns .google-maps-embed, .et_pb_equal_columns .google-maps-embed .et_pb_code_inner, .et_pb_equal_columns .google-maps-embed iframe
    {
        height: 100%;
    }
}

@media all and ( max-width: 980px )
{
    .google-maps-embed iframe
    {
        width: 100%;
    }
}

/* Custom order on mobile

Apply .custom-order to ROWS
Apply .nth-on-mobile to COLUMNS
------------------------------ */
@media all and ( max-width: 980px )
{
    .custom-order
    {
        display: flex;
        flex-wrap: wrap;
    }

    .first-on-mobile
    {
        -webkit-order: 1;
        order: 1;
    }

    .second-on-mobile
    {
        -webkit-order: 2;
        order: 2;
    }

    .custom-order .et_pb_column_1_2.second-on-mobile
    {
        margin-bottom: 0;
    }

    .custom-order .et_pb_column:last-child
    {
        margin-bottom: 30px;
    }
}

/* Image load animation

Apply .image-load-animation to IMAGE MODULE
------------------------------ */

.image-load-animation img {
	width: 20em !important;
}

.image-load-animation {
	position: relative;
	overflow: hidden;
	width: max-content;
}

.image-load-animation:after{
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	background-color: #f8b029;
	position: absolute;
	top: 0;
	left: 0;
	transition: 1s ease;
  }

@keyframes overlay {
	0% {
		transform: translateY(0%);
	}

	100% {
		transform: translateY(-100%);
	}
}

@keyframes shutter-zoom {
	0% {
		transform: scale(1.4);
	}

	100% {
		transform: scale(1);
	}
}

.image-load-animation img {
	visibility: hidden;
}

.image-load-animation.loading-animation img {
	visibility: visible;
}


.loading-animation.image-load-animation:after {
	animation: ease-in-out overlay 1s forwards;
}


.loading-animation img {
	object-fit: cover;
	object-position: bottom;
	width: max-content;
	animation: ease-in-out forwards shutter-zoom;
	animation-duration: var(--image-load-animation-duration, 1s);
}

/* HEADER
==================== */

header .et_pb_menu
{
    --menu-color: var( --easy-yellow );
}

/* Change colors for the homepage, .white-menu is a class applied in Divi builder */
header .et_pb_menu.white-menu
{
    --menu-color: white;
}

/* Logo sizing
------------------------------ */

@media all and (max-width: 980px)
{
    header .et_pb_menu__logo img
    {
        max-height: 65px;
    }
}

/* Lines between menu items
------------------------------ */

header .et_pb_menu ul.et-menu > li
{
    border-right: 1px solid var( --menu-color );
    padding: 0 40px;
}

header .et_pb_menu ul.et-menu > li:last-child
{
    border-right: none;
}

/* Animated underline
------------------------------ */

header .et_pb_menu ul.et-menu li a
{
    opacity: initial; /* Prevent Divi from decreasing opacity on hover */

    background: linear-gradient( var( --menu-color ), var( --menu-color ) ) left bottom -10px/0px 3px no-repeat;
    background-origin: content-box;

    transition: background-size 100ms;
}

header .et_pb_menu.white-menu ul.et-menu li a
{
    color: var( --menu-color ); /* When the menu text is set to "Light" Divi uses rgba() to decrease the opacity, so the above doesn't prevent it */
}

header .et_pb_menu ul.et-menu li.current-menu-item a, header .et_pb_menu ul.et-menu li a:hover, header .et_pb_menu ul.et-menu li a:focus
{
    background-size: 100% 3px;
}

/* Mobile dropdown menu
------------------------------ */

header .et_pb_menu.white-menu ul.et_mobile_menu li a
{
    color: var( --easy-yellow );
}

/* HOMEPAGE
==================== */

/* We're no longer trying to get the section to fit the height of the screen, because with padding under the picture it's already tall enough
#main-content #fill-screen
{
    margin-top: -208px;
    padding-top: 208px;
}
*/

@media all and (min-width: 480px)
{
    body.home .inline-buttons .et_pb_button_1_wrapper
    {
        margin-left: 70px;
    }
}

@media all and (max-width: 479px)
{
    body.home .inline-buttons .et_pb_button_1_wrapper
    {
        float: right;
    }
}

body.home h1
{
    padding-bottom: 0; /* remove Divi's default 10px bottom padding since this isn't body text */
}

body.home footer .et_pb_section
{
    background-color: white !important; /* thanks, Divi */
}

/* "KJØPE" PAGE
==================== */

#iframe-container iframe
{
    display: block; /* prevent strange space under underline elements */
    margin: 0 auto;
    width: 100%;
}

@media all and (min-width: 768px) and (max-width: 1250px) /* non-fullwidth when the app will be less than 1000px, but not on mobile */
{
    #iframe-container
    {
        max-width: 1200px;
        width: 80%;
        margin: 0 auto;
    }
}

/* "SELGE" PAGE
==================== */

body.page-id-126 .larger-text h1
{
    font-size: 64px;
}

body.page-id-126 .larger-text p
{
    font-size: 36px;
    line-height: 1.4;
}

@media all and ( max-width: 767px )
{
    body.page-id-126 .larger-text h1
    {
        font-size: 46px;
    }

    body.page-id-126 .larger-text p
    {
        font-size: 24px;
    }

    body.page-id-126 .larger-text
    {
        width: 100%;
    }
}

/* Kim likte ikke text-align: justify;
@media all and ( max-width: 479px )
{
    body.page-id-126 .larger-text p
    {
        text-align: justify;
    }
}
*/

/* Row gutters and column padding
------------------------------ */

body.page-id-126
{

    --box-with-bg-padding: 55px;
}

@media all and ( max-width: 767px )
{
    body.page-id-126
    {
        --box-with-bg-padding: 30px;
    }
}

body.page-id-126 #main-content .et_pb_row:first-child
{
    padding-top: 0;
}

body.page-id-126 #main-content .et_pb_row
{
    padding: var( --row-gutter ) 0;
}

body.page-id-126 #main-content .et_pb_row:last-child
{
    padding-bottom: 0;
}

/* Boxes with background padding
------------------------------ */

body.page-id-126 .et_pb_column.background
{
    padding: var( --box-with-bg-padding );
    padding-bottom: calc( var( --box-with-bg-padding ) * 0.8 );
}

/* Reduce space between text and buttons */
body.page-id-126 .et_pb_column.background .et_pb_text
{
    margin-bottom: 15px;
}

/* "KONTAKT" PAGE
==================== */

body.page-id-182 #employees h3
{
    padding-bottom: 20px;
}

.no-list-styling ul
{
    padding: 0;
}

#contact-info
{
    line-height: 1.4;
}

@media all and ( max-width: 767px )
{
    body.page-id-182 #employees h3
    {
        padding-bottom: 5px;
    }
}

/* Row gutters
------------------------------ */

/* Default top padding on the first row */
body.page-id-182 #main-content .et_pb_row:first-child
{
    padding-bottom: var( --row-gutter );
}

body.page-id-182 #main-content .et_pb_row:not(:first-child)
{
    padding: var( --row-gutter ) 0;
}

body.page-id-182 #main-content .et_pb_row:last-child
{
    padding-bottom: 0;
}

/* "OM OSS" PAGE
==================== */

/* Remove padding under Bruktbil fra Easy box */
body.page-id-412 #main-content .et_pb_text ul
{
    padding-bottom: 0;
}

/* Boxes with background padding
------------------------------ */

body.page-id-412
{

    --box-with-bg-padding: 55px;
}

@media all and ( max-width: 767px )
{
    body.page-id-412
    {
        --box-with-bg-padding: 30px;
    }
}

body.page-id-412 .et_pb_text.background-padding
{
    padding: var( --box-with-bg-padding );
}

/* FOOTER
==================== */

footer .contact-item
{
    display: flex;
}

footer .et-pb-icon
{
    color: var( --easy-yellow );
    font-size: 24px;
    vertical-align: middle; /* by default the icons seem to be a bit above the baseline of the text, probably due to Divi's icon font */
}

@media all and ( min-width: 981px )
{
    footer .contact-item
    {
        justify-content: flex-end;
        text-align: right;
    }

    footer .et-pb-icon
    {
        margin-left: 1em;
        order: 2;
    }
}

@media all and ( max-width: 980px )
{
    footer .contact-item
    {
        justify-content: flex-start;
        text-align: left;
    }

    footer .et-pb-icon
    {
        margin-right: 1em;
    }
}

/* Make sure the address fits on one line
------------------------------ */

/* Instead of changing the font size, place a line break to put the postal code and city on a second line */
@media all and ( min-width: 383px )
{
    footer .contact-info br.breakpoint
    {
        display: none;
    }
}

/* Lines between menu items
------------------------------ */
@media all and ( min-width: 1100px )
{
    footer .et_pb_menu ul.et-menu > li
    {
        border-right: 2px solid var( --easy-yellow );
        padding: 0 30px;

        /* who knows why, but Divi has an 8px margin-top to make up for the fact that the bounding box is shifted down */
        margin-top: 0;
        padding-top: 8px; /* we want the border to be centered, and borders are drawn on the outside of the padding not the margin */
    }

    footer .et_pb_menu ul.et-menu > li:last-child
    {
        border-right: none;
    }
}

/* Show expanded menu on tablet and mobile
------------------------------ */
@media all and (max-width: 980px)
{
    footer .et_pb_menu .et_pb_menu__menu
    {
        display: flex;
    }

    footer .et_pb_menu .et_mobile_nav_menu
    {
        display: none;
    }
}

@media all and (max-width: 479px)
{
    footer .et_pb_menu ul.et-menu
    {
        flex-direction: column;
        align-items: center;
    }

    footer .et_pb_menu ul.et-menu > li
    {
        line-height: 1;
    }
}

/* DIVI TWEAKS
==================== */

/* Hide Sidebar */
#sidebar {display:none;}

/* Take out the divider line between content and sidebar */
#main-content .container:before {background: none;}

/* Expand the content area to fullwidth */
@media (min-width: 980px) {
    #left-area {
        width: 100%;
        padding: 23px 0px 0px !important;
        float: none !important;
    }
}

/* Make load-animated images visible in Divi Builder */
body.et-fb .image-load-animation img
{
    visibility: visible;
}
