/* Lightbox Component Styles */

/* Body lock when modal is open - prevent background scrolling */
body.modal-open {
    overflow: hidden !important;
    touch-action: none !important;
    /* Position fixed is set via JavaScript to preserve scroll position */
}

/* Popup Overlay Base */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(210, 213, 221, 0.25);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    box-sizing: border-box;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    overflow: hidden;
}

.popup-overlay.visible {
    opacity: 1 !important;
    pointer-events: auto;
    display: flex !important;
}

.popup-overlay.hidden {
    display: none;
}

/* Popup Content Base */
.popup-content {
    background: var(--color-black);
    border: 1px solid var(--color-gray);
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    position: relative;
}

/* Close Button */
.popup-close {
    position: sticky;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--color-white);
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 30;
    margin-left: auto;
}

.popup-close:hover {
    color: var(--color-signature);
}

/* Lightbox Specific Styles */
.lightbox-content {
    width: 90vw;
    max-width: 1200px;
    max-height: 90vh;
    background: var(--color-black);
    border-radius: 12px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 0 40px rgba(255, 69, 0, 0.3), 0 0 80px rgba(255, 69, 0, 0.1);
    overscroll-behavior: contain;
    touch-action: pan-y !important;
    -webkit-overflow-scrolling: touch;
}

/* Loading Animation */
#animation-to-lightbox-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--color-black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: opacity var(--transition-normal);
    pointer-events: none;
}

.animation-for-lightbox-gif {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-signature);
    animation: sedgPulse 2s ease-in-out;
}

@keyframes sedgPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Lightbox Main Content */
.lightbox-main {
    padding: var(--spacing-xl);
    padding-bottom: calc(var(--spacing-xl) * 2);
    opacity: 1 !important;
    display: block !important;
}

/* Lightbox Images - Natural Aspect Ratio */
.main-image-of-project-output-box img,
.image-1-output-box img,
.image-2-output-box img,
.last-main-image-output-box img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-main.visible {
    box-shadow: 0 0 30px rgba(255, 69, 0, 0.4), 0 0 60px rgba(255, 69, 0, 0.2);
}

.lightbox-close {
    top: var(--spacing-md);
    right: var(--spacing-md);
}

/* Lightbox Header */
.lightbox-header {
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-accent);
}

.project-title-input-box {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-signature);
    margin-bottom: var(--spacing-lg);
    line-height: 1.2;
}

/* Project Info */
.project-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    align-items: center;
}

.project-info > div {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.project-info span:first-child {
    font-size: 0.875rem;
    color: var(--color-white);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-info span:last-child {
    font-size: 1rem;
    color: var(--color-accent);
    font-weight: var(--font-weight-medium);
}

/* Share Container */
.share-container {
    display: flex;
    flex-direction: row !important;
    gap: var(--spacing-sm);
    justify-self: end;
    align-items: center;
}

.share-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition-fast);
    color: var(--color-white);
}

.share-btn:hover {
    color: var(--color-signature);
    transform: scale(1.2);
}

/* Main Context Container */
#main-context-container {
    margin-top: var(--spacing-xl);
}

