/* =========================
   TOPBAR
========================= */
.topbar {
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.logo {
    font-size: 30px;
    font-weight: bold;
    color: #0d6efd;
}

.top-links {
    display: flex;
    gap: 14px;
    align-items: center;
    font-size: 14px;
    color: #555;
}

/* =========================
   MOBILE HAMBURGER
========================= */
body.menu-open {
    overflow: hidden;
}

.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 2000;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.mobile-topbar-inner {
    height: 56px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #111827;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.hamburger-btn {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    padding: 0;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    border-radius: 999px;
    background: #111827;
}

.mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2090;
    background: rgba(15, 23, 42, 0.52);
    opacity: 0;
    visibility: hidden;
    transition: all 0.22s ease;
}

.mobile-menu-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-side-menu {
    position: fixed;
    top: 0;
    right: -84%;
    width: 84%;
    max-width: 360px;
    height: 100vh;
    z-index: 2100;
    background: #ffffff;
    box-shadow: -12px 0 30px rgba(15, 23, 42, 0.18);
    transition: right 0.22s ease;
    display: flex;
    flex-direction: column;
}

.mobile-side-menu.is-open {
    right: 0;
}

.mobile-side-menu-header {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eef2f7;
}

.mobile-side-menu-title {
    font-size: 18px;
    font-weight: 900;
    color: #111827;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #111827;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.mobile-side-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 18px;
}

.mobile-side-link {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 14px 14px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #111827;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
}

