/* Variables */
:root {
    --primary-color: #0D0D0D; /* Rich Black */
    --secondary-color: #FFFFFF; /* White */
    --accent-color: #B2945E; /* Elegant Gold */
    --text-color: #333333; /* Dark Gray */
    --inverse-text-color: #FFFFFF;
    --background-color: #FFFEFC;
    /*--background-color: #B2945E; !* Elegant Gold *!*/
    --font-primary: 'Raleway', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
    --font-calligraphic: 'Tangerine', cursive; /* Calligraphic font */
}

/* Reset Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Global focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Remove default focus outline only when focus-visible is supported */
*:focus:not(:focus-visible) {
    outline: none;
}

body {
    font-family: var(--font-secondary), sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Centering text */
body, h1, h2, h3, h4, h5, h6, p, ul {
    text-align: center;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary), sans-serif;
    color: var(--primary-color);
    margin-bottom: 20px;
}

p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--text-color);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0 auto;
}

ul li {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* Navbar */
.navbar {
    background-color: transparent;
    transition: background-color 0.3s ease, padding 0.3s ease;
    position: fixed;
    width: 100%;
    z-index: 1000;
    min-height: 5vh;
    will-change: background-color;
}

.navbar.scrolled {
    background-color: var(--primary-color);
    padding: 10px 0;
}

#navbarNav.scrolled {
    background-color: var(--primary-color);
    /*padding: 10px 0;*/
}

.navbar .navbar-brand {
    font-family: var(--font-calligraphic), cursive;
    font-size: 2rem;
    color: var(--inverse-text-color) !important;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.navbar.show-brand .navbar-brand {
    display: block;
    opacity: 1;
}

.navbar .navbar-toggler {
    border: none;
    outline: none;
    color: var(--secondary-color);
}

.navbar .navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(178, 148, 94, 0.5);
}

.navbar .navbar-toggler:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.navbar .navbar-toggler-icon {
    color: var(--secondary-color);
}

.navbar .nav-link {
    color: var(--secondary-color);
    margin: 0 15px;
    position: relative;
    font-size: 1rem;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.navbar .nav-link::after {
    content: '';
    width: 0%;
    height: 2px;
    background-color: var(--accent-color);
    position: absolute;
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.navbar .nav-link:hover {
    color: var(--accent-color);
}

.navbar .nav-link:hover::after {
    width: 100%;
}

.navbar .nav-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 4px;
}

.navbar.scrolled .nav-link {
    color: var(--secondary-color);
}

.navbar.scrolled .nav-link:hover {
    color: var(--accent-color);
}

.navbar .navbar-collapse {
    justify-content: center;
}

/* Hero Section */
.hero {
    background-image: url('images/hero-desktop-horizontal.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    color: var(--secondary-color);
    position: relative;
    min-height: 100vh; /* Ensures hero takes full viewport height */
    will-change: transform;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 13, 13, 0.6);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 2s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding-top: 100px;
}

.hero-title {
    font-size: 4rem;
    margin-bottom: 20px;
    letter-spacing: 3px;
    position: absolute;
    top: 10%; /* Adjusted to reduce gap between navbar and hero title */
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-calligraphic), cursive;
    color: var(--inverse-text-color) !important;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 40px;
    font-weight: 300;
    font-style: italic;
}

.hero-cta {
    padding: 15px 50px;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 30px;
    display: inline-block;
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    white-space: nowrap;
}

.hero-cta:hover {
    background-color: #927545;
}

.hero-cta:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 4px;
}

.hero-cta i {
    margin-left: 10px;
}

/* Sections */
section {
    /*padding: 100px 20px;*/
    scroll-margin-top: 5vh; /* Adjust this value to match the height of your navbar */
    contain: layout style paint;
}

section:nth-of-type(even) {
    background-color: var(--secondary-color);
}

section:nth-of-type(odd) {
    background-color: var(--background-color);
}

section h2 {
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
}

section h2::after {
    content: '';
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

/* Button Styles */
.btn {
    padding: 12px 30px;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 30px;
}

.btn:hover {
    background-color: #927545;
}

/* Videos Section */
.videos .carousel {
    max-width: 800px;
    margin: 0 auto;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    background-color: var(--accent-color);
    border-radius: 50%;
    padding: 15px;
}

.carousel-item {
    transition: transform 0.6s ease-in-out;
}

.carousel-item iframe {
    will-change: transform;
}

.carousel-indicators [data-bs-target] {
    background-color: var(--accent-color);
}

/* Gallery Section */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    contain: layout;
}

.gallery-grid a {
    position: relative;
    overflow: hidden;
    display: block;
    border-radius: 10px;
    background-color: #f0f0f0;
    aspect-ratio: 2/3;
    contain: layout style paint;
}

.gallery-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 10px;
    will-change: transform;
    image-rendering: high-quality;
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    content-visibility: auto;
}

