/* Root Variables */
:root {
    --primary-color: #1a365d;
    --secondary-color: #2c5282;
    --accent-color: #3182ce;
    --text-color: #2d3748;
    --text-muted: #718096;
    --background-color: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #38a169;
    --warning-color: #d69e2e;
    --danger-color: #e53e3e;
    --font-primary: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #63b3ed;
    --secondary-color: #4299e1;
    --accent-color: #3182ce;
    --text-color: #f7fafc;
    --text-muted: #a0aec0;
    --background-color: #1a202c;
    --border-color: #2d3748;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    font-weight: 700;
    line-height: 1.3;
}

.gb-headline {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Header Styles */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--background-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}



.main-header {
    padding: 1rem 0;
}

.logo {
    height: 55px;
    width: auto;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 10px;
}

.header-actions .btn {
    color: var(--text-color);
    font-size: 1.1rem;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,0.1);
    z-index: 1001;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.1s ease;
}

/* Hero Section */
.hero-section {
    padding: 3rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.hero-article {
    padding: 2rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

.category-badge-large {
    background: var(--accent-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-title a {
    color: white;
    text-decoration: none;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-meta {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
}

.hero-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.hero-image img {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Main Content */
.main-content {
    padding: 4rem 0;
}

.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-all-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.view-all-link:hover {
    color: var(--secondary-color);
}

/* Article Cards */
.article-card .card {
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    background: var(--background-color);
}

.article-card .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Clickable Card */
.clickable-card {
    position: relative;
    cursor: pointer;
}

.clickable-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.clickable-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.card-img-top[loading="lazy"] {
    opacity: 0;
}

.card-img-top[loading="lazy"].loaded {
    opacity: 1;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
}

/* Image placeholder styles */
.image-placeholder {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-weight: 500;
    transition: all 0.3s ease;
}

.image-placeholder:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
}

.image-placeholder i {
    opacity: 0.6;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-title a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.3;
}

.card-title a:hover {
    color: var(--primary-color);
}

.article-meta {
    font-size: 0.85rem;
}

.author-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.article-tags {
    margin-top: 0.5rem;
}

.article-tags .badge {
    margin-right: 5px;
    font-size: 0.75rem;
}

/* Single Article */
.single-article {
    padding: 2rem 0;
}

.inside-article {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 2rem;
    text-align: center;
}

.byline-date {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 1rem 0;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.author-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.social-share {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.share-btn:hover {
    transform: scale(1.1);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.naver { background: #03c75a; }
.share-btn.copy { background: #6c757d; }

/* Key Takeaways Box */
.key-takeaways-box {
    background: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
}

.key-takeaways-box h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.key-takeaways-box ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.key-takeaways-box li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.key-takeaways-box li i {
    color: var(--success-color);
    margin-top: 2px;
}

/* Entry Content */
.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.entry-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-size: 1.8rem;
}

.entry-content h5 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-size: 1.3rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.entry-content figure {
    margin: 2rem 0;
    text-align: center;
}

.entry-content figcaption {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Advertisement Area */
.econad {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.ad-placeholder {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Article Tags */
.article-tags {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.article-tags h6 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.tag-link:hover {
    background: var(--secondary-color);
    color: white;
}

/* Author Box */
.author-box {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.author-avatar {
    color: var(--primary-color);
}

.author-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.author-bio {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Up Next Sticky Component */
.up-next-sticky {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    padding: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.up-next-sticky.show {
    opacity: 1;
    transform: translateY(0);
}

.up-next-content h6 {
    margin: 0 0 12px 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.next-article-preview {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.next-article-preview:hover {
    transform: scale(1.02);
}

.next-article-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.next-article-info {
    padding: 8px 0;
}

.next-category-badge {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.next-article-title {
    margin: 8px 0 4px 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

.next-article-desc {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Newsletter Section */
.newsletter-section {
    background: var(--primary-color);
    color: white;
    padding: 3rem 0;
}

.newsletter-section h3 {
    color: white;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.newsletter-form .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.newsletter-form .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* Footer */
.site-footer {
    background: #2d3748;
    color: #a0aec0;
    margin-top: 4rem;
}

.main-footer {
    padding: 3rem 0 2rem;
}

.footer-logo {
    height: 40px;
    width: auto;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding: 2rem 0;
    background: #1a202c;
}

.copyright-info {
    text-align: center;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Breadcrumb */
.breadcrumb-nav {
    background: #f8f9fa;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.breadcrumb {
    background: none;
    margin: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

/* List Page */
.list-page {
    padding: 2rem 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.page-description {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.articles-grid {
    margin-bottom: 3rem;
}

/* Pagination */
.pagination-nav {
    margin-top: 3rem;
}

.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
    padding: 0.75rem 1rem;
}

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

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

/* Taxonomy Pages */
.taxonomy-page {
    padding: 2rem 0;
}

.taxonomy-grid {
    margin-top: 2rem;
}

.taxonomy-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.taxonomy-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.taxonomy-link {
    text-decoration: none;
    color: var(--text-color);
}

.taxonomy-link h5 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Error Page */
.error-page {
    padding: 5rem 0;
    text-align: center;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .gb-headline {
        font-size: 2rem;
    }
    
    .byline-date {
        flex-direction: column;
        gap: 10px;
    }
    
    .social-share {
        gap: 8px;
    }
    
    .share-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .up-next-sticky {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }
    
    .error-code {
        font-size: 5rem;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    

}

@media (max-width: 576px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-article {
        padding: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .newsletter-section {
        padding: 2rem 0;
    }
    
    .newsletter-section .row {
        text-align: center;
    }
    
    .newsletter-section .col-md-4 {
        margin-top: 1rem;
    }
}

/* Print Styles */
@media print {
    .site-header,

    .social-share,
    .newsletter-section,
    .site-footer,
    .up-next-sticky,
    .econad {
        display: none !important;
    }
    
    .single-article {
        padding: 0;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .gb-headline,
    .section-title,
    h1, h2, h3, h4, h5, h6 {
        color: black !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {

    
    .card {
        transition: none;
    }
    
    .share-btn {
        transition: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --text-color: #000000;
        --background-color: #ffffff;
        --border-color: #000000;
    }
}
