/* ==========================================================================
   ../css/case-study.css 
   Case Study Layout - Edwin Clay Hymas Portfolio
   ========================================================================== */

/* --- 1. Global Header Override & Base Structure --- */ 
.main-header { 
  background-color: rgba(14, 114, 180, 1);
  border-bottom: 2px solid rgba(255, 255, 255, .8);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
} 

/* --- 1. Base Structural Layout & Header Safety Buffer --- */
.case-study {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    /* Exact layout safety buffer from about.css to push below fixed headers */
    padding-top: clamp(6rem, 5rem + 3vw, 12rem);
    padding-bottom: clamp(4rem, 3rem + 3vw, 10rem);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

.phase-two{
    background-color: var(--bg-secondary);
    border-bottom: 1px solid rgba(0, 50, 78, 0.08);
    border-top: 1px solid rgba(0, 50, 78, 0.08);
}

/* --- 2. Hero Header Block --- */
.case-study-hero {
    padding-bottom: 2.5rem;
    transition: border-color 0.3s ease;
}

.case-study-hero h1 {
    line-height: 1.1;
    margin-bottom: 1.25rem;
}

.case-study-hero .subtitle {
    font-size: clamp(1rem, 1rem + 1vw, 1.2rem);
    margin-bottom: 2.5rem;
}

/* Interactive Button Group */
.case-study-action-group { 
    display: flex; 
    gap: 15px; 
    margin-top: 2.5rem;
    flex-wrap: wrap;
    .btn{
        font-size: clamp(.8rem, 5vw, 1.25rem);
    }
} 



/* Project Meta Grid Module */
.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.75rem;
    background-color: rgba(0, 50, 78, 0.04);
    border-left: 4px solid #00324e; /* Clean accent indicator edge matches about.css style */
    padding: 1.75rem;
    border-radius: 0 8px 8px 0;
    
}

.visual-caption{
    font-size: 1rem;
    margin: .5rem 2.2rem 0 2.2rem;
}

.meta-item {
    font-size: 0.95rem;
    text-wrap: balance;
}

