/* 공개 사이트 공통 스타일 — resources/views/site/layouts/app.blade.php 의 <style> 에서 옮김 (2026-11-17, 계획 D1).
   관리자 설정 색상·글꼴(--cream, --terracotta, --font-body)과 맞춤 CSS 는 레이아웃에 남아 이 파일 뒤에 온다. */
/* Bootstrap Modal 최소 CSS */
.modal { display: none; position: fixed; top: 0; left: 0; z-index: 1055; width: 100%; height: 100%; overflow-x: hidden; overflow-y: auto; outline: 0; }
.modal.show { display: block; }
.modal-backdrop { position: fixed; top: 0; left: 0; z-index: 1050; width: 100vw; height: 100vh; background-color: #000; }
.modal-backdrop.show { opacity: 0.5; }
.modal-backdrop.fade { opacity: 0; transition: opacity 0.15s linear; }
.modal.fade .modal-dialog { transition: transform 0.3s ease-out; transform: translateY(-50px); }
.modal.show .modal-dialog { transform: none; }
.modal-dialog { position: relative; width: auto; margin: 1.75rem auto; max-width: 500px; pointer-events: none; }
.modal-dialog.modal-sm { max-width: 300px; }
.modal-content { position: relative; display: flex; flex-direction: column; width: 100%; pointer-events: auto; background-color: #fff; background-clip: padding-box; border: 1px solid rgba(0,0,0,.2); border-radius: 0.5rem; outline: 0; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid #dee2e6; }
.modal-title { margin: 0; line-height: 1.5; font-size: 1.25rem; font-weight: 500; }
.modal-body { position: relative; flex: 1 1 auto; padding: 1rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; padding: 0.75rem; border-top: 1px solid #dee2e6; gap: 0.5rem; }
.btn-close { box-sizing: content-box; width: 1em; height: 1em; padding: 0.25em; color: #000; background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat; border: 0; border-radius: 0.375rem; opacity: 0.5; cursor: pointer; }
.btn-close:hover { opacity: 0.75; }
.fade { transition: opacity 0.15s linear; }
.fade:not(.show) { opacity: 0; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --warm-white: #FFFDF9;
    --charcoal: #1A1A1A;
    --ink: #2C2C2C;
    --stone: #8A8580;
    --terracotta-soft: #D4815F;
    --sage: #7A8B6F;
    --border: #E8E2DA;
    --card-shadow: 0 2px 20px rgba(26,26,26,0.06);
    --card-shadow-hover: 0 8px 40px rgba(26,26,26,0.12);
    --font-display: 'Noto Sans KR', 'Pretendard Variable', 'Pretendard', sans-serif;
    --max-width: 1280px;
    --gutter: 24px;
    --header-height: 72px;
}

html {
    scroll-behavior: smooth;
    /* iOS 는 텍스트 자동 확대(text autosizing)로 글자를 부풀린다. 페이징 버튼처럼
       높이가 고정된 요소는 부푼 글자가 들어갈 자리가 없어 잘리거나 줄바꿈된다. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--ink);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    background: rgba(255,253,249,0.92);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.site-brand {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--charcoal);
    flex-shrink: 0;
}

.site-brand span { color: var(--terracotta); font-style: italic; }

.site-brand img {
    max-height: 50px;
    /* inline-block 이면 이미지가 텍스트 베이스라인에 앉아 아래쪽에 디센더 여백이 붙는다.
       그만큼 <a> 박스가 늘어나 로고가 헤더 중앙보다 위로 치우쳐 보인다. */
    display: block;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.site-nav a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.3s;
    position: relative;
}

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--terracotta);
    transition: width 0.3s ease;
}

.site-nav a:hover { color: var(--charcoal); }
.site-nav a:hover::after { width: 100%; }

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.search-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: var(--stone);
}

.search-toggle:hover {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: white;
}

/* PC 설치(PWA) — 기본은 숨김, 스크립트가 설치 가능할 때만 hidden 을 푼다 */
.pwa-install {
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--stone);
    white-space: nowrap;
    transition: all 0.3s;
}

.pwa-install[hidden] { display: none; }

.pwa-install:hover {
    background: var(--charcoal);
    border-color: var(--charcoal);
    color: white;
}

/* 메뉴가 길어 좁은 PC 폭에선 헤더가 넘친다 — 1200 미만은 아이콘만, 1024 미만은 숨김 */
@media (max-width: 1199px) {
    .pwa-install { width: 40px; padding: 0; justify-content: center; }
    .pwa-install-label { display: none; }
}

@media (max-width: 1023px) {
    .pwa-install { display: none; }
}

