/* ========================================
   Portfolio & Case Study styles
   Home case study section, case studies index, single case study, results metrics
   Ported from dc-2023 / DigitalCreative
   ======================================== */

/* Home case study section – matches DigitalCreative (portfolio-hero-showcase + case-study-details) */
section.home-case-studies .container {
    padding-top: 0;
}
.home-case-studies h2 {
    margin-bottom: 3rem;
    text-align: center;
}
.home-case-studies .container h2 {
    border-top: 3px solid #eee;
    padding-top: 4rem;
    margin-bottom: 2rem;
}
/* Match DigitalCreative homepage case study layout */
.home-case-studies .portfolio-hero-showcase {
    margin-top: 0;
    padding: 1rem 4rem 4rem;
}
.home-case-studies .portfolio-hero-showcase .portfolio-hero-grid {
    max-width: 70rem;
    margin: 0 auto;
}
.home-case-studies .case-study-details {
    margin: 0 0 3rem 0;
}
.home-case-studies-grid {
    display: grid;
    gap: 2rem;
}
.home-case-studies-grid.cs-grid-1 {
    grid-template-columns: 1fr;
}
.home-case-studies-grid.cs-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}
.home-case-studies-grid.cs-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 767px) {
    .home-case-studies-grid.cs-grid-2,
    .home-case-studies-grid.cs-grid-3 {
        grid-template-columns: 1fr;
    }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .home-case-studies-grid.cs-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}
.home-case-study-item {
    display: flex;
    flex-direction: column;
}
.home-case-study-item .portfolio-hero-showcase {
    margin-bottom: 1.5rem;
}
.portfolio-hero-grid-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.home-case-study-item .portfolio-hero-image {
    transition: transform 0.2s ease;
}
.home-case-study-item .case-study-details h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.home-case-study-item .case-study-details h3 a,
.home-case-study-item .case-study-details h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}
.home-case-study-item .case-study-details h3 a:hover,
.home-case-study-item .case-study-details h4 a:hover {
    color: #1ca190;
}
.home-case-study-item .case-study-details h4 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #6b7280;
}

/* Flexible grid (featured case studies – mix full width and 2 column per item) */
.home-case-studies-grid.cs-grid-flexible {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}
.home-case-studies-grid.cs-grid-flexible .cs-item-full {
    grid-column: 1 / -1;
}
.home-case-studies-grid.cs-grid-flexible .cs-item-2col {
    grid-column: span 1;
}
@media (max-width: 767px) {
    .home-case-studies-grid.cs-grid-flexible {
        grid-template-columns: 1fr;
    }
    .home-case-studies-grid.cs-grid-flexible .cs-item-full,
    .home-case-studies-grid.cs-grid-flexible .cs-item-2col {
        grid-column: span 1;
    }
}

/* Case studies index page */
.case-studies-list {
    display: grid;
    gap: 2rem;
    margin-top: 1.5rem;
}
.case-study-teaser {
    border: none;
    margin-bottom: 2rem;
}
.case-study-teaser a {
    padding-bottom: 1rem;
    border: 2px solid transparent;
    padding: 1.5rem;
    border-radius: 1rem;
}
.case-study-teaser a h2 {
    transition: all 0.3s ease;
}
.case-study-teaser a:hover {
    text-decoration: none;
    box-shadow: 0 0 20px #00000025;
}
.case-study-teaser a:hover h2 {
    color: #1ca190;
}

.case-study-teaser-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.case-study-teaser-img {
    margin-bottom: 1rem;
    border-radius: 4px;
    overflow: hidden;
}
.case-study-teaser-img img {
    width: 100%;
    height: auto;
    display: block;
}
.case-study-teaser-details {
    padding: 1rem;
}
.case-study-teaser-details h2 {
    margin: 0 0 0.5rem 0;
}

.case-study-teaser-cta {
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: #1ca190;
    font-weight: 500;
    border: 2px solid #00000010;
    border-radius: 100px;
    padding: 0.7rem 1.4rem;
}
.case-study-teaser .case-study-teaser-cta:hover {
    background-color: #1ca190;
    color: #fff;
}

