:root {
    --logo-height-initial: 120px;
    --logo-height-scrolled: 60px;
    --logo-height-initial-mobile: 90px;
    --logo-height-scrolled-mobile: 45px;
    --header-transition-duration: 0.3s;
}

/* ------- HEADER ------- */
header {
    background-color: var(--layout-primary-color);
    color: var(--layout-primary-text-color);
    position: sticky;
    top: 0;
    z-index: 1020;
}

header.header-scrolled .language-switcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

header.header-scrolled .navbar-brand-logo {
    height: var(--logo-height-scrolled);
}

.navbar {    
    border-bottom: 1px solid var(--neutral-color-grey);
    margin-bottom: 0px !important;

    background-image: url("../images/backgrounds/graff2.webp");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.navbar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.40); /* Black overlay with 40% opacity */
    z-index: 1; /* Place overlay above the background image but below content */
}

.navbar > * {
    z-index: 2;
}

.navbar-logo {
    height: 100%;
    width: auto;
    border-radius: 25px;
    transition: transform 0.1s ease;
}

.navbar-logo:hover {
    transform: rotate(-6deg);
}

.navbar-brand-logo {
    height: var(--logo-height-initial);
    width: auto;
    display: inline-flex;
    align-items: center;
    overflow: visible;
    transition: height var(--header-transition-duration) ease-in-out;
}