/* Main Image Group */
.main-image-of-project-group-container {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.main-image-of-project-output-box {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.main-image-credit-input-box {
    font-size: 0.75rem;
    color: var(--color-gray);
    font-style: italic;
    text-align: center;
}

/* Sub Container Layout */
#sub-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

/* Project Sidebar */
#project-sidebar-container {
    border-radius: 8px;
    padding: var(--spacing-lg);
    height: fit-content;
    position: sticky;
    top: var(--spacing-md);
}

.contact-group-of-project-container,
.services-group-of-project-container,
.client-group-of-project-container {
    margin-bottom: var(--spacing-lg);
}

.contact-group-of-project-container:last-child,
.services-group-of-project-container:last-child,
.client-group-of-project-container:last-child {
    margin-bottom: 0;
}

.contact-title-of-project-output-box,
.services-title-of-project-output-box,
.client-title-of-project-output-box {
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-text-of-project-output-box,
.client-text-of-project-input-box {
    font-size: 0.875rem;
    color: var(--color-gray);
    line-height: 1.4;
}

.services-text-of-project-click-button {
    background: none !important;
    border: 1px solid var(--color-gray) !important;
    color: var(--color-gray) !important;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}

.services-text-of-project-click-button:hover {
    background: var(--color-signature);
}

/* Content Area */
.content-area {
    padding-left: var(--spacing-md);
}

.untitled-element-output-box {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--color-white);
    line-height: 1.3;
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Image Groups */
.image-1-group-container,
.image-2-group-container {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.image-1-output-box,
.image-2-output-box {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.image-1-credit-input-box,
.image-2-credit-input-box {
    font-size: 0.75rem;
    color: var(--color-gray);
    font-style: italic;
}

/* Context Group */
.context-group-container {
    margin-bottom: var(--spacing-xl);
}

.head-title-input-box {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    margin-bottom: var(--spacing-lg);
    line-height: 1.3;
}

.description-1-input-box,
.description-2-input-box,
.description-3-input-box {
    font-size: 1rem;
    color: var(--color-gray);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    white-space: pre-wrap;  /* 줄바꿈 문자 인식 */
}

/* Last Main Image */
.last-main-image-group-container {
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.last-main-image-output-box {
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.last-main-image-credit-input-box {
    font-size: 0.75rem;
    color: var(--color-gray);
    font-style: italic;
}

/* Related Projects */
#related-group-container {
    margin-top: var(--spacing-xxl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--color-accent);
}

.related-text-group-container {
    text-align: center;
    padding-bottom: var(--spacing-xl);
}

.related-text-output-box {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
}

.untitled-element-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.related-project-container {
    background: var(--color-gray);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.related-project-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 69, 0, 0.2);
}

.related-projects-image-output-box {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition-slow);
}

.related-project-container:hover .related-projects-image-output-box {
    transform: scale(1.05);
}

.related-project-title-output-box {
    font-size: 1.125rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-xs);
    line-height: 1.3;
}

.related-project-type-output-box {
    font-size: 0.875rem;
    color: var(--color-signature);
    padding: 0 var(--spacing-md) var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--font-weight-medium);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .lightbox-content {
        width: 95vw;
    }
    
    .lightbox-main {
        padding: var(--spacing-lg);
    }
    
    #sub-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    #project-sidebar-container {
        position: static;
        text-align: center;
    }
    
    .contact-group-of-project-container,
    .services-group-of-project-container,
    .client-group-of-project-container {
        text-align: center;
    }
    
    .contact-title-of-project-output-box,
    .services-title-of-project-output-box,
    .client-title-of-project-output-box,
    .contact-text-of-project-output-box,
    .services-text-of-project-click-button,
    .client-text-of-project-output-box {
        text-align: center;
    }
    
    .content-area {
        padding-left: 0;
        text-align: center;
    }
    
    .untitled-element-output-box,
    .head-title-input-box {
        text-align: center;
    }
    
    .project-info {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .share-container {
        justify-self: center;
        grid-column: 1 / -1;
        margin-top: var(--spacing-sm);
    }
}

@media (max-width: 768px) {
    .lightbox-content {
        width: 95vw;
        max-width: none;
        max-height: 95vh;
        overflow-y: auto;
    }

    .lightbox-main {
        padding: var(--spacing-md);
    }
    
    .lightbox-header {
        text-align: center;
    }
    
    .project-title-input-box {
        text-align: center;
    }
    
    .project-info {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .share-container {
        justify-self: center;
    }
    
    .untitled-element-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .main-image-of-project-output-box img,
    .image-1-output-box img,
    .image-2-output-box img,
    .last-main-image-output-box img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .popup-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: var(--spacing-xs);
    }

    .lightbox-content {
        width: 98vw;
        max-height: 93vh;
        border-radius: 8px;
        overflow-y: auto;
    }

    .lightbox-main {
        padding: var(--spacing-xl);
    }
    
    .lightbox-header {
        text-align: center;
        margin-top: var(--spacing-md);
        margin-bottom: var(--spacing-md);
    }
    
    .project-title-input-box {
        text-align: center;
        font-size: clamp(1.5rem, 6vw, 2rem);
    }
    
    .popup-close {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .related-projects-image-output-box {
        height: 150px;
    }
    
    .related-text-output-box {
        margin-bottom: var(--spacing-lg);
    }
}

/* Message Animation */
@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* Image Editing Styles */
.image-editable {
    cursor: pointer !important;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    border-radius: 4px;
}

.image-editable:hover {
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.3);
    transform: scale(1.02);
}

.image-editable:active {
    transform: scale(0.98);
}

/* Upload Progress Overlay */
.image-upload-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    z-index: 100;
    border-radius: 4px;
}

