@import url('/shared/components/font.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* [전체 레이아웃 구조 (Navigation, Main, Footer)] */
.navigation {
    background: transparent;
    height: auto;
    text-align: initial;
    color: inherit;
    line-height: normal;
    font-size: inherit;
    flex-shrink: 0;
    width: 100%;
}

body {
    font-family: 'RIDIBatang', serif;
    background: #ffffff;
    color: #000000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.main-portfolio-container {
    flex-grow: 1;
    display: flex;
    align-items: center; 
    justify-content: center;
    padding: 20px;
}

/* [기존 .portfolio-container -> .portfolio-content-wrapper] */
.portfolio-content-wrapper { 
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
    display: flex;
    min-height: 600px;
    isolation: isolate;
}

/* 왼쪽 이미지 슬라이더 */
.image-slider {
    flex: 1;
    position: relative;
    background: #f5f5f5;
    border-right: 3px solid #000000;
    overflow: hidden;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 30px;
}

.slide img {
    max-width: 90%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 0;
    border: 3px solid #000000;
    box-shadow: none;
}

.slide-caption {
    font-family: 'RIDIBatang', serif;
    font-size: 1rem;
    color: #091327;
    margin-top: 15px;
    text-align: center;
    padding: 0 20px;
    font-weight: 300;
}

.slider-nav {
    position: absolute;
    padding: 0px 0px 0px 0px;
    top: 200px;
    left: 50%;
    right: auto;
    transform: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    z-index: 10;
    width: min(216px, calc(100% - 180px));
    transform: translateX(-50%);
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #000000;
}

.slider-dot.active {
    background: #000000;
    border-color: #000000;
    box-shadow: none;
}

.slider-arrow {
    position: absolute;
    top: 186px;
    transform: none;
    background: #ffffff;
    border: 3px solid #000000;
    width: 40px;
    height: 40px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #091327;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-arrow:hover {
    background: #000000;
    color: #ffffff;
    box-shadow: none;
}

.slider-arrow.prev {
    left: 46px;
}

.slider-arrow.next {
    left: auto;
    right: 46px;
}

/* 오른쪽 콘텐츠 */
.content-section {
    flex: 1.5;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    min-width: 0;
}

.portfolio-title {
    font-family: 'KOHIBaeumOTF', serif;
    font-size: clamp(1.45rem, 2.35vw, 2.15rem);
    font-weight: 300;
    color: #000000;
    margin-bottom: 10px;
    line-height: 1.08;
    letter-spacing: -0.02em;
    word-break: keep-all;
    overflow-wrap: anywhere;
    white-space: normal;
    flex: 1 1 auto;
    min-width: 0;
}

.slide-caption,
.portfolio-subtitle,
.portfolio-description,
.portfolio-tags .tag,
.tech-title,
.tech-tag,
.tech-content p,
.tech-content p strong,
.tech-content li,
.tech-content a,
.show-all-button,
.mobile-menu-bar .show-all-button {
    font-family: 'HanSantteutDotum-Regular', 'Malgun Gothic', sans-serif;
}

.portfolio-subtitle {
    font-weight: 300;
    font-size: 1.2rem;
    color: #000000;
    margin-bottom: 30px;
}

.portfolio-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #000000;
    margin-bottom: 30px;
    text-align: justify;
}

.portfolio-description p + p {
    margin-top: 18px;
}

