/* ===== header.php 인라인 스타일 옮김 START ===== */
/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

/* 기본 레이아웃 */
body {
    font-family: 'Helvetica', 'Arial', sans-serif;
    background-color: #fafafa;
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
    line-height: 1.4;
}

/* 로고 스타일 */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0 0 0;
    /* 아래 padding 제거 */
    margin: 10px auto;
    /* 위 margin도 조정 */
    max-width: 480px;
    width: 100%;
}

.site-logo {
    width: 120px;
    /* 기존 160px → 120px */
    height: auto;
    /* 자동 비율 유지 */
    flex-shrink: 0;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}


.logo-image {
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

.logo-text .title-main {
    font-size: 30px;
    font-weight: 800;
    color: #1a3c6e;
    line-height: 1.3;
}

.logo-text .title-sub {
    font-size: 22px;
    font-weight: 600;
    color: #7ca982;
    line-height: 1.2;
}


h1.site-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    text-align: left;
    font-size: 1em;
    font-weight: normal;
}

.title-main {
    font-size: 28px;
    font-weight: 700;
    color: #1a3c6e;
    line-height: 1.2;
    display: block;
}

.title-sub {
    font-size: 20px;
    font-weight: 500;
    color: #7ca982;
    line-height: 1.2;
    display: block;
}

@media (max-width: 480px) {
    .logo-link {
        gap: 15px;
    }

    .site-logo {
        width: 120px;
        height: 90px;
    }

    .title-main {
        font-size: 24px;
    }

    .title-sub {
        font-size: 18px;
    }
}

/* 공통 컨테이너 스타일 */
#site-header,
.site-nav,
.site-content,
.calendar-container,
.page-section,
#content-area {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

#content-area {
    padding: 0 10px;
    min-height: 200px;
    position: relative;
    transition: opacity 0.3s ease;
}

h1 {
    text-align: center;
    font-size: 1.3em;
    /* 가이드 예시 1.5em이나 원본 기준 1.3em */
    margin: 15px 0;
    /* 가이드 예시 margin-bottom: 5px 이나 원본 기준 */
    padding: 0;
}

h1 a {
    text-decoration: none;
    color: inherit;
}

#last-updated {
    margin-top: 0 !important;
    /* 강제 제거 */
    padding-top: 4px;
    /* 약간만 띄움 */
    font-size: 0.8em;
    color: #555;
    text-align: center;
}

/* 메인 내비게이션 스타일 */
.site-nav {
    max-width: 480px;
    width: 100%;
    background: #fff;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 0 auto;
    padding: 0 10px;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: 40px;
    display: flex;
    justify-content: center;
    box-sizing: border-box;
}

.site-nav::before {
    content: none;
}

.site-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    position: relative;
}

.site-nav li {
    flex: 1;
    text-align: center;
    border-right: 1px solid #eee;
    height: 100%;
    min-width: 0;
}

.site-nav li:last-child {
    border-right: none;
}

.site-nav a {
    text-decoration: none;
    color: #333;
    font-weight: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 2px;
}

.site-nav a.active {
    color: #fff;
    background: #3498db;
}

/* 텔레그램 초대링크 메뉴 스타일 */
.telegram-menu {
    margin-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    flex: 1 !important;
    max-width: 100% !important;
    height: 100% !important;
    border-right: 1px solid #eee !important;
}

.telegram-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 2px !important;
    color: #3498db !important;
    /* 파란색으로 변경 */
    font-weight: 700 !important;
    /* 볼드체로 변경 */
    font-size: clamp(1em, 2.5vw, 0.9em) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transition: background-color 0.3s ease !important;
}

.telegram-button:hover {
    transform: none !important;
    background-color: #f8f9fa !important;
    color: #3498db !important;
    box-shadow: none !important;
}

.telegram-icon {
    font-size: clamp(0.8em, 2.5vw, 0.9em) !important;
    color: #3498db !important;
    flex-shrink: 0 !important;
    animation: pulse 2s infinite;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .telegram-menu {
        margin: 0 !important;
        padding: 0 !important;
    }

    .telegram-button {
        font-size: clamp(0.9em, 2vw, 0.9em) !important;
        padding: 0 !important;
    }

    .telegram-icon {
        font-size: clamp(0.75em, 2vw, 0.9em) !important;
    }
}

