/* WWII Rare & Remarkable — Complete Stylesheet */

:root {
    --parchment: #f4ede4;
    --parchment-dark: #e8dfd2;
    --parchment-darker: #d4c9b8;
    --ink: #1c1917;
    --ink-light: #3d3835;
    --ink-muted: #6b6560;
    --burgundy: #7c2020;
    --burgundy-dark: #5c1818;
    --burgundy-light: #9c3030;
    --gold: #a08020;
    --gold-light: #c0a030;
    --olive: #3d4a2a;
    --olive-light: #5a6a3a;
    --sepia: #8b7355;
    --cream: #faf8f5;
    --shadow: rgba(28, 25, 23, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'EB Garamond', Georgia, serif;
    background-color: var(--parchment);
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(160, 128, 32, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(124, 32, 32, 0.03) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238b7355' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    color: var(--ink);
    line-height: 1.75;
    font-size: 18px;
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: 'IM Fell English', 'Palatino Linotype', serif;
    color: var(--ink);
    line-height: 1.25;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

a {
    color: var(--burgundy);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: var(--burgundy-dark); text-decoration: underline; }

/* --- Header --- */
.site-header {
    background: linear-gradient(180deg, var(--ink) 0%, #2d2520 100%);
    border-bottom: 4px solid var(--gold);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px var(--shadow);
}

.header-inner { max-width: 1200px; margin: 0 auto; padding: 0.5rem 1.5rem; }

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1rem 0 0.5rem;
    border-bottom: 1px solid rgba(160, 128, 32, 0.3);
    margin-bottom: 0.5rem;
}

.header-ornament { color: var(--gold); font-size: 1.5rem; letter-spacing: 0.5rem; }

.header-title h1 a {
    color: var(--parchment);
    font-size: 2.2rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    display: block;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.header-tagline {
    color: var(--gold-light);
    font-family: 'EB Garamond', serif;
    font-style: italic;
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* --- Navigation --- */
.main-nav { display: flex; justify-content: center; }

.main-nav > ul {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}

.main-nav a {
    color: var(--parchment-dark);
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    border-radius: 3px;
    transition: all 0.2s;
    text-transform: uppercase;
    font-family: 'Special Elite', 'Courier New', monospace;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--gold);
    background: rgba(160, 128, 32, 0.15);
    text-decoration: none;
}

.has-submenu { position: relative; }

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--ink);
    border: 1px solid var(--gold);
    border-top: none;
    min-width: 220px;
    list-style: none;
    z-index: 200;
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.has-submenu:hover .submenu { display: block; }

.submenu li { border-bottom: 1px solid rgba(160, 128, 32, 0.2); }
.submenu li:last-child { border-bottom: none; }
.submenu a {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    text-transform: none;
    font-family: 'EB Garamond', serif;
    letter-spacing: 0;
    border-radius: 0;
    display: block;
}
.submenu a:hover { background: rgba(160, 128, 32, 0.2); }

/* --- Header Search --- */
.header-search {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0 0.75rem;
    gap: 0;
}

.header-search input {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--gold);
    border-right: none;
    border-radius: 3px 0 0 3px;
    background: rgba(244, 237, 228, 0.1);
    color: var(--parchment);
    font-family: 'EB Garamond', serif;
    font-size: 0.9rem;
    width: 280px;
}

.header-search input::placeholder { color: rgba(244, 237, 228, 0.5); }

.header-search button {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--gold);
    border-left: none;
    border-radius: 0 3px 3px 0;
    background: var(--gold);
    color: var(--ink);
    cursor: pointer;
    font-size: 1rem;
}

/* --- Main Content --- */
.site-main { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

/* --- Page Headers --- */
.page-header {
    text-align: center;
    padding: 2rem 0 3rem;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 2.5rem;
    position: relative;
}

.page-header::before, .page-header::after {
    content: '✦';
    color: var(--gold);
    font-size: 1.2rem;
    position: absolute;
    bottom: -0.7rem;
}
.page-header::before { left: calc(50% - 120px); }
.page-header::after { right: calc(50% - 120px); }

.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { color: var(--ink-muted); font-style: italic; font-size: 1.1rem; }

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--ink) 0%, #3a2e28 60%, var(--olive) 100%);
    border: 3px solid var(--gold);
    border-radius: 4px;
    padding: 3rem 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='1' fill='%23a08020' fill-opacity='0.1'/%3E%3C/svg%3E");
    pointer-events: none;
}