.mobile-side-link:active {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.mobile-side-menu-footer {
    padding: 14px;
    border-top: 1px solid #eef2f7;
    background: #ffffff;
}

.mobile-side-auth-btn {
    display: inline-flex;
    width: 100%;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 800;
    background: #2563eb;
    color: #ffffff;
}

/* =========================
   HERO
========================= */
.hero {
    position: relative;
    height: 520px;
    border-radius: 18px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1;
}

.hero-inner {
    position: relative;
    z-index: 2;
}

/* =========================
   SEARCH
========================= */
.search-box {
    display: flex;
    gap: 10px;
    max-width: 650px;
}

.search-box input {
    flex: 1;
    height: 52px;
    border: none;
    border-radius: 8px;
    padding: 0 16px;
    font-size: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.search-box button {
    width: 120px;
    border: none;
    border-radius: 8px;
    background: #0d6efd;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
}

/* =========================
   HERO BUTTONS
========================= */
.hero-btns {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

/* =========================
   HERO CARD
========================= */
.hero-card {
    background: rgba(255,255,255,0.92);
    color: #333;
    border-radius: 14px;
    padding: 24px;
    backdrop-filter: blur(6px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.hero-card h3 {
    margin: 0 0 12px 0;
    font-size: 22px;
}

.hero-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 18px;
}

/* =========================
   MAIN GRID
========================= */
.main-grid {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr 1fr;
    gap: 20px;
    margin: 24px 0;
}

/* =========================
   SECTION
========================= */
.section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 20px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title-row h3 {
    margin: 0;
    font-size: 20px;
}

.section-title-row a {
    font-size: 13px;
    color: #0d6efd;
}

/* =========================
   LIST
========================= */
.list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.list li:last-child {
    border-bottom: none;
}

/* =========================
   INFO BOX
========================= */
.info-box {
    display: grid;
    gap: 12px;
}

.mini-card {
    padding: 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
}

.mini-card strong {
    display: block;
    margin-bottom: 6px;
}

/* =========================
   AD ROW
========================= */
.ad-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.ad-box {
    background: #fff;
    border: 1px dashed #bbb;
    border-radius: 10px;
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #888;
    font-size: 14px;
}

/* =========================
   HOME SEARCH REDESIGN
========================= */
.home-search-section {
    position: relative;
    margin: 16px 14px 20px;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(180deg, #07132b 0%, #081a3d 50%, #061022 100%);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.home-search-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top right, rgba(24, 119, 242, 0.25), transparent 35%),
        radial-gradient(circle at bottom left, rgba(0, 153, 255, 0.16), transparent 40%);
    pointer-events: none;
}

.home-search-inner {
    position: relative;
    z-index: 1;
    padding: 20px 16px 18px;
}

.home-search-badge {
    display: inline-block;
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #d9e8ff;
    font-size: 11px;
    font-weight: 700;
}

.home-search-title {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.8px;
    word-break: keep-all;
}

.home-search-desc {
    margin: 0 0 14px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.55;
    word-break: keep-all;
}

.home-search-form {
    margin: 0 0 12px;
}

.home-search-input-wrap {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.home-search-input {
    display: block;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    height: 48px;
    padding: 0 14px;
    margin: 0;
    border: none;
    border-radius: 12px;
    background: #ffffff;
    color: #111827;
    font-size: 15px;
    font-weight: 500;
    line-height: 48px;
    outline: none;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.home-search-input::placeholder {
    color: #9ca3af;
    line-height: 48px;
}

.home-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 48px;
    padding: 0 16px;
    margin: 0;
    border: none;
    border-radius: 12px;
    background: linear-gradient(180deg, #1d4ed8 0%, #1e40af 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 120px;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.28);
}

.home-search-submit:active {
    transform: scale(0.98);
}

.home-search-quick {
    display: flex;
    gap: 10px;
}

.home-search-quick-btn {
    flex: 1;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* 인기글 보기: 검색보다 한 단계 약한 파란색 */
.home-search-quick-btn.primary {
    background: #3b82f6;
    color: #ffffff;
    border: 1px solid #60a5fa;
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.18);
}

/* 커뮤니티 둘러보기: 가장 약한 버튼 */
.home-search-quick-btn.secondary {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
}

.home-search-quick-btn.primary:active,
.home-search-quick-btn.secondary:active {
    transform: scale(0.98);
}

/* =========================
   FOOTER
========================= */
.footer {
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 24px 0;
    color: #666;
    font-size: 14px;
    margin-top: 30px;
}

/* =========================
   TABLET
========================= */
@media (max-width: 1024px) {
    .hero-inner,
    .main-grid,
    .ad-row,
    .mega-grid {
        grid-template-columns: 1fr;
    }

    .main-menu {
        flex-direction: column;
    }

    .main-menu > li > a {
        text-align: left;
    }

    .hero {
        height: auto;
        min-height: 0;
        padding: 80px 0;
    }

    .hero-left h1 {
        font-size: 38px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box button {
        width: 100%;
        height: 48px;
    }

    .mega-menu {
        position: static;
    }
}

/* =========================
   HOME SEARCH DESKTOP
========================= */
@media (min-width: 768px) {
    .home-search-section {
        width: 100%;
        max-width: none;
        margin: 0 0 20px;
        border-radius: 24px;
        min-height: 380px;
    }

    .home-search-inner {
        min-height: 380px;
        padding: 36px 42px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .home-search-title {
        font-size: 42px;
        line-height: 1.2;
    }

    .home-search-desc {
        max-width: 900px;
        font-size: 22px;
        line-height: 1.6;
    }

    .home-search-form {
        max-width: 980px;
    }

    .home-search-input-wrap {
        flex-direction: row;
        gap: 12px;
    }

    .home-search-input {
        height: 58px;
        line-height: 58px;
        border-radius: 14px;
        font-size: 18px;
    }

    .home-search-input::placeholder {
        line-height: 58px;
    }

    .home-search-submit {
        width: 150px;
        height: 58px;
        flex: 0 0 150px;
        border-radius: 14px;
        font-size: 18px;
    }

    .home-search-quick {
        margin-top: 12px;
        gap: 12px;
        max-width: 980px;
    }

    .home-search-quick-btn {
        min-height: 52px;
        font-size: 17px;
        border-radius: 14px;
    }
}

/* =========================
   MOBILE
========================= */
@media (max-width: 767px) {
    .mobile-topbar {
        display: block;
    }

    .topbar {
        display: none;
    }

    .hero {
        height: auto;
        min-height: 0;
        border-radius: 14px;
    }

    .hero-bg img {
        min-height: 260px;
    }

    .hero-btns {
        flex-direction: column;
    }

    .hero-btns .btn {
        width: 100%;
    }

    .home-search-section {
        margin: 12px 0 16px;
        border-radius: 16px;
    }

    .home-search-inner {
        padding: 18px 14px 16px;
    }

    .home-search-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .home-search-desc {
        margin-bottom: 14px;
        font-size: 14px;
        line-height: 1.55;
    }

    .home-search-input-wrap {
        flex-direction: column;
    }

    .home-search-input {
        width: 100%;
        height: 48px;
        line-height: 48px;
        border-radius: 12px;
    }

    .home-search-input::placeholder {
        line-height: 48px;
    }

    .home-search-submit {
        width: 100%;
        height: 50px;
        flex: none;
        border-radius: 12px;
    }

    .home-search-quick {
        flex-direction: column;
    }

    .home-search-quick-btn {
        width: 100%;
    }
}

/* =========================
   SMALL MOBILE
========================= */
@media (max-width: 480px) {
    .search-box {
        flex-direction: column;
    }

    .search-box input[type="text"],
    .search-box button {
        width: 100%;
    }

    .ad-row {
        grid-template-columns: 1fr;
    }

    /* =========================
    MAIN GRID FIX (중요)
    ========================= */
    @media (max-width: 1024px) {
        .main-grid {
            grid-template-columns: 1fr !important;
        }
    }

    .weather-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .weather-stat-box {
        min-height: 80px;
        overflow: hidden;
    }

    .weather-stat-value {
        font-size: 22px;
    }

}