.case-study-meta {
    margin: 1rem 0;
}
.hero-meta {
    display: flex;
    gap: 1rem;
    font-size: 1rem;
    line-height: 1.6;
}
.meta-item {
    margin: 0 0 1.5rem 0;
    border: 1px solid #ddd;
    padding-bottom: 1rem;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    gap: 0.5rem;
    flex-direction: column;
    padding: 1.5rem;
    width: 100%;
}
.meta-label {
    font-weight: 700;
}
.case-study-hero-images {
    margin: 1rem 0;
}
.case-study-hero-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.case-study-hero-grid .case-study-hero-image {
    flex: 1 1 auto;
    min-width: 0;
}
.case-study-hero-grid .case-study-hero-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 767px) {
    .hero-meta {
        flex-direction: column;
        gap: 0.02rem;
        margin: 0;
    }
    .meta-item {
        margin: 0 0 1rem 0;
        padding: 1rem;
    }
}

/* Portfolio Case Study (single page) – Hero layout + Design Process tabs/grid */
.portfolio-case-study {
    min-height: 50vh;
}

.case-study-section h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.case-study-section h3 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.portfolio-hero-content {
    margin-bottom: 2rem;
}
.portfolio-hero-content .lead {
    font-size: 1.4rem;
    margin-bottom: 2rem;
}

.portfolio-hero-showcase {
    /* margin-top: 2rem; */
    padding: 3rem 2rem;
    border-radius: 12px;
    background: linear-gradient(to bottom right, #dbeafe, #e0f2fe, #dbeafe);
    background: linear-gradient(to bottom right, #dbeafe, #e0f2fe, #23e2c7);
    background: linear-gradient(to bottom right, #f3f8ff, #acfff4, #23e2c7);
}
.portfolio-hero-grid {
    display: flex;
    gap: 3%;
    max-width: 70rem;
    margin: 0 auto;
    justify-content: center;
    align-items: flex-start;
}
.portfolio-hero-grid .portfolio-hero-image {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    position: relative;
    overflow: visible;
    perspective: 1000px;
    transform-style: preserve-3d;
}
/* Match DigitalCreative .portfolio-hero-image img dimensions and 3D transform setup */
.portfolio-hero-grid .portfolio-hero-image img {
    width: 100%;
    max-width: 280px;
    max-height: 470px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    object-fit: cover;
    object-position: top;
    transform: scale(1) rotateY(0deg);
    transform-origin: center center;
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out;
    will-change: transform;
    backface-visibility: hidden;
}
@media (min-width: 1024px) {
    .portfolio-hero-grid .portfolio-hero-image img {
        max-height: 550px;
    }
}
@media (min-width: 1100px) {
    .portfolio-hero-grid {
        gap: 0%;
    }
}
@media (max-width: 767px) {
    .portfolio-hero-grid .portfolio-hero-image:nth-child(3) {
        display: none;
    }

    .portfolio-hero-content h1 {
        font-size: 3.2rem;
    }

    .case-study-section h2 {
        font-size: 2.5rem;
    }

    .case-study-section h3 {
        font-size: 2rem;
    }
}

/* Teaser hero (case studies index): same dimensions as main hero / DigitalCreative */
.portfolio-hero-showcase-teaser {
    /* padding: 1.25rem; */
    border-radius: 12px;
    background: linear-gradient(to bottom right, #dbeafe, #e0f2fe, #dbeafe);
}
.portfolio-hero-showcase-teaser .portfolio-hero-grid {
    max-width: 100%;
    gap: 2%;
}
.portfolio-hero-showcase-teaser .portfolio-hero-image img {
    width: 100%;
    max-width: 280px;
    max-height: 470px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    object-fit: cover;
    object-position: top;
    transform: scale(1) rotateY(0deg);
    transform-origin: center center;
    transform-style: preserve-3d;
    transition: transform 0.2s ease-out;
    will-change: transform;
    backface-visibility: hidden;
}
@media (min-width: 1024px) {
    .portfolio-hero-showcase-teaser .portfolio-hero-image img {
        max-height: 550px;
    }
}
@media (min-width: 768px) {
    .portfolio-hero-showcase-teaser .portfolio-hero-image:nth-child(3) {
        display: flex;
    }
}

/* Screenshots section (optional: single grid of images) */
.portfolio-screenshots-section .portfolio-screenshots-header {
    text-align: center;
    margin-bottom: 2rem;
}
.portfolio-screenshots-header p {
    font-size: 1.125rem;
    color: #4b5563;
    max-width: 42rem;
    margin: 0.5rem auto 0;
}
.portfolio-screenshots-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
/* Lightgallery list (case study Screenshots): same pattern as #lightgallery on portfolio */
#lightgallery-screenshots.portfolio-screenshots-grid,
.portfolio-screenshots-section .portfolio-screenshots-grid.list-unstyled {
    list-style: none;
    padding: 0;
    margin: 0;
}
#lightgallery-screenshots li {
    cursor: pointer;
}
@media (min-width: 640px) {
    .portfolio-screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .portfolio-screenshots-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}
.portfolio-screenshot-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
    background: #f9fafb;
}
.portfolio-screenshots-section .portfolio-screenshot-item.shadow {
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}
.portfolio-screenshot-item:hover,
#lightgallery-screenshots li:hover .portfolio-screenshot-item {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.portfolio-screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Design Process section */
.portfolio-process-header {
    text-align: center;
    margin-bottom: 2rem;
}
/* .portfolio-process-header h2 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
} */
.portfolio-process-header p {
    font-size: 1.125rem;
    color: #4b5563;
    max-width: 42rem;
    margin: 0 auto;
}
.portfolio-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.portfolio-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border-radius: 9999px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #4b5563;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0;
    font-weight: 400;
}
.portfolio-tab:hover {
    background: #f9fafb;
    color: #111827;
}
.portfolio-tab.active {
    background: #1ca190;
    color: white;
    border-color: #1ca190;
    box-shadow: 0 10px 15px -3px rgba(28, 161, 144, 0.4);
}
.portfolio-tab .tab-check {
    display: none;
    width: 1rem;
    height: 1rem;
    vertical-align: middle;
    margin-left: 0.5rem;
}
.portfolio-tab.active .tab-check {
    display: inline-block;
}
.portfolio-tab .tab-check svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Portfolio grid (Design Process images) */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 3rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.portfolio-grid.fade-out {
    opacity: 0;
}
.portfolio-grid.fade-in {
    opacity: 1;
}

@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
}