.portfolio-tags {
    margin-bottom: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portfolio-tags .tag {
    background-color: #ffffff;
    color: #000000;
    padding: 4px 12px;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tech-section {
    margin-bottom: 30px;
}

.tech-title {
    font-weight: 700;
    font-size: 1.3rem;
    color: #000000;
    margin-bottom: 20px;
    border-bottom: 3px solid #000000;
    padding-bottom: 10px;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.tech-tag {
    background: #ffffff;
    color: #000000;
    padding: 7px 14px;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, border-width 160ms ease;
    border: 2px solid #000000;
    letter-spacing: 0;
}

.tech-tag:hover {
    background: #000000;
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

.tech-tag.active {
    background: #000000;
    color: #ffffff;
}

.tech-content {
    background: #ffffff;
    border-radius: 0;
    padding: 0;
    margin-top: 15px;
    border: 3px solid #000000;
    display: none;
}

.tech-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.tech-content h4 {
    color: #000000;
    margin: 0;
    padding: 14px 18px 12px;
    font-weight: 700;
    font-size: clamp(1.28rem, 2.2vw, 1.75rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    border-bottom: 3px solid #000000;
    background: #000000;
    color: #ffffff;
}

.tech-section,
.tech-section *,
.tech-content,
.tech-content * {
    font-family: 'HanSantteutDotum-Regular', 'Malgun Gothic', sans-serif !important;
    letter-spacing: 0 !important;
}

.tech-content p {
    color: #000000;
    line-height: 1.6;
    padding: 18px;
    font-size: 1.02rem;
}

.tech-content p strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.08rem;
    line-height: 1.35;
}

.tech-content ul {
    padding: 18px 18px 18px 34px;
}

.tech-content p + ul,
.tech-content ul + p,
.tech-content ul + ul {
    padding-top: 0;
}

.tech-content li {
    color: #000000;
    line-height: 1.7;
    margin-bottom: 8px;
}

.tech-content li:last-child {
    margin-bottom: 0;
}

.tech-content a {
    color: #0000ff;
    text-decoration: none;
}

.tech-content a:hover {
    text-decoration: underline;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 제목과 버튼을 한 줄에 정렬 */
.header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 10px;
    margin-top: 0;
}

.button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
    max-width: 140px;
}

/* 전체 보기 버튼 */
.show-all-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-width: 98px;
    white-space: nowrap;
    padding: 10px 20px;
    background-color: #ffffff;
    color: #000000;
    border: 3px solid #000000;
    border-radius: 0;
    cursor: pointer;
    font-size: 0.82rem;
    transition: background 160ms ease, color 160ms ease;
    margin-left: 0;
    letter-spacing: 0;
    text-transform: uppercase;
}

#savePdfBtn {
    margin-top: 10px;
    display: none;
}

.show-all-button:hover {
    background-color: #000000;
    color: #ffffff;
    box-shadow: none;
    transform: none;
}

#showAllBtn,
#showAllBtnMobile {
    background-color: #f8b51b;
    color: #071120;
    border-color: #071120;
    font-weight: 800;
}

#showAllBtn:hover,
#showAllBtn:focus-visible,
#showAllBtnMobile:hover,
#showAllBtnMobile:focus-visible {
    background-color: #071120;
    color: #f8b51b;
}

/* 전체 보기 모드 */
.portfolio-content-wrapper.show-all-active {
    height: auto;
    align-items: flex-start;
}

.portfolio-content-wrapper.show-all-active .image-slider {
    height: auto;
    padding-top: 0;
}

.portfolio-content-wrapper.show-all-active .slide {
    margin-bottom: 40px;
    padding-top: 30px;
}

.portfolio-content-wrapper.show-all-active .slider-container {
    flex-direction: column;
    transform: none !important;
    height: auto;
}

.portfolio-content-wrapper.show-all-active .slider-arrow,
.portfolio-content-wrapper.show-all-active .slider-nav {
    display: none;
}

.portfolio-content-wrapper.show-all-active .tech-tags {
    display: none;
}

.portfolio-content-wrapper.show-all-active .tech-content {
    display: block !important;
    animation: none;
}

/* 모바일 상단 메뉴바 스타일 */
.mobile-menu-bar {
    position: absolute;
    top: 84px !important;
    left: 0;
    width: 100%;
    display: none;
    background: #ffffff;
    padding: 10px 20px;
    box-shadow: none;
    z-index: 20;
    justify-content: center;
    align-items: center;
    border-radius: 0;
    border-bottom: 3px solid #000000;
}

