@import url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard.css');

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    font-family: 'Pretendard', sans-serif;
}

body::before {
    content: "";
    position: fixed;
    top: -20px;
    left: -20px;
    width: 105%;
    height: 105%;
    background-image: url('./img/main_newspaper.jpg');
    background-repeat: no-repeat;
    background-size: 100% auto;
    background-position: center top;
    z-index: -1;
    transition: filter 1.2s ease; 
    filter: blur(0);
}

body.bg-blur::before {
    filter: blur(8px);
}

section {
	padding: 80px 0 0 0 !important;
}

.gallery-container {
    max-width: 1370px;
    margin: 130px auto;
	margin-bottom: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-section{ height:auto; }

.spread-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    min-height: 850px;
    position: relative;
	margin-bottom: 40px;
	place-items: center;
}

.photo-card {
    background: #fff;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.20);
    cursor: pointer;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px; 
	height: 580px !important;
    transform: translate(-50%, -50%) scale(1);
    transition: 
        transform 1.5s cubic-bezier(0.16, 1, 0.3, 1), 
        opacity 1.2s ease-out,
        box-shadow 0.5s ease;
    z-index: 5;
	will-change: transform, opacity;
	display:flex;
	flex-direction: column;
    align-items: center;
}

.spread-gallery.active .photo-card:hover {
    transform: translate(0, -10px) scale(1.02) !important;
    background: #fff !important;
}

.photo-card img {
    width: 100%;
    height: 90% !important;
    object-fit: cover;
	display: block;
}

/* 펼쳤을 때 사진 */
.spread-gallery.active .photo-card {
    position: relative;
    top: 0;
    left: 0;
    width: 410px; 
	height: auto !important;
	min-height: 310px; 
    transform: translate(0, 0) rotate(0deg) !important;
	display: flex;
	flex-direction: column;
    z-index: 1;
	justify-content: space-between;
}

.spread-gallery.active .photo-card img{
	width: 100%;
    height: 260px !important;
    object-fit: cover;
	object-position: top;
	display: block;
}

.guide-text {
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.09rem;
    font-weight: 500;
    color: #222222;
    background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.12);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
	transition: all 0.3s ease;
    padding: 0 24px;
    visibility: hidden;
    opacity: 0;
    cursor: default;
    word-break: keep-all;
	height: 60px;
	border-radius: 30px;
	line-height: 1.4em;
	z-index: 5;
	grid-column: span 1;
    box-sizing: border-box;
    letter-spacing: -0.02em;
	align-content: center;
}

.spread-gallery.active .guide-text {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.8s ease 1s, background 0.3s ease, border 0.3s ease;
}
.viewer-header {
    width: 100%;
    text-align: center;
    margin-bottom: 60px;
}

.v-year {
    display: block;
    color: #888;
    font-size: 16px;
    letter-spacing: 2px;
    font-weight: 500;
}

.text-gap {
    display: block;
    height: 20px; 
    content: "";
}

.viewer-header h3 {
    font-size: 50px;
    color: #222;
    margin: 0;
    font-weight: 700;
    font-family: 'Noto Serif KR', serif; 
}

.viewer-header .line-deco {
    margin: 30px auto 0; 
    width: 50px;
    height: 2px;
    background: #222;
}

.main-viewer {
    width: 100vw;
    margin-top: 100px;
    display: flex;
    flex-direction: column;
    gap: 60px;
    padding-bottom: 120px;
	background: rgba(255, 255, 255, 0.5);
	z-index:5;
}

.main-viewer.hidden { display: none; }

.viewer-row { 
    align-items: center; 
    gap: 50px; 
	margin: 0 auto;
	margin-top: 130px;
	width:70%;
}

.viewer-content-wrap {
    display: flex;
    align-items: flex-start; 
    gap: 20px; 
	margin: 20px 0;
	align-items: center;
}

.viewer-content-wrap.row-reverse {
    flex-direction: row-reverse; 
}

