/* ============================================================
   STUDIO WESTONIA — Portfolio
   ============================================================ */

/* --- Portfolio Overview --- */
.portfolio-hero {
    padding-top: calc(var(--nav-height) + clamp(3rem, 6vw, 6rem));
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: clamp(1.5rem, 3vw, 3rem);
    margin-bottom: clamp(2rem, 4vw, 4rem);
}

.portfolio-filter {
    padding: 0.5rem 1.25rem;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    transition: all var(--transition);
    cursor: pointer;
}

.portfolio-filter:hover,
.portfolio-filter.is-active {
    color: var(--white);
    border-color: var(--blue);
    background: var(--blue);
}

.portfolio-full-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.portfolio-full-grid__item {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    aspect-ratio: 16/10;
    cursor: pointer;
    display: block;
}

.portfolio-full-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

@media (hover:hover){
.portfolio-full-grid__item:hover img {
    transform: scale(1.05);
}
}

.portfolio-full-grid__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(1rem, 2vw, 1.5rem);
    opacity: 0;
    transition: opacity var(--transition);
}

@media (hover:hover){
.portfolio-full-grid__item:hover .portfolio-full-grid__overlay {
    opacity: 1;
}
}

.portfolio-full-grid__title {
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    font-weight: var(--font-bold);
    color: var(--white);
}

.portfolio-full-grid__cat {
    font-size: 0.75rem;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.25rem;
}

/* --- Portfolio Detail --- */
.project-hero {
    padding-top: calc(var(--nav-height) + clamp(3rem, 6vw, 5rem));
    padding-bottom: clamp(2rem, 4vw, 4rem);
}

.project-hero__meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.project-hero__meta span {
    color: var(--blue);
}

.project-video,
.sw-player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0;
    overflow: hidden;
    background-color: var(--grey-dark);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: clamp(2rem, 4vw, 4rem);
}

/* Vertical (9:16) variant — used when the CMS entry for a
   youtube_ids row is flagged as 'vertical'. Capped max-width so a
   reel doesn't stretch the main column into a 1200px-tall box on
   desktop; still full width on mobile. */
.project-video--vertical {
    aspect-ratio: 9 / 16;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.project-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Multi-video grid: 2 columns when more than 1 video */
.project-videos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1rem, 2vw, 1.5rem);
    margin-bottom: clamp(2rem, 4vw, 4rem);
}

.project-videos-grid .project-video {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .project-videos-grid {
        grid-template-columns: 1fr;
    }
}

.project-description {
    max-width: 720px;
    margin-bottom: clamp(3rem, 5vw, 5rem);
}

.project-description p {
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(0.75rem, 1.5vw, 1rem);
    margin-bottom: clamp(3rem, 5vw, 5rem);
}

.project-gallery img {
    width: 100%;
    border-radius: 0;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.project-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.project-nav a {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color var(--transition);
}

@media (hover:hover){
.project-nav a:hover {
    color: var(--blue);
}
}

.project-nav__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

.project-nav__name {
    font-size: clamp(1rem, 1.3vw, 1.15rem);
    font-weight: var(--font-bold);
    text-transform: none;
    letter-spacing: 0;
}

/* --- Light-mode overrides --- */
.section--light .portfolio-filter {
    color: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 0, 0, 0.1);
}

.section--light .portfolio-filter:hover,
.section--light .portfolio-filter.is-active {
    color: var(--white);
    border-color: var(--blue);
    background: var(--blue);
}

.section--light .project-hero__meta {
    color: rgba(0, 0, 0, 0.5);
}

.section--light .project-video {
    background: var(--grey-light);
}

.section--light .project-description p {
    color: rgba(0, 0, 0, 0.65);
}

.section--light .project-nav {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.section--light .project-nav a {
    color: rgba(0, 0, 0, 0.5);
}

@media (hover:hover){
.section--light .project-nav a:hover {
    color: var(--blue);
}
}

/* --- Project content splits (text + image side by side) --- */
.project-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
    margin-bottom: clamp(3rem, 5vw, 5rem);
}

.project-split--reversed {
    direction: rtl;
}

.project-split--reversed > * {
    direction: ltr;
}

.project-split__text h2 {
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    font-weight: var(--font-bold);
    margin-bottom: 1rem;
}

.project-split__text p {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.7;
    color: rgba(0, 0, 0, 0.65);
}

.project-split__img img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

/* Video variant for splits — used when the side-by-side layout
   alternates a YouTube embed with the text instead of a still
   image (e.g. CoachedByClub's three-video zigzag). 16/9 ratio
   so the iframe fills cleanly without letterboxing. */
.project-split__video {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}
/* Vertical (9:16) variant for shorts/reels — capped width so the
   iframe doesn't turn the split column into a 1200px-tall box on
   desktop. YouTube fills the iframe natively so no letterboxing. */
.project-split__video--vertical {
    aspect-ratio: 9/16;
    max-width: 340px;
    margin-left: auto;
    margin-right: auto;
}
.project-split__video iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .project-split,
    .project-split--reversed {
        grid-template-columns: 1fr;
        direction: ltr;
    }

    .portfolio-full-grid {
        grid-template-columns: 1fr;
        gap: clamp(1.5rem, 4vw, 2rem);
    }

    /* Mobile: project label sits BELOW the image instead of being a
       hover overlay. Hover doesn't exist on touch — without this the
       grid would look like nameless thumbnails. */
    .portfolio-full-grid__item {
        aspect-ratio: auto;
        overflow: visible;
        cursor: pointer;
    }
    .portfolio-full-grid__item img {
        aspect-ratio: 16 / 10;
        height: auto;
    }
@media (hover:hover){
    .portfolio-full-grid__item:hover img {
        transform: none;
    }
}
    .portfolio-full-grid__overlay {
        position: static;
        inset: auto;
        background: none;
        opacity: 1;
        padding: 0.75rem 0 0;
    }
    .portfolio-full-grid__title {
        color: var(--black);
        font-size: 1rem;
    }
    .portfolio-full-grid__cat {
        color: var(--blue);
        margin-top: 0.2rem;
    }

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

/* --- Dienst context block on portfolio detail pages --- */
.dienst-block {
    padding: clamp(2rem, 3vw, 3rem);
    border: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: clamp(3rem, 5vw, 5rem);
    transition: border-color var(--transition);
}

@media (hover:hover){
.dienst-block:hover {
    border-color: var(--blue);
}
}

.dienst-block__title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: var(--font-bold);
    margin-bottom: 1rem;
}

.dienst-block__desc {
    font-size: clamp(0.95rem, 1.2vw, 1.05rem);
    line-height: 1.7;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 1.5rem;
}

.dienst-block__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
    color: var(--blue);
    transition: gap var(--transition);
}

@media (hover:hover){
.dienst-block__link:hover {
    gap: 0.85rem;
}
}

.dienst-block__link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}
