@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;700;900&display=swap');

/* ============================================================
   Design Tokens
   ============================================================ */
:root {
    --eureka-deep:    #1a5c4e;
    --eureka-teal:    #24a7a7;
    --eureka-mint:    #34b197;
    --eureka-cream:   #faf8f3;
    --eureka-warm:    #f5f0e8;
    --eureka-gold:    #c8a45c;
    --text-primary:   #1a1a1a;
    --text-secondary: #5a5a5a;
    --text-muted:     #8a8a8a;
    --transition-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   Containers
   ============================================================ */
.eureka-list-container,
.eureka-post-container {
    max-width: 1100px;
    margin: 48px auto 0 auto;
    padding: 52px 48px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(26, 92, 78, 0.07);
}

/* ============================================================
   Breadcrumb
   ============================================================ */
.breadcrumb {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ============================================================
   List Header
   ============================================================ */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 36px;
    border-bottom: 2px solid var(--eureka-deep);
}

.list-header h1 {
    margin: 0;
    font-family: 'Noto Serif KR', Georgia, serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--eureka-deep);
    letter-spacing: -0.02em;
}

.list-summary {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
}

/* ============================================================
   Search Bar
   ============================================================ */
.list-search {
    margin-bottom: 28px;
}

.list-search form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-select,
.search-input {
    height: 44px;
    border: 1px solid #d8ddd9;
    border-radius: 22px;
    padding: 0 18px;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--eureka-cream);
    transition: border-color 0.2s ease;
}

.search-select:focus,
.search-input:focus {
    outline: none;
    border-color: var(--eureka-teal);
}

.search-input {
    flex: 1;
}

.btn-search {
    border: none;
    border-radius: 22px;
    padding: 0 24px;
    height: 44px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--eureka-deep);
    color: #fff;
    transition: background 0.2s var(--transition-smooth);
}

.btn-search:hover {
    background: #12453a;
}

.btn-reset {
    border: 1px solid #d8ddd9;
    border-radius: 22px;
    padding: 0 18px;
    height: 44px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: var(--eureka-warm);
    color: var(--eureka-deep);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s ease;
}

.btn-reset:hover {
    background: #ede8df;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ============================================================
   Magazine List (eureka_list) — 가로형 리스트 카드
   ============================================================ */
.magazine-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.magazine-card {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.35s var(--transition-smooth);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.magazine-card:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 24px rgba(26, 92, 78, 0.10);
    border-color: var(--eureka-teal);
}

/* 썸네일 래퍼 — 고정 크기 */
.magazine-cover-wrapper {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    overflow: hidden;
    background: var(--eureka-warm);
    position: relative;
}

.magazine-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s var(--transition-smooth);
}

.magazine-card:hover .magazine-cover-img {
    transform: scale(1.08);
}

.magazine-cover-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    background: var(--eureka-warm);
}

/* 카드 본문 — 세로 중앙 정렬 */
.magazine-card-body {
    flex: 1;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.magazine-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--eureka-warm);
    color: var(--eureka-deep);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    align-self: flex-start;
}

.magazine-card-title {
    font-family: 'Noto Serif KR', Georgia, serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.45;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.magazine-card:hover .magazine-card-title {
    color: var(--eureka-deep);
}

.magazine-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================================
   Classic Table Layout (fallback / news list)
   ============================================================ */
.list-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

.list-table thead tr {
    border-bottom: 2px solid var(--eureka-deep);
}

.list-table th,
.list-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #eef0ee;
    text-align: center;
    vertical-align: middle;
}

.list-table th {
    background: var(--eureka-cream);
    color: var(--eureka-deep);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.col-title  { text-align: left !important; width: 45%; }
.col-thumb  { text-align: center; width: 110px; }
.col-number { width: 64px; }
.col-views  { width: 80px; }
.col-date   { width: 100px; }

/* Thumbnail in table */
.list-thumb {
    width: auto;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(26, 92, 78, 0.08);
    background: var(--eureka-warm);
    transition: transform 0.3s var(--transition-smooth);
}

.list-thumb:hover {
    transform: scale(1.05);
}

.thumb-empty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 80px;
    border-radius: 6px;
    border: 1px dashed #cdd7d3;
    color: var(--text-muted);
    font-size: 12px;
}

.btn_right_box { display: none; }

.title-link {
    color: var(--text-primary);
    font-weight: 600;
    text-decoration: none;
    line-height: 1.5;
}