/* Category Selection Popup */
.category-selection-popup {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.9) !important;
    filter: none !important;
    backdrop-filter: none !important;
}

.category-selection-popup * {
    filter: none !important;
    backdrop-filter: none !important;
}

.category-selection-popup.visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.category-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95) !important;
}

.category-selection-content {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 90% !important;
    max-width: 500px !important;
    max-height: 80vh !important;
    background: #000000 !important;
    border: 3px solid #FF4500 !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 0 50px rgba(255, 69, 0, 0.8) !important;
    z-index: 100000 !important;
    filter: none !important;
    backdrop-filter: none !important;
}

.category-selection-header {
    padding: 20px !important;
    border-bottom: 3px solid #FF4500 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: #d2d5dd !important;
    filter: none !important;
    backdrop-filter: none !important;
}

.category-selection-header h3 {
    color: #ffffff !important;
    font-size: 1.5rem !important;
    font-weight: 900 !important;
    margin: 0 !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
    filter: none !important;
}

.category-selection-close {
    width: 30px;
    height: 30px;
    background: transparent;
    border: 2px solid #ffffff;
    border-radius: 50%;
    color: #ffffff !important;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-selection-close:hover {
    background: #FF4500 !important;
    border-color: #FF4500 !important;
    color: #ffffff !important;
}

.category-selection-list {
    max-height: 60vh !important;
    overflow-y: auto !important;
    padding: 15px !important;
    background: #d2d5dd !important;
    filter: none !important;
    backdrop-filter: none !important;
}

.category-option {
    padding: 15px !important;
    margin: 8px 0 !important;
    border-radius: 8px !important;
    cursor: pointer !important; 
    transition: all 0.3s ease !important;
    border: 2px solid #d2d5dd !important;
    background: #d2d5dd !important;
    filter: none !important;
    backdrop-filter: none !important;
}

.category-option:hover {
    background: rgba(255, 69, 0, 0.3) !important;
    border-color: #FF4500 !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.category-name {
    display: block !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    font-size: 1.2rem !important;
    margin-bottom: 8px !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
    filter: none !important;
}

.category-description {
    display: block !important;
    color: var(--color-gray) !important;
    font-size: 1rem !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
    filter: none !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .category-selection-content {
        width: 95% !important;
        max-height: 85vh !important;
        background: #000000 !important;
        border: 3px solid #FF4500 !important;
        filter: none !important;
        backdrop-filter: none !important;
    }
    
    .category-selection-header {
        padding: 15px !important;
        background: #111111 !important;
        filter: none !important;
        backdrop-filter: none !important;
    }
    
    .category-selection-header h3 {
        font-size: 1.3rem !important;
        color: #ffffff !important;
        font-weight: 900 !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
        filter: none !important;
    }
    
    .category-option {
        padding: 12px !important;
        background: #1a1a1a !important;
        border: 2px solid #333333 !important;
        filter: none !important;
        backdrop-filter: none !important;
    }
    
    .category-name {
        color: #ffffff !important;
        font-size: 1.1rem !important;
        font-weight: 900 !important;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8) !important;
        filter: none !important;
    }
    
    .category-description {
        color: #eeeeee !important;
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        filter: none !important;
    }
}

/* --------------------------------------------------------------------------
   Public project case study — light editorial theme

   Keep these overrides scoped to the public lightbox so the admin/editor and
   category-selection layers above retain their existing behavior.
   -------------------------------------------------------------------------- */

#lightbox-of-project-container.popup-overlay {
    align-items: center;
    padding: clamp(12px, 2.5vw, 32px);
    background: transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* 상세 데이터가 준비되기 전에는 회색 로딩막 없이 뒤 화면의 블러만 보인다. */
