/* ============================================
   G.Ya. Umarov Memorial — Article Pages
   Shared stylesheet matching main site theme
   ============================================ */

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

:root {
  --navy: #0a1628;
  --navy-light: #162240;
  --gold: #d4a520;
  --gold-light: #f0c850;
  --amber: #e8922a;
  --orange: #e06020;
  --cream: #faf5eb;
  --cream-dark: #f0e8d8;
  --white: #ffffff;
  --text-dark: #1a1a2e;
  --text-muted: #555566;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Lato', -apple-system, sans-serif;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.18);
  --transition: 0.3s ease;
}

[data-theme="light"] {
  --bg: var(--cream);
  --bg-alt: var(--cream-dark);
  --bg-card: var(--white);
  --text: var(--text-dark);
  --text-secondary: var(--text-muted);
  --border: rgba(0,0,0,0.08);
  --nav-bg: rgba(250,245,235,0.92);
  --accent-glow: rgba(212,165,32,0.08);
  --tag-bg: #f0ead8;
  --tag-text: #7a7060;
}

[data-theme="dark"] {
  --bg: #0a0a0f;
  --bg-alt: #111118;
  --bg-card: rgba(20,20,35,0.7);
  --text: #e8e4df;
  --text-secondary: #9a9aaa;
  --border: rgba(255,255,255,0.08);
  --nav-bg: rgba(10,10,15,0.88);
  --accent-glow: rgba(212,165,32,0.06);
  --tag-bg: #1e1e30;
  --tag-text: #8a88a0;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: clamp(16px, 1.1vw, 18px);
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.25; color: var(--text); font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }
p { margin-bottom: 1em; color: var(--text-secondary); }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--amber); }

blockquote {
  border-left: 3px solid var(--gold);
  padding: 1rem 1.5rem; margin: 1.5rem 0;
  background: var(--accent-glow);
  border-radius: 0 8px 8px 0;
  font-style: italic; color: var(--text-secondary);
}

/* --- Layout --- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: 820px; }

/* --- Header / Nav --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition), transform var(--transition);
}
.site-header.hidden { transform: translateY(-100%); }

.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}

.nav__logo {
  font-family: var(--font-serif); font-size: 1.1rem; font-weight: 700;
  color: var(--gold); display: flex; align-items: center; gap: 0.5rem;
  white-space: nowrap;
}

.nav__links {
  display: flex; align-items: center; gap: 0.2rem;
  list-style: none; flex-wrap: nowrap; overflow-x: auto;
}
.nav__links a {
  padding: 0.5rem 0.6rem; font-size: 0.82rem; font-weight: 400;
  color: var(--text-secondary); border-radius: 6px; white-space: nowrap;
  min-height: 44px; display: flex; align-items: center;
  transition: color var(--transition), background var(--transition);
}
.nav__links a:hover, .nav__links a.active {
  color: var(--gold); background: rgba(212,165,32,0.08);
}

.nav__actions { display: flex; align-items: center; gap: 0.5rem; }

.lang-switcher { display: flex; align-items: center; gap: 2px; }
.lang-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-secondary); font-size: 0.72rem; font-weight: 700;
  padding: 0.25rem 0.4rem; cursor: pointer; letter-spacing: 0.03em;
  transition: all var(--transition); font-family: var(--font-sans); line-height: 1;
}
.lang-btn:hover { color: var(--gold); border-color: var(--gold); }
.lang-btn.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }

.theme-toggle {
  background: none; border: 2px solid var(--border); border-radius: 50%;
  width: 44px; height: 44px; cursor: pointer; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); transition: all var(--transition); flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--gold); background: rgba(212,165,32,0.1); }

/* Mobile menu */
.nav__hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 8px;
}
.nav__hamburger span {
  width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transition: all 0.3s;
}

.mobile-menu {
  display: none; position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 999; padding: 2rem 1.5rem;
  flex-direction: column; gap: 0.5rem; overflow-y: auto;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 1rem; font-size: 1.1rem; font-weight: 500;
  color: var(--text-secondary); border-radius: 12px; transition: all 0.2s;
}
.mobile-menu a:hover { background: rgba(212,165,32,0.08); color: var(--gold); }

