/**
 * Portfolio1 Block Styles
 * Expandable portfolio items with category filtering
 */

.portfolio1-block {
    width: 100%;
    padding: 0;
    background: #F7F7F5;
}

.portfolio1-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Category Filter */
.portfolio1-filter {
    display: flex;
    gap: 0;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding: 25px 58px;
    width: 100%;
    background: #FFFFFF;
}

.portfolio1-filter-btn {
    padding: 16px 32px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-family: 'Switzer', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 20px;
    line-height: 26px;
    letter-spacing: -0.03em;
    color: #757472;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    text-decoration: none;
    position: relative;
}

.portfolio1-filter-btn:not(:last-child)::after {
    content: '•';
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    color: #cccccc;
    font-size: 12px;
}

.portfolio1-filter-btn:hover {
    color: #000000;
}

.portfolio1-filter-btn.active {
    color: #000000;
    text-decoration-line: underline;
}

/* Portfolio Items */
.portfolio1-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.portfolio1-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 120px 0;
    gap: 62px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    width: 100%;
}

.portfolio1-item.hidden {
    display: none;
}

.portfolio1-item.bg-white {
    background: #FFFFFF;
}

.portfolio1-item.bg-gray {
    background: #F7F7F5;
}

/* Inner content wrapper */
.portfolio1-item-inner {
    max-width: 1440px;
    width: 100%;
    padding: 0 58px;
    display: flex;
    flex-direction: column;
    gap: 62px;
}

/* Header Section */
.portfolio1-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0;
    gap: 60px;
    width: 100%;
}

.portfolio1-header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 22px;
    width: 540px;
}

.portfolio1-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    gap: 22px;
    width: 428px;
}

.portfolio1-category {
    font-family: 'Helvetica', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 18px;
    line-height: 140%;
    color: #F237A6;
    margin: 0;
}

.portfolio1-title-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0;
    gap: 30px;
}

.portfolio1-main-title {
    font-family: 'Switzer', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 82px;
    line-height: 110%;
    text-align: left;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    color: #000000;
    margin: 0;
}

.portfolio1-logo-icon {
    width: 62px;
    height: 62px;
    flex-shrink: 0;
}

.portfolio1-logo-icon svg {
    width: 100%;
    height: 100%;
}

.portfolio1-description {
    flex: 1;
}

.portfolio1-description p {
    font-family: 'Helvetica', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 18px;
    line-height: 140%;
    display: flex;
    align-items: center;
    color: #000000;
    margin: 0;
}

.portfolio1-cta-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 0;
    gap: 8px;
    background: transparent;
    border: none;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.portfolio1-cta-text {
    font-family: 'Switzer', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 20px;
    line-height: 26px;
    letter-spacing: -0.03em;
    text-decoration-line: underline;
    color: #000000;
    margin: 0;
    transition: color 0.3s ease;
}

.portfolio1-arrow-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.portfolio1-arrow-icon svg {
    width: 100%;
    height: 100%;
}

.portfolio1-arrow-icon rect {
    fill: #000000;
    transition: fill 0.3s ease;
}

.portfolio1-arrow-icon path {
    stroke: #FFFFFF;
    transition: stroke 0.3s ease;
}

/* Hover effect - invert colors */
.portfolio1-cta-button:hover .portfolio1-arrow-icon rect {
    fill: #FFFFFF;
}

.portfolio1-cta-button:hover .portfolio1-arrow-icon path {
    stroke: #000000;
}

/* Scrollable Image Section */
.portfolio1-image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0;
    gap: 0;
    isolation: isolate;
    width: 100%;
    background: #000000;
}

.portfolio1-image-wrapper {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 58px;
}

.portfolio1-image-container {
    position: relative;
    width: 100%;
    max-width: 1208px;
    margin: 0 auto;
    cursor: pointer;
}

/* MacBook Mockup Frame */
.portfolio1-macbook-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #2c2c2c;
    border-radius: 8px 8px 0 0;
    padding: 12px 12px 0 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);
}

