/* Project Details Common Layout */
.work-detail {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Layout */
.project-content-sections {
    padding: 100px 0 20px;
    background-color: var(--color-bg);
}

.project-section {
    margin-bottom: 70px;
}

.section-container {
    max-width: none;
    margin: 0;
    padding: 0 clamp(24px, 5vw, 72px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.section-label {
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 1.25rem;
    color: var(--color-text);
    margin-bottom: 2rem;
    text-transform: capitalize;
}

.section-text {
    max-width: 800px;
    margin-bottom: 4rem;
}

.section-text p {
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    line-height: 1.35;
    color: #1a1a1a;
    font-weight: 350;
}

.section-text p + p {
    margin-top: 2rem;
}

.section-text strong {
    font-weight: 600;
}

.section-text em {
    font-style: italic;
    font-family: serif;
}

.section-gallery + .section-container {
    margin-top: 4rem;
}

/* Gallery / Placeholders */
.section-gallery {
    width: 100%;
    padding: 0 clamp(24px, 5vw, 72px);
    box-sizing: border-box;
    margin-bottom: 2rem;
}

.section-container .section-gallery {
    padding: 0;
}

.section-gallery.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.section-gallery.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 1.2vw, 16px);
}

.section-gallery.grid-3 .placeholder {
    aspect-ratio: 1986 / 4057;
    background-color: transparent;
}

.section-gallery.full {
    width: 100%;
}

.section-gallery:has(.seasons-full) {
    padding: 0;
}

.placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.section-gallery.grid-2 .placeholder {
    aspect-ratio: 1136.6487 / 1348.3692;
}

.placeholder img,
.placeholder video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder.native-size {
    aspect-ratio: auto;
    background-color: transparent;
}

.placeholder.native-size img {
    height: auto;
    object-fit: unset;
}

.placeholder.sunehri-screen-fit {
    aspect-ratio: auto;
    background-color: transparent;
}

.placeholder.sunehri-screen-fit img {
    height: auto;
    object-fit: contain;
}

/* Package Slider */
.package-slider {
    position: relative;
    overflow: hidden;
}

/* Farm Gallery Section (Generic Splide Slider) */
.farm-gallery-section {
    width: 100%;
    overflow: hidden;
    padding: 0;
}

.project-section:has(+ .farm-gallery-section) {
    margin-bottom: 4rem;
}

.project-section:has(+ .farm-gallery-section) .section-text {
    margin-bottom: 0;
}

.farm-gallery-full-width {
    width: 100%;
    position: relative;
    padding: 0 clamp(1rem, 10vw, 12rem);
    box-sizing: border-box;
}

#farm-gallery-splide .splide__slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

#farm-gallery-splide .splide__slide img {
    width: 100%;
    height: auto;
    display: block;
}

/* Gallery Controls (arrows + counter) */
.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.75rem;
    padding: 0.875rem clamp(1rem, 10vw, 12rem);
    max-width: none;
    margin: 0;
}

.gallery-arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--color-text);
    opacity: 0.6;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.gallery-arrow svg {
    width: 24px;
    height: 24px;
}

.gallery-arrow:hover {
    opacity: 1;
}