.meta-item strong {
    display: block;
    color: #00324e;
    margin-bottom: 6px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

/* --- 3. Body Typography & Case Study Structure --- */
.cs-section {
    margin: 2rem 0;
}

.cs-section h2 {
    font-size: clamp(1.8rem, 1.5rem + 2vw, 2.5rem);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.cs-section h3 {
    font-size: 1.4rem;
    margin: 2.5rem 0 1rem 0;
    letter-spacing: 0.05rem;
}

.cs-section p {
    margin-bottom: 1.25rem;
}

.cs-section ul {
    margin-bottom: 1.5rem;
    padding-left: 24px;
}

.cs-section li {
    margin-bottom: 0.75rem;
}

/* --- 4. Custom UI Containers --- */

/* Objective Callout Box */
.callout-box {
    background-color: rgba(0, 50, 78, 0.04);
    border-left: 4px solid #00324e;
    padding: 1.75rem;
    margin: 2.5rem 0;
    border-radius: 0 8px 8px 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.callout-box p {
    margin: 0;
    font-size: 1.1rem;
}

/* Wireframe & Prototype Placeholders */
.image-placeholder {
    background-color: rgba(0, 50, 78, 0.02);
    border: 2px dashed rgba(0, 50, 78, 0.2);
    border-radius: 8px;
    height: clamp(200px, 150px + 15vw, 340px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2.5rem 0;
    padding: 24px;
    text-align: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.placeholder-text {
    opacity: 0.6;
    font-weight: 500;
    font-family: monospace;
    font-size: 0.95rem;
    margin: 0;
}

/* Outcome Metrics Dashboard Style */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    margin-top: 2rem;
}

.metric-card {
    background-color: rgba(0, 50, 78, 0.04);
    border-left: 4px solid #00324e;
    padding: 1.75rem;
    border-radius: 0 8px 8px 0;
    /* Clean micro-interaction animation matching about.css specs */
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s ease, border-color 0.3s ease;
    will-change: transform;
}

/* Horizontal glide interaction pattern */
.metric-card:hover {
    transform: translateX(4px);
    background-color: rgba(0, 50, 78, 0.06);
}

.metric-card h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    letter-spacing: 0.05rem;
}

.metric-card p {
    margin: 0;
    font-size: 0.95rem;
}

/* --- 5. Responsive Structural Overrides --- */
@media (max-width: 768px) {
    .project-meta-grid {
        grid-template-columns: 1fr; /* Single column flow for mobile readability */
    }
}

/* --- 6. Dark Mode Color Palette System --- */
[data-theme="dark"] .case-study-hero {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .project-meta-grid,
[data-theme="dark"] .callout-box,
[data-theme="dark"] .metric-card {
    background-color: rgba(255, 255, 255, 0.04);
    border-left-color: #0F7BC2; /* Matched to alternate dark mode blue accent */
}

[data-theme="dark"] .project-meta-grid h4,
[data-theme="dark"] .metric-card h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .meta-item strong {
    color: #0d94e2; /* Maps neatly to your active dark link elements */
}

[data-theme="dark"] .metric-card:hover {
    background-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .image-placeholder {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.15);
}


/* --- Persona Component Grid Styles --- */
.persona-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    margin: 2.5rem 0 0 0;
}

.persona-card {
    background-color: rgba(0, 50, 78, 0.04);
    border-left: 4px solid #00324e;
    padding: 1.75rem;
    border-radius: 0 8px 8px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* Smooth horizontal glide transition matched perfectly to about.css pattern */
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.2s ease, border-color 0.3s ease;
    will-change: transform;
}

.persona-card:hover {
    transform: translateX(4px);
    background-color: rgba(0, 50, 78, 0.06);
}

.persona-card h3 {
    font-size: 1.6rem;
    margin: 0.25rem 0 0.75rem 0;
    text-transform: uppercase;
}

.persona-quote {
    font-style: italic;
    font-size: 0.95rem;
    line-height: 1.4;
    opacity: 0.85;
    margin-bottom: 1.25rem;
    padding-left: 10px;
    border-left: 2px solid rgba(0, 50, 78, 0.3);
}

.persona-body {
    margin-top: auto;
    border-top: 1px solid rgba(0, 50, 78, 0.1);
    padding-top: 1rem;
}

.persona-meta {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.persona-meta:last-child {
    margin-bottom: 0;
}

/* Dark Mode Overrides for Personas */
[data-theme="dark"] .persona-card {
    background-color: rgba(255, 255, 255, 0.04);
    border-left-color: #0F7BC2;
}

[data-theme="dark"] .persona-card:hover {
    background-color: rgba(255, 255, 255, 0.07);
}

[data-theme="dark"] .persona-quote {
    border-left-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .persona-body {
    border-top-color: rgba(255, 255, 255, 0.1);
}


/* --- Phase 2: Tri-Discovery Layout Elements --- */
.wireframe-slider-container {
    margin: 3rem 0;
    width: 100%;
}

.mockup-blueprint {
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px dashed rgba(0, 50, 78, 0.2);
    border-radius: 8px;
    padding: 2rem;
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.bp-search-bar {
    border: 1px solid rgba(0, 50, 78, 0.2);
    padding: 0.75rem;
    border-radius: 4px;
    background: transparent;
    opacity: 0.7;
}

.bp-alphabet-row {
    letter-spacing: 0.2rem;
    font-weight: bold;
    opacity: 0.8;
    text-align: center;
    border-bottom: 1px solid rgba(0, 50, 78, 0.1);
    padding-bottom: 0.75rem;
}

.bp-accordion-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bp-node {
    background-color: rgba(0, 50, 78, 0.03);
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid #00324e;
}

/* Dark Mode Overrides for Wireframe Blueprint Box */
[data-theme="dark"] .mockup-blueprint {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .bp-search-bar {
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .bp-alphabet-row {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .bp-node {
    background-color: rgba(255, 255, 255, 0.03);
    border-left-color: #0F7BC2;
}

/* --- Phase 3: Interactive Triad Container Styles --- */
.triad-container {
    margin: 2.5rem 0;
    width: 100%;
    border: 1px solid rgba(0, 50, 78, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(0, 50, 78, 0.01);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

/* Tab Navigation Header Layout */
.triad-tabs {
    display: flex;
    background-color: rgba(0, 50, 78, 0.04);
    border-bottom: 1px solid rgba(0, 50, 78, 0.1);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.triad-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 1.25rem 1rem;
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.25rem;
    letter-spacing: 0.05rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.triad-tab-btn:hover {
    opacity: 0.9;
    background-color: rgba(0, 50, 78, 0.02);
}

.triad-tab-btn.active {
    opacity: 1;
    background-color: var(--bg-primary);
    border-bottom: 2px solid var(--badge-label-accent-text);
}

.tab-badge {
    font-family: system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    background-color: rgba(0, 50, 78, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0.8;
    transition: background-color 0.3s ease;
}

.triad-tab-btn.active .tab-badge {
    background-color: var(--bg-dark-color-primary);
    color: #ffffff;
}

/* Panel Layout System */
.triad-panel {
    padding: 2.25rem;
    animation: fadeIn 0.3s ease-in-out;
}

/* Hides inactive panels safely */
.triad-panel[hidden] {
    display: none !important;
}

.triad-content-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

.triad-metric-summary h3 {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    margin: 0.5rem 0 1rem 0;
    line-height: 1.2;
}

.triad-action-card {
    background-color: var(--bg-primary);
    border-left: 4px solid var(--badge-label-accent-text);
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.triad-action-card strong {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
}

.triad-action-card ul {
    margin: 0;
    padding-left: 18px;
}

.triad-action-card li {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.triad-action-card li:last-child {
    margin-bottom: 0;
}

/* --- Dark Mode Configuration Synchronizations --- */
[data-theme="dark"] .triad-container {
    border-color: rgba(255, 255, 255, 0.1);
    background-color: rgba(255, 255, 255, 0.01);
}

[data-theme="dark"] .triad-tabs {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .triad-tab-btn.active {
    background-color: #222222; /* Matches your --bg-primary token exactly */
    border-bottom-color: #0d94e2;
}

[data-theme="dark"] .triad-tab-btn.active .tab-badge {
    background-color: #0d94e2;
}

[data-theme="dark"] .tab-badge {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .triad-action-card {
    background-color: rgba(255, 255, 255, 0.02);
    border-left-color: #0F7BC2;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Structural Refinements */
@media (max-width: 768px) {
    .triad-content-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .triad-panel {
        padding: 1.5rem;
    }
    .triad-tabs {
        flex-direction: column;
    }
    .triad-tab-btn {
        justify-content: flex-start;
        border-bottom: 1px solid rgba(0, 50, 78, 0.05);
        padding: 1rem;
    }
    [data-theme="dark"] .triad-tab-btn {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }
    .triad-tab-btn.active {
        border-bottom: none;
        border-left: 3px solid var(--badge-label-accent-text);
    }
    [data-theme="dark"] .triad-tab-btn.active {
        border-left-color: #0d94e2;
    }
}


/* --- Case Study UI Screenshot Gallery Layout --- */
.case-study-visual-stack {
    margin: 2rem 0;
    width: 100%;
}

.case-study-visual-stack h3 {
    font-size: 1.8rem;
    margin: 0.5rem 0 1rem 0;
}

.visual-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.gallery-item {
    background-color: var(--bg-primary);
    border: 1px solid rgba(0, 50, 78, 0.1);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.2s ease, border-color 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 50, 78, 0.08);
}

/* Simulated Browser Wrapper Header */
.browser-frame-mock {
    background-color: rgba(0, 50, 78, 0.04);
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0, 50, 78, 0.08);
    display: flex;
    gap: 6px;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.browser-frame-mock .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(0, 50, 78, 0.15);
}

.gallery-img {
    width: 100%;
    height: auto;
    display: block;
    border-bottom: 1px solid rgba(0, 50, 78, 0.05);
}

.gallery-item figcaption {
    padding: 1.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    opacity: 0.9;
    margin-top: auto;
}

/* --- Dark Mode Configuration Syncs --- */
[data-theme="dark"] .gallery-item {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .gallery-item:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .browser-frame-mock {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .browser-frame-mock .dot {
    background-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .gallery-img {
    border-bottom-color: rgba(255, 255, 255, 0.08);
    filter: brightness(0.95); /* Softens stark white screenshots inside dark themes */
}

/* Tablet Layout Optimization */
@media (max-width: 900px) {
    .visual-gallery-grid {
        grid-template-columns: 1fr; /* Drop to clean single stack layout below desktop break metrics */
        gap: 2rem;
    }
}


/* --- Clickable Gallery Zoom Enhancements --- */
.gallery-img {
    cursor: zoom-in; /* Signals interactively to the user that the image expands */
    transition: filter 0.3s ease, transform 0.2s ease;
}

.gallery-img:hover {
    filter: brightness(1.05);
}

.gallery-img:focus-visible {
    outline: 3px solid var(--badge-label-accent-text);
    outline-offset: -3px;
}

/* Lightbox Modal Backdrop Overlay */
.lightbox-modal {
    position: fixed;
    z-index: 10000; /* Forces visibility above global elements and mobile headers */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 30, 50, 0.85);
    backdrop-filter: blur(12px); /* Premium soft blur layer style matching advanced portfolio interfaces */
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 24px;
}

.lightbox-modal.open {
    opacity: 1;
    pointer-events: auto;
}

/* Close Control Button Configuration */
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 300;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
    padding: 10px;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: var(--badge-label-accent-text);
    transform: scale(1.1);
}

/* Expanded Image Constraints */
.lightbox-content {
    max-width: 90%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.97);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox-modal.open .lightbox-content {
    transform: scale(1);
}

/* Text Caption Module Overlay Alignment */
#lightbox-caption {
    margin-top: 1.5rem;
    color: #ffffff;
    text-align: center;
    max-width: 750px;
    font-size: 0.95rem;
    line-height: 1.5;
}

#lightbox-caption strong {
    color: #25c47a; /* Uses a high contrast color matching your green token design logic */
}

/* Dark Mode Background Adaptations */
[data-theme="dark"] .lightbox-modal {
    background-color: rgba(10, 10, 10, 0.92);
}
