
/* ----------------------------------------------------------- */
/* WORK PAGE (GRID & FILTERS)                                  */
/* ----------------------------------------------------------- */

/* Work Page Container */
.work-container {
    padding-top: calc(var(--header-offset) + var(--spacing-md));
    padding-bottom: var(--spacing-lg);
    min-height: 100vh;
}

.work-intro-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-md);
    border-bottom: 1px solid #333;
}

.work-intro-section .grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.work-intro-section .col-left {
    padding-right: var(--spacing-md);
}

.work-intro-section .col-right {
    padding-left: var(--spacing-md);
}

.work-intro-section .section-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    margin-top: 0;
}

/* Isometric Title Styles (Global for Work/KhojBeen) */
.isometric-title-container {
    margin-bottom: var(--spacing-md);
}

.specs-project-title-iso {
    font-family: var(--font-heading);
    font-size: clamp(2.6rem, 3.5vw, 3.5rem);
    line-height: 1.0;
    font-weight: 300; /* NORMAL/THIN */
    margin: 0;
    color: #fff;
    text-transform: none;
}

.specs-project-subtitle-iso-new {
    font-family: var(--font-heading);
    font-size: clamp(2.6rem, 3.5vw, 3.5rem); /* Same size as title */
    line-height: 1.0;
    font-weight: 700; /* BOLD */
    margin-top: -10px; /* Reduced space to bring them closer */
    color: #fff;
    text-transform: none;
    opacity: 0.9;
}

.work-intro-section .intro-text {
    font-size: 1.5rem;
    line-height: 1.4;
    font-weight: 300;
    margin-bottom: var(--spacing-md);
}

.work-intro-section .body-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    color: var(--color-ui-muted);
}

/* Page Header */
.work-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.work-header h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.work-header p {
    color: var(--color-ui-muted);
    font-size: 1rem;
    letter-spacing: 1px;
}

/* Instagram Section Styling (Matching Team Cards) */
.instagram-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
}

.instagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

@media (min-width: 720px) {
    .instagram-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

.insta-card {
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.insta-image-wrapper {
    width: 100%;
    aspect-ratio: 5/6;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    position: relative;
    background: #1a1a1a;
}

.insta-image-wrapper::after {
    content: "\25B6"; /* Play icon */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.insta-card:hover .insta-image-wrapper::after {
    opacity: 0.8;
}

.insta-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease, transform 0.5s ease;
}

.insta-card:hover .insta-image {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.insta-info {
    text-align: left;
}

.insta-caption {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--color-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

/* Modal for Instagram Video */
.insta-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.insta-modal.active {
    opacity: 1;
    visibility: visible;
}

.insta-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    height: 90%;
    max-height: 800px;
}

.insta-modal-close {
    position: absolute;
    top: -30px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.insta-modal iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Filters */
.filters-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 10px; /* Reduced gap from 16px */
    margin-bottom: var(--spacing-md);
    padding: 0 var(--spacing-md);
    border-bottom: 1px solid #333;
    padding-bottom: var(--spacing-md);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-secondary);
    padding: 8px 16px;
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent text wrap */
    flex-shrink: 0;
    text-transform: none;
}

.filter-btn:hover {
    color: var(--color-text-primary);
}

.filter-btn.active {
    color: var(--color-accent);
    border: 1px solid var(--color-accent); /* Boxed active state */
}

/* Project Grid (4 Columns) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Changed from 5 to 4 */
    gap: 20px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (max-width: 768px) {
    .work-intro-section {
        padding-left: var(--spacing-lg);   /* body = header/footer padding on small screens */
        padding-right: var(--spacing-lg);
    }

    .project-grid {
        padding-left: var(--spacing-lg);
        padding-right: var(--spacing-lg);
    }
}

@media (min-width: 768px) and (max-width: 1400px) {
    .work-intro-section {
        padding-left: calc(var(--spacing-lg) * 2);
        padding-right: calc(var(--spacing-lg) * 2);
    }

    .project-grid {
        padding-left: calc(var(--spacing-lg) * 2);
        padding-right: calc(var(--spacing-lg) * 2);
    }
}

.project-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3; /* 4:3 Aspect Ratio */
    overflow: hidden;
    background-color: #1a1a1a;
    border: none; /* Removed border for clean gap look */
    cursor: pointer;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.4s ease, transform 0.4s ease;
}

/* Hover Effects */
.project-card:hover {
    z-index: 2; /* Bring to top */
    /* box-shadow: 0 0 20px rgba(0,0,0,0.5); Highlight shadow removed as per minimalist request if needed, but keeping for now */
}

.project-card:hover img {
    filter: grayscale(0%);
    /* transform: scale(1.05); Removed zoom for stricter grid alignment */
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end; /* Title at the bottom */
    justify-content: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 50%); /* Gradient for better readability at bottom */
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 30px 20px; /* Increased bottom padding */
}

