/*
576px for portrait phones.
768px for tablets.
992px for laptops.
1200px for large devices.

Piblic Sphere - Stracture/Layout
================================================================
Naming convention:

BEM:    [block-name]__[element-name]--[modifier-name]
PS:     [blockName]_[elementName]__[modifierName]
        
    Use allways the Tag Name of elements within Blocks when elements are standard or predictable
        [formSerach]
            [formSerach] input
        [cart]
            [cart] figure
            [cart] img
            [cart] figcaption
        [cartProduct]
            [cartProduct] figure
            [cartProduct] img
            [cartProduct] figcaption
================================================================
*/

html {
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

header,
nav,
main,
footer,
section,
article,
aside,
figure,
figcaption,
dialog,
menu,
summary,
details {
    display: block;
}

/* 
    Page Structure
    ID selectors (#) are only used for basic navigation on header/top
    ================================
nav#navTop
header#header
nav#nav
div.page
    div.content
        main.main
            articles
        aside.aside
            nav.nav_aside
footer.footer

 */

html,
body {
    font-family: var(--body-fonts);
    background-color: var(--body-bg);
    color: var(--body-color);
    font-size: 17px;
    font-weight: 500;
    line-height: 160%;
    margin: 0;
    padding: 0;
}

@media (min-device-width: 1600px) {

    html,
    body {
        font-size: 19px;
    }
}

@media (min-device-width: 1920px) {

    html,
    body {
        font-size: 20px;
    }
}

/*
    Generic Flex classes that can be redifined by their own or parents elements and used anywhere
    Starts from mobile device
    .row_flex: (display: flex) used in header#header, nav#nav, footer#footer - and OBS! used also in jQueries, in basic_jq.js
        - flex-direction: column OR row (use flex-wrap instead)
        - justify-content: center, flex-start, flex-end, space-around, space-between,
        - align-items: center, flex-start (top), flex-end (bottom), stretch, baseline
*/

.flex_start,
.flex_end,
.flex_center,
.flex_around,
.flex_between {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.flex_nowrap {
    flex-wrap: nowrap !important;
}

.flex_start {
    justify-content: flex-start;
}

.flex_end {
    justify-content: flex-end;
}

.flex_center {
    justify-content: center;
}

.flex_around {
    justify-content: space-around;
}

.flex_align_start {
    align-items: flex-start;
}

.flex_align_end {
    align-items: flex-end;
}

.flex_align_stretch {
    align-items: stretch;
}

/*
    Multiple flex-items (used within row_flex-containers) NOT USED
*/
.flex_items,
[class*="col-"] {
    width: 100%;
}

@media (min-width: 768px) {
    .flex_items {
        width: 48%;
        flex: 1;
    }
}

/*
    =====================================================
    TOP NAVIGATION to Languages and to Applications Links with LOGIN and Search
    FLEX-itmes: 
        #langFlags, 
        #sxNavAppsMarker (sxNav_Markers.css) and 
        #sxNavApps (sxNav_Headers.css)
    #navTop is irrelevant if Apps navigation is within the Main Nav
    Top Search form is defined in sx_Forms.css
    ===================================================== 
*/

#navTop {
    position: relative;
    padding: 0.2rem 0.75rem;
    z-index: 200;
    background-color: var(--top-bg);
}

/**
    If no flags on the left, center the top navigation
    However, in mobiles, set the application mark to the right
*/
#navTop .nav_top_flex,
#navTop .nav_top_flex_between {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

#navTop .nav_top_flex {
    justify-content: flex-end;
}

@media only screen and (min-width: 1024px) {
    #navTop .nav_top_flex {
        justify-content: center;
    }
}

/* 
    Flags margin top/bottom can, together with #navTop padding
    define the height of Top Menu:
    Flags' height + margin >= to the height of sxNavAppsMarker
*/
#langFlags {
    padding: 0;
    margin: 0.1rem 0;
    line-height: 0;
}

#langFlags img {
    display: inline-block;
    width: 1.75rem;
    height: auto;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* 
    If flags are placed within the application list (#sxNavApps (sxNav_Headers.css))
*/
#langFlagsInList img {
    display: inline-block;
    width: 1.5em;
    height: auto;
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-right: 0.3em;
    vertical-align: bottom;
}

/**
    Header Structure
        1 #header (takes always the width of window)
            2 .header_content (used to place the content of header in the same width as the content of page:
                        .header_content and .content should have the same margin: 0 XX% for the same media
                3 .flex_between (is placed at the center, as the grid of page, with: margin: 0 auto)
                        Set only the max-width as equal to the max-width of the .content_grid
    Give the #header the same padding as .page so that
    the width of its content follows the width of page content
*/

#header {
    background-color: var(--header-bg);
    background-image: var(--header-bg-image);
    padding: 0 1%;
    margin: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    border-top: 1px solid var(--header-border);
}

.header_content {
    margin: 0 auto;
    max-width: 1340px;
}

