@charset "utf-8";

/* ============================================================
   Mission Magazine — sspm.or.kr
   Namespaced under .magazine-home / .story-detail
   ============================================================ */

:root {
    --mag-primary: #1a5276;
    --mag-primary-light: #2980b9;
    --mag-accent: #c0392b;
    --mag-accent-warm: #e67e22;
    --mag-bg: #fafafa;
    --mag-bg-warm: #fdf6ee;
    --mag-text: #2c3e50;
    --mag-text-light: #7f8c8d;
    --mag-border: #dce1e5;
    --mag-card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --mag-radius: 4px;
}

/* ============================================================
   MAGAZINE HOME — Quarter index page
   ============================================================ */

.magazine-home {
    font-size: 15px;
    line-height: 1.7;
    color: var(--mag-text);
    word-break: keep-all;
    margin-top: 20px;
}

/* Compact banner */
.magazine-home .mag-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 0 24px;
    padding: 12px;
    background: var(--mag-bg);
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
}

.magazine-home .mag-banner-thumb {
    flex-shrink: 0;
    width: 100px;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.magazine-home .mag-banner-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.magazine-home .mag-banner-info {
    flex: 1;
    min-width: 0;
}

.magazine-home .mag-banner-quarter {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.3;
    margin: 0 0 4px;
    color: var(--mag-text);
}

.magazine-home .mag-banner-title {
    font-size: 20px;
    font-weight: bold;
    line-height: 1.3;
    margin: 0 0 6px;
    color: var(--mag-primary);
    font-family: 'Nanum Myeongjo', serif;
}

.magazine-home .mag-banner-region {
    font-size: 13px;
    color: var(--mag-text-light);
}

/* Country tabs */
.magazine-home .mag-tabs {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    border-bottom: 2px solid var(--mag-primary);
    margin: 0 0 24px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    scrollbar-width: none;
}

.magazine-home .mag-tabs::-webkit-scrollbar {
    display: none;
}

.magazine-home .mag-tabs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline-flex;
}

.magazine-home .mag-tabs-list li {
    flex-shrink: 0;
}

.magazine-home .mag-tab {
    display: inline-block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    color: var(--mag-text-light);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.magazine-home .mag-tab:hover,
.magazine-home .mag-tab:focus {
    color: var(--mag-primary);
    text-decoration: none;
}

.magazine-home .mag-tab.active {
    color: var(--mag-primary);
    border-bottom-color: var(--mag-primary);
}

.magazine-home .mag-tab .flag {
    margin-right: 4px;
}

/* Country sections */
.magazine-home .mag-country {
    margin: 0 0 36px;
    scroll-margin-top: 60px;
}

.magazine-home .mag-country-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--mag-primary);
    margin: 0 0 16px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--mag-border);
    font-family: 'Nanum Myeongjo', serif;
}

.magazine-home .mag-country-name .flag {
    margin-right: 6px;
}

/* 관리자용 수정 버튼 (배너 / 지도자지침서) */
.magazine-home .mag-admin-edit {
    display: inline-block;
    margin-left: 10px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: normal;
    font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    vertical-align: middle;
    border: 1px solid var(--mag-primary);
    border-radius: var(--mag-radius);
    background: var(--mag-primary);
    color: #fff;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.magazine-home .mag-admin-edit:hover {
    background: var(--mag-primary-light);
    border-color: var(--mag-primary-light);
    color: #fff;
}

.magazine-home .mag-banner-info .mag-admin-edit {
    margin-left: 0;
    margin-top: 10px;
}

/* Story cards */
.magazine-home .mag-cards {
    list-style: none;
    margin: 0;
    padding: 0;
}

.magazine-home .mag-card {
    display: flex;
    flex-direction: column;
    margin: 0 0 16px;
    background: #fff;
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
    overflow: hidden;
    box-shadow: var(--mag-card-shadow);
    transition: box-shadow 0.2s;
}

.magazine-home .mag-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.magazine-home .mag-card a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.magazine-home .mag-card-img {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.magazine-home .mag-card-img img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center top;
}

.magazine-home .mag-card-date {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--mag-primary);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 2px;
}

.magazine-home .mag-card-body {
    padding: 14px 16px;
    flex: 1;
}

.magazine-home .mag-card-title {
    font-size: 16px;
    font-weight: bold;
    line-height: 1.4;
    margin: 0 0 6px;
    color: var(--mag-text);
}

.magazine-home .mag-card-summary {
    font-size: 13px;
    color: var(--mag-text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.magazine-home .mag-card-person {
    font-size: 12px;
    color: var(--mag-text-light);
    margin-top: 8px;
}

/* Archive link */
.magazine-home .mag-archive {
    margin: 30px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--mag-border);
    text-align: center;
}

.magazine-home .mag-archive a {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
    color: var(--mag-text-light);
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.magazine-home .mag-archive a:hover {
    background: var(--mag-primary);
    border-color: var(--mag-primary);
    color: #fff;
}

/* ============================================================
   LEADER GUIDE — 지도자지침서
   ============================================================ */

.magazine-home .leader-guide-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--mag-text);
}

.magazine-home .leader-guide-content h4 {
    font-size: 17px;
    font-weight: bold;
    color: var(--mag-primary);
    margin: 0 0 10px;
    padding: 0 0 6px;
    border-bottom: 1px solid var(--mag-border);
}

.magazine-home .leader-guide-content h5 {
    font-size: 15px;
    font-weight: bold;
    color: var(--mag-text);
    margin: 16px 0 8px;
}

.magazine-home .leader-guide-content p {
    margin: 0 0 12px;
}

.magazine-home .leader-guide-content a {
    color: var(--mag-primary-light);
    text-decoration: none;
}

.magazine-home .leader-guide-content a:hover {
    text-decoration: underline;
}

.magazine-home .leader-guide-box {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--mag-bg-warm);
    border: 1px solid #e8d5c0;
    border-radius: var(--mag-radius);
}

.magazine-home .leader-guide-box h4 {
    color: var(--mag-accent-warm);
    border-bottom-color: #e8d5c0;
}

.magazine-home .leader-guide-box ul {
    margin: 8px 0 0;
    padding: 0 0 0 20px;
    list-style-type: disc;
}

.magazine-home .leader-guide-box li {
    margin: 0 0 4px;
}

.magazine-home .leader-guide-letter,
.magazine-home .leader-guide-features,
.magazine-home .leader-guide-resources {
    margin: 0 0 20px;
}

.magazine-home .leader-links {
    margin: 4px 0 12px;
    padding: 0 0 0 20px;
    list-style-type: disc;
}

.magazine-home .leader-links li {
    margin: 0 0 4px;
}

/* ============================================================
   STORY DETAIL — Individual story page
   ============================================================ */

.story-detail {
    font-size: 17px;
    line-height: 2.0;
    color: var(--mag-text);
    word-break: keep-all;
    margin-top: 20px;
}

/* Hero */
.story-detail .story-hero {
    position: relative;
    margin: 0 0 28px;
    overflow: hidden;
    border-radius: var(--mag-radius);
}

.story-detail .story-hero img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: top;
}

.story-detail .story-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 24px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}

.story-detail .story-hero-country {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    margin: 0 0 6px;
}

.story-detail .story-hero-title {
    font-size: 24px;
    font-weight: bold;
    line-height: 1.3;
    margin: 0 0 8px;
    font-family: 'Nanum Myeongjo', serif;
}

.story-detail .story-hero-meta {
    font-size: 13px;
    opacity: 0.8;
}

.story-detail .story-hero-meta span + span::before {
    content: "·";
    margin: 0 6px;
}

/* Editor note */
.story-detail .editor-note {
    margin: 0 0 24px;
    padding: 16px 20px;
    border-left: 4px solid var(--mag-accent-warm);
    background: var(--mag-bg-warm);
    border-radius: 0 var(--mag-radius) var(--mag-radius) 0;
    font-size: 15px;
    line-height: 1.8;
    color: #5d4e37;
}

.story-detail .editor-note::before {
    content: "편집자 주";
    display: block;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--mag-accent-warm);
    margin: 0 0 8px;
}

/* Body text */
.story-detail .story-body {
    margin: 0 0 28px;
}

.story-detail .story-body p {
    margin: 0 0 16px;
}

.story-detail .story-body p:last-child {
    margin-bottom: 0;
}

/* Offering note */
.story-detail .offering-note {
    margin: 0 0 28px;
    padding: 20px;
    background: linear-gradient(135deg, #eaf2f8, #d4e6f1);
    border-radius: var(--mag-radius);
    border: 1px solid #aed6f1;
    font-size: 15px;
    line-height: 1.8;
    text-align: center;
}

.story-detail .offering-note::before {
    content: "🌏 제13안식일 헌금 안내";
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: var(--mag-primary);
    margin: 0 0 8px;
}

/* Sidebar boxes: Story Tips & Mission Post */
.story-detail .story-sidebar-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 0 28px;
}

.story-detail .sidebar-box {
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
    overflow: hidden;
}

.story-detail .sidebar-box-header {
    padding: 10px 16px;
    background: var(--mag-primary);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

.story-detail .sidebar-box-body {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.7;
}

.story-detail .sidebar-box-body ul {
    margin: 0;
    padding: 0 0 0 18px;
    list-style-type: disc;
}

.story-detail .sidebar-box-body li {
    margin: 0 0 6px;
    list-style-type: disc;
}

/* English toggle */
.story-detail .en-toggle {
    margin: 0 0 28px;
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
}

.story-detail .en-toggle summary {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: bold;
    color: var(--mag-text-light);
    cursor: pointer;
    background: var(--mag-bg);
    border-radius: var(--mag-radius);
    list-style: none;
}

.story-detail .en-toggle summary::-webkit-details-marker {
    display: none;
}

.story-detail .en-toggle summary::before {
    content: "▶ ";
    font-size: 11px;
    transition: transform 0.2s;
    display: inline-block;
}

.story-detail .en-toggle[open] summary::before {
    content: "▼ ";
}

.story-detail .en-toggle .en-content {
    padding: 16px;
    font-size: 15px;
    line-height: 1.8;
    color: #555;
    border-top: 1px solid var(--mag-border);
}

.story-detail .en-toggle .en-content p {
    margin: 0 0 12px;
}

/* Previous / Next navigation */
.story-detail .story-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 28px 0 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--mag-border);
}

.story-detail .story-nav a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
    text-decoration: none;
    color: var(--mag-text);
    font-size: 14px;
    transition: background 0.2s, border-color 0.2s;
}

.story-detail .story-nav a:hover {
    background: var(--mag-bg);
    border-color: var(--mag-primary-light);
}

.story-detail .story-nav .nav-dir {
    font-size: 12px;
    color: var(--mag-text-light);
    margin-bottom: 2px;
}

.story-detail .story-nav .nav-title {
    font-weight: bold;
}

.story-detail .story-nav .nav-prev .nav-arrow {
    margin-right: 12px;
    font-size: 18px;
    color: var(--mag-text-light);
}

.story-detail .story-nav .nav-next {
    text-align: right;
    flex-direction: row-reverse;
}

.story-detail .story-nav .nav-next .nav-arrow {
    margin-left: 12px;
    font-size: 18px;
    color: var(--mag-text-light);
}

/* Back to index link */
.story-detail .back-link {
    display: inline-block;
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--mag-text-light);
    text-decoration: none;
}

.story-detail .back-link:hover {
    color: var(--mag-primary);
}

.story-detail .back-link::before {
    content: "← ";
}

/* Top bar: back link + admin actions */
.story-detail .story-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 20px;
}

.story-detail .story-top-bar .back-link {
    margin: 0;
}

.story-detail .admin-actions a {
    display: inline-block;
    padding: 5px 14px;
    font-size: 13px;
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
    color: var(--mag-text-light);
    text-decoration: none;
    margin-left: 6px;
    transition: background 0.2s, color 0.2s;
}

.story-detail .admin-actions a:hover {
    background: var(--mag-primary);
    border-color: var(--mag-primary);
    color: #fff;
}


/* ============================================================
   DESKTOP — 720px+
   ============================================================ */

@media screen and (min-width: 720px) {

    /* Banner */
    .magazine-home .mag-banner-thumb {
        width: 140px;
    }

    .magazine-home .mag-banner-quarter {
        font-size: 18px;
    }

    .magazine-home .mag-banner-title {
        font-size: 24px;
    }

    /* Cards: row layout */
    .magazine-home .mag-card a {
        flex-direction: row;
    }

    .magazine-home .mag-card-img {
        width: 200px;
        flex-shrink: 0;
    }

    .magazine-home .mag-card-img img {
        aspect-ratio: auto;
        height: 100%;
        min-height: 140px;
    }

    .magazine-home .mag-card-body {
        padding: 16px 20px;
    }

    /* Story detail */
    .story-detail .story-hero img {
        max-height: 480px;
    }

    .story-detail .story-hero-title {
        font-size: 30px;
    }

    /* Sidebar boxes: 2-column grid */
    .story-detail .story-sidebar-grid {
        flex-direction: row;
    }

    .story-detail .sidebar-box {
        flex: 1;
        min-width: 0;
    }

    /* Prev/next navigation: row */
    .story-detail .story-nav {
        flex-direction: row;
    }

    .story-detail .story-nav a {
        flex: 1;
    }
}


/* ============================================================
   PRINT
   ============================================================ */

@media print {
    .magazine-home .mag-tabs,
    .magazine-home .mag-archive,
    .story-detail .story-nav,
    .story-detail .en-toggle,
    .story-detail .back-link {
        display: none !important;
    }

    .magazine-home .mag-card,
    .story-detail .story-hero,
    .story-detail .sidebar-box {
        box-shadow: none !important;
        border-color: #ccc !important;
    }

    .story-detail {
        font-size: 12pt;
        line-height: 1.6;
    }

    .story-detail .story-hero img {
        max-height: 300px;
    }

    .story-detail .story-body {
        page-break-inside: avoid;
    }
}
