/* Eat's Sense Renewal Theme Styles - Based on mainPage_draft7.html */

:root {
    --warm-bg: #faf7f2;
    --warm-card: #ffffff;
    --warm-primary: #556b2f;      /* 올리브 그린 */
    --warm-primary-light: #f1ebd9;
    --warm-accent: #e07a5f;       /* 테라코타 (경보) */
    --warm-accent-light: #fae8e3;
    --warm-dark: #2f3e46;
    --warm-gray: #7f8c8d;
    --warm-border: #ebd9c8;
    --font-family: 'Gowun Dodum', 'Noto Sans KR', sans-serif;
    --transition: all 0.25s ease;
}

/* 전역 폰트 적용 (Font Awesome 등 아이콘 폰트 깨짐 방지 처리) */
body, html, input, select, textarea, button {
    font-family: var(--font-family) !important;
}

div, p, span, a, h1, h2, h3, h4, h5, h6, li, td, th {
    font-family: var(--font-family);
}

body {
    background-color: var(--warm-bg) !important;
    color: var(--warm-dark) !important;
    line-height: 1.7 !important;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1040px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

@media (max-width: 768px) {
    .container {
        padding: 0 3px !important;
    }
}

/* 구글 자동 번역기 영역 (로고 바로 우측 배치) */
.google_translate_element_parent_div {
    position: static !important;
    top: auto !important;
    right: auto !important;
    max-width: none !important;
    margin: 0 !important;
    display: inline-block !important;
    padding: 0 !important;
    z-index: 99 !important;
    background: transparent !important;
    box-sizing: border-box !important;
}

/* 히어로 영역 배경색 동기화 */
.hero {
    background: var(--warm-bg) !important;
    background-image: none !important;
    color: var(--warm-dark) !important;
    padding: 60px 0 40px !important;
}

/* 최상단 긴급 알림 띠 배너 */
.alert-bar {
    background-color: var(--warm-accent) !important;
    color: #ffffff !important;
    padding: 8px 20px !important;
    font-size: 13.5px !important;
    font-weight: bold !important;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.alert-bar a {
    color: #ffffff !important;
    text-decoration: underline !important;
    margin-left: 6px;
}

/* 헤더 */
header {
    background-color: var(--warm-card) !important;
    border-bottom: 1px solid rgba(0,0,0,0.04) !important;
    padding: 16px 0 !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: none !important;
}

header .container {
    max-width: 1040px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 20px !important;
}

.logo {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--warm-primary) !important;
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.logo h1 {
    font-size: 22px !important;
    margin: 0 !important;
}

.logo h1 a {
    color: var(--warm-primary) !important;
}

nav {
    display: flex;
    gap: 24px !important;
    font-size: 14.5px !important;
    align-items: center !important;
}

nav ul {
    display: flex !important;
    align-items: center !important;
    gap: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

nav ul li {
    margin-left: 0 !important;
}

nav ul li a {
    text-decoration: none !important;
    color: var(--warm-dark) !important;
    font-weight: 500 !important;
    transition: var(--transition) !important;
}

nav ul li a:hover, nav ul li a.active {
    color: var(--warm-primary) !important;
    font-weight: 700 !important;
}

nav ul li a::after {
    display: none !important;
}

/* 실시간 위해정보 / 배너 분할 정보 레이아웃 가로폭 고정 % 적용 */
.info-layout {
    display: flex !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    margin-bottom: 60px !important;
}

.info-layout > div:first-child {
    width: 62% !important; /* 위해정보 영역 고정 62% */
}

.info-layout > div:last-child {
    width: 35% !important; /* 배너 영역 고정 35% */
}

@media (max-width: 1024px) {
    .info-layout > div:first-child {
        width: 100% !important;
        margin-bottom: 30px !important;
    }
    .info-layout > div:last-child {
        width: 100% !important;
    }
}

/* 푸터 */
footer {
    background: #efeae2 !important;
    padding: 40px 0 !important;
    font-size: 13px !important;
    text-align: center !important;
    color: var(--warm-gray) !important;
    border-top: 1px solid rgba(0,0,0,0.02) !important;
}

footer .container {
    max-width: 1040px !important;
    margin: 0 auto !important;
}

/* 배너 슬라이더 및 이미지 고정 규격 처리 */
.olive-banner-slider {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    width: 356px !important;
    max-width: 100% !important;
    height: 210px !important;
    max-height: 210px !important;
    transition: none !important;
}

.warm-slide {
    width: 100% !important;
    height: 100% !important;
    max-height: 210px !important;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: none !important;
}

.warm-slide a {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    transition: none !important;
}

.warm-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 14px;
    transition: none !important;
}

/* 챗봇 버튼 가로 정렬 맞춤 */
.chatbot-btn-box {
    width: 356px !important;
    max-width: 100% !important;
}

/* 위해정보 리스트 영역 가로폭 100% 강제 고정 */
.recall-list {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

/* 위해정보 아이템 타일 높이/너비 고정 및 오버플로우 방지 */
.recall-item-tile {
    width: 100% !important;
    height: 78px !important;
    max-height: 78px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
}

/* 전역 서브페이지 헤더(.page-header) 스타일 리뉴얼 */
.page-header {
    background: linear-gradient(135deg, #556b2f 0%, #425424 100%) !important;
    background-color: #556b2f !important;
    padding: 20px 0 !important; /* 높이 영역 대폭 감소 */
    text-align: center !important;
    border-bottom: 1px solid rgba(0,0,0,0.04) !important;
}

.page-header h1,
.page-header p[style*="bold"],
.page-header p:first-child {
    font-size: 20px !important; /* 제목 폰트 크기 통일 */
    font-weight: 700 !important;
    margin: 0 0 6px 0 !important;
    color: #ffffff !important;
    display: block !important;
}

.page-header p:not(:first-child),
.page-header span {
    font-size: 12.5px !important; /* 설명 폰트 크기 통일 */
    opacity: 0.85 !important;
    color: #ffffff !important;
    display: block !important;
    margin: 0 !important;
}

/* 지정 서브페이지(리스트/상세) 본문 및 컨트롤 글자 크기 미세 축소 */
.gallery-section, 
.board-section, 
.content-section, 
.store-list, 
.store-detail {
    font-size: 13.5px !important;
}

.gallery-section table,
.board-section table,
.content-section table,
.store-list table,
.store-detail table,
.list-div,
.list-div th,
.list-div td,
.list-item-group,
.list-item-title-group,
.gallery-item,
.detail-table,
.food-qr-detail-table,
.article-meta,
.article-content {
    font-size: 13px !important;
}

.gallery-section h2, .gallery-section h3,
.board-section h2, .board-section h3,
.content-section h2, .content-section h3,
.store-list h2, .store-list h3,
.store-detail h2, .store-detail h3 {
    font-size: 1.1rem !important;
}

.gallery-section input, .gallery-section select, .gallery-section button,
.board-section input, .board-section select, .board-section button,
.content-section input, .content-section select, .content-section button,
.store-list input, .store-list select, .store-list button,
.store-detail input, .store-detail select, .store-detail button {
    font-size: 13px !important;
}

/* 매장정보 자체 스타일(내부 폰트 설정)이 강하게 적용된 클래스 오버라이드 */
.store-name-text { font-size: 0.98rem !important; }
.store-address-text { font-size: 0.82rem !important; }
.store-tel-text, .store-distance-text { font-size: 0.78rem !important; }
.store-badge { font-size: 0.75rem !important; }
.detail-title { font-size: 1.35rem !important; }
.detail-branch { font-size: 0.85rem !important; }
.card-subtitle { font-size: 0.98rem !important; }
.sanc-header { font-size: 0.85rem !important; }
.sanc-body { font-size: 0.78rem !important; }
.user-badge, .btn-review-submit, .edit-textarea { font-size: 0.78rem !important; }
.reviewer-name { font-size: 12.5px !important; }
.review-date { font-size: 11px !important; }
.review-content { font-size: 12.5px !important; }
.depth-badge { font-size: 0.6rem !important; }


/* 대형 스크린 (1280px 이상) */
@media (min-width: 1280px) {
    nav ul {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }
    nav ul li {
        display: flex !important;
        align-items: center !important;
        margin-left: 1.2rem !important;
    }
    nav ul li a {
        font-size: 15px !important;
    }
    #header_profile_menu {
        margin-left: 2.2rem !important;
    }
}

/* 태블릿 / 중형 스크린 (769px ~ 1279.98px) - 메뉴 찌그러짐 및 2줄 깨짐 방지 */
@media (min-width: 769px) and (max-width: 1279.98px) {
    nav ul {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }
    nav ul li {
        display: flex !important;
        align-items: center !important;
        margin-left: 0.6rem !important;
    }
    nav ul li a {
        font-size: 13px !important;
        white-space: nowrap !important;
    }
    #header_profile_menu {
        margin-left: 1rem !important;
    }
}

/* 모바일 스크린 (768px 이하) - 모바일 드로어 메뉴 및 프로필 최상단 배치 */
@media (max-width: 768px) {
    /* 모바일 위해공지 배너 최적화 (CSS Grid 기법) */
    #topAlert {
        /* 우측에 절대 위치로 고정된 버튼들과 겹치지 않도록 오른쪽 패딩 확보 */
        padding-right: 125px !important;
        padding-left: 15px !important;
        justify-content: flex-start !important; /* 모바일은 왼쪽 정렬이 가독성에 좋음 */
        height: 40px; /* 높이 고정 */
    }

    #topAlertText {
        display: inline-block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important; /* 길면 ... 처리 */
        flex: 1; /* 남은 공간 점유 */
        min-width: 0;
        font-size: 12px !important; /* 모바일 폰트 축소 */
    }

    #topAlertLink {
        font-size: 12px !important;
        white-space: nowrap !important;
        flex-shrink: 0; /* 상세조회 버튼은 안 잘리게 */
        margin-left: 4px !important;
    }

    /* '오늘 하루 보지 않기' 라벨 위치 및 텍스트 조정 */
    #topAlert label {
        right: 35px !important; /* 닫기 버튼 왼쪽으로 바짝 붙임 */
        font-size: 0 !important; /* 텍스트 숨기기 기법 (체크박스만 남김) */
    }

    #topAlert label input {
        margin: 0 !important;
        font-size: 11px; /* 폰트 리셋 */
    }

    /* 텍스트 대신 아이콘처럼 보이기 위해 '오늘..' 글자 대신 가상 요소로 짧게 표시 가능 */
    #topAlert label::after {
        content: "오늘끄기"; /* 글자를 줄여서 공간 확보 */
        font-size: 10px;
        color: rgba(255,255,255,0.8);
        white-space: nowrap;
    }

    #topAlert .emergency-close {
        right: 10px !important; /* 닫기 버튼 위치 조정 */
    }

    .x-btn {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        margin-bottom: 20px !important;
        width: 100% !important;
        height: 35px !important;
    }

    #x-svg-btn {
        position: static !important;
        cursor: pointer !important;
        display: block !important;
        width: 30px !important;
        height: 30px !important;
    }

    nav {
        display: none;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        width: 280px !important;
        height: 100vh !important;
        background-color: var(--warm-card) !important;
        box-shadow: -5px 0 25px rgba(0,0,0,0.15) !important;
        z-index: 999999 !important;
        padding: 20px !important;
        box-sizing: border-box !important;
        overflow-y: auto !important;
    }

    nav ul {
        display: flex !important;
        flex-direction: column !important;
        margin-top: 10px !important;
        gap: 15px !important;
        background: transparent !important;
        border-top: none !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    nav ul li {
        display: block !important;
        margin-left: 0 !important;
        line-height: 42px !important;
    }
    /* 프로필 메뉴를 모바일 메뉴 제일 상단으로 배치 */
    #header_profile_menu {
        order: -1 !important;
        margin-left: 0 !important;
        margin-top: 5px !important;
        margin-bottom: 15px !important;
        padding-bottom: 12px !important;
        border-bottom: 1px solid #ebd9c8 !important;
    }
    #header_profile_menu a {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        justify-content: flex-start !important;
        padding: 5px 0 !important;
        width: auto !important;
        height: auto !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    #header_profile_menu a #header-profile-img {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        object-fit: cover !important;
    }
    #header_profile_menu a #header-profile-icon {
        width: 32px !important;
        height: 32px !important;
        display: flex;
        align-items: center !important;
        justify-content: center !important;
        background-color: var(--primary-light) !important;
        color: var(--primary-color) !important;
        border-radius: 50% !important;
        font-size: 14px !important;
    }
    .mobile-profile-label {
        display: inline-block !important;
        font-weight: 700 !important;
        color: var(--text-color) !important;
        font-size: 14px !important;
    }

    .olive-banner-slider {
        width: 100% !important;
    }

    .chatbot-btn-box {
        width: 100% !important;
    }
}

.mobile-profile-label {
    display: none;
}

nav ul li a.profile-link::after {
    display: none !important;
}