/* === Homepage: Structure & Spacing === */
#homepage-content-container > .content-section {
    padding-top: 0;
    padding-bottom: 0;
}
#homepage-content-container > .content-section:first-of-type {
    padding-top: 5rem;
}
#homepage-content-container > .content-section:last-of-type {
    padding-bottom: 5rem;
}
.spacer-block {
    width: 100%;
}

/* === Homepage: Hero Block === */
.hero-container {
    position: relative;
    width: 100%;
    height: 90vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--primary-foreground);
    overflow: hidden;
}
.hero-background {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}
.hero-background--video { object-fit: cover; }
.hero-background--image { background-size: cover; background-position: center; }
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
    z-index: 2;
}
.hero-content {
    position: relative;
    z-index: 3;
    padding: 1.5rem;
}
.hero-title {
    font-size: 4rem;
    text-shadow: 1px 1px 20px rgba(0, 0, 0, 0.2);
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--primary-foreground);
    transition: text-shadow var(--transition-speed) ease-in-out;
}
.hero-subtitle {
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto 2rem auto;
    color: rgba(255,255,255,0.9);
}

/* === Homepage: Video Block === */
.video-block {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}
.video-block video, .video-block iframe {
    position: absolute;
    top: 50%; left: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    border: none;
}
.video-block__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.1) 100%);
    z-index: 2;
}
.video-block__title {
    position: relative;
    z-index: 3;
    color: var(--primary-foreground);
    font-size: 2.5rem;
    text-align: center;
    text-shadow: 1px 1px 20px rgba(0,0,0,0.3);
    padding: 2rem;
}

/* === Homepage: Story Slider (Yamaha Style) === */
.story-slider-container {
    position: relative;
    width: 100%;
    height: 85vh; /* 85% of the viewport height */
    min-height: 550px;
    background-color: #111;
    color: var(--primary-foreground);
    overflow: hidden;
}

/* Layer 1: Background Images Container */
.story-slider__backgrounds {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.story-slider__background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.story-slider__background.is-active {
    opacity: 1;
}

/* Layer 2: Dark Overlay for Text Readability */
.story-slider__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 20%, rgba(0,0,0,0.1) 80%);
    z-index: 2;
}

/* Layer 3: Main Content Wrapper */
.story-slider__content-wrapper {
    position: relative;
    z-index: 3;
    height: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align content to the bottom */
}

.story-slider__content {
    position: relative;
    padding-bottom: 2rem;
}

/* Individual slide content styling */
.story-slider__slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out 0.2s; /* Delay text transition slightly */
    transform: translateY(20px);
    transition-property: opacity, transform;
}

.story-slider__slide-content.is-active {
    opacity: 1;
    transform: translateY(0);
}

.story-slider__title {
    font-size: 3rem;
    color: var(--primary-foreground);
    text-shadow: 1px 1px 10px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
    max-width: 20ch; /* Limit title width */
}

.story-slider__text {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.85);
    max-width: 55ch; /* Limit paragraph width */
    margin-bottom: 2rem;
}

/* Navigation Controls */
.story-slider__nav {
    display: flex;
    align-items: center;
    width: 100%; /* Ensure the nav bar spans the full width */
    padding-bottom: 2rem;
}

.story-slider__btn--prev {
    order: 1; /* Arrow appears first */
}

.story-slider__counter {
    order: 2; /* Counter appears in the middle */
    flex-grow: 1; /* CRITICAL: This makes the counter take up all available space */
    text-align: center; /* This centers the text within its expanded container */
    font-size: 1.2rem;
    font-weight: 700;
}

.story-slider__btn--next {
    order: 3; /* Arrow appears last */
}

.counter--current { 
    font-size: 2rem; 
}

.story-slider__btn--prev,
.story-slider__btn--next {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--primary-foreground);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.story-slider__btn--prev:hover,
.story-slider__btn--next:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}


/* === Homepage: Other Blocks === */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.gallery-item {
    overflow: hidden;
    border-radius: var(--radius);
    height: 250px;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item img:hover { transform: scale(1.05); }

.map-embed-container { text-align: center; }
.map-embed-container iframe { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

.contact-text { max-width: 650px; margin-bottom: 1rem; color: var(--muted-foreground); }
.content-section.homepage-block--cta { text-align: center; display: flex; flex-direction: column; align-items: center; }


/* === Mobile-Specific Overrides for Homepage Blocks === */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1rem; }
    .video-block__title { font-size: 1.5rem; }
    .map-embed-container {
        position: relative;
        padding-bottom: 80%;
        height: 0;
        overflow: hidden;
    }
    .map-embed-container iframe {
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
    }

    /* Responsive adjustments for story slider on smaller screens */
    .story-slider-container {
        height: 80vh;
        min-height: 500px;
    }
    .story-slider__content-wrapper {
        padding: 1rem;
    }
    .story-slider__overlay {
        background: linear-gradient(to top, rgba(0,0,0,0.8) 10%, rgba(0,0,0,0.2) 70%);
    }
    .story-slider__title {
        font-size: 2.2rem;
    }
    .story-slider__text {
        font-size: 1rem;
        max-width: 100%;
    }
    .story-slider__nav {
        padding-bottom: 1rem;
    }
}