.hero h1 {
    color: var(--parchment);
    font-size: 2.8rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.hero .hero-sub {
    color: var(--gold-light);
    font-style: italic;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    position: relative;
}

.hero-stat { text-align: center; }
.hero-stat .stat-num {
    font-family: 'IM Fell English', serif;
    font-size: 2.2rem;
    color: var(--gold);
    display: block;
}
.hero-stat .stat-label {
    color: var(--parchment-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: 'Special Elite', monospace;
}

/* --- Featured / Fact Cards --- */
.section-title {
    font-family: 'IM Fell English', serif;
    font-size: 1.6rem;
    border-bottom: 2px solid var(--burgundy);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title .icon { font-size: 1.4rem; }

.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.fact-card {
    background: var(--cream);
    border: 1px solid var(--parchment-darker);
    border-radius: 3px;
    padding: 1.5rem;
    position: relative;
    box-shadow: 3px 3px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.fact-card:hover {
    transform: translateY(-3px);
    box-shadow: 5px 8px 16px var(--shadow);
}

.fact-card .rarity-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    background: var(--burgundy);
    color: var(--parchment);
    font-family: 'Special Elite', monospace;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0 0 0 3px;
}

.fact-card .category-tag {
    display: inline-block;
    background: var(--parchment);
    color: var(--ink-muted);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    margin-bottom: 0.5rem;
    font-family: 'Special Elite', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fact-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--burgundy-dark);
    line-height: 1.3;
}

.fact-card .excerpt {
    color: var(--ink-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fact-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--ink-muted);
    font-style: italic;
    border-top: 1px solid var(--parchment-darker);
    padding-top: 0.75rem;
}

.fact-card .read-more {
    font-family: 'Special Elite', monospace;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Story Cards --- */
.story-card {
    background: var(--cream);
    border: 1px solid var(--parchment-darker);
    border-left: 4px solid var(--burgundy);
    border-radius: 3px;
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 3px 3px 8px var(--shadow);
    position: relative;
}

.story-card .story-role {
    font-family: 'Special Elite', monospace;
    font-size: 0.8rem;
    color: var(--burgundy);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.story-card .story-location-date {
    font-size: 0.85rem;
    color: var(--ink-muted);
    font-style: italic;
    margin-bottom: 0.75rem;
}

.story-card .story-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--ink-light);
}

.story-card .hero-type-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gold);
    color: var(--ink);
    font-family: 'Special Elite', monospace;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 2px;
    text-transform: uppercase;
}

/* --- Detail Pages --- */
.detail-header {
    background: var(--ink);
    color: var(--parchment);
    padding: 2.5rem 2rem;
    border-radius: 3px;
    margin-bottom: 2rem;
    border-left: 5px solid var(--gold);
}

.detail-header h1 {
    color: var(--parchment);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.detail-header .detail-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--parchment-dark);
    font-family: 'Special Elite', monospace;
}

.detail-header .detail-meta span { display: flex; align-items: center; gap: 0.4rem; }

.fact-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--ink-light);
    max-width: 800px;
}

.fact-content p { margin-bottom: 1.25rem; text-align: justify; }

.fact-image {
    margin: 2rem 0;
    text-align: center;
}

.fact-image img {
    max-width: 100%;
    border: 3px solid var(--parchment-darker);
    border-radius: 3px;
    box-shadow: 4px 4px 12px var(--shadow);
}

.fact-image .caption {
    font-size: 0.85rem;
    color: var(--ink-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

.fact-image .credit {
    font-size: 0.75rem;
    color: var(--ink-muted);
}

.source-block {
    background: var(--parchment-dark);
    border: 1px solid var(--parchment-darker);
    border-left: 4px solid var(--olive);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    font-size: 0.9rem;
    border-radius: 0 3px 3px 0;
}

.source-block strong { font-family: 'Special Elite', monospace; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--olive); }

/* --- Categories Page --- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.cat-card {
    background: var(--cream);
    border: 1px solid var(--parchment-darker);
    border-top: 4px solid var(--burgundy);
    padding: 1.5rem;
    border-radius: 3px;
    box-shadow: 3px 3px 8px var(--shadow);
    transition: transform 0.2s;
}

.cat-card:hover { transform: translateY(-3px); }

.cat-card .cat-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.cat-card h3 { margin-bottom: 0.5rem; }
.cat-card p { font-size: 0.9rem; color: var(--ink-light); margin-bottom: 0.75rem; }
.cat-card .cat-count {
    font-family: 'Special Elite', monospace;
    font-size: 0.75rem;
    color: var(--burgundy);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- Search Page --- */
.search-form {
    max-width: 700px;
    margin: 0 auto 3rem;
    text-align: center;
}

.search-form input[type="text"] {
    width: 100%;
    padding: 0.9rem 1.2rem;
    font-size: 1.1rem;
    border: 2px solid var(--burgundy);
    border-radius: 3px;
    font-family: 'EB Garamond', serif;
    background: var(--cream);
    color: var(--ink);
}

.search-form input[type="text"]:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(160, 128, 32, 0.2); }