/* 설치 직후 작업표시줄 고정 안내 — 크롬·엣지는 파이어폭스처럼 고정을 묻지 않는다 */
.pwa-pin-hint {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 360px;
    padding: 16px 18px;
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--ink);
    word-break: keep-all;
}

.pwa-pin-hint strong { display: block; margin-bottom: 2px; }

.pwa-pin-hint button {
    flex-shrink: 0;
    border: none;
    background: none;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--stone);
    cursor: pointer;
}

/* Search overlay */
.search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(26,26,26,0.6);
    backdrop-filter: blur(4px);
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

.search-overlay.active { display: flex; }

.search-overlay-inner {
    background: var(--warm-white);
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 640px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
}

.search-overlay-inner form {
    display: flex;
    gap: 12px;
}

.search-overlay-inner input {
    flex: 1;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-family: var(--font-body);
    outline: none;
    background: none;
    transition: border-color 0.3s;
}

.search-overlay-inner input:focus {
    border-color: var(--terracotta);
}

.search-overlay-inner button {
    background: var(--charcoal);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.search-overlay-inner button:hover { background: var(--terracotta); }

/* Mobile menu */
.mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--charcoal);
    transition: all 0.3s;
}

/* Mobile menu panel */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--warm-white);
    border-bottom: 1px solid var(--border);
    z-index: 99;
    padding: 16px var(--gutter);
    /* 항목이 많으면 패널 안에서 스크롤 (뒷 페이지로 스크롤이 넘어가지 않도록) */
    max-height: calc(100vh - var(--header-height));
    max-height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.mobile-menu.active { display: block; }

/* 메뉴가 열려 있는 동안 본문 스크롤 잠금 */
body.menu-open { overflow: hidden; }

.mobile-menu a {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink);
    border-bottom: 1px solid var(--border);
}

.mobile-menu a:last-child { border-bottom: none; }

/* 서비스 정보 그룹 — 홈은 무한 스크롤이라 푸터에 닿을 수 없다.
   푸터에만 있던 소개·문의·약관 링크의 유일한 진입 경로다. */
.mobile-menu-group { margin-top: 8px; }

.mobile-menu-heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--stone);
    margin: 16px 0 4px;
}

/* Mobile search — 햄버거 메뉴 안 첫 항목이다.
   메뉴 자체가 모바일에서만 열리므로 여기서 미디어 쿼리로 감출 필요가 없다. */
.mobile-search {
    display: block;
    margin: 0 0 8px;
    min-width: 0;
    overflow: hidden;
}

.mobile-search form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

.mobile-search input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    /* 16px 미만이면 iOS 가 포커스 시 페이지를 자동 확대한다. 확대되면
       레이아웃 좌표를 쓰는 최근 검색어 패널이 화면 밖으로 밀려 보인다.
       (iOS 는 접근성 때문에 maximum-scale 을 무시하므로 글자 크기로 막는다) */
    font-size: 1rem;
    background: #f5f0eb;
    border: 1px solid var(--border);
    border-radius: 18px;
    outline: none;
    font-family: var(--font-body);
    min-width: 0;
}

.mobile-search input:focus {
    border-color: var(--terracotta);
    background: white;
}

.mobile-search button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--terracotta);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 56px 0 32px;
    border-bottom: 2px solid var(--charcoal);
    margin-bottom: 32px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--charcoal);
    letter-spacing: -0.01em;
}

.section-more {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--terracotta);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.3s;
}

.section-more:hover { gap: 10px; }

/* ============================================
   POST CARDS
   ============================================ */
.post-card {
    background: var(--warm-white);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
}

