/* Design Direction 1c: Encyclopedia (홍학 소백과 — 옛 사전 항목 형식) */

:root {
    --bg-color: #F7F1E4;
    --text-color: #2A2320;
    --accent-color: #BC5A72;
    --border-color: rgba(42, 35, 32, 0.25);
    --border-dark: rgba(42, 35, 32, 0.5);
    --tag-bg: rgba(188, 90, 114, 0.07);
    --tag-border: rgba(188, 90, 114, 0.35);
    --diagram-bg: #F1E8D6;
    
    --font-heading: 'Song Myung', serif;
    --font-body: 'Gowun Batang', serif;
    --font-english: 'Newsreader', serif;
    --font-mono: ui-monospace, Menlo, monospace;
}

body {
    margin: 0;
    padding: 40px 20px;
    background-color: #E6DFD1;
    color: var(--text-color);
    font-family: var(--font-body);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.dictionary-container {
    width: 100%;
    max-width: 940px;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 30px rgba(31, 26, 22, 0.08);
    overflow: hidden;
}

/* Header */
.dict-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 34px 40px 20px;
}

.header-main-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 40px;
    font-weight: 400;
    line-height: 1.1;
}

.header-subtitle {
    font-size: 14px;
    color: rgba(42, 35, 32, 0.65);
    display: block;
    margin-top: 8px;
}

.header-right {
    text-align: right;
}

.header-eng-title {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: rgba(42, 35, 32, 0.55);
    line-height: 1.9;
}

.double-divider {
    margin: 0 40px;
    border-top: 3px double var(--border-dark);
}

/* Grid Layout */
.dict-grid {
    display: grid;
    grid-template-columns: 1fr 264px;
    gap: 40px;
    padding: 30px 40px 36px;
}

/* Entry Section */
.entry-section {
    display: flex;
    flex-direction: column;
}

.entry-header {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap;
}

.word-korean {
    font-size: 44px;
    font-weight: 700;
}

.word-hanja {
    font-size: 22px;
    color: rgba(42, 35, 32, 0.6);
}

.word-ipa {
    font-family: var(--font-english);
    font-style: italic;
    font-size: 14px;
    color: rgba(42, 35, 32, 0.6);
}

.word-category {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    background-color: var(--accent-color);
    color: var(--bg-color);
    padding: 3px 9px;
    border-radius: 2px;
}

/* Definition List */
.definition-list {
    list-style: none;
    padding: 0;
    margin: 22px 0 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.def-item {
    display: flex;
    gap: 12px;
}

.def-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-color);
}

.def-text {
    margin: 0;
    font-size: 16px;
    line-height: 1.9;
}

.def-link {
    font-size: 13px;
    color: var(--accent-color);
    cursor: pointer;
    transition: text-decoration 0.2s ease;
}

.def-link:hover {
    text-decoration: underline;
}

/* Usage Box */
.usage-box {
    margin-top: 26px;
    padding: 16px 20px;
    background-color: var(--tag-bg);
    border: 1px solid var(--tag-border);
    transition: background 0.3s ease;
}

.usage-box:hover {
    background-color: rgba(188, 90, 114, 0.12);
}

.usage-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--accent-color);
    display: block;
    margin-bottom: 8px;
}

.usage-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.8;
}

/* Sidebar Notes */
.margin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.margin-note {
    border-left: 3px solid var(--accent-color);
    padding: 2px 0 2px 14px;
    transition: transform 0.2s ease;
}

.margin-note:hover {
    transform: translateX(4px);
}

.note-title {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-color);
}

.note-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.75;
    color: rgba(42, 35, 32, 0.8);
}

/* Diagram Figure */
.diagram-figure {
    margin: 0;
    border: 1px solid rgba(42, 35, 32, 0.35);
    background-color: var(--diagram-bg);
    transition: transform 0.3s ease;
}

.diagram-figure:hover {
    transform: scale(1.01);
}

.diagram-placeholder {
    height: 170px;
    background: repeating-linear-gradient(135deg, rgba(188, 90, 114, 0.12) 0 10px, rgba(188, 90, 114, 0) 10px 22px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagram-text {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: rgba(42, 35, 32, 0.5);
    text-align: center;
}

.diagram-caption {
    padding: 10px 14px;
    border-top: 1px solid rgba(42, 35, 32, 0.25);
    font-size: 12.5px;
    color: rgba(42, 35, 32, 0.7);
}

/* Footer Cross Refs */
.dict-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 18px 40px;
    border-top: 1px solid rgba(42, 35, 32, 0.3);
}

.cross-ref-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: rgba(42, 35, 32, 0.55);
}

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

.ref-tag {
    font-size: 13.5px;
    border: 1px solid rgba(42, 35, 32, 0.4);
    padding: 5px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ref-tag:hover {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .dict-header {
        padding: 24px 20px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-right {
        text-align: left;
    }

    .double-divider {
        margin: 0 20px;
    }

    .dict-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 20px 20px 24px;
    }

    .dict-footer {
        padding: 18px 20px;
    }
}