.title-link:hover {
    color: var(--eureka-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-notice {
    background: #e74c3c;
    color: #fff;
}

.prefix-badge {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(26, 92, 78, 0.08);
    color: var(--eureka-deep);
    font-size: 11px;
    font-weight: 700;
}

.comment-count {
    margin-left: 5px;
    color: #e74c3c;
    font-weight: 700;
    font-size: 13px;
}

.secret-icon {
    margin-left: 5px;
    font-size: 14px;
}

/* ============================================================
   Empty / Error States
   ============================================================ */
.list-empty,
.post-empty {
    padding: 72px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 17px;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dde3df;
    color: var(--eureka-deep);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--eureka-warm);
    border-color: var(--eureka-deep);
}

.page-link.active {
    background: var(--eureka-deep);
    color: #fff;
    border-color: var(--eureka-deep);
}

/* ============================================================
   Post Header (eureka_view / eureka_news_view)
   ============================================================ */
.post-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--eureka-deep);
}

.post-header h1,
.post-title {
    margin: 0 0 14px;
    font-family: 'Noto Serif KR', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ============================================================
   Post Sections
   ============================================================ */
.post-section {
    margin-top: 32px;
}

.post-section h2 {
    margin: 0 0 12px;
    font-family: 'Noto Serif KR', Georgia, serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--eureka-deep);
    padding-left: 12px;
    border-left: 3px solid var(--eureka-gold);
}

.post-summary {
    background: var(--eureka-cream);
    border-radius: 12px;
    padding: 22px 24px;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 15px;
    word-break: break-word;
    border-left: 3px solid var(--eureka-mint);
}

.post-content {
    line-height: 1.85;
    color: var(--text-primary);
    font-size: 16px;
    word-break: break-word;
}

.post-content.empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    padding: 40px 0;
}

/* ============================================================
   Post Images
   ============================================================ */
.post-images {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 18px;
}

.post-image {
    margin: 0;
}

.post-image img {
    width: 100%;
    max-width: 540px;
    border-radius: 12px;
    display: block;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.09);
}

/* ============================================================
   Reply Section
   ============================================================ */
.reply-section {
    background: #fff9f4;
    border-radius: 14px;
    padding: 28px;
    border-left: 4px solid var(--eureka-gold);
}

.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.reply-header h2 {
    border-left: none;
    padding-left: 0;
    color: var(--eureka-gold);
}

.reply-title {
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.reply-date {
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================================
   Post Actions
   ============================================================ */
.post-actions {
    margin-top: 48px;
    display: flex;
    justify-content: flex-end;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    height: 46px;
    background: var(--eureka-deep);
    color: #fff;
    border-radius: 23px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background 0.2s var(--transition-smooth);
}

.btn-back:hover {
    background: #12453a;
}

/* ============================================================
   Cover Hero (view pages)
   ============================================================ */
.post-cover-hero {
    margin: 28px 0 36px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(26, 92, 78, 0.12);
    max-height: 480px;
}

.post-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================================
   External Link
   ============================================================ */
.external-link {
    color: var(--eureka-teal);
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
    .magazine-cover-wrapper {
        width: 100px;
        height: 75px;
    }
}

@media (max-width: 768px) {
    .eureka-list-container,
    .eureka-post-container {
        padding: 32px 20px;
        margin: 24px 12px;
        border-radius: 14px;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .list-header h1 {
        font-size: 24px;
    }

    .list-search form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .search-input,
    .search-select,
    .btn-search,
    .btn-reset {
        width: 100%;
    }

    .magazine-grid {
        gap: 10px;
    }

    .magazine-cover-wrapper {
        width: 90px;
        height: 68px;
    }

    .magazine-card-body {
        padding: 10px 14px;
    }

    .magazine-card-title {
        font-size: 14px;
    }

    .list-table th:nth-child(2),
    .list-table td:nth-child(2),
    .list-table th:nth-child(4),
    .list-table td:nth-child(4) {
        display: none;
    }

    .post-header h1,
    .post-title {
        font-size: 20px;
    }

    .post-meta {
        flex-direction: column;
        gap: 4px;
    }

    .post-actions {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .magazine-cover-wrapper {
        width: 72px;
        height: 54px;
    }

    .magazine-card-body {
        padding: 8px 12px;
    }

    .magazine-card-title {
        font-size: 13px;
    }

    .magazine-card-badge {
        font-size: 10px;
        padding: 1px 8px;
    }
}