.post-card-img {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.post-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.post-card:hover .post-card-img img { transform: scale(1.06); }

.post-card-body {
    padding: 24px;
}

.post-card-category {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-bottom: 10px;
}

.post-card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--charcoal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-excerpt {
    font-size: 0.95rem;
    color: var(--stone);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

/* 메타 줄 (partials/post-stats) — 노출수·좋아요수.
   하나의 flex 아이템으로 묶는다 — 낱개로 두면 부모의 gap 과 겹쳐
   간격이 화면마다 달라진다. */
.post-stats {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* 날짜와 뒤 내용을 가르는 점. 뒤가 감춰지면 점도 같이 사라져야 한다. */
.post-meta-sep {
    margin: 0 6px 0 0;
}

.post-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.post-stat i {
    font-size: 0.9em;
    opacity: 0.75;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--stone);
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ============================================
   COMPACT LIST
   ============================================ */
.compact-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: padding-left 0.3s;
}

/* 터치 기기에서는 탭 후 :hover 가 눌어붙어 항목이 밀린 채로 남는다 */
@media (hover: hover) {
    .compact-item:hover { padding-left: 8px; }
}
/* 무한 스크롤로 붙는 항목은 별도 컨테이너의 first-child 라서
   스코프를 좁히지 않으면 2번째 글의 윗여백까지 사라진다 */
.compact-list .compact-item:first-child { padding-top: 0; }

.compact-item-img {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.compact-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.compact-item-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.compact-item-category {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sage);
    margin-bottom: 6px;
}

.compact-item-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 6px;
    color: var(--charcoal);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.compact-item-meta {
    font-size: 0.85rem;
    color: var(--stone);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background: var(--charcoal);
    color: rgba(255,255,255,0.5);
    padding: 48px 0 28px;
    margin-top: 56px;
}

.footer-grid {
    display: grid;
    /* Categories 열을 내려 3열이다. 되살리면 2fr 1fr 1fr 1fr 로. */
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 32px;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.footer-brand span { color: var(--terracotta-soft); font-style: italic; }

.footer-desc { font-size: 0.875rem; line-height: 1.7; }

.footer-heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a { font-size: 0.875rem; transition: color 0.3s; }
.footer-links a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    font-size: 0.8rem;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer-company {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
    margin-top: 8px;
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--terracotta);
    z-index: 200;
    transition: width 0.1s;
    width: 0%;
}

/* ============================================
   ANIMATIONS (CSS Transition 기반)
   ============================================ */
.animate-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ============================================
   CONTENT (글 본문 반응형)
   ============================================ */
.content img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
    margin: 1rem auto;
}

.content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

.content .se-component,
.content .se-component-content,
.content .se-section,
.content .se-module {
    max-width: 100% !important;
    width: auto !important;
}

.content table { max-width: 100%; overflow-x: auto; display: block; }
.content iframe, .content video { max-width: 100%; height: auto; }

/* ============================================
   PAGINATION
   ============================================ */
/* Laravel 페이지네이터는 Bootstrap 5 마크업을 내보내지만
   (AppServiceProvider의 Paginator::useBootstrapFive) 이 레이아웃은
   Bootstrap CSS를 싣지 않아 d-none/d-sm-none 표시 유틸리티가 동작하지 않는다.
   그 결과 모바일용 블록과 번호 블록이 동시에 보이고, 번호 목록이
   좁은 화면을 넘쳐 페이지 가로 스크롤이 생긴다. */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 0;
}

/* 번호 목록에 ‹ › 가 이미 있어 중복인 «Previous/Next» 블록 */
nav.justify-content-between > .d-sm-none { display: none; }

/* "Showing 1 to 12 of 277 results" (영문, Bootstrap 없이는 항상 노출됨) */
nav.justify-content-between .small { display: none; }

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    /* 높이가 고정이라 글자가 두 줄이 되면 그대로 삐져나온다 */
    white-space: nowrap;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--ink);
    font-size: 0.875rem;
    transition: all 0.3s;
    background: none;
    text-decoration: none;
}

.pagination .page-link:hover {
    background: var(--charcoal);
    color: white;
    border-color: var(--charcoal);
}

.pagination .page-item.active .page-link {
    background: var(--terracotta);
    color: white;
    border-color: var(--terracotta);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    pointer-events: none;
}

/* ============================================
   LOADING
   ============================================ */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 0;
    color: var(--stone);
}

.loading-spinner .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--terracotta);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    /* 2열로 접으면 3개짜리 그리드가 2+1 이 돼 오른쪽이 빈다.
       열이 4개이던 시절(2x2)의 규칙이라 3열을 유지하고 간격만 줄인다. */
    .footer-grid { gap: 32px; }
}