/* Smooth fade-in for lazy loaded images */
.gallery-grid img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in, transform 0.3s ease;
}

.gallery-grid img.loaded {
    opacity: 1;
}

.gallery-grid a::after {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: var(--secondary-color);
    font-size: 2rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-grid a:hover img {
    transform: scale(1.05);
}

.gallery-grid a:hover::after {
    opacity: 1;
}

.gallery-grid a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 10px;
    pointer-events: none;
}

.gallery-grid a:hover::before {
    opacity: 1;
}

.gallery-grid a:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 10px;
}

/* Improve Fancybox image quality */
.fancybox__image {
    image-rendering: high-quality;
    image-rendering: -webkit-optimize-contrast;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Contact Section */
.contact-info {
    max-width: 600px;
    margin: 0 auto;
}

.contact-info p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.contact-info a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

.contact-info a:hover {
    text-decoration: underline;
}

.contact-info a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: var(--inverse-text-color);
    padding: 30px 0;
    text-align: center;
}

.footer p {
    margin: 0 auto;
    font-size: 0.9rem;
    color: var(--inverse-text-color);
    text-align: center;
}

.footer .social-media {
    margin-top: 20px;
}

.footer .social-media a {
    color: var(--secondary-color);
    text-decoration: none;
    margin: 0 15px;
    font-size: 1.8rem;
    transition: color 0.3s ease;
}

.footer .social-media a:hover {
    color: var(--accent-color);
}

.footer .social-media a:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Scroll Button Styles */
#scroll-button {
    position: fixed;
    bottom: 50px; /* Align vertically with hero-cta */
    right: 20px;  /* Place it on the right side */
    background-color: var(--accent-color);
    color: var(--secondary-color);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    opacity: 1; /* Control visibility with opacity */
    will-change: opacity;
}

#scroll-button:hover {
    background-color: #927545;
}

#scroll-button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

/* Hide scroll button when in the hero section */
#scroll-button.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Animations */
@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Center content and adjust section heights */
.hero,
#about,
#repertoire,
#videos,
#gallery,
#contact {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin: 0 auto;
}

#about {
    height: 47.5vh;
}

#repertoire {
    height: 47.5vh;
}

#videos {
    height: 95vh;
}

#gallery > .container {
    margin: 10vh;
}

#contact {
    height: 45vh;
}

/* Adjusted Navbar Collapse for Smaller Screens */
@media (max-width: 992px) {
    /* Adjust navbar for smaller screens */
    .navbar .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 10vh 0; /* Reduced padding to lower gaps between items */
    }

    .navbar .nav-link {
        margin: 5px 0; /* Reduced margin to lower gaps between menu items */
        color: var(--secondary-color);
        font-size: 1.2rem;
    }

    .navbar .nav-item {
        text-align: center;
    }

    .navbar .navbar-brand {
        display: none;
    }

    .navbar.show-brand .navbar-brand {
        display: block;
    }

    .navbar .nav-link {
        margin: 5px 0; /* Reduced margin to lower gaps between menu items */
        font-size: 1.1rem;
    }

    .hero {
        background-attachment: scroll;
        min-height: 100vh; /* Hero section takes full viewport height */
    }

    .hero-title {
        font-size: 2.5rem;
        top: 8%; /* Reduced gap between navbar and hero title */
    }

    .hero-cta {
        bottom: 15vh;
        padding: 15px 30px; /* Adjusted padding */
        max-width: 80%; /* Limit width to prevent overflow */
        word-wrap: break-word; /* Allow text to wrap */
    }

    section {
        /*padding: 5vh;*/
        scroll-margin-top: 5vh; /* Adjust this value if your navbar height changes on smaller screens */
    }

    /* Hero and About sections take full viewport height */
    #about {
        height: 95vh;
    }

    /* Repertoire and Videos sections each take half viewport height */
    #repertoire {
        height: 95vh;
    }

    #videos {
        min-height: 95vh;
    }

    /* Contact section takes half viewport height */
    #contact {
        height: 95vh;
    }

    /* Adjust h2 margin in sections */
    section h2 {
        margin-bottom: 20px;
    }

    /* Adjust the gallery-grid to fit in the new layout */
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    /* Adjust Repertoire list */
    #repertoire ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    #repertoire ul li {
        margin-bottom: 10px;
    }

    /* Adjust Videos carousel */
    .videos .carousel {
        width: 100%;
        max-width: 600px;
    }
}


/* Further adjustments for screens less than 576px */
@media screen and (max-width: 576px) {
    .hero-title {
        font-size: 2rem;
        top: 5%; /* Further reduced gap between navbar and hero title */
    }

    .hero-cta {
        bottom: 10vh;
        padding: 15px 20px; /* Further adjusted padding */
        max-width: 90%;
    }

    section {
        /*padding: 5vh;*/
        scroll-margin-top: 5vh; /* Adjust this value if your navbar height changes on smaller screens */
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}