/* ==========================================================================
   Koreanica — Korean Fund of the Institute of Oriental Manuscripts (RAS)
   Modernized semantic markup, visually identical to the live site.

   Visual reference: https://www.orientalstudies.ru/rus/templates/koreanica/index.html
   DevTools confirms: style.css → 404 Not Found.
   The live site renders with NO CSS — only browser defaults + <body> attributes:
     <body bgcolor="#000000" text="433824" link="433824" alink="433824" vlink="433824">

   Therefore the visual target is:
     Background : #000000 (black)
     Text color : #433824 (dark brown, parsed as hex without #)
     Link color : #433824 (same as text, distinguished only by underline)
     Font       : browser default serif, medium (16px)
     Line-height: normal (~1.2)
   ========================================================================== */

/* --- Minimal reset (preserve browser defaults for serif / margins) --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- Body: reproduces <body bgcolor/text/link attributes> --- */
body {
    margin: 0;
    background-color: #000000;
    color: #433824;
    /* No font-family set — browser default serif (Times New Roman on Windows) */
    /* No font-size set — browser default medium (16px) */
}

/* --- Links: all states same color as text, browser default underline --- */
a {
    color: #433824;
}

a:visited {
    color: #433824;
}

a:active {
    color: #433824;
}

/* --- Site wrapper (fixed 960px, centered on black bg) --- */
.site-wrapper {
    width: 960px;
    margin: 0 auto;
}

/* --- Header banner --- */
.site-header img {
    display: block;
    width: 960px;
    height: 253px;
}

/* --- Navigation bar ---
   Old markup: <td width="960" height="225" background="...02.jpg">
     inner <table align="left">: <td width="155"> + <td width="510" align="right" valign="middle">
   Old table had default border-spacing: 2px, so actual layout was:
     2px + 155px + 2px + 510px + 2px = 671px → right edge of text at 669px.
   Reproduced with flex. padding-right = 960 - 669 = 291px. */
.site-nav {
    width: 960px;
    height: 225px;
    background: url('images/koreanica_main_02.jpg') no-repeat;
    background-size: 960px 225px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 291px;
}

.site-nav .nav-content {
    width: 510px;
    text-align: right;
}

/* Old table valign="middle" centered content ignoring h3's top margin.
   Reset h3 margins in nav context so flex centering matches. */
.site-nav h3 {
    margin-top: 0;
}

/* --- Main content area ---
   Old markup: <td width="960" background="...03.jpg">
     <table width="950" align="right">:
       <td width="130"> + <td width="650"> + <td width="170">
     Inside the 650px td: <table width="610" align="center">
   align="right" shifts the 950px table right within 960px → 10px left gap.
   justify-content: flex-end reproduces this. */
.site-content {
    width: 960px;
    background: url('images/koreanica_main_03.jpg') repeat-y;
    background-size: 960px auto;
    display: flex;
    justify-content: flex-end;
}

.content-spacer-left {
    flex: 0 0 130px;
}

.content-main {
    flex: 0 0 650px;
    /* Slightly narrower than old 610px inner table for better readability */
    padding: 0 30px;
}

.content-spacer-right {
    flex: 0 0 170px;
}

/* --- Article content --- */
.content-main article {
    text-align: justify;
    /* Old markup had <br> before title, adding ~1 line of top space */
    padding-top: 0.5em;
}

/* Title: old <b><font size="3"><div style="text-align:center">
   <font size="3"> = medium = 16px = same as body default.
   Net effect: bold centered, same size as body text. */
.content-main article h2 {
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    margin: 0.5em 0;
}

/* Title variant: old korean_studies_history used <h1><font size="2">
   where size="2" = small ≈ 13px. Other pages used size="3" = 16px (1em). */
.content-main article h2.title-sm {
    font-size: small;
}

/* Paragraphs: old used single <p> with <br><br> separators.
   <br><br> produces ~1 line of vertical space = ~19px at 16px/1.2.
   margin-bottom: 1em (= 16px) is a close match. */
.content-main article p {
    margin: 0 0 1em 0;
}

/* --- Lists: old had browser default disc bullets (no CSS loaded) --- */
.content-main ul {
    margin: 0 0 1em 0;
    padding-left: 40px;
}

/* --- Author attribution --- */
.content-main .author {
    font-weight: bold;
}

/* --- Footer banner --- */
.site-footer img {
    display: block;
    width: 960px;
    height: 284px;
}