@media (max-width: 480px) {
    .telegram-button {
        font-size: clamp(0.8em, 1.8vw, 0.85em) !important;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}


/* 캘린더 스타일 */
.calendar-container {
    width: 100%;
    padding: 0;
}

.calendar-error {
    text-align: center;
    padding: 10px;
    color: #c0392b;
    font-size: 0.9em;
}

.month-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    padding: 10px;
}

.month-title {
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
}

.calendar-header,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    width: 100%;
}

.calendar-header {
    text-align: center;
    font-weight: bold;
    font-size: 0.8em;
    margin-bottom: 4px;
}

.calendar-day {
    padding: 4px;
    border: 1px solid #eee;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
}

.calendar-day.no-rooms {
    min-height: unset;
}

.calendar-day .room-indicator {
    min-height: 20px;
}

.calendar-day.no-rooms .room-indicator {
    display: none;
}

.day-info {
    font-size: 0.75em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 4px;
}

.no-rooms .day-info {
    margin-bottom: 0;
}

.saturday {
    color: blue;
}

.sunday {
    color: red;
}

.room-indicator {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    min-height: 20px;
}

.room-text {
    display: block;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 0.65em;
    text-align: center;
    text-decoration: none;
    color: #000;
    background: #ddd;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 18px;
    line-height: 18px;
}

.empty-day {
    background: #f5f5f5;
}

.next-month {
    background: #f9f9f9;
}

.next-month-day {
    background: #f0f0f0;
}

@media (hover: hover) {
    .room-text:hover {
        filter: brightness(1.1);
    }
}

/* 모바일 최적화 (site-nav) */
@media (max-width: 480px) {
    .site-nav {
        height: 36px;
    }

    .site-nav a {
        padding: 0;
        font-size: clamp(0.75em, 3vw, 0.9em);
    }

    .logo-text .title-main {
        font-size: 18px;
    }

    .logo-text .title-sub {
        font-size: 14px;
    }

    .site-logo {
        width: 48px;
        height: auto;
    }

}

/* TOP 버튼 스타일 */
.top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: rgba(52, 152, 219, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    font-size: 28px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    cursor: pointer;
    transform: translateY(20px);
}

.top-button::before {
    content: '↑';
    font-family: sans-serif;
    line-height: 1;
    transform: translateY(-2px);
}

.top-button.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.top-button:hover {
    background: rgba(52, 152, 219, 0.95);
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 480px) {
    .top-button {
        bottom: 25px;
        right: 25px;
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
}

/* ===== header.php 인라인 스타일 옮김 END ===== */


/* ===== index.php 추가 스타일 START ===== */
/* 로딩 인디케이터 스타일 */
#loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 페이지 내비게이션 스타일 */
.page-nav {
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    justify-content: center;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 5px;
    box-sizing: border-box;
    position: sticky;
    top: 40px;
    /* 메인 내비게이션 높이 */
    z-index: 90;
}

.page-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    max-width: 480px;
    margin: 0 auto;
}

.page-nav li {
    flex: 0 1 auto;
}

.page-nav a {
    display: block;
    padding: 6px 12px;
    color: #666;
    text-decoration: none;
    font-size: 0.85em;
    white-space: nowrap;
    background: #f8f9fa;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.page-nav a.active {
    color: #fff;
    background: #3498db;
    box-shadow: 0 1px 3px rgba(52, 152, 219, 0.3);
}

/* 스크롤 시 헤딩 포커스 효과 제거됨 */
.section-heading {
    scroll-margin-top: 60px;
    /* 서브내비 높이 고려 필요 */
}

/* 모바일 최적화 (page-nav) */
@media (max-width: 480px) {
    .page-nav {
        padding: 4px;
        top: 36px;
        /* 모바일에서 메인 내비게이션 높이 */
    }

    .page-nav ul {
        gap: 3px;
    }

    .page-nav a {
        padding: 4px 8px;
        font-size: 0.8em;
    }
}

/* 페이지 섹션 스타일 */
.page-section {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 15px auto;
    padding: 20px;
}