.mobile-menu-bar .show-all-button {
    margin-left: 10px;
    margin: 0 5px;
    margin-top: 0;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .slider-nav {
        top: 40px;
        left: 50%;
        right: auto;
        width: min(176px, calc(100% - 176px));
    }
    
    .portfolio-content-wrapper {
        flex-direction: column;
        max-width: 100%;
        min-height: auto;
        border-radius: 0;
    }

    .image-slider {
        border-right: 0;
        border-bottom: 3px solid #000000;
    }
    
    .main-portfolio-container {
        padding: 0;
    }

    .image-slider {
        height: 350px;
        padding-top: 50px;
    }

    .content-section {
        padding: 20px;
    }

    .portfolio-title {
        font-size: clamp(1.55rem, 8vw, 2rem);
    }
    
    .slider-nav {
        bottom: 20px;
    }

    .slider-arrow {
        top: 26px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .slider-arrow.prev {
        left: 34px;
    }

    .slider-arrow.next {
        left: auto;
        right: 34px;
    }
    
    .header-row {
        display: none;
    }
    
    .mobile-menu-bar {
        display: flex;
        border-radius: 0;
    }
    
    .portfolio-content-wrapper.show-all-active .image-slider {
        padding-top: 0;
    }
}

@media print {
    @page {
        size: 1280px 1040px;
        margin: 0;
    }

    html,
    body {
        background: white;
        padding: 0;
        margin: 0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    [data-site-header-placeholder],
    .site-header,
    #footer-placeholder,
    .footer-container,
    footer,
    .button-wrapper,
    .slider-arrow,
    .slider-nav,
    .tech-tags,
    .mobile-menu-bar,
    .navigation {
        display: none !important;
    }
    
    .main-portfolio-container {
        padding: 20px !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
    }
    
    .portfolio-content-wrapper {
        width: 1200px !important;
        max-width: 1200px !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        box-shadow: none;
        border-radius: 0;
        display: flex !important;
        flex-direction: row !important;
        height: auto !important;
        align-items: stretch !important;
        overflow: visible !important;
    }

    .image-slider {
        flex: 1 1 0 !important;
        height: auto !important;
        padding-top: 0 !important;
        background: #f5f5f5 !important;
        border-right: 3px solid #000000 !important;
        border-bottom: 0 !important;
        overflow: visible !important;
    }
    
    .content-section {
        flex: 1.5 1 0 !important;
        height: auto !important;
        padding: 40px !important;
        background: #ffffff !important;
    }

    .header-row {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 24px !important;
        margin-bottom: 10px !important;
    }

    .slider-container {
        flex-direction: column !important;
        transform: none !important;
        height: auto !important;
    }

    .slide {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-bottom: 40px;
        padding-top: 30px !important;
    }

    .slide img {
        box-shadow: none;
        border: 3px solid #000000;
        max-width: 90%;
    }

    .slide-caption {
        font-size: 1rem;
        margin-top: 15px;
    }

    .tech-content {
        display: block !important;
        animation: none !important;
        border: 2px solid #000000;
        border-radius: 0;
        padding: 0;
        margin-top: 10px;
        margin-bottom: 14px;
        background: #ffffff;
        break-inside: avoid;
    }

    .tech-title {
        font-size: 1.05rem !important;
        margin-bottom: 10px !important;
        padding-bottom: 9px !important;
        border-bottom-width: 2px !important;
    }

    .tech-content h4 {
        font-size: 1.12rem !important;
        line-height: 1.25 !important;
        padding: 8px 14px 7px !important;
        font-weight: 500 !important;
    }

    .tech-content p {
        font-size: 0.82rem !important;
        line-height: 1.48 !important;
        padding: 11px 14px 12px !important;
        font-weight: 300 !important;
    }

    .tech-content p strong {
        display: block;
        margin-bottom: 7px;
        font-size: 0.86rem !important;
        line-height: 1.35 !important;
        font-weight: 500 !important;
    }

    .tech-content ul {
        padding: 11px 18px 12px 28px !important;
    }

    .tech-content li {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
        margin-bottom: 5px !important;
        font-weight: 300 !important;
    }

    .portfolio-description,
    .portfolio-tags,
    .slide {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}