.project-card:hover .project-overlay,
.carousel-item:hover .project-overlay {
    opacity: 1;
}

.project-info {
    text-align: center;
    transform: translateY(15px); /* Fade in from slightly below */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    width: 100%;
}

.project-card:hover .project-info,
.carousel-item:hover .project-info {
    transform: translateY(0);
}

/* Page Transition Full-Screen Zoom Animation */
.project-card.transitioning,
.carousel-item.transitioning {
    opacity: 0;
    pointer-events: none;
}

.project-transition-clone {
    position: fixed;
    z-index: 999999;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    pointer-events: none;
    backface-visibility: hidden;
    transform-origin: center center;
    will-change: transform, opacity;
}

.project-transition-clone.expanded {
    opacity: 1;
}

.project-title {
    font-size: 1.2rem;
    color: #fff;
    margin: 0;
    letter-spacing: 1px;
    border: none;
    
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.4;
    text-align: center;
}

.project-location {
    display: none; /* Hide location on grid as per instruction "PROJECT NAME DISPLAY ONLY" */
}

/* Utility */
.hidden {
    display: none !important;
}
@media (max-width: 1600px) {
    /* Maintain 5 columns on large screens */
}

@media (max-width: 1400px) {
    .project-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .project-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .work-container {
        padding-top: 100px;
    }
    .project-card {
        border: none;
        margin-bottom: 2px;
    }
}

@media (max-width: 480px) {
    .project-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* ----------------------------------------------------------- */
/* PROJECT PAGE (WIREFRAME LAYOUT)                             */
/* ----------------------------------------------------------- */

/* Specifications Section Layout */
.specs-section {
    background-color: transparent;
    padding: 0;
    min-height: 100vh; /* Force full screen height */
    height: 100vh; /* Explicit height */
    display: flex;
    align-items: center;
    justify-content: center; /* Center content vertically */
    scroll-snap-align: start; /* Snap to start */
    overflow: hidden; /* Prevent overflow */
}

/* Specific override for auto-height sections (Workshops/Adda) */
.specs-section.auto-height {
    min-height: auto !important;
    height: auto !important;
    padding: 40px 0 !important;
    overflow: visible !important;
}

.specs-layout {
    display: grid;
    grid-template-columns: 1.3fr 1.7fr; /* Specs wider, text narrower */
    gap: var(--spacing-xl);
    align-items: center; /* Vertically center content */
    margin: 0 var(--spacing-md);
    height: 100%;
    width: 100%;
}

.specs-section .container {
    max-width: 1000px;
}

/* Workshop / Adda detail layout (title with image under it) */
.event-detail-layout {
    display: grid;
    grid-template-columns: 1.4fr 1.6fr;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

.event-detail-left {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm); /* Title aur image ke beech ka gap kam */
}

.event-detail-title {
    font-family: var(--font-heading);
    font-size: 2.2rem; /* Thoda chhota, ek line me fit karne ke liye */
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0 0 6px 0;
    border-bottom: none;
    white-space: nowrap; /* Hamesha single line */
    overflow: visible;
}

.event-main-image {
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
}

.event-main-image img {
    width: 100%;
    height: auto;
    max-height: 360px; /* Right side ke text se zyada lamba na लगे */
    object-fit: cover;
    display: block;
}

.event-detail-right {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm); /* Description aur details ke beech ka gap kam */
}

