/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-red: #991b1b;
    --primary-red-dark: #7f1d1d;
    --primary-red-light: #b91c1c;
    --charcoal: #111827;
    --charcoal-light: #1f2937;
    --accent-gold: #eab308;
    --accent-gold-dark: #ca8a04;
    --background: #fafafa;
    --background-white: #ffffff;
    --text-color: #111827;
    --text-secondary: #4b5563;
    --border-subtle: #e5e7eb;
    --border-medium: #d1d5db;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    line-height: 1.75;
    color: var(--text-color);
    background-color: var(--background);
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Noto Serif KR', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--charcoal);
    letter-spacing: -0.01em;
}

h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 1.75rem;
    border-bottom: 4px solid var(--primary-red);
    padding-bottom: 1rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    color: var(--charcoal);
    position: relative;
    padding-left: 1rem;
    border-left: 4px solid var(--primary-red);
}

h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--charcoal);
}

h4 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--charcoal-light);
}

p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
    max-width: 75ch;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--primary-red);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-red);
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

a:hover {
    color: var(--primary-red-dark);
    border-bottom-color: var(--primary-red-dark);
    background-color: rgba(153, 27, 27, 0.03);
}

a:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Header Styles */
.site-masthead {
    background-color: var(--background-white);
    border-bottom: 3px solid var(--primary-red);
    padding: 1.75rem 0;
    position: static;
    box-shadow: var(--shadow-sm);
}

.header-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-title {
    font-family: 'Noto Serif KR', Georgia, serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-red);
    text-decoration: none;
    border-bottom: none;
    letter-spacing: -0.02em;
    transition: all 0.2s ease-in-out;
}

.brand-title:hover {
    border-bottom: none;
    background-color: transparent;
    color: var(--primary-red-dark);
    transform: translateY(-1px);
}

.primary-navigation {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.primary-navigation a {
    color: var(--text-color);
    font-size: 0.9375rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.primary-navigation a:hover {
    color: var(--primary-red);
    border-bottom-color: var(--primary-red);
    background-color: transparent;
}

.primary-navigation a:focus {
    outline: 2px solid var(--primary-red);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.75rem 0;
}

.breadcrumb-nav ol {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb-nav a {
    color: var(--primary-red);
    border-bottom: none;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

/* Main Content Area */
.content-region {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 2.5rem;
}

.article-content {
    background-color: var(--background-white);
    padding: 4rem;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
}

/* Warning and Note Boxes */
.warning-callout {
    background: linear-gradient(to right, #fef2f2 0%, #ffffff 100%);
    border-left: 5px solid var(--primary-red);
    padding: 1.75rem 2rem;
    margin: 2.5rem 0;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.warning-callout h3 {
    color: var(--primary-red);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-callout h3::before {
    content: "⚠";
    font-size: 1.5rem;
}

.warning-callout p {
    color: var(--charcoal-light);
    margin-bottom: 0;
}

.historical-note {
    background: linear-gradient(to right, #fef9c3 0%, #fffbeb 100%);
    border-left: 5px solid var(--accent-gold);
    padding: 1.75rem 2rem;
    margin: 2.5rem 0;
    border-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.historical-note h3 {
    color: #854d0e;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.historical-note p {
    color: var(--charcoal-light);
    margin-bottom: 0;
}

/* Lists */
ul, ol {
    margin-bottom: 1.75rem;
    padding-left: 2.25rem;
}

li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

li::marker {
    color: var(--primary-red);
}

ul li {
    padding-left: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    font-size: 0.9375rem;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th, td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    background-color: var(--charcoal);
    font-weight: 600;
    color: var(--background-white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.875rem;
}

tbody tr {
    transition: background-color 0.15s ease-in-out;
}

tbody tr:hover {
    background-color: #f9fafb;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Footer Styles */
.site-footer {
    background: linear-gradient(to bottom, var(--charcoal) 0%, #0a0f1a 100%);
    color: #9ca3af;
    padding: 3rem 0;
    margin-top: 6rem;
    border-top: 4px solid var(--primary-red);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.footer-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem;
    text-align: center;
    font-size: 0.9375rem;
}

.footer-links {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 3rem;
}

.footer-links a {
    color: #d1d5db;
    border-bottom: 1px solid transparent;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

.footer-links a:hover {
    color: var(--background-white);
    border-bottom-color: var(--primary-red);
    background-color: transparent;
}

.footer-wrapper p {
    color: #9ca3af;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .header-wrapper {
        flex-direction: column;
        gap: 1.25rem;
        padding: 0 1.5rem;
    }

    .brand-title {
        font-size: 1.5rem;
    }

    .primary-navigation {
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: center;
        font-size: 0.875rem;
    }

    h1 {
        font-size: 2rem;
        padding-bottom: 0.75rem;
        border-bottom-width: 3px;
    }

    h2 {
        font-size: 1.625rem;
        margin-top: 2.5rem;
        padding-left: 0.75rem;
        border-left-width: 3px;
    }

    h3 {
        font-size: 1.375rem;
    }

    .article-content {
        padding: 2.5rem 1.75rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .content-region {
        margin: 2rem auto;
        padding: 0;
    }

    .warning-callout,
    .historical-note {
        padding: 1.5rem;
        margin: 2rem 0;
        border-radius: 0;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-wrapper {
        padding: 0 1.5rem;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.75rem;
    }
}

/* Additional polish and accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

/* Selection styles */
::selection {
    background-color: var(--primary-red);
    color: var(--background-white);
}

::-moz-selection {
    background-color: var(--primary-red);
    color: var(--background-white);
}