.viewer-img-box { 
	width: 500px;
    height: auto;
    overflow: visible;
    background: #f8f8f8; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.viewer-img-box img { width: 100%; height: auto; object-fit: contain; display: block; }
.viewer-text-box { flex: 1; text-align: left; }
.viewer-text-full-box {
	width: 100%;
    margin:20px 0;
    text-align: left;	
	}
.viewer-text-full-box p {
	font-size: 18px;
    line-height: 1.4;
    color: #444;
    word-break: keep-all;
    white-space: pre-line; 
	display: flex;
}
.bottom-row .viewer-text-box { align-items: flex-end; text-align: right; }
.top-row .viewer-text-box { align-items: flex-start; text-align: left; }
.viewer-text-box h3 { font-size: 32px; margin: 10px 0 20px 0; color: #222; font-weight: 700; }
.viewer-text-box p { font-size: 18px; line-height: 1.6; color: #444; word-break: keep-all; margin: 0;}
.line-deco { width: 60px; height: 3px; background: #222; margin-top: 25px; }

.photo-card .card-title {
    margin: 12px 0 0 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.spread-gallery.active .photo-card .card-title {
    opacity: 1;
}

/* 반응형 */
@media (max-width: 1400px) {
    .spread-gallery { grid-template-columns: repeat(2, 1fr); min-height: auto; }
    .photo-card {
		width: 600px;
		height: 500px !important; 
	} 
    .viewer-row { gap: 30px; }
}

@media (max-width: 1100px) {
	.viewer-content-wrap,
	.viewer-content-wrap.row-reverse {
		flex-direction: column;
		gap: 20px;
	}
	.viewer-text-box { text-align: center !important; align-items: center !important; }
}

@media (max-width: 900px) {
	body {
		height: 100vh !important;
		min-height: 100vh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        overflow-y: auto !important;
    }

    body::before {
        height: 100% !important;
        width: 100% !important;
        top: 0 !important;
        left: 0 !important;
		background-size:300%;
		background-image: url('./img/main_newspaper.jpg');
    }
    .spread-gallery { grid-template-columns: repeat(1, 1fr); gap: 20px; min-height: 480px !important; margin-bottom: 60px;}
	.viewer-content-wrap,
	.viewer-content-wrap.row-reverse {
		flex-direction: column;
        gap: 20px;
    }
	.viewer-header h3 {
        font-size: 28px;
    }	
    .viewer-row { flex-direction: column; gap: 30px; width:80%; }
    .viewer-row.bottom-row { flex-direction: column-reverse; }
    .viewer-img-box { width: 100%; height: auto; }
    .viewer-text-box { text-align: center !important; align-items: center !important; }
    .line-deco { margin: 25px auto 0 !important; }
	
	.gallery-container {
		flex: 1 !important;
        margin: 140px auto; 
		margin-bottom: 0;
        padding: 0 25px; 
		width: 100% !important;
		box-sizing: border-box;
    }

    .photo-card {
        width: 380px !important; 
		height: 340px !important; 
        top: 45% !important;     
        left: 50% !important;
        max-width: 340px; 
        margin: 0 auto; 
    }
	
	.photo-card img { height: 85% !important; }
	
	.photo-card .card-title {
        font-size: 0.9rem !important;
        margin-top: 6px !important;
    }
	
	.spread-gallery.active {
        min-height: auto !important; 
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .spread-gallery.active .photo-card {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        max-width: 340px !important;
        height: auto !important;
        min-height: 310px !important;
        transform: translate(0, 0) rotate(0deg) scale(1) !important;
        margin: 0 auto 20px auto !important;
    }

    .spread-gallery.active .photo-card img {
        width: 100% !important;
        aspect-ratio: 3 / 2;   
        object-fit: cover;
    }

    .spread-gallery.active .guide-text {
        position: relative !important;
        margin: 20px auto 0 auto !important;
        order: 999; 
    }

    .guide-text {
        width: 100% !important;
        max-width: 340px;
        height: 60px !important;
        margin: 10px auto 0 !important;
        font-size: 0.95rem;
        aspect-ratio: auto; 
    }

    .viewer-img-box {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 3 / 2; 
    }
	
	.viewer-img-box img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }

    .viewer-text-box h3 {
        font-size: 22px;
        word-break: keep-all; 
    }
	
	
}

/* 스크롤 업 버튼 */
.scroll-top-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-end; 
    align-items: center;
    padding: 40px 40px 20px 0;
    box-sizing: border-box;
}

.scroll-top-btn {
    width: 60px;   
    height: 60px;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 50%; 
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.scroll-top-btn:hover {
    background-color: #f8fafc;
    transform: translateY(-2px); 
}

.scroll-top-btn svg {
    width: 26px;
    height: 26px;
    stroke: #4b74d8;
}

@media (max-width: 768px) {
    .scroll-top-wrapper {
        padding: 30px 20px 10px 0; 
    }
    .scroll-top-btn {
        width: 50px;
        height: 50px;
    }
    .scroll-top-btn svg {
        width: 22px;
    }
}