.event-detail-right .overview-text {
    font-family: var(--font-primary);
    font-size: 0.95rem;  /* Changed to match project specs content */
    line-height: 1.7; /* Increased line-height for readability */
    font-weight: 300;
    text-transform: none;
    margin: 0 0 var(--spacing-sm) 0;
    text-align: justify; /* Justify alignment like project details */
}

.event-detail-meta h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 10px 0;
    border-bottom: none;
}

@media (max-width: 768px) {
    .event-detail-layout {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

/* Left Column: Specs Box */
.specs-box {
    background-color: #2a2a2a; /* Distinct background as per wireframe note (blue/dark) */
    border: 1px solid #333;
    padding: var(--spacing-lg);
    position: sticky;
    top: 100px; /* Sticky scroll */
}

.specs-box h3 {
    font-size: 1.1rem;
    color: var(--color-accent);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.spec-row {
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid #3a3a3a;
    padding-bottom: 8px;
}

.spec-row:last-child {
    border-bottom: none;
}

.spec-key {
    display: block;
    font-size: 0.75rem;
    color: var(--color-ui-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.spec-val {
    font-size: 0.95rem;
    color: #fff;
    font-weight: 500;
}

/* Right Column: Overview & Client Speak */
.project-text-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md); /* Reduced from lg to md */
}

.overview-box h2 {
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 10px; /* Reduced from var(--spacing-md) */
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: none;
}

.overview-text {
    font-size: 1rem;
    color: #ddd;
    line-height: 1.8;
    text-align: justify;
}

.client-speak-box {
    margin-top: 0;
    padding-top: var(--spacing-md);
    border-top: 1px solid #333;
}

.client-speak-box h3 {
    font-size: 1.2rem;
    color: var(--color-ui-muted);
    margin-bottom: 10px; /* Reduced from var(--spacing-md) */
    text-transform: uppercase;
}

.quote-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--color-text-secondary);
    border-left: 3px solid var(--color-accent);
    padding-left: var(--spacing-md);
}

/* Visual Carousel Updates */
.visual-carousel-section {
    padding-top: 0;
    margin-top: var(--header-offset);
    position: relative; /* Ensure stacking context */
    z-index: 1;
    min-height: calc(100vh - var(--header-offset)); /* Use min-height instead of fixed height */
    height: auto; /* Allow auto height */
}

.visual-carousel-container {
    position: relative;
    width: 100%;
    height: 80vh; /* Reduce height to 80% viewport to ensure next section is visible/not overlapped */
    overflow: hidden;
}

/* Top Shadow for Header Visibility */
.visual-carousel-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 5;
    pointer-events: none;
}

.visual-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.visual-slide {
    min-width: 100%;
    height: 100%;
}

.visual-slide img {
    width: 100%;
    height: 110%;
    object-fit: cover;
    display: block;
    margin-top: -2px;
}

/* Hero title overlay (workshops, adda, project detail) */
.visual-caption {
    position: absolute;
    bottom: 0; /* Align to bottom for gradient coverage */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    text-align: center;
    width: 100%;
    padding-bottom: 80px; /* Original spacing from bottom */
    padding-top: 100px; /* Space for gradient */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

.visual-carousel-title-iso {
    font-family: var(--font-heading);
    font-size: clamp(2.6rem, 3.5vw, 3.5rem);
    line-height: 1.0;
    font-weight: 300;
    margin: 0;
    color: #fff;
    text-align: center;
}

.visual-carousel-subtitle-iso {
    font-size: clamp(2.6rem, 3.5vw, 3.5rem); /* Same as title */
    font-weight: 700;
    color: #ffffff; /* White color */
    text-align: center;
    margin-top: -10px; /* Reduced space to bring them closer */
    opacity: 0.9;
    font-family: var(--font-body);
    letter-spacing: 0.5px;
}

.visual-nav-btn,
.technical-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: radial-gradient(closest-side, rgba(0,0,0,0.2) 0%, transparent 70%);
    border: none !important;
    outline: none;
    color: #ffffff;
    width: 80px;
    height: 80px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, color 0.3s ease, background 0.3s ease;
    z-index: 10;
    border-radius: 50%;
}