.portfolio-image-card {
    position: relative;
    max-height: 650px;
    cursor: pointer;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    transition:
        background-color 0.5s ease,
        box-shadow 0.2s ease;
}
.portfolio-image-card.showing-hifi {
    background: #f6f8fa;
}
.portfolio-image-card.showing-lofi {
    background: #fff;
}
.portfolio-image-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.portfolio-image-wrapper {
    position: relative;
    width: 100%;
}
.portfolio-image-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    object-fit: cover;
    object-position: top;
}
.portfolio-image-primary {
    position: relative;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.5s ease;
}
.portfolio-image-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    object-fit: cover;
    object-position: top;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.portfolio-image-card.showing-hifi .portfolio-image-primary {
    opacity: 1;
}
.portfolio-image-card.showing-hifi .portfolio-image-overlay {
    opacity: 0;
}
.portfolio-image-card.showing-lofi .portfolio-image-primary {
    opacity: 0;
}
.portfolio-image-card.showing-lofi .portfolio-image-overlay {
    opacity: 1;
}

/* Results metrics (case study Results section) */
.results-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.metric-card {
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    line-height: 1.65;
}
.metric-value {
    font-size: 3rem;
    font-weight: 700;
    color: #1ca190;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.metric-label {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}
.metric-change {
    font-size: 0.875rem;
    color: #6b7280;
}
.metric-note {
    font-size: 0.875rem;
    color: #059669;
    font-weight: 500;
    margin-top: 0.25rem;
}

@media (max-width: 768px) {
    .results-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .metric-value {
        font-size: 2.5rem;
    }
}
