/* --- Common Styles & Resets --- */
body {
    font-family: 'Gowun Dodum', sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    color: #343a40;
    line-height: 1.6;
    margin: 0; /* 0은 절반해도 0 */
    padding: 0; /* 0은 절반해도 0 */
}

/* --- Detail Page Container (전체 컨텐츠 감싸는 역할) --- */
.detail-page-container { /* HTML의 최상위 div 클래스명 */
    max-width: 1000px; /* 요청대로 max-width */
    margin: 0 auto;    /* 가운데 정렬 (0 auto는 그대로 유지) */
    padding: 20px; /* 20px -> 10px */
    background-color: #ffffff;
}

/* PC 환경에서 헤더 높이만큼 마진 추가 */
@media (min-width: 769px) {
    .detail-page-container {
        margin-top: 80px; /* 헤더 높이 80px -> 40px */
        border-radius: 12px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
    }
}

/* --- Page Header (식당 이름) --- */
.detail-header {
    text-align: center;
    padding: 12.5px 10px; /* 25px 20px -> 12.5px 10px */
    margin-bottom: 15px; /* 30px -> 15px */
    border-bottom: 2px solid #fd7e14;
}
.detail-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #fd7e14;
    margin: 0 0 4px 0; /* 0 0 8px 0 -> 0 0 4px 0 */
    font-family: "Gowun Dodum", sans-serif;
}
.detail-header .sub-name {
    font-size: 18px;
    color: #6c757d;
    margin: 0; /* 0은 절반해도 0 */
}