.visual-carousel-container:hover .visual-nav-btn {
    opacity: 1;
}

.visual-nav-btn:hover,
.technical-nav-btn:hover {
    color: var(--color-accent);
    background: radial-gradient(closest-side, rgba(0,0,0,0.4) 0%, transparent 70%);
}

/* Position hero carousel arrows on left/right edges */
.visual-carousel-container .prev-visual {
    left: 20px;
}

.visual-carousel-container .next-visual {
    right: 20px;
}

/* Responsive Project Page */
@media (max-width: 992px) {
    .specs-layout {
        grid-template-columns: 1fr;
    }
    .specs-box {
        position: static;
        margin-bottom: var(--spacing-lg);
    }
}

/* Related Projects Carousel */
.related-carousel-container {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.related-section .related-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md) 30px; /* Reduced bottom padding */
}

.related-section .related-title {
    margin-bottom: 20px;
    letter-spacing: 1px;
    color: var(--color-text-primary);
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
}

.related-carousel-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
}

.related-carousel-container .carousel-item {
    min-width: calc(25% - 15px); /* 4 items per row (100% / 4 minus gap) */
    width: calc(25% - 15px);
    aspect-ratio: 1/1; /* Square */
    position: relative;
    cursor: pointer;
    overflow: hidden; /* Prevent overlay spillover */
}

@media (max-width: 992px) {
    .related-carousel-container .carousel-item {
        min-width: calc(50% - 10px); /* 2 items per row */
        width: calc(50% - 10px);
    }
}

@media (max-width: 576px) {
    .related-carousel-container .carousel-item {
        min-width: 100%; /* 1 item per row */
        width: 100%;
    }
}

.related-carousel-container .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.related-carousel-container .carousel-item:hover img {
    filter: grayscale(0%);
}

/* Combined Footer Section */
.combined-footer-section {
    min-height: calc(100vh - var(--header-offset));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: var(--spacing-lg);
    gap: 80px; /* Increased gap between sections */
    scroll-snap-align: start;
    position: relative;
    background: var(--color-bg-primary);
}

/* Trivia Section Layout (Project Page) */
.trivia-section {
    padding-bottom: 0; /* Removed padding */
}

.trivia-section .trivia-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md) 20px; /* Reduced bottom padding */
}

.trivia-section .grid-layout,
.related-section .grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.trivia-section .col-left,
.related-section .col-left {
    padding-right: var(--spacing-md);
}

.trivia-section .col-right,
.related-section .col-right {
    padding-left: var(--spacing-md);
}

.trivia-section .trivia-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    line-height: 1.1;
    margin: 0 0 var(--spacing-md);
    font-weight: 700;
}

.trivia-section .trivia-text,
.related-section .trivia-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-ui-muted);
    margin: 0;
    text-align: right;
}

/* Adjust children spacing */
.combined-footer-section .related-section {
    display: flex;
    align-items: flex-start; /* Align to top */
}

.combined-footer-section .site-footer {
    margin-top: auto; /* Push footer to bottom */
}

/* Remove separate scroll snap from children if present */
.combined-footer-section > * {
    scroll-snap-align: none;
}

@media (max-width: 768px) {
    .combined-footer-section {
        min-height: auto;
        padding-top: var(--spacing-md);
    }
    .trivia-section .grid-layout,
    .related-section .grid-layout {
        grid-template-columns: 1fr;
    }
    .trivia-section .col-left,
    .trivia-section .col-right,
    .related-section .col-left,
    .related-section .col-right {
        padding: 0;
    }
    .trivia-section .trivia-text,
    .related-section .trivia-text {
        text-align: left;
        margin-top: var(--spacing-sm);
    }
    .combined-footer-section .related-section {
        align-items: flex-start;
    }
}

@media (max-height: 700px) {
    .combined-footer-section {
        min-height: auto;
    }
}