#header .header_flex {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

/*  Obs! Obs! Obs! Obs! 
    The height of #logo and #logo_small /inludding padding and margin)
    defines the haight of the navigation bar, 
    both the normal (#logo) and the fixed (#logo_small)
    - the height must be equal or heigher than the other parts of Nav
*/

#logo,
#logo_small {
    padding: 0.5rem 0;
    text-align: center;
    flex: auto;
}

#logo_small {
    display: none;
}

/**
    For best results, the big and small logo must have equal width.
*/
#logo img,
#logo_small img {
    display: block;
    width: 100%;
    max-height: 150px;
    margin: 0 auto;
}

@media (min-width: 768px) {

    #header .header_flex {
        justify-content: space-between;
    }
}


#logo h1 {
    margin: 1.5rem 0 0 0;
    padding: 0;
}

#logo h1 a {
    color: #ffffff90;
    font-size: 1.6em;
}

#logo h1 a:hover {
    color: #fff;
}

#logo h2 {
    padding: 0;
    margin: 0;
    color: #ffffff96;
    font-size: 1em;
    font-weight: normal;
}

/*
    =====================================================
    MAIN NAVIGATION
	To make the Top Navigation Menu FIXED when scrolling
    =====================================================
    Add the class .jqNavFixed as follow (is defined dynamically and added dynamically)
        <nav id="nav">
            <div class="nav_fixed jqNavFixed">
	jQuery toggles the position of .nav_fixed between relative and fixed depending on page scrolling
        - You don't need to set the height of #nav (which shrinks when .nav_fixed becomes fixed), it is set by jQuery
		- If Navigation is already place on top, jQuery will set .nav_fixed to 
          fixed on page load and don't use the scroll functions
    The background (color and image) of navigation must be set at .nav_fixed 
        and be inherited by its childs (only the color for the navigation list)
        - Otherwise you must redifine them there (se sxNav_Header.css)
*/

#nav {
    margin: 0;
    padding: 0;
}

#nav .nav_fixed {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: var(--nav-bg);
    background-image: var(--nav-bg-image);
    border-top: 1px solid var(--nav-border);
    border-bottom: 1px solid var(--nav-border);
}

#nav .nav_flex_between {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0 0.5rem;
    max-width: 1340px;
    margin: 0 auto;
}

/**
    When the logo is within navigation
    Main navigation and apps navigation (including flags) are placed 
        as 2 rows with a flex column
    The first row, with apps navigatin (nav_flex_column_apps), is moved to 
        absolut itemion when the main nav becomes fixed in mobiles
        - alternatively it can be hide, in absolut position to Nav
          and shown with a Nav Mark
*/

#nav .nav_flex_column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
}

/*
    When Apps, inluding languages, are in navigation menu, you have 2 options
    for tabletes and mobiles:
    - if you have few Apps, or only language, set .nav_flex_column_apps to 
      absolute position to make them visible
    - else, set .nav_flex_column_apps to static position to make the 
      Apps Navigation Mark visible 
*/
#nav .nav_flex_column_apps {
    position: static;
    top: 0;
    right: 0.5rem;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    column-gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: auto;
}

@media only screen and (min-width: 1024px) {

    #nav .nav_flex_column_apps {
        position: static;
        column-gap: 1rem;
    }
}

/*
    =====================================================
    The .page Structure
        .page
                - might contain wide adverises and slider, covering the width of the whole screen
                - alternatively can be used to define the active width of the page cantent (left/right padding in %)
            .content or .content_wide
                - can alse be used to define the active width of the page content by {margin: Xrem X%}
                - they might contain adverises and slider equally wide as the page content
                - Can also define max widt of page content, e.g. {max-width: 1600px; margin: Xrem auto}
            .content_wide is for one column pages
            .content is a grid used for 2 or thre colums: 
                    .main
                        - optionally devided into 2 more columns by .grid_equal or .grid_varied
                        - contains mainly .articles
                    .aside
                        - .nav (different navigation menus)
                        - .ads (right-top and right-bottom advertising)
*/

.page {
    position: relative;
    margin: 2rem 1rem 4rem 1rem;
    padding: 0;
    background-color: var(--page-bg);
}

/*
    For sections outside the content - big advertises or slider
*/

.page>section {
    margin-bottom: 2em;
}

/*
    .content_wide is used for pages with one column
*/
.content_wide {
    margin: 0 1%;

}

/*
    .content is used:
        - For pages with 2 columns, by including  .main and .aside
        - For pages with 3 or more columns, 
            by including the grids .grid_equal or .grid_varied within .main
            .grid_equal and .grid_varied can also be used anywhere
*/

.content,
.grid_varied,
.grid_equal {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 4rem;
}

.content {
    /* Usually the same max width as the header_content */
    max-width: 1340px;
    margin: 1rem auto;
}