/* Screen area with thin bezel */
.portfolio1-screen-bezel {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000000;
    border-radius: 6px 6px 0 0;
    padding: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

/* Actual screen content area */
.portfolio1-screen-content {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000000;
    border-radius: 3px;
}

.portfolio1-scroll-image {
    width: 100%;
    height: auto;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    transition: none;
    pointer-events: none;
    image-rendering: auto; /* browser default — bilinear/bicubic for smooth downscaling of screenshots */
}

/* MacBook Base (keyboard area) */
.portfolio1-macbook-base {
    position: relative;
    width: 100%;
    height: 16px;
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.portfolio1-macbook-base::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #1a1a1a;
    border-radius: 0 0 4px 4px;
}


/* Mobile Visibility */
.portfolio1-block.hide-mobile {
    display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .portfolio1-header {
        flex-direction: column;
        gap: 30px;
    }

    .portfolio1-header-left,
    .portfolio1-header-right {
        width: 100%;
    }

    .portfolio1-content-inner {
        flex-direction: column;
        gap: 40px;
    }

    .portfolio1-main-title {
        font-size: 48px;
    }

    .portfolio1-macbook-frame {
        padding: 6px 6px 0 6px;
    }

    .portfolio1-macbook-base {
        height: 16px;
    }
}

@media (max-width: 768px) {
    .portfolio1-block {
        /* No top padding: the 40px grey (#F7F7F5) strip sat between the pink
           hero labels and the white filter bar, reading as an unwanted grey
           band. Drop it so the pink connects straight to the white filter. */
        padding: 0 0 40px 0;
    }

    /* Item: vertical padding only — item-inner handles horizontal */
    .portfolio1-item {
        padding: 40px 0;
    }

    /* Item-inner: 20px horizontal padding (was 58px desktop — fixing double-padding) */
    .portfolio1-item-inner {
        padding: 0 20px;
        gap: 30px;
    }

    /* Accordion gap override at mobile */
    .portfolio1-item-inner:has(.portfolio1__details) .portfolio1-image-section {
        margin-top: 30px;
    }

    /* Image section: reduce black vertical padding (was 60px) */
    .portfolio1-image-section {
        padding: 24px 0;
    }

    /* Image wrapper: near-edge to maximise MacBook width */
    .portfolio1-image-wrapper {
        padding: 0 8px;
    }

    .portfolio1-filter {
        padding: 15px 20px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .portfolio1-filter::-webkit-scrollbar {
        display: none;
    }

    .portfolio1-filter-btn {
        padding: 10px 16px;
        font-size: 16px;
        white-space: nowrap;
    }

    .portfolio1-filter-btn:not(:last-child)::after {
        font-size: 10px;
    }

    .portfolio1-main-title {
        font-size: 28px;
    }

    .portfolio1-logo-icon {
        width: 36px;
        height: 36px;
    }

    .portfolio1-description p {
        font-size: 14px;
    }

    .portfolio1-cta-button {
        padding: 10px 0;
    }

    .portfolio1-cta-text {
        font-size: 16px;
    }

    .portfolio1-arrow-icon {
        width: 22px;
        height: 22px;
    }

    .portfolio1-macbook-frame {
        padding: 4px 4px 0 4px;
        /* Taller aspect ratio on mobile — less landscape-constrained */
        aspect-ratio: 4 / 3;
    }

    .portfolio1-screen-bezel {
        padding: 0;
    }

    .portfolio1-macbook-base {
        height: 10px;
    }

    .portfolio1-macbook-base::before {
        width: 40px;
        height: 2px;
    }

    .portfolio1-block.hide-mobile {
        display: block;
    }

    /* Mobile: tap the screenshot to open fullscreen lightbox */
    .portfolio1-screen-content[data-full-image] {
        cursor: pointer;
    }
}

/* ===== PORTFOLIO1 MOBILE LIGHTBOX ===== */

/* Lightbox container — created dynamically by JS, starts invisible */
.portfolio1-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: stretch;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.portfolio1-lightbox.is-open {
    opacity: 1;
}

/* Dark backdrop — clicking it closes the lightbox */
.portfolio1-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

/* Inner container sits above backdrop */
.portfolio1-lightbox__inner {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

/* Close button — top-right corner */
.portfolio1-lightbox__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.portfolio1-lightbox__close:hover,
.portfolio1-lightbox__close:active {
    background: rgba(255, 255, 255, 0.3);
}

/* Scroll container — full height, vertically scrollable */
.portfolio1-lightbox__scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 60px 0 24px;
    box-sizing: border-box;
}

/* The full screenshot image — full width, natural height */
.portfolio1-lightbox__image {
    width: 100%;
    height: auto;
    display: block;
}

/* Lock body scroll while lightbox is open */
body.portfolio1-lightbox-open {
    overflow: hidden;
}

@media (min-width: 769px) {
    .portfolio1-block.hide-mobile {
        display: none;
    }
}

@media (max-width: 576px) {
    .portfolio1-main-title {
        font-size: clamp(22px, 6vw, 28px);
    }

    .portfolio1-title-wrapper {
        gap: 12px;
    }

    .portfolio1-image-wrapper {
        padding: 0 4px;
    }

    .portfolio1-header {
        gap: 20px;
    }

    .portfolio1-category {
        font-size: 14px;
    }
}

/* ─────────────────────────────────────────────────────────
   Portfolio1 Details Accordion
───────────────────────────────────────────────────────── */

/* Remove bottom padding from card when accordion is present */
.portfolio1-item[data-has-details="true"] {
    padding-bottom: 0;
}

/* Zero the flex gap on item-inner so accordion bar sits flush under image-section.
   Re-add the same gap between header and image-section via margin-top. */
.portfolio1-item-inner:has(.portfolio1__details) {
    gap: 0;
}
.portfolio1-item-inner:has(.portfolio1__details) .portfolio1-image-section {
    margin-top: 62px;
}

.portfolio1__details {
    width: 100%;
}

/* ── Toggle bar ── */
.portfolio1__details-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 58px;
    height: 112px;
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #bbbab6;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.portfolio1__details-toggle:hover {
    background: rgba(0, 0, 0, 0.03);
}

.portfolio1__details-title {
    font-family: 'Switzer', sans-serif;
    font-weight: 500;
    font-size: clamp(20px, 2.5vw, 42px);
    letter-spacing: -0.05em;
    color: #000;
    text-transform: uppercase;
}

.portfolio1__details-icon {
    width: 62px;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #000;
}

.portfolio1__details-icon svg {
    display: block;
}

/* Default: plus visible, close hidden.
   Higher specificity (0,2,0) beats .portfolio1__details-icon svg{display:block} (0,1,1). */
.portfolio1__details-icon .portfolio1__details-icon--close {
    display: none;
}

/* Open state: swap icons */
.portfolio1__details-toggle[aria-expanded="true"] .portfolio1__details-icon .portfolio1__details-icon--plus {
    display: none;
}
.portfolio1__details-toggle[aria-expanded="true"] .portfolio1__details-icon .portfolio1__details-icon--close {
    display: block;
}

/* ── Expanded content ── */
.portfolio1__details-content {
    display: none;
    flex-direction: row;
    align-items: flex-start;
    gap: 60px;
    padding: 58px 58px 80px;
}

.portfolio1__details-content.is-open {
    display: flex;
}

/* ── Text column (left) ── */
.portfolio1__details-text {
    flex: 0 0 500px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 42px;
}

/* Full width when no image */
.portfolio1__details-content.has-text-only .portfolio1__details-text {
    flex: 1;
    max-width: 100%;
}

/* Individual section: heading + body */
.portfolio1__details-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.portfolio1__details-heading {
    font-family: 'Switzer', sans-serif;
    font-weight: 500;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    color: #000;
    margin: 0;
}

.portfolio1__details-body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.5;
    color: #141414;
}