#lightbox-of-project-container.is-loading .lightbox-content {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#lightbox-of-project-container > .loading-animation-container {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.lightbox-content {
    width: min(1280px, 100%);
    max-width: 1280px;
    max-height: calc(100dvh - 64px);
    background: var(--color-surface, #ffffff);
    color: var(--color-ink, #20242a);
    border: 1px solid var(--color-border, #d9dde3);
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(24, 28, 34, 0.24);
    scrollbar-gutter: stable;
}

#animation-to-lightbox-container {
    inset: 0;
    min-height: 100%;
    background: var(--color-surface, #ffffff);
}

.animation-for-lightbox-gif {
    color: var(--color-signature, #e94a29);
    letter-spacing: -0.04em;
}

.lightbox-main,
.lightbox-main.visible {
    display: block !important;
    padding: clamp(32px, 5vw, 72px);
    padding-bottom: clamp(56px, 7vw, 96px);
    color: var(--color-ink, #20242a);
    background: var(--color-surface, #ffffff);
    box-shadow: none;
}

#lightbox-of-project-container .lightbox-close {
    position: sticky;
    top: 16px;
    right: auto;
    width: 44px;
    height: 44px;
    min-width: 44px;
    margin: 0 0 -44px auto;
    color: var(--color-ink, #20242a);
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #d9dde3);
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(24, 28, 34, 0.1);
    line-height: 1;
    z-index: 40;
}

#lightbox-of-project-container .lightbox-close:hover {
    color: var(--color-surface, #ffffff);
    background: var(--color-signature, #e94a29);
    border-color: var(--color-signature, #e94a29);
    transform: translateY(-1px);
}

#lightbox-of-project-container .lightbox-close:focus-visible,
#lightbox-of-project-container .share-btn:focus-visible,
#lightbox-of-project-container .services-text-of-project-click-button:focus-visible {
    outline: 3px solid var(--color-signature, #e94a29);
    outline-offset: 3px;
}

.lightbox-header {
    margin: 0 0 clamp(40px, 5vw, 64px);
    padding: 4px 64px clamp(28px, 4vw, 44px) 0;
    border-bottom: 1px solid var(--color-border, #d9dde3);
    text-align: left;
}

.project-title-input-box {
    max-width: 18ch;
    margin: 0 0 clamp(28px, 4vw, 44px);
    color: var(--color-ink, #20242a);
    font-size: clamp(2.25rem, 5.2vw, 4.75rem);
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.06;
    letter-spacing: -0.045em;
    text-align: left;
    text-wrap: balance;
}

.project-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(32px, 1fr) auto;
    gap: clamp(16px, 2vw, 28px);
    align-items: end;
    text-align: left;
}

.project-info > :not(.share-container):not(.empty-space-output-box) {
    min-width: 0;
    padding-left: 14px;
    border-left: 2px solid var(--color-border, #d9dde3);
}

.project-info span:first-child {
    display: block;
    margin-bottom: 5px;
    color: var(--color-muted, #69707a);
    font-size: 0.7rem;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.3;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-info span:last-child {
    display: block;
    overflow: hidden;
    color: var(--color-ink, #20242a);
    font-size: 0.95rem;
    font-weight: var(--font-weight-medium, 500);
    line-height: 1.45;
    text-overflow: ellipsis;
}

.share-container {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    justify-self: end;
    gap: 8px;
}

#lightbox-of-project-container .share-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    color: var(--color-ink, #20242a);
    background: transparent;
    border: 1px solid var(--color-border, #d9dde3);
    border-radius: 50%;
    transition: color var(--transition-fast, 0.2s ease),
                background-color var(--transition-fast, 0.2s ease),
                border-color var(--transition-fast, 0.2s ease),
                transform var(--transition-fast, 0.2s ease);
}

#lightbox-of-project-container .share-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

#lightbox-of-project-container .share-btn:hover {
    color: var(--color-surface, #ffffff);
    background: var(--color-signature, #e94a29);
    border-color: var(--color-signature, #e94a29);
    transform: translateY(-2px);
}

#main-context-container {
    margin-top: 0;
}

.main-image-of-project-group-container,
.last-main-image-group-container,
.image-1-group-container,
.image-2-group-container {
    margin-bottom: clamp(40px, 6vw, 72px);
    text-align: left;
}

.main-image-of-project-output-box,
.last-main-image-output-box,
.image-1-output-box,
.image-2-output-box {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 12px;
    object-fit: contain;
    background: var(--color-surface, #ffffff);
    border-radius: 12px;
    box-shadow: none;
}

.main-image-credit-input-box,
.last-main-image-credit-input-box,
.image-1-credit-input-box,
.image-2-credit-input-box {
    max-width: 72ch;
    margin: 0;
    color: var(--color-muted, #69707a);
    font-size: 0.78rem;
    font-style: normal;
    line-height: 1.55;
    text-align: left;
}

#sub-container {
    display: grid;
    grid-template-columns: minmax(190px, 224px) minmax(0, 720px);
    justify-content: space-between;
    gap: clamp(48px, 7vw, 88px);
    margin: clamp(56px, 8vw, 104px) 0;
}

#project-sidebar-container {
    position: sticky;
    top: 24px;
    height: fit-content;
    padding: 22px 0 0;
    color: var(--color-ink, #20242a);
    background: transparent;
    border-top: 3px solid var(--color-signature, #e94a29);
    border-radius: 0;
    text-align: left;
}

.contact-group-of-project-container,
.services-group-of-project-container,
.client-group-of-project-container {
    margin: 0;
    padding: 0 0 22px;
}

.contact-group-of-project-container + .services-group-of-project-container,
.services-group-of-project-container + .client-group-of-project-container {
    padding-top: 22px;
    border-top: 1px solid var(--color-border, #d9dde3);
}

.contact-title-of-project-output-box,
.services-title-of-project-output-box,
.client-title-of-project-output-box {
    margin: 0 0 8px;
    color: var(--color-muted, #69707a);
    font-size: 0.7rem;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.3;
    letter-spacing: 0.1em;
    text-align: left;
    text-transform: uppercase;
}

.contact-text-of-project-output-box,
.client-text-of-project-input-box {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--color-ink, #20242a);
    font-size: 0.92rem;
    line-height: 1.6;
    text-align: left;
}

#lightbox-of-project-container .services-text-of-project-click-button {
    min-height: 44px;
    padding: 9px 14px;
    color: var(--color-ink, #20242a) !important;
    background: transparent !important;
    border: 1px solid var(--color-border, #d9dde3) !important;
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1.25;
}

#lightbox-of-project-container .services-text-of-project-click-button:hover {
    color: var(--color-surface, #ffffff) !important;
    background: var(--color-signature, #e94a29) !important;
    border-color: var(--color-signature, #e94a29) !important;
}

#lightbox-save-button {
    min-height: 44px;
    background: var(--color-signature, #e94a29) !important;
    border-radius: 999px !important;
    font-weight: var(--font-weight-bold, 700);
}

#lightbox-save-button:hover {
    box-shadow: 0 10px 24px rgba(233, 74, 41, 0.2);
    transform: translateY(-1px);
}

.content-area {
    width: 100%;
    max-width: 720px;
    min-width: 0;
    padding: 0;
    text-align: left;
}

.untitled-element-output-box {
    margin: 0 0 20px;
    color: var(--color-signature, #e94a29);
    font-size: 0.72rem;
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-align: left;
    text-transform: uppercase;
}

.context-group-container {
    margin: clamp(48px, 7vw, 88px) 0 0;
}

.head-title-input-box {
    max-width: 22ch;
    margin: 0 0 24px;
    color: var(--color-ink, #20242a);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: var(--font-weight-bold, 700);
    line-height: 1.22;
    letter-spacing: -0.025em;
    text-align: left;
    text-wrap: balance;
}

.description-1-input-box,
.description-2-input-box,
.description-3-input-box {
    max-width: 68ch;
    margin: 0 0 1.25em;
    color: var(--color-ink, #20242a);
    font-size: clamp(1rem, 1.2vw, 1.075rem);
    line-height: 1.82;
    text-align: left;
    white-space: pre-wrap;
    word-break: keep-all;
    overflow-wrap: break-word;
}

#related-group-container {
    margin-top: clamp(64px, 9vw, 112px);
    padding-top: clamp(32px, 5vw, 56px);
    border-top: 1px solid var(--color-border, #d9dde3);
}

.related-text-group-container {
    padding: 0 0 24px;
    text-align: left;
}

.related-text-output-box {
    margin: 0;
    color: var(--color-ink, #20242a);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.untitled-element-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(16px, 2vw, 24px);
}

.related-project-container {
    overflow: hidden;
    color: var(--color-ink, #20242a);
    background: var(--color-surface, #ffffff);
    border: 1px solid var(--color-border, #d9dde3);
    border-radius: 12px;
    box-shadow: none;
    transition: transform var(--transition-normal, 0.3s ease),
                box-shadow var(--transition-normal, 0.3s ease),
                border-color var(--transition-normal, 0.3s ease);
}

.related-project-container:hover {
    border-color: var(--color-signature, #e94a29);
    box-shadow: 0 14px 36px rgba(24, 28, 34, 0.1);
    transform: translateY(-3px);
}

.related-projects-image-output-box {
    display: block;
    width: 100%;
    height: clamp(180px, 22vw, 260px);
    object-fit: cover;
}

.related-project-title-output-box {
    display: -webkit-box;
    margin: 0;
    padding: 18px 18px 6px;
    overflow: hidden;
    color: var(--color-ink, #20242a);
    font-size: 1.05rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.related-project-type-output-box {
    margin: 0;
    padding: 0 18px 18px;
    color: var(--color-muted, #69707a);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

@media (max-width: 1100px) {
    #sub-container {
        grid-template-columns: minmax(0, 720px);
        justify-content: center;
        gap: 48px;
    }

    #project-sidebar-container {
        position: static;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
        width: 100%;
        max-width: 720px;
        padding: 22px 0;
        border-bottom: 1px solid var(--color-border, #d9dde3);
    }

    .contact-group-of-project-container,
    .services-group-of-project-container,
    .client-group-of-project-container {
        padding: 0;
        text-align: left;
    }

    .contact-group-of-project-container + .services-group-of-project-container,
    .services-group-of-project-container + .client-group-of-project-container {
        padding: 0 0 0 24px;
        border-top: 0;
        border-left: 1px solid var(--color-border, #d9dde3);
    }

    .content-area {
        margin: 0 auto;
    }
}

/* 모바일 전면 표시.
   브레이크포인트는 이 프로젝트의 기준값인 768px에 맞춘다(예전엔 700px이라
   701~768px 구간의 기기는 데스크톱용 인셋 레이아웃을 받아 사방에 배경이 보였다).

   아래쪽에 배경이 비치던 진짜 원인:
   오버레이는 height:100%(고정 위치 → 큰 뷰포트 기준)인데 패널만 100dvh였다.
   모바일 주소창이 접히면 보이는 영역은 커지는데 오버레이는 따라 커지지 않아
   화면 아래에 페이지 캔버스(#f2f1ec)가 띠처럼 드러났다.
   → 오버레이가 동적 뷰포트를 직접 따라가고, 패널은 그 오버레이를 100%로 채운다.
   이러면 vh/dvh 해석 차이 자체가 사라져 어느 브라우저에서도 틈이 생기지 않는다. */
@media (max-width: 768px) {
    #lightbox-of-project-container.popup-overlay {
        inset: 0;
        align-items: stretch;
        justify-content: stretch;
        width: 100%;
        /* 폴백: 큰 뷰포트라 항상 보이는 영역 이상을 덮는다 */
        height: 100vh;
        /* 지원 브라우저: 주소창 접힘/펼침을 실시간으로 따라간다 */
        height: 100dvh;
        padding: 0;
        background: var(--color-surface, #ffffff);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    #lightbox-of-project-container.popup-overlay.is-loading {
        background: transparent;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    /* 세이프에어리어 레터박스나 iOS 고무줄 스크롤로 캔버스가 드러나도
       패널과 같은 색이라 띠로 보이지 않는다 */
    body.modal-open {
        background: var(--color-surface, #ffffff);
    }

    .lightbox-content {
        /* 뷰포트 단위를 직접 쓰지 않고 오버레이 박스를 그대로 채운다 */
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        scrollbar-gutter: auto;
    }

    .lightbox-main,
    .lightbox-main.visible {
        min-height: 100%;
        padding: max(20px, env(safe-area-inset-top))
                 max(20px, env(safe-area-inset-right))
                 max(64px, calc(48px + env(safe-area-inset-bottom)))
                 max(20px, env(safe-area-inset-left));
    }

    #lightbox-of-project-container .lightbox-close {
        top: max(12px, env(safe-area-inset-top));
    }

    .lightbox-header {
        margin-bottom: 40px;
        padding: 8px 56px 28px 0;
    }

    .project-title-input-box {
        max-width: none;
        margin-bottom: 28px;
        font-size: clamp(2rem, 10vw, 3rem);
        line-height: 1.08;
    }

    .project-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 12px;
    }

    .project-info .empty-space-output-box {
        display: none;
    }

    .share-container {
        grid-column: 1 / -1;
        justify-self: start;
        margin-top: 4px;
    }

    .main-image-of-project-group-container,
    .last-main-image-group-container,
    .image-1-group-container,
    .image-2-group-container {
        margin-bottom: 40px;
    }

    .main-image-of-project-output-box,
    .last-main-image-output-box,
    .image-1-output-box,
    .image-2-output-box {
        border-radius: 10px;
    }

    #sub-container {
        grid-template-columns: 1fr;
        gap: 40px;
        margin: 56px 0;
    }

    #project-sidebar-container {
        grid-template-columns: 1fr;
        gap: 0;
        padding-bottom: 0;
    }

    .contact-group-of-project-container,
    .services-group-of-project-container,
    .client-group-of-project-container {
        padding: 0 0 20px;
    }

    .contact-group-of-project-container + .services-group-of-project-container,
    .services-group-of-project-container + .client-group-of-project-container {
        padding: 20px 0;
        border-top: 1px solid var(--color-border, #d9dde3);
        border-left: 0;
    }

    .head-title-input-box {
        font-size: clamp(1.65rem, 8vw, 2.15rem);
    }

    .description-1-input-box,
    .description-2-input-box,
    .description-3-input-box {
        font-size: 1rem;
        line-height: 1.78;
    }

    .untitled-element-container {
        grid-template-columns: 1fr;
    }

    .related-projects-image-output-box {
        height: min(62vw, 240px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .animation-for-lightbox-gif {
        animation: none;
    }

    #lightbox-of-project-container .lightbox-close,
    #lightbox-of-project-container .share-btn,
    .related-project-container,
    .related-projects-image-output-box {
        transition: none;
    }

    #lightbox-of-project-container .lightbox-close:hover,
    #lightbox-of-project-container .share-btn:hover,
    .related-project-container:hover,
    .related-project-container:hover .related-projects-image-output-box {
        transform: none;
    }
}

/* ===========================================================================
   라이트박스 스크롤바 — 라운드 코너 보존
   ---------------------------------------------------------------------------
   .lightbox-content의 둥근 모서리를 전역 스크롤바 트랙이 덮지 않도록
   위/아래 끝에서 둥근 모서리를 덮어 각진 자국을 만들었다.

   해결: 이 컨테이너에서는 트랙을 투명하게 두고 위아래로 여백을 줘서
   모서리 반경 영역을 아예 침범하지 않게 한다. 썸(막대)만 둥글게 보인다.
   =========================================================================== */

/* 표준 scrollbar-width/color는 Firefox 전용으로 격리한다.
   Chrome 121+ 는 요소에 이 두 속성이 하나라도 걸리면 그 요소의
   ::-webkit-scrollbar-* 규칙을 통째로 무시하고 OS 기본 스크롤바를 그린다.
   그래서 아래에 화살표 숨김 규칙이 있어도 위/아래 화살표가 다시 나타났다.
   ::-webkit-scrollbar 를 지원하지 않는 브라우저(Firefox)에서만 적용한다. */
@supports not selector(::-webkit-scrollbar) {
    .lightbox-content {
        scrollbar-width: thin;
        /* 막대는 배경에 가깝게 옅은 회색 (전역 스크롤바와 동일 토큰) */
        scrollbar-color: var(--color-scrollbar, #9aa09d) transparent;
    }
}

.lightbox-content::-webkit-scrollbar {
    width: 12px;
    background: transparent;
}

.lightbox-content::-webkit-scrollbar-track {
    background: transparent;
    /* 컨테이너의 둥근 코너를 건드리지 않는다 */
    margin: 16px 0;
}

.lightbox-content::-webkit-scrollbar-thumb {
    background: var(--color-scrollbar, #9aa09d);
    border-radius: 999px;
    /* 투명 테두리 + content-box 로 막대를 얇게 보이게 하고 양옆 여백을 만든다 */
    border: 3px solid transparent;
    background-clip: content-box;
}

.lightbox-content::-webkit-scrollbar-thumb:hover {
    background: var(--color-signature, #e94a29);
    background-clip: content-box;
}

.lightbox-content::-webkit-scrollbar-corner {
    background: transparent;
}

/* 위/아래 화살표 버튼 숨김 - 막대만 남긴다 */
.lightbox-content::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.lightbox-content::-webkit-scrollbar-button:single-button,
.lightbox-content::-webkit-scrollbar-button:vertical:decrement,
.lightbox-content::-webkit-scrollbar-button:vertical:increment,
.lightbox-content::-webkit-scrollbar-button:start,
.lightbox-content::-webkit-scrollbar-button:end {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}
