/* ══════════════════════════════════════════════════════
   modals.css
   Project lightbox modal + inner content styles
   (About / Skills / Contact now rendered as page sections)
   ══════════════════════════════════════════════════════ */

/* === INNER CONTENT STYLES (used in page sections) === */
.about-text p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0;
    max-width: 68ch; /* readable line length: 65–75ch per ui-ux-pro-max */
}

.skills-grid,
.contact-info {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
    font-weight: 300;
    letter-spacing: 0;
}

/* About Stats Section */
.about-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--graphite-600);
}

.stat {
    text-align: center;
    padding: 0.6rem 0.4rem;
    background: rgba(242, 239, 233, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(242, 239, 233, 0.08);
    transition: all 0.3s ease;
}

.stat:hover {
    background: rgba(242, 239, 233, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-family: 'Space Grotesk', sans-serif;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.2;
}

.skills-section {
    margin: 2rem 0;
}

.skills-section h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.skill-category h4 {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-item {
    background: var(--graphite-600);
    color: var(--text-secondary);
    padding: 0.3rem 0.7rem;
    border-radius: 2px; /* angular, not pill — matches architectural aesthetic */
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border: 1px solid var(--graphite-500);
}

.contact-intro {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
    font-weight: 300;
    margin-bottom: 1.25rem;
    max-width: 68ch;
}

.contact-form .form-field {
    margin-bottom: 1rem;
}

.contact-form .form-field label {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
    font-family: 'Space Grotesk', sans-serif;
}

.contact-form .form-field input,
.contact-form .form-field select,
.contact-form .form-field textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--graphite-600);
    background: rgba(20, 20, 22, 0.85);
    color: var(--text-primary);
    font-family: 'Work Sans', sans-serif;
    font-size: 0.9rem;
}

.contact-form .form-field textarea {
    resize: vertical;
    min-height: 6rem;
}

.contact-form .contact-btn {
    margin-top: 0.5rem;
    width: 100%;
}

.form-success {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--graphite-500);
    border-radius: 8px;
    background: rgba(42, 42, 46, 0.3);
}

.form-success p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.modal-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-year,
.meta-cat,
.meta-sw {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 500;
}

.meta-sep {
    color: var(--text-tertiary);
    font-weight: 400;
}

/* === MODALS — PROJECT LIGHTBOX === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 3000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(20, 20, 22, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    touch-action: none;
}

.modal-content {
    position: relative;
    background: transparent;
    border-radius: 8px;
    width: 500px;
    max-height: calc(100% - 24px);
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin-top: 16px;
    margin-bottom: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: none;
    border: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.modal#modal .modal-content {
    width: min(625px, 92vw);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    width: 44px;  /* touch target minimum */
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.9);
}

.modal-title {
    font-size: 1.45rem;
    color: var(--text-primary);
    font-weight: 300;
    margin: 0 0 1rem 0;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.modal-scrollable-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(26, 26, 28, 0.8);
    backdrop-filter: blur(15px);
    border-radius: 0 0 8px 8px;
    min-height: 0;
    width: 100%;
    overscroll-behavior: contain;
}

.modal-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 0;
    width: 100%;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    backdrop-filter: blur(15px);
    height: auto;
    min-height: 140px;
    max-height: 400px;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 8px 8px 0 0;
    transition: opacity 0.75s ease, transform 0.75s ease;
}

.modal-info {
    padding: 1rem 2rem 1rem 2rem;
    background: transparent;
    flex: 0 0 auto;
    overflow-y: visible;
    backdrop-filter: none;
    border-radius: 0;
    scroll-behavior: smooth;
}

.modal-gallery-container {
    position: relative;
    margin: 0;
    padding: 1rem 2rem 1rem 2rem;
    border-top: 1px solid var(--graphite-600);
    flex-shrink: 0;
    background: transparent;
    backdrop-filter: none;
    border-radius: 0 0 8px 8px;
    min-height: 60px;
    width: 100%;
}

.modal-gallery {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding: 0;
    min-height: 50px;
    align-items: center;
}

.modal-gallery::-webkit-scrollbar {
    display: none;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 1px solid var(--graphite-500);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    width: 36px;  /* enlarged for usability; full 44px would overlap thumbnails */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.gallery-nav:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(242, 239, 233, 0.05);
}

.gallery-nav-left {
    left: 0.5rem;
}

.gallery-nav-right {
    right: 0.5rem;
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 0.81rem;
    font-weight: 300;
    letter-spacing: 0;
}

.modal-description p {
    margin-bottom: 1rem;
}

.modal-description p:last-child {
    margin-bottom: 0;
}

.modal-gallery img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.75s ease;
    border: 1px solid var(--graphite-600);
    flex-shrink: 0;
}

.modal-gallery img:hover {
    transform: scale(1.03);
    border-color: var(--text-secondary);
}

/* Hide scrollbars on modals for cleaner look */
.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-info::-webkit-scrollbar {
    display: none;
}

/* Contact Section */
.contact-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--graphite-600);
}

.contact-section h3 {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    letter-spacing: 0.05em;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-icon {
    font-size: 1.2rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.contact-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.contact-cta {
    text-align: center;
    margin-top: 2rem;
}

.contact-cta p {
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.contact-btn {
    padding: 0.8rem 2rem;
    background: rgba(42, 42, 46, 0.5);
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.contact-btn:hover {
    background: var(--text-secondary);
    color: var(--graphite-900);
    transform: translateY(-2px);
}

/* Section hero headers removed — About/Skills/Contact now use
   editorial section-entry + about-layout / contact-layout (layout.css) */

body.modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

.modal-scrollable-content {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* --- MOBILE REFINEMENTS --- */
@media (max-width: 768px) {
    .modal.active {
        align-items: flex-start !important;
        padding-top: 10px !important;
    }

    .modal-content {
        width: 94vw !important;
        margin: 0 auto !important;
        max-height: calc(100dvh - 20px) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .modal-scrollable-content {
        display: flex !important;
        flex-direction: column !important;
    }

    .modal-gallery-container {
        order: 1 !important;
        padding: 1rem !important;
        border-top: none !important;
        border-bottom: 1px solid var(--graphite-600) !important;
    }

    .modal-info {
        order: 2 !important;
        padding: 1rem 1.2rem !important;
    }

    .modal-image-container {
        height: 180px !important;
        min-height: 180px !important;
        touch-action: pan-y;
    }

    .modal-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
    }

    .modal-title {
        font-family: 'Space Grotesk', sans-serif !important;
        font-size: 1.25rem !important;
        text-align: center !important;
        margin-bottom: 1rem !important;
    }

    .modal-description {
        text-align: justify !important;
        text-justify: inter-word !important;
        font-size: 0.81rem !important;
    }
}