@media (max-width: 768px) {
    :root { --gutter: 16px; --header-height: 60px; }

    .site-nav { display: none; }
    .mobile-toggle { display: flex; }
    .search-toggle { display: none; }

    .site-brand { font-size: 1.35rem; }

    .section-header { padding: 40px 0 20px; }
    .section-title { font-size: 1.35rem; }

    .compact-item { grid-template-columns: 80px 1fr; gap: 16px; padding: 16px 0; }

    /* About·Legal 은 항목이 2~3개뿐이라 세로로 쌓으면 푸터만 길어진다.
       나란히 두고, 브랜드 소개는 두 칸을 다 쓴다. */
    /* 푸터 축소 (DEV-048) — 화면 한 장을 다 차지해서 기사가 덜 보였다.
       About·Legal 제목을 빼고 링크 5개를 한 줄로 흘린다(좁으면 두 줄).
       div·ul 을 display: contents 로 풀어 li 가 .footer-grid 의 플렉스 항목이 된다. */
    .site-footer { padding: 28px 0 20px; margin-top: 40px; }
    .footer-grid { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 20px; }
    .footer-grid > :first-child { flex-basis: 100%; margin-bottom: 8px; }
    .footer-grid > div:not(:first-child), .footer-links { display: contents; }
    .footer-heading { display: none; }
    .footer-brand { font-size: 1.25rem; margin-bottom: 2px; }
    .footer-desc { font-size: 0.8125rem; }
    .footer-links a { font-size: 0.8125rem; }
    .footer-bottom { padding-top: 16px; font-size: 0.75rem; }
    .footer-bottom-inner { flex-direction: column; gap: 2px; }
    .footer-company { font-size: 0.6875rem; line-height: 1.6; }

    /* 번호가 세 줄로 늘어지지 않도록 한 칸 줄임 */
    .pagination .page-link { width: 36px; height: 36px; font-size: 0.8125rem; }
}


/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }


/* ---------- 검색 드롭다운 (최근 검색어) ---------- */
/* 패널은 body 에 붙여 fixed 로 띄운다. 검색창이 세 곳이고 각각 레이아웃이
   달라(플렉스 폭 계산 포함), 입력창을 감싸면 기존 배치가 깨질 수 있다. */
.sb-panel {
    position: fixed;
    z-index: 300; /* 검색 오버레이(200) 위 */
    display: none;
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(26,26,26,0.14);
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sb-panel.is-open { display: block; }

.sb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    font-size: 0.78rem;
    color: var(--stone);
    border-bottom: 1px solid var(--border);
}

.sb-clear {
    background: none;
    border: 0;
    /* 히트 영역을 넓히되 음수 마진으로 헤더 높이는 그대로 둔다.
       작으면 빗나간 클릭이 패널 밖으로 떨어져 패널만 닫힌다. */
    padding: 10px 12px;
    margin: -10px -12px -10px 0;
    border-radius: 8px;
    font-size: 0.78rem;
    color: var(--stone);
    font-family: var(--font-body);
    cursor: pointer;
}

.sb-clear:hover { color: var(--terracotta); background: #EFE8E0; }

.sb-list { list-style: none; margin: 0; padding: 4px 0; }

.sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    /* 터치 목표 44px 확보 — 개별 삭제 버튼이 옆에 붙어 있어 여유가 필요하다 */
    padding: 11px 14px;
    font-size: 0.9rem;
    color: var(--ink);
    cursor: pointer;
}

.sb-item:hover,
.sb-item.is-cursor { background: #F5F0EB; }

.sb-item .bi { flex-shrink: 0; color: var(--stone); font-size: 0.95rem; }

.sb-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sb-del {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    /* 40px 히트 영역. 음수 마진으로 행 높이는 키우지 않는다.
       좁으면 빗나간 클릭이 항목(li)에 걸려 삭제 대신 검색이 실행된다. */
    width: 40px;
    height: 40px;
    margin: -8px -6px -8px 0;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    color: var(--stone);
    cursor: pointer;
}

.sb-del:hover { color: var(--terracotta); background: #EFE8E0; }

/* ---------- "앱에서 보기" 배너 ---------- */
/* 헤더 아래 흐름 안에 둔다. 고정하면 맨 위로 버튼·스와이프 힌트·광고와 겹친다. */
.app-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px var(--gutter);
    background: var(--warm-white);
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    line-height: 1.4;
}

.app-banner-text { flex: 1; min-width: 0; color: var(--ink); }

.app-banner-open {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--terracotta);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
}

.app-banner-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    margin-right: -8px;
    border: 0;
    background: transparent;
    color: var(--stone);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

/* 맨 위로 이동 버튼 — 화면 우하단 고정. 스크롤을 내리면 나타난다. (모든 사이트 화면 공통)
   z-index는 모바일 메뉴(99)·검색 오버레이(200)보다 낮게 두어
   그것들이 열렸을 때는 뒤로 가려지게 한다.
   앱 하단바는 웹뷰 바깥(아래)에 따로 놓여서 bottom 기준으로 고정해도 겹치지 않는다. */
.to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--warm-white);
    color: var(--charcoal);
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    /* 기본은 숨김 — 화면 밖 클릭까지 막으려면 pointer-events도 꺼야 한다 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.3s, color 0.3s;
}

.to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.to-top.is-visible:hover {
    background: var(--charcoal);
    color: white;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; font-size: 1.1rem; }
}