.navbar-tagline { 
    font-size: 3rem;
    font-weight: 450;
    color: var(--layout-primary-text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    transition: font-size var(--header-transition-duration) ease-in-out,
                visibility var(--header-transition-duration) ease-in-out;
}

.navbar-nav {
    margin-right: auto;
}

.navbar-nav .nav-item {
    margin-left: 5px;
    margin-right: 5px;
}

.navbar-nav .nav-link {
    color: var(--layout-primary-text-color);
    transition: transform 0.1s ease, color 0.1s ease-in-out;
    font-size: 1.3rem;
    font-weight: bold;
    
    position: relative; /* For underlining */
    display: inline-block;
    padding-bottom: 3px;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    transform: rotate(-3deg);
}

.navbar-nav .nav-link::after {  /* --- Underlining : Initialy hidden --- */
    content: ''; /* Necessary */
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0; 
    left: 7.5%; /* Start from the left */
    background-color: var(--layout-primary-text-color); 
    transition: width 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link:focus::after {
    width: 85%;
}

.navbar-toggler .navbar-toggler-icon {  /* Make the hamburger menu light colored */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler {
    border-color: var(--layout-primary-text-color);
}

.language-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--header-transition-duration) ease-in-out,
                visibility var(--header-transition-duration) ease-in-out;
}

.language-switcher .btn {
    border-radius: 12px;
    width: 32px;
    height: 32px;
    padding: 12px 12px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    color: var(--layout-primary-text-color);
}

.language-button-on {
    padding: 12px 12px;
    font-size: 0.875rem;
    text-decoration: underline;
    border: none;
}

.language-button-off {
    border: none;
    text-decoration: none;
    transition: transform 0.1s ease-in-out, color 0.1s ease-in-out;

    position: relative; /* For underlining */
    display: inline-block;
    padding-bottom: 1px;
}

.language-button-off:hover,
.language-button-off:focus {
    transform: rotate(-3deg);
}

.language-switcher .language-button-off:focus,
.language-switcher .language-button-off:active {
    box-shadow: none;
    outline: none;               
}

.language-button-off::after {  /* --- Underlining : Initialy hidden --- */
    content: ''; /* Necessary */
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 10%; /* Start from the left */
    background-color: var(--layout-primary-text-color);
    transition: width 0.2s ease-in-out;
}

.language-button-off:hover::after,
.language-button-off:focus::after {
    width: 80%;
}

.language-separator {
    width: 1px; 
    height: 20px; 
    background-color: var(--neutral-color-grey);
}

@media (max-width: 1199.98px) {
    .navbar-brand-logo {
        height: var(--logo-height-initial-mobile);
    }

    header.header-scrolled .navbar-brand-logo {
        height: var(--logo-height-scrolled-mobile);
    }
    
    .navbar-collapse.show .navbar-nav,
    .navbar-collapse.collapsing .navbar-nav {
        width: 100%;
        margin-top: 15px; /* Add some space above the nav items */
        margin-bottom: 15px; /* Add some space below the nav items */
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .navbar-collapse.show .nav-item,
    .navbar-collapse.collapsing .nav-item {
        margin-left: 0;
        margin-right: 0;
        width: auto;
    }

    .navbar-collapse.show .nav-link,
    .navbar-collapse.collapsing .nav-link {
        text-align: center;
        padding: 3px 15px;
    }
    
    .navbar-collapse.show .language-switcher,
    .navbar-collapse.collapsing .language-switcher {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center; 
        margin-top: 20px;
        margin-bottom: 20px;
        width: 100%;
    }

    .navbar-collapse.show .language-switcher .btn,
    .navbar-collapse.collapsing .language-switcher .btn {
        font-size: 1.1rem;
    }
    
    header.header-scrolled .language-switcher {
        opacity: 1; 
        visibility: visible;
        pointer-events: auto;
    }
}

@media (max-width: 575.98px) {  /* For screen smaller than bootstrap sm endpoint */

    .navbar-brand-logo {
        margin-left: 5%;
    }

    .navbar-tagline {
        font-size: 2.5rem;
    }

    header.header-scrolled .navbar-tagline {
        font-size: 1.5rem;
    }
    
    .navbar-collapse.show .navbar-nav,
    .navbar-collapse.collapsing .navbar-nav { 
        margin-left: auto;
        margin-right: auto;
    }
    
    .navbar-nav .nav-link {
        text-align: center;
        font-size: 1.4rem;
        padding: 8px 15px;
    }
    
    .navbar-toggler {
        margin-right: 5%;
    }

    .language-switcher { 
        text-align: center;
        margin-top: 10px;
    }

    .language-switcher .btn {
        font-size: 1.2rem;
    }
}

@media (max-width: 450px) {
    .navbar-tagline {
        visibility: hidden;
        overflow: hidden;
        width: 0;
    }
}

/* ------- FOOTER ------- */
.footer {
    background-color: var(--layout-primary-color);
    color: var(--layout-primary-text-color);
    border-top: 1px solid var(--neutral-color-grey);
    padding-top: 30px;
    padding-bottom: 30px;
    line-height: 1.4;
    text-align: center;
}

.footer-section h4 {
    color: var(--layout-primary-text-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section p {
    color: var(--layout-secondary-text-color);
    margin-bottom: 10px;
}

.footer-section address {
    color: var(--layout-secondary-text-color);
    margin-bottom: 10px;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 5px;
}

.footer a {
    color: var(--layout-secondary-text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer a:hover {
    color: var(--layout-tertiary-text-color);
    text-decoration: underline;
}

.social-icons a {
    font-size: 2.5rem;
    margin-left: 7.5px;
    margin-right: 7.5px;
    display: inline-block;
}

.social-icons a:hover {
    color: var(--secondary-accent-color);
    text-decoration: none;
}

.social-icons i {
    transition: transform 0.1s ease-in-out;
    display: inline-block;
}

.social-icons a:hover i {
    transform: rotate(-6deg);
}

.footer-bottom {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--neutral-color-grey);
    font-size: 0.9rem;
    color: var(--neutral-color-grey);
}

@media (max-width: 767.98px) {
    .footer-section {
        margin-bottom: 30px;
    }
}

@media (hover: none) {
    .navbar-logo:hover {
        transform: initial;
    }
    .navbar-logo:active {
        transform: rotate(-6deg);
    }

    .navbar-nav .nav-link:hover,
    .navbar-nav .nav-link:focus {
        transform: initial;
    }
    .navbar-nav .nav-link:hover::after,
    .navbar-nav .nav-link:focus::after {
        width: 0;
    }
    .navbar-nav .nav-link:active {
        transform: rotate(-3deg);
    }
    .navbar-nav .nav-link:active::after {
        width: 85%;
    }

    .language-button-off:hover,
    .language-button-off:focus {
        transform: initial;
    }
    .language-button-off:hover::after,
    .language-button-off:focus::after {
        width: 0;
    }
    .language-button-off:active {
        transform: rotate(-3deg);
    }
    .language-button-off:active::after{
        width: 80%;
    }

    .footer a:hover {
        color: var(--layout-secondary-text-color);
        text-decoration: none;
    }
    .footer a:active {
        color: var(--layout-tertiary-text-color);
        text-decoration: underline;
    }

    .social-icons a:hover {
        color: var(--neutral-color-grey);
        text-decoration: none;
    }
    .social-icons a:hover i {
        transform: none;
    }
    .social-icons a:active {
        color: var(--secondary-accent-color);
        text-decoration: none;
    }
    .social-icons a:active i {
        transform: rotate(-6deg);
    }
}