.main,
.aside {
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.content>.aside {
    /* To get right H2 headers in the same line as left H1 headers */
    padding-top: 1.2rem;
}

.main>section {
    padding: 0 0 1rem 0;
    margin-bottom: 1rem;
    background-color: var(--main-section-bg);
}

.main article {
    padding: 5px 25px 15px 25px;
    border: 1px solid #e6e6e6;
    border-radius: 9px;
    margin-bottom: 0.4em;
    overflow: hidden;
    background-color: var(--main-article-bg);
}

.aside>section {
    margin-bottom: 2em;
    background-color: var(--aside-section-bg);
}

section>header {
    text-align: center;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/*
 * Used when the text version uses aside texts in first page
*/

.grid_varied_left {
    padding: 0;
}

.grid_varied_right article {
    padding: 10px;
    background-color: #f6f6f6;
    border: 1px solid #eeeeee;
    margin-bottom: 4px;
}


.grid_12,
.grid_13,
.grid_21,
.grid_31 {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 1rem;
}

/*
    Special styles for SIA, since white color is set in articles
*/
#body_links .main>section,
#body_photos .main>section {
    background-color: #fff;
    padding: 5px 25px 15px 25px;
    border-radius: 9px;
}

/*
===========================
    Media
===========================
*/

@media (min-width: 768px) {
    .grid_equal {
        grid-template-columns: 1fr 1fr;
        column-gap: 4%;
    }

    .grid_12 {
        display: grid;
        grid-template-columns: 1fr 2fr;
        column-gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .content_wide {
        margin: 0 2%;
    }

    .grid_12 {
        display: grid;
        grid-template-columns: 1fr 2fr;
        column-gap: 3rem;
    }

}

@media (min-width: 1200px) {
    .content {
        grid-template-columns: 8fr 4fr;
        column-gap: 4%;
    }

    .grid_varied {
        grid-template-columns: 8fr 4fr;
        column-gap: 0.5rem;
    }

    .content_wide {
        margin: 0 6%;
    }

    .grid_12 {
        column-gap: 1.5rem;
    }

}

@media (min-width: 1600px) {
    .content {
        column-gap: 4%;
    }

    .content_wide {
        margin: 0 10%;
    }

    .grid_12 {
        column-gap: 3rem;
    }

}

@media print {
    section {
        page-break-inside: avoid;
        margin: 0;
        padding: 0;
    }
}

/*
    Pages with one column
*/
#body_default .content_wide,
#body_items .content_wide {
    margin: 0 !important;
    padding: 0;
}

#body_default .content_wide .aside,
#body_items .aside {
    padding-left: 2%;
    padding-right: 2%;
}

@media (min-width: 1200px) {

    #body_default .content_wide .aside,
    #body_items .aside {
        padding-left: 4%;
        padding-right: 4%;
    }
}

@media (min-width: 1600px) {

    #body_default .content_wide .aside,
    #body_items .aside {
        padding-left: 8%;
        padding-right: 8%;
    }
}

/*  
    =====================================================
    FOOTER CLASSES
    =====================================================
*/

.footer {
    font-family: var(--footer-fonts);
    position: relative;
    background-color: var(--footer-bg);
    background-image: var(--footer-bg-image);
    color: var(--footer-color);
    margin: 0;
    padding: 1rem 4% 4rem 4%;
}

.scroll_footer {
    position: absolute;
    top: 5px;
    right: 15px;
}

.scroll_footer,
.footer li .sx_svg,
.footer a .sx_svg,
.footer a {
    color: var(--footer-link);
}

.scroll_footer:hover,
.footer li:hover .sx_svg,
.footer a:hover .sx_svg,
.footer a:hover {
    color: var(--footer-link-hover);
}

.footer h4 {
    color: var(--footer-color);
}

/**
    2 Grids with 1 row and 3 columns
    Thereby you can style the 2 grids separately
*/

.footer_grid {
    display: grid;
    grid-template-columns: 1fr;
    align-items: flex-start;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .footer_grid {
        grid-template-columns: 1fr 1fr 1fr;
        align-items: stretch;
    }
}

.footer_grid:first-of-type {
    border: 3px solid rgba(0, 0, 0, 0.5);
}

.footer_grid:last-of-type {
    background-color: var(--footer-bg);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
}

.footer_grid>div {
    padding: 30px 0;
    margin: 0 auto;
}

.footer_grid p {
    margin-top: 0;
}

.footer ul {
    display: inline-block;
    text-align: left;
}

/*
    In case the SVG-images to social media are defined as IDs from the file sx_symbols.svg
*/
.footer .social_media svg {
    margin-right: 0.5em;
    font-size: 2em;
    vertical-align: bottom;
}

/*
    All SVG social media has 20% transparent white color as default - with 100% transparent background.
    You cannot change the color of SVG in an image but you can change the background color
    Set a background-color for the img element if the background-color of the footer is white or too light.
*/

.footer .social_media img {
    margin-right: 0.5em;
    height: 1.65rem;
    width: 1.65rem;
    vertical-align: bottom;
}