.gallery-counter {
    font-size: 0.875rem;
    letter-spacing: 0.14em;
    color: var(--color-text);
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.splide__track {
    cursor: grab;
}

.splide__track:active {
    cursor: grabbing;
}

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slider-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider-image.active {
    opacity: 1;
}

/* Overlay Section */
.overlay-container {
    position: relative;
    overflow: hidden;
    background-color: #f5f5f5;
}

.overlay-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.overlay-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.overlay-bg-image.active {
    opacity: 1;
}

.overlay-top {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Image Loop (Fade) & Sequential Grid */
.loop-container,
.sequential-grid .placeholder {
    position: relative;
    overflow: hidden;
}

.loop-image,
.sequential-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.loop-image.active,
.sequential-image.active {
    opacity: 1;
}

/* Faster crossfade for the BLC work loop */
#blc-work-loop .loop-image {
    transition: opacity 0.5s ease-in-out;
}

/* Horizontal Sliding Loop */
.loop-container.slide-horizontal .loop-image {
    opacity: 1;
    transform: translateX(100%);
    transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.loop-container.slide-horizontal .loop-image.active {
    transform: translateX(0);
    z-index: 2;
}

.loop-container.slide-horizontal .loop-image.prev {
    transform: translateX(-100%);
    z-index: 1;
}

/* Hero & Metadata */
.work-detail-hero {
    padding: 8rem clamp(1.5rem, 4vw, 3rem) 0.63rem;
    background-color: var(--color-bg);
    min-height: clamp(360px, 50vw, 520px);
    display: flex;
    align-items: flex-start;
}

.hero-inner {
    width: 100%;
    align-self: flex-start;
}

.metadata-value {
    font-size: 1rem;
    font-weight: 400;
    color: #1a1a1a96;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .work-detail-hero {
        min-height: auto;
    }

    .project-section {
        margin-bottom: 80px;
    }

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

    .section-gallery.grid-3 {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: clamp(16px, 4vw, 32px);
    }

    .section-gallery.grid-3 .placeholder {
        width: 100%;
        max-width: 420px;
    }

    .farm-gallery-full-width {
        padding: 0 clamp(24px, 5vw, 72px);
    }

    .gallery-controls {
        padding: 0.875rem clamp(24px, 5vw, 72px);
    }
}

@media (max-width: 480px) {
    .farm-gallery-full-width {
        padding: 0 clamp(24px, 5vw, 72px);
    }

    .gallery-controls {
        padding: 0.875rem clamp(24px, 5vw, 72px);
    }

    .metadata-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
        padding: 1rem 0;
    }
}

/* Project metadata table - shared across all case study pages */
.metadata-table {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.metadata-row {
    display: grid;
    grid-template-columns: 40% 60%;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    align-items: start;
    gap: 1rem;
}

.metadata-row:first-child {
    border-top: none;
}

.metadata-row:last-child {
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.metadata-key {
    font-size: 0.9375rem;
    font-weight: 333;
    letter-spacing: 0.08em;
    color: var(--color-nav-text);
    line-height: 1.6;
}

.metadata-val {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--color-text);
    line-height: 1.6;
}

/* Marquee Styles (Horizontal - Right to Left) */
.marquee-wrapper {
    position: relative;
    overflow: hidden;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.marquee-track {
    display: flex;
    flex-direction: row;
    height: 100%;
    width: max-content;
    gap: 0;
    will-change: transform;
}

.marquee-track.scrolling {
    animation: marqueeHorizontal 20s linear infinite;
}

@keyframes marqueeHorizontal {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-25%);
    }
}

.marquee-image {
    height: 100%;
    flex-shrink: 0;
}

.marquee-image img {
    height: 100%;
    width: auto;
    max-width: none;
    display: block;
    object-fit: cover;
}

.hero-landscape img,
.gallery-item img,
.section-full img,
.grid-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Next Project Navigation Button */
.next-project-nav {
    display: block;
    width: 100%;
}

.next-project-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(77, 77, 77, 0.1);
    color: var(--color-nav-text);
    text-decoration: none;
    padding: 1rem 1.25rem 1rem 1.5rem;
    border-radius: 100px;
    font-family: var(--font-primary);
    transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease, color 220ms ease;
    box-shadow: none;
    width: fit-content;
    margin-top: 0.75rem;
    margin-bottom: 3rem;
    margin-left: auto;
    margin-right: clamp(24px, 5vw, 72px);
}

.next-project-btn:hover {
    transform: translateY(-2px);
    background: rgba(0, 173, 238, 0.13);
    color: var(--color-brand-blue);
    box-shadow: none;
}

.next-project-btn:active {
    transform: scale(0.98);
    box-shadow: none;
}

.next-project-btn-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.next-project-label {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.55;
    line-height: 1;
}

.next-project-name {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.next-project-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 220ms ease;
}

.next-project-btn:hover svg {
    transform: translateX(4px);
}