.portfolio1__details-body p {
    margin: 0 0 12px;
}

.portfolio1__details-body p:last-child {
    margin-bottom: 0;
}

.portfolio1__details-body ol,
.portfolio1__details-body ul {
    padding-left: 24px;
    margin: 0;
}

.portfolio1__details-body li {
    margin-bottom: 4px;
}

/* ── Image column (right) — full image, no crop ── */
.portfolio1__details-image {
    flex: 1;
    min-width: 0;
    max-width: 652px;
}

/* Full width when no text */
.portfolio1__details-content.has-image-only .portfolio1__details-image {
    max-width: 100%;
}

.portfolio1__details-img,
.portfolio1__details-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .portfolio1__details-toggle {
        padding: 0 24px;
        height: 80px;
    }

    .portfolio1__details-content {
        flex-direction: column;
        padding: 40px 24px 60px;
        gap: 40px;
    }

    .portfolio1__details-text {
        flex: none;
        max-width: 100%;
        width: 100%;
    }

    .portfolio1__details-title {
        font-size: 20px;
    }

    .portfolio1__details-icon {
        width: 40px;
        height: 40px;
    }

    .portfolio1__details-image {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .portfolio1__details-toggle {
        padding: 0 20px;
    }

    .portfolio1__details-content {
        padding: 30px 20px 50px;
    }

    .portfolio1__details-heading {
        font-size: 24px;
    }

    .portfolio1__details-body {
        font-size: 16px;
    }
}
