/* ===========================
   project.css — DIY Solutions
   =========================== */

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}
/* Prevent over-stretching on large screens (MacBooks) */
body {
    max-width: 100vw;
    overflow-x: hidden;
}


/* Ensure all wrappers behave */
* {
    box-sizing: border-box;
}

body {
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}



/* ══════════════════════════
   PROJECTS GRID
   ══════════════════════════ */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    position: relative;
    padding: 2rem 0;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ══════════════════════════
   PROJECT CARD — BASE
   ══════════════════════════ */

.project-card {
    position: relative;
    background: white;
    border: 2px solid #e8e8ed;
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-height: 320px;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

.project-card:hover {
    border-color: #1d1d1f;
}

@media (hover: hover) {
    .project-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    }
}

.project-card:focus {
    outline: 2px solid #1d1d1f;
    outline-offset: 4px;
}

/* ══════════════════════════
   CARD FRONT
   ══════════════════════════ */

.project-card-front {
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: opacity 0.3s ease;
}

.project-card.expanded .project-card-front {
    opacity: 0;
    pointer-events: none;
}

.project-logo {
    margin-bottom: 2rem;
}

.logo-placeholder {
    width: 180px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.project-card:hover .logo-placeholder {
    transform: scale(1.05);
}

.project-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.project-subtitle {
    font-size: 1rem;
    color: #6e6e73;
    font-weight: 400;
}

/* ══════════════════════════════════════════
   EXPANDED CARD — Two Column Layout
   Left: scrollable content | Right: media
   ══════════════════════════════════════════ */

.project-card.expanded {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: 92vw;
    max-width: 1100px;
    height: 88vh;
    max-height: 860px;
    z-index: 99999;
    box-shadow: 0 25px 100px rgba(0, 0, 0, 0.3);
    border-color: #1d1d1f;
    overflow: hidden;
    border-radius: 24px;
}

.project-card-expanded {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
    padding: 0;
}

.project-card.expanded .project-card-expanded {
    opacity: 1;
    pointer-events: auto;
}

/* Two-column grid wrapper */
.expanded-inner {
    display: grid;
    grid-template-columns: 1fr 360px;
    height: 100%;
}

/* LEFT — scrollable text */
.expanded-left {
    overflow-y: auto;
    padding: 3rem 2.5rem 3rem 3rem;
    border-right: 1px solid #e8e8ed;
}

.expanded-left::-webkit-scrollbar { width: 6px; }
.expanded-left::-webkit-scrollbar-track { background: #f5f5f7; }
.expanded-left::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: 10px; }
.expanded-left::-webkit-scrollbar-thumb:hover { background: #b0b0b5; }

/* RIGHT — media panel */
.expanded-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 2.5rem 2rem 2rem 2rem;
    background: #f5f5f7;
    overflow-y: auto;
}

.expanded-right::-webkit-scrollbar { width: 4px; }
.expanded-right::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: 10px; }

/* Images */
.expanded-img {
    width: 100%;
    height: 155px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e8e8ed;
    display: block;
}

/* Video embed */
.expanded-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e8ed;
}

.expanded-video iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Section labels above media */
.media-label {
    font-size: 0.68rem;
    font-weight: 700;
    color: #86868b;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: -4px;
}

/* Close button */
.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #1d1d1f;
    color: white;
    border: none;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.close-btn:hover {
    background: #3a3a3c;
    transform: rotate(90deg);
}

.close-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Expanded text styles */
.expanded-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 0.4rem;
    letter-spacing: -0.03em;
    padding-right: 2.5rem;
    line-height: 1.2;
}

.expanded-subtitle {
    font-size: 1.1rem;
    color: #6e6e73;
    margin-bottom: 2rem;
    font-weight: 400;
}

.content-section {
    margin-bottom: 1.75rem;
}

.content-section h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
}

.content-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #3a3a3c;
    font-weight: 400;
}

.content-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.content-section ul li {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #3a3a3c;
    padding-left: 1.25rem;
    position: relative;
    margin-bottom: 0.4rem;
}

.content-section ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1d1d1f;
    font-weight: 700;
    font-size: 1.1rem;
}

/* ══════════════════════════
   OVERLAY
   ══════════════════════════ */

.project-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99998;
}

.project-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ══════════════════════════
   ANIMATIONS
   ══════════════════════════ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════ */

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card.expanded {
        width: 95vw;
        height: 92vh;
        max-height: none;
        border-radius: 20px;
        overflow: hidden;
    }

    /* Mobile: stack into tabs — text first, media second */
    .expanded-inner {
        display: flex;
        flex-direction: column;
        height: 100%;
        overflow: hidden;
    }

    .expanded-left {
        overflow-y: auto;
        padding: 56px 1.25rem 1.25rem;
        border-right: none;
        border-bottom: 1px solid #e8e8ed;
        flex: 1;
        min-height: 0;
    }

    .expanded-right {
        padding: 1rem 1.25rem 1.25rem;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
        background: #f5f5f7;
    }

    .expanded-title { font-size: 1.5rem; }
    .expanded-subtitle { font-size: 0.9rem; }

    /* Make instagram embeds taller on mobile */
    .instagram-embed-wrapper {
        padding-top: 120% !important;
    }
}