/* --- Detail Section (지도, 기본정보, 설명, 갤러리 공통) --- */
/* HTML의 detail-map-wrapper, info-section 등을 이 스타일로 통합 또는 개별 적용 */
.detail-map-wrapper,
.info-section, /* HTML의 .info-section 클래스 사용 */
.no-map-placeholder
{
    margin-bottom: 17.5px; /* 35px -> 17.5px */
    padding: 12.5px; /* 25px -> 12.5px */
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.detail-map-wrapper:last-of-type, /* 이 규칙은 실제 마지막 요소에 따라 조정 필요 */
.info-section:last-of-type { /* .detail-actions가 마지막이므로 이 규칙은 적용 안될 수 있음 */
    margin-bottom: 0; /* 0은 절반해도 0 */
}


/* 각 섹션 내부 제목 (HTML의 h3 사용) */
.detail-map-wrapper h3, /* 지도 섹션에 h3가 있다면 */
.info-section h3
{
    font-size: 22px;
    font-weight: 600;
    color: #343a40;
    margin-top: 0; /* 0은 절반해도 0 */
    margin-bottom: 10px; /* 20px -> 10px */
    padding-bottom: 6px; /* 12px -> 6px */
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
}
.detail-map-wrapper h3 i,
.info-section h3 i
{
    margin-right: 6px; /* 12px -> 6px */
    color: #fd7e14;
    font-size: 20px;
}

/* JS 애니메이션용 초기 상태 */
.revealable {
    opacity: 0;
    transform: translateY(25px) scale(0.99); /* transform 값은 padding/margin이 아니므로 유지 */
    transition: opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.revealable.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 1. Map Section */
.detail-map-wrapper iframe { /* iframe에 직접 스타일 적용 */
    width: 100%;
    height: 350px; /* 요청된 높이 */
    border-radius: 8px; /* iframe 모서리 */
    border: none;
}
.no-map-placeholder { /* HTML 클래스명 일치 */
    padding: 15px; /* 30px -> 15px */
    text-align: center;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 8px;
    font-size: 16px;
}
.no-map-placeholder p {
    margin:0; /* 0은 절반해도 0 */
    display: flex;
    align-items: center;
    justify-content: center;
}
.no-map-placeholder i {
    margin-right: 4px; /* 8px -> 4px */
    font-size: 18px;
}


/* 2. Basic Info Section */
.info-section .info-list {
    list-style: none;
    padding: 0; /* 0은 절반해도 0 */
    margin: 0; /* 0은 절반해도 0 */
}
.info-section .info-list li {
    display: flex;
    align-items: flex-start;
    padding: 6px 0; /* 12px 0 -> 6px 0 */
    border-bottom: 1px dashed #e9ecef;
    font-size: 16px;
}
.info-section .info-list li:last-child {
    border-bottom: none;
}
.info-section .info-label {
    min-width: 120px;
    font-weight: 500;
    color: #495057;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 1px; /* 2px -> 1px */
}
.info-section .info-label i {
    margin-right: 5px; /* 10px -> 5px */
    color: #868e96;
    width: 18px;
    text-align: center;
}
.info-section .info-value {
    color: #212529;
    word-break: break-word;
    flex-grow: 1;
}
.info-section .info-value.rating {
    color: #fd7e14;
    font-weight: bold;
    display: flex;
    align-items: center;
}
.info-section .info-value.rating i.fa-star {
    color: #ffc107;
    margin-right: 2px; /* 4px -> 2px */
}

.info-section .info-value.hashtags {
    color: #007bff;
    font-style: italic;
}
.info-section .address-item {
    display: flex;
    align-items: center;
}
.info-section .address-item .info-value {
    margin-right: 5px; /* 10px -> 5px */
}
.copy-btn {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 20px;
    padding: 2.5px 5px; /* 5px 10px -> 2.5px 5px */
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}
.copy-btn:hover {
    background-color: #e2e6ea;
    border-color: #b8c0c7;
}
.copy-btn.copied {
    background-color: #28a745;
    color: white;
    border-color: #1f7a3d;
}
.copy-btn i {
    margin-right: 0; /* 0은 절반해도 0 */
}
.copy-btn.copied i.fa-copy { display: none; }
.copy-btn i.fa-check { display: none; }
.copy-btn.copied i.fa-check { display: inline-block; }

/* 3. Description Section */
.info-section .description-text {
    font-size: 16px;
    line-height: 1.4;
    color: #343a40;
    white-space: pre-wrap; /* Thymeleaf에서 줄바꿈 처리했다면 이 속성 필요 */
    background-color: #f8f9fa;
    padding: 10px; /* 20px -> 10px */
    border-radius: 8px;
}

/* 4. Photo Gallery Section */
.gallery-section .gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px; /* gap은 padding/margin이 아니므로 유지 */
}
/* HTML에서 .gallery-image-link 와 .gallery-image-wrapper 를 .gallery-item 으로 통일 가정 */
.gallery-section .gallery-item { /* div.gallery-item */
    border-radius: 8px;
    overflow: hidden; /* 확대 시 이미지가 튀어나가지 않도록 */
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1;
    background-color: #e9ecef;
    /* cursor: pointer; /* 확대 효과 위해 JS에서 처리할 수도 있지만, CSS로도 충분 */
}
.gallery-section .gallery-item:hover .gallery-image { /* 호버 시 자식 img 태그 확대 */
    transform: scale(1.1); /* 요청하신 확대 효과 */
}
.gallery-section .gallery-image { /* img 태그 */
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease; /* 부드러운 확대/축소 효과 */
}
/* HTML에서 Lightbox용 a 태그를 제거했으므로, .gallery-image-link 관련 스타일 불필요 */


/* --- Page Actions (하단 버튼) --- */
.detail-actions {
    text-align: center;
    margin-top: 20px; /* 40px -> 20px */
    padding-top: 15px; /* 30px -> 15px */
    border-top: 1px solid #e0e0e0;
}
.action-btn {
    display: inline-block;
    padding: 6px 14px; /* 12px 28px -> 6px 14px */
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.25s ease;
    margin: 4px; /* 8px -> 4px */
    border: none;
    cursor: pointer;
    font-family: "Gowun Dodum", sans-serif;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.action-btn i { margin-right: 5px; /* 10px -> 5px */ }
.action-btn.btn-primary { background-color: #fd7e14; color: white; }
.action-btn.btn-primary:hover { background-color: #e66a09; box-shadow: 0 5px 12px rgba(0,0,0,0.18); transform: translateY(-2px); }
.action-btn.btn-secondary { background-color: #6c757d; color: white; }
.action-btn.btn-secondary:hover { background-color: #5a6268; box-shadow: 0 5px 12px rgba(0,0,0,0.18); transform: translateY(-2px); }

/* --- "정보 없음" 컨테이너 --- */
.not-found-container { /* HTML의 .detail-page-container.not-found-container 에 적용 */
    text-align: center;
    padding: 30px 10px; /* 60px 20px -> 30px 10px */
    min-height: calc(100vh - 80px - 70px); /* 예시: 화면높이 - 헤더 - 푸터 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.not-found-container h2 { color: #dc3545; font-size: 28px; margin-bottom: 10px; /* 20px -> 10px */ }
.not-found-container p { font-size: 18px; color: #555; margin-bottom: 15px; /* 30px -> 15px */ }


/* --- 반응형 스타일 --- */
/* 태블릿 (769px ~ 991px) */
@media (max-width: 991px) {
    .detail-page-container { /* HTML 클래스명과 일치 */
        max-width: 100%;
        padding: 10px; /* 20px -> 10px */
        margin-top: 0; /* 0은 절반해도 0 */
    }
    .page-detail-header h1 { font-size: 28px; }
    .detail-map-wrapper, .info-section { padding: 10px; /* 20px -> 10px */ }
    .info-section h3, .info-section h2 { font-size: 20px; }
    .info-section .info-list li { font-size: 15px; }
    .info-section .info-label { min-width: 100px; }
    .gallery-section .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px; /* gap은 padding/margin이 아니므로 유지 */
    }
}

/* 모바일 (최대 768px) */
@media (max-width: 768px) {
    .detail-page-container {
        padding: 7.5px; /* 15px -> 7.5px */
        border-radius: 0;
        box-shadow: none;
        margin-top: 0; /* 0은 절반해도 0 */
    }
    .page-detail-header {
        padding: 10px 7.5px; /* 20px 15px -> 10px 7.5px */
        margin-bottom: 10px; /* 20px -> 10px */
        border-radius: 0;
    }
    .page-detail-header h1 { font-size: 24px; }

    .detail-map-wrapper, .info-section {
        padding: 7.5px; /* 15px -> 7.5px */
        margin-bottom: 10px; /* 20px -> 10px */
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    .info-section h3, .info-section h2 { font-size: 19px; }
    .info-section .info-label { min-width: auto; margin-bottom: 1.5px; /* 3px -> 1.5px */ font-weight: bold; }
    .info-section .info-list li {
        flex-direction: column;
        align-items: flex-start;
        padding: 4px 0; /* 8px 0 -> 4px 0 */
    }
    .info-section .info-value { margin-top: 1px; /* 2px -> 1px */ }
    .info-section .address-item { flex-direction: row; align-items: center; }
    .info-section .address-item .info-label { margin-bottom: 0; /* 0은 절반해도 0 */ }
    .info-section .address-item .copy-btn { margin-left: auto; } /* auto는 그대로 유지 */

    .detail-map-wrapper iframe { height: 250px; }

    .gallery-section .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px; /* gap은 padding/margin이 아니므로 유지 */
    }

    .detail-actions { margin-top: 12.5px; /* 25px -> 12.5px */ padding-top: 10px; /* 20px -> 10px */ }
    .action-btn {
        padding: 5.5px 10px; /* 11px 20px -> 5.5px 10px */
        font-size: 15px;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    .action-btn + .action-btn { margin-top: 6px; /* 12px -> 6px */ margin-left: 0; /* 0은 절반해도 0 */ }
}