:root {
    --bg-color: #f7f9fc;
    --app-bg: #ffffff;
    --text-color: #1a1b1e;
    --text-secondary: #4b4d52;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --primary-color: #3b82f6;
    --accent-color: #10b981;
    --border-color: #e5e7eb;
    --header-bg: #ffffff;
    --ad-bg: #f3f4f6;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --app-bg: #1e293b;
    --text-color: #f8fafc;
    --text-secondary: #94a3b8;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --primary-color: #60a5fa;
    --accent-color: #34d399;
    --border-color: #334155;
    --header-bg: #1e293b;
    --ad-bg: #334155;
}

body {
    font-family: 'Inter', 'Pretendard', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.7;
}

/* Header & Nav */
header {
    background-color: var(--header-bg);
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px var(--shadow-color);
    height: 70px;
    display: flex;
    align-items: center;
}

.header-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 1.4rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--primary-color);
}

.main-nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.blog-link {
    color: var(--accent-color);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.nav-link:hover {
    color: var(--text-color);
    background: var(--shadow-color);
}

/* Ad Placeholders */
.ad-placeholder {
    background-color: var(--ad-bg);
    border: 1px dashed var(--border-color);
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-radius: 12px;
}

.top-ad { height: 90px; max-width: 970px; }
.mid-ad { height: 120px; max-width: 100%; }
.bottom-ad { height: 250px; max-width: 100%; margin-top: 40px; }

/* Main Layout */
main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.section-header {
    margin: 40px 0;
}

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

.live-date {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 6px 14px;
    border-radius: 30px;
}

/* News Cards */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.news-card {
    background-color: var(--app-bg);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    box-shadow: 0 4px 6px -1px var(--shadow-color);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.news-card:hover {
    transform: translateY(-4px);
}

.news-card-image {
    width: 320px;
    min-width: 320px;
    height: 220px;
    background-size: cover;
    background-position: center;
}

.news-card-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    line-height: 1.4;
    font-weight: 800;
}

/* Detail View */
#article-detail {
    background-color: var(--app-bg);
    padding: 60px;
    border-radius: 24px;
    box-shadow: 0 20px 25px -5px var(--shadow-color);
}

.summary-section {
    background: var(--bg-color);
    padding: 35px;
    border-radius: 16px;
    margin: 40px 0;
    border-left: 6px solid var(--primary-color);
}

.summary-section p {
    font-size: 1.15rem;
    color: var(--text-color);
    margin: 0;
}

/* Guestbook */
.guestbook-container {
    background: var(--app-bg);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

/* Footer */
.footer {
    padding: 60px 20px;
    text-align: center;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--app-bg);
    padding: 50px;
    border-radius: 24px;
    max-width: 600px;
    width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 30px;
    cursor: pointer;
}

/* Blog View */
.blog-frame-container {
    width: 100%;
    height: calc(100vh - 100px); /* Adjust based on header height */
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow-color);
    border: 1px solid var(--border-color);
}

#blog-iframe {
    width: 100%;
    height: 100%;
    background-color: white;
}
