/* ==========================================================================
   Portfolio index — category sections, sticky section nav, two-up card grid.
   Loaded only by portfolio.php / it_portfolio.php.
   Prefixed .pf- so nothing collides with the existing .port-* rules.
   Palette, faces and pill buttons all come from style.css; nothing new here.
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

/* --- Sticky section nav ---------------------------------------------------
   The site header is position:fixed, 120px tall, z-index 1000. This bar sits
   directly under it.

   z-index has to thread a needle in style.css: above page content (.cbox and
   .centro-box are 1, #hero-styles is 2) but below .overlay-menu at 19, or the
   bar shows through the burger menu when it opens. Keep it under 19. */

.pf-nav {
    position: sticky;
    top: 120px;
    z-index: 5;
    background: #fff;
    border-bottom: 1px solid #ddd;
    margin-top: 50px;
    margin-bottom: 60px;
}

.pf-nav ul {
    display: flex;
    gap: 32px;
    margin: 0;
    padding: 0 20px;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.pf-nav ul::-webkit-scrollbar {
    display: none;
}

.pf-nav a {
    display: block;
    padding: 18px 0;
    white-space: nowrap;
    font-family: 'josefin-light', sans-serif;
    font-size: 15px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #222;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}

.pf-nav a:hover,
.pf-nav a:focus-visible {
    color: #0e8581;
}

.pf-nav a[aria-current="true"] {
    color: #0e8581;
    border-bottom-color: #0e8581;
}

/* --- Section shell -------------------------------------------------------- */

.pf-section {
    /* clears the fixed header (120) plus the sticky nav (~55) when anchored */
    scroll-margin-top: 200px;
    padding-bottom: 110px;
}

.pf-section + .pf-section {
    border-top: 1px solid #e4e4e4;
    padding-top: 90px;
}

.pf-layout {
    display: grid;
    gap: 48px;
}

/* --- Left rail: the category as a mini landing ---------------------------- */

.pf-move {
    font-family: 'josefin-light', sans-serif;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 18px;
    color: #8a8a8a;
}

.pf-move span {
    color: #222;
}

.pf-move i {
    font-style: normal;
    color: #0e8581;
    padding: 0 .5em;
}

.pf-rail h2 {
    font-family: 'josefin-semibold', sans-serif;
    font-size: 24px;
    line-height: 118%;
    text-transform: uppercase;
    margin: 0 0 18px;
}

.pf-audience {
    font-family: 'josefin-light', sans-serif;
    font-size: 14px;
    line-height: 155%;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #0e8581;
    margin-bottom: 18px;
}

.pf-rail p.pf-body {
    font-family: 'josefin-light', sans-serif;
    font-size: 17px;
    line-height: 168%;
    margin-bottom: 28px;
}

/* --- Right column: project cards ------------------------------------------ */

.pf-works {
    display: grid;
    grid-template-columns: 1fr;
    gap: 44px;
}

/* Two up from tablet width. Below that every card takes the full row. */
@media only screen and (min-width: 768px) {

    .pf-works {
        grid-template-columns: repeat(2, 1fr);
        gap: 48px 32px;
    }
}

.pf-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.pf-shot {
    overflow: hidden;
    background: #eee;
    margin-bottom: 14px;
}

.pf-shot img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .5s ease;
}

.pf-card a:hover .pf-shot img,
.pf-card a:focus-visible .pf-shot img {
    transform: scale(1.04);
}

.pf-tag {
    display: inline-block;
    font-family: 'josefin-light', sans-serif;
    font-size: 11px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #0e8581;
    margin-bottom: 8px;
}

.pf-card h3 {
    font-family: 'josefin-regular', sans-serif;
    font-size: 15px;
    line-height: 140%;
    text-transform: uppercase;
    margin: 0;
    transition: color .2s;
}

.pf-card a:hover h3,
.pf-card a:focus-visible h3 {
    color: #0e8581;
}

/* --- Secondary projects, as text ------------------------------------------ */

.pf-more {
    margin-top: 44px;
    font-family: 'josefin-light', sans-serif;
    font-size: 13px;
    line-height: 175%;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.pf-more span {
    color: #8a8a8a;
}

.pf-more a {
    color: #222;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
}

.pf-more a:hover,
.pf-more a:focus-visible {
    color: #0e8581;
    border-bottom-color: #0e8581;
}

/* --- Closing statement ---------------------------------------------------- */

.pf-close {
    border-top: 2px solid #222;
    padding: 70px 0 120px;
}

.pf-close h2 {
    font-family: 'josefin-semibold', sans-serif;
    font-size: 26px;
    line-height: 125%;
    text-transform: uppercase;
    max-width: 20ch;
    margin: 0 0 24px;
}

.pf-close p {
    font-family: 'josefin-light', sans-serif;
    font-size: 17px;
    line-height: 168%;
    max-width: 62ch;
    margin-bottom: 32px;
}

/* --- Focus visibility ------------------------------------------------------ */

.pf-nav a:focus-visible,
.pf-card a:focus-visible,
.pf-more a:focus-visible,
.pf-section .btn-cta:focus-visible {
    outline: 2px solid #0e8581;
    outline-offset: 3px;
}

/* --- 992px and up: the 30/70 split ---------------------------------------- */

@media only screen and (min-width: 992px) {

    .pf-layout {
        grid-template-columns: 30% 1fr;
        gap: 60px;
    }

    /* The rail holds position while its projects scroll past, so each category
       reads as its own landing rather than a caption on a list. */
    .pf-rail {
        position: sticky;
        top: 210px;
        align-self: start;
    }

    .pf-rail h2 {
        font-size: 28px;
    }

    .pf-close h2 {
        font-size: 34px;
    }
}

@media only screen and (min-width: 1401px) {

    .pf-nav ul {
        padding: 0 80px;
    }

    .pf-nav a {
        font-size: 16px;
    }

    .pf-rail h2 {
        font-size: 32px;
    }

    .pf-audience {
        font-size: 15px;
    }

    .pf-rail p.pf-body {
        font-size: 18px;
    }

    .pf-close h2 {
        font-size: 40px;
    }

    .pf-close p {
        font-size: 18px;
    }
}

@media only screen and (min-width: 576px) and (max-width: 767px) {
    .pf-nav ul { padding: 0 30px; }
}

@media only screen and (min-width: 768px) and (max-width: 991px) {
    .pf-nav ul { padding: 0 40px; }
}

@media only screen and (min-width: 992px) and (max-width: 1399px) {
    .pf-nav ul { padding: 0 50px; }
}

/* --- Small screens --------------------------------------------------------- */

@media only screen and (max-width: 991px) {

    .pf-nav ul {
        gap: 24px;
    }

    .pf-nav {
        margin-top: 56px;
    }

    .pf-section {
        padding-bottom: 70px;
    }

    .pf-section + .pf-section {
        padding-top: 60px;
    }

}

@media (prefers-reduced-motion: reduce) {

    .pf-shot img,
    .pf-card h3,
    .pf-nav a {
        transition: none;
    }

    .pf-card a:hover .pf-shot img,
    .pf-card a:focus-visible .pf-shot img {
        transform: none;
    }

    html {
        scroll-behavior: auto;
    }
}