.search-form button {
    margin-top: 0.75rem;
    padding: 0.6rem 2rem;
    font-size: 1rem;
    font-family: 'Special Elite', monospace;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: var(--burgundy);
    color: var(--parchment);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}
.search-form button:hover { background: var(--burgundy-dark); }

.search-result { margin-bottom: 2rem; }
.search-result h3 { margin-bottom: 0.5rem; }
.search-result h3 a { color: var(--burgundy-dark); }
.search-result .excerpt { color: var(--ink-light); font-size: 0.95rem; margin-bottom: 0.5rem; }
.search-result .result-meta { font-size: 0.8rem; color: var(--ink-muted); font-style: italic; }

/* --- About Page --- */
.about-content { max-width: 800px; margin: 0 auto; }
.about-content h2 { border-bottom: 2px solid var(--burgundy); padding-bottom: 0.3rem; margin: 2rem 0 1rem; }
.about-content p { margin-bottom: 1rem; }

/* --- Rarity Legend --- */
.rarity-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
    background: var(--parchment-dark);
    border-radius: 3px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.rarity-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.rarity-dot { width: 12px; height: 12px; border-radius: 50%; }
.rarity-10 { background: #7c2020; }
.rarity-8 { background: #a06020; }
.rarity-6 { background: #607020; }

/* --- Breadcrumb --- */
.breadcrumb {
    font-family: 'Special Elite', monospace;
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}
.breadcrumb a { color: var(--burgundy); }

/* --- Tags --- */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.tag {
    background: var(--parchment);
    color: var(--ink-muted);
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-family: 'Special Elite', monospace;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}
.pagination a, .pagination span {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--parchment-darker);
    border-radius: 3px;
    font-family: 'Special Elite', monospace;
    font-size: 0.85rem;
    color: var(--ink);
}
.pagination a:hover { border-color: var(--burgundy); color: var(--burgundy); }
.pagination .current { background: var(--burgundy); color: var(--parchment); border-color: var(--burgundy); }

/* --- Footer --- */
.site-footer {
    background: var(--ink);
    color: var(--parchment-dark);
    margin-top: 4rem;
    border-top: 4px solid var(--gold);
}

.footer-inner { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

.footer-ornament {
    text-align: center;
    color: var(--gold);
    font-size: 0.9rem;
    letter-spacing: 0.5rem;
    margin-bottom: 1.5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3, .footer-section h4 { color: var(--gold); margin-bottom: 0.75rem; font-size: 1.1rem; }
.footer-section p { font-size: 0.9rem; color: var(--parchment-dark); line-height: 1.6; }
.footer-note { font-style: italic; color: var(--sepia) !important; margin-top: 0.5rem; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.4rem; }
.footer-section ul li a { color: var(--parchment-dark); font-size: 0.9rem; }
.footer-section ul li a:hover { color: var(--gold); }

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(160, 128, 32, 0.2);
    padding-top: 1rem;
    font-size: 0.85rem;
    color: var(--sepia);
    font-style: italic;
}

/* --- Empty / No Results --- */
.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--ink-muted);
    font-style: italic;
}

/* --- Back to Top --- */
.back-link { display: inline-block; margin-bottom: 1.5rem; font-family: 'Special Elite', monospace; font-size: 0.85rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .header-top { flex-direction: column; gap: 0.5rem; }
    .header-title h1 a { font-size: 1.6rem; }
    .main-nav > ul { flex-wrap: wrap; justify-content: center; gap: 0; }
    .main-nav a { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
    .header-search input { width: 200px; }
    .hero { padding: 2rem 1.5rem; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; }
    .fact-grid { grid-template-columns: 1fr; }
    .cat-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    .detail-header { padding: 1.5rem 1rem; }
    .detail-header h1 { font-size: 1.5rem; }
    h1 { font-size: 1.8rem; }
}