.page-section h2 {
    font-size: 1.2em;
    margin: 0 0 15px 0;
    padding: 10px 0;
    border-bottom: 2px solid #3498db;
    color: #2c3e50;
}

.page-section h3 {
    font-size: 1.1em;
    margin: 15px 0 10px 0;
    color: #34495e;
}

.page-section p {
    line-height: 1.6;
    margin: 0 0 15px 0;
    color: #444;
}

/* 리스트 스타일 개선 */
.page-section ul,
.page-section ol {
    padding-left: 0;
    margin: 0 0 15px 0;
    list-style: none;
}

.page-section li {
    margin-bottom: 12px;
    line-height: 1.5;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* 리스트 내 날짜 강조 */
.page-section li strong,
.page-section li b {
    color: #2980b9;
    display: inline-block;
    margin-right: 6px;
}

/* 중첩된 리스트 스타일 */
.page-section li ul,
.page-section li ol {
    margin: 8px 0 0 0;
}

.page-section li li {
    margin: 6px 0;
    padding: 8px;
    background: #fff;
    border-left: 2px solid #95a5a6;
}

/* 에러 메시지 스타일 */
.error-message {
    text-align: center;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 2rem auto;
    max-width: 480px;
}

.error-message p {
    color: #e74c3c;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.error-message button {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.error-message button:hover {
    background: #2980b9;
}

/* ===== index.php 추가 스타일 END ===== */


/* ===== footer.php 인라인 스타일 START ===== */
/* 푸터 스타일 */
.site-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid #eee;
    background-color: #fff;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #333;
}

.footer-copyright {
    font-size: 0.85em;
    color: #888;
}

/* 모바일 최적화 (footer) */
@media (max-width: 480px) {
    .site-footer {
        padding: 15px;
        margin-top: 30px;
    }

    .footer-links a {
        display: inline-block;
        margin: 5px;
    }
}

/* ===== footer.php 인라인 스타일 END ===== */

/* 가이드 이미지 스타일 */
.guide-images {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem 0;
    max-width: 100%;
}

.guide-image-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.guide-image-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.guide-image-container:active {
    transform: translateY(0);
}

.responsive-image {
    width: 400px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
    display: block;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-caption {
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    margin-top: 0.5rem;
    width: 100%;
    max-width: 400px;
}

/* 이미지 팝업 스타일 */
.image-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    display: flex !important;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.image-popup-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: 20px;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.image-popup-overlay.active .image-popup-content {
    transform: scale(1);
}

.image-popup-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.popup-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 1rem;
    padding: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.close-popup {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 1;
}

.close-popup:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* 가이드 리스트 스타일 */
.guide-step {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.guide-step-text {
    font-size: 1rem;
    color: #2c3e50;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
    .guide-images {
        gap: 1.5rem;
        padding: 0 10px;
    }

    .guide-image-container {
        padding: 0.8rem;
    }

    .image-caption {
        font-size: 0.8rem;
    }

    .guide-step {
        padding: 0.8rem;
    }

    .image-popup-content {
        margin: 10px;
    }

    .popup-caption {
        font-size: 0.9rem;
        bottom: -35px;
    }

    .close-popup {
        top: -35px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
}

/* 애드센스 광고 컨테이너 스타일 */
.ad-container {
    width: 100%;
    max-width: 480px;
    margin: 20px auto;
    padding: 0 10px;
    box-sizing: border-box;
    text-align: center;
}

.ad-container ins {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

/* 메인 콘텐츠 영역 */
.main-content {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
}

/* 반응형 광고 스타일 */
@media (max-width: 480px) {
    .ad-container {
        padding: 0 5px;
        margin: 15px auto;
    }
}

/* 모바일 최적화 */
@media (max-width: 480px) {
    .spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }

    .error-message {
        padding: 1.5rem;
        margin: 1rem;
    }

    .error-message p {
        font-size: 1rem;
    }
}

/* 캘린더 하단 광고 컨테이너 스타일 */
#calendar-ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 480px; /* 콘텐츠 최대 너비와 일치 */
    min-height: 90px;  /* 광고 로드 전 높이 유지 (CLS 방지) */
    margin: 10px auto;
    padding: 0 10px;
    box-sizing: border-box;
}

#calendar-ad-container .adsbygoogle {
    max-width: 100%;
}