/* --- Article Hero --- */
.article-hero {
  padding: 7rem 0 3rem;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.article-hero__back {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 1.5rem;
}
.article-hero__back:hover { color: var(--gold); }
.article-hero__tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.article-hero__title { max-width: 720px; margin-bottom: 0.75rem; }
.article-hero__meta { font-size: 0.94rem; color: var(--text-secondary); }

/* Tags */
.tag {
  display: inline-block; padding: 0.25rem 0.75rem;
  font-size: 0.75rem; font-weight: 700;
  background: var(--tag-bg); color: var(--tag-text);
  border-radius: 100px; letter-spacing: 0.02em;
}
.tag--accent { background: rgba(212,165,32,0.15); color: var(--gold); }

/* --- Article Content --- */
.article-content { padding: 3rem 0 4rem; }

.article-content .container--narrow > h2 {
  margin-top: 2.5rem; margin-bottom: 1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}
.article-content .container--narrow > h3 { margin-top: 2rem; margin-bottom: 0.75rem; }
.article-content .container--narrow > p { font-size: 1.05rem; line-height: 1.85; }

.article-content .container--narrow > ul,
.article-content .container--narrow > ol {
  padding-left: 1.5rem; margin-bottom: 1.5rem; color: var(--text-secondary);
}
.article-content .container--narrow > ul li,
.article-content .container--narrow > ol li {
  margin-bottom: 0.75rem; line-height: 1.75;
}

/* Data table */
.data-table {
  width: 100%; border-collapse: collapse; margin: 1.5rem 0;
  font-size: 0.94rem; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
}
.data-table thead { background: rgba(212,165,32,0.1); }
.data-table th {
  padding: 0.875rem 1rem; text-align: left; font-weight: 700;
  color: var(--gold); font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase;
}
.data-table td {
  padding: 0.875rem 1rem; border-top: 1px solid var(--border); color: var(--text-secondary);
}
.data-table tbody tr:hover { background: var(--accent-glow); }

/* Publication items */
.pub-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.pub-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem; transition: all 0.2s;
}
.pub-item:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.pub-item__year { font-size: 0.75rem; font-weight: 700; color: var(--gold); letter-spacing: 0.05em; }
.pub-item__title { font-weight: 600; margin: 0.25rem 0 0.4rem; color: var(--text); }
.pub-item__journal { font-size: 0.875rem; font-style: italic; color: var(--text-secondary); margin-bottom: 0; }
.pub-item__pdf {
  display: inline-block; font-size: 0.8rem; font-style: normal; font-weight: 600;
  color: var(--gold); margin-top: 0.4rem;
}
.pub-item__pdf:hover { color: var(--amber); text-decoration: underline; }
.pub-item__pdf + .pub-item__pdf { margin-left: 1rem; }

/* Article scan gallery */
.article-scans { margin: 2rem 0; }
.article-scans__grid {
  display: flex; flex-direction: column; gap: 1.5rem;
}
.article-scans__item {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--bg-card); box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease;
}
.article-scans__item:hover { box-shadow: var(--shadow-md); }
.article-scans__item img {
  width: 100%; height: auto; display: block; cursor: zoom-in;
}
.article-scans__item img.zoomed {
  cursor: zoom-out; transform: scale(1); position: relative; z-index: 10;
}
.article-scans__caption {
  padding: 0.75rem 1rem; font-size: 0.85rem; color: var(--text-secondary);
  border-top: 1px solid var(--border); text-align: center; font-style: italic;
}
.article-scans__credit {
  margin-top: 1rem; padding: 1rem; background: var(--accent-glow);
  border-radius: 8px; font-size: 0.85rem; color: var(--text-secondary);
  text-align: center;
}

/* Lightbox */
.lightbox {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.92); z-index: 10000; cursor: zoom-out;
  justify-content: center; align-items: center; padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 95vw; max-height: 95vh; object-fit: contain;
  border-radius: 4px; box-shadow: 0 0 60px rgba(0,0,0,0.5);
}
.lightbox__close {
  position: absolute; top: 1rem; right: 1.5rem;
  background: none; border: none; color: #fff; font-size: 2rem;
  cursor: pointer; opacity: 0.7; transition: opacity 0.2s;
}
.lightbox__close:hover { opacity: 1; }

/* Navigation cards */
.nav-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-top: 3rem; }
.nav-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 1.25rem; transition: all 0.2s;
}
.nav-card:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); }
.nav-card__label {
  font-size: 0.72rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.nav-card__title { font-size: 1rem; font-weight: 600; color: var(--text); margin-top: 0.25rem; }

/* Footer */
.site-footer {
  padding: 2.5rem 0; background: var(--bg-alt);
  border-top: 1px solid var(--border); text-align: center;
}
.site-footer p { font-size: 0.85rem; color: var(--text-secondary); }

/* Animations */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__hamburger { display: flex; }
}

@media (max-width: 768px) {
  .nav-cards { grid-template-columns: 1fr; }
  .data-table { display: block; overflow-x: auto; }
  .article-hero { padding: 6rem 0 2rem; }
}

@media (max-width: 480px) {
  html { font-size: 15px; }
  .container { padding: 0 1rem; }
}

@media print {
  .site-header, .mobile-menu, .theme-toggle, .lang-switcher { display: none !important; }
  body { background: #fff; color: #000; }
}
