/* ==========================================================================
   Israel Rabinovich-Barav Memorial & Chess Website
   Clean, modern, responsive styles for GitHub Pages
   ========================================================================== */

:root {
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --link-color: #2563eb;
  --link-hover: #1d4ed8;
  --header-bg: #1e293b;
  --nav-text: #e2e8f0;
  --nav-hover: #ffffff;
  --nav-active: #38bdf8;
  --game-card-bg: #ffffff;
  --game-border: #cbd5e1;
  --max-width: 860px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f172a;
    --surface-color: #1e293b;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --link-color: #60a5fa;
    --link-hover: #93c5fd;
    --header-bg: #0b1120;
    --nav-text: #cbd5e1;
    --nav-hover: #ffffff;
    --nav-active: #38bdf8;
    --game-card-bg: #1e293b;
    --game-border: #334155;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.site-header {
  background-color: var(--header-bg);
  color: #ffffff;
  padding: 1.75rem 1rem 1.25rem;
  text-align: center;
  border-bottom: 3px solid #0284c7;
}

.site-header h1 {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.25rem 0;
}

.site-header h1 a {
  color: #ffffff;
  text-decoration: none;
}

.site-header .subtitle {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 1.25rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 0.85rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-nav a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  color: var(--nav-hover);
  background-color: rgba(255, 255, 255, 0.1);
}

.site-nav a.active {
  color: var(--nav-active);
  font-weight: 600;
  background-color: rgba(56, 189, 248, 0.15);
}

.container {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.25rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

h2 {
  font-size: 1.45rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link-hover);
}

blockquote {
  border-left: 4px solid #38bdf8;
  padding: 0.85rem 1.25rem;
  margin: 1.5rem 0;
  background-color: var(--surface-color);
  border-radius: 0 6px 6px 0;
  font-style: italic;
}

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

blockquote .attribution {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-style: normal;
  color: var(--text-muted);
}

figure {
  margin: 1.75rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: inline-block;
}

figcaption {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.image-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin: 1.75rem 0;
}

.image-row figure {
  margin: 0;
  flex: 1 1 320px;
  max-width: 420px;
}

.game-block {
  background-color: var(--game-card-bg);
  border: 1px solid var(--game-border);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.game-header {
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.game-header h3 {
  margin: 0 0 0.25rem 0;
  color: var(--text-color);
}

.game-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.game-moves {
  line-height: 1.8;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.92rem;
  margin: 1rem 0;
}

.game-moves strong {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #0284c7;
}

.diagram-figure {
  margin: 1.25rem auto;
  text-align: center;
  max-width: 320px;
}

.diagram-figure img {
  max-width: 280px;
  height: auto;
  border: 2px solid #64748b;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

hr {
  border: 0;
  height: 1px;
  background-color: var(--border-color);
  margin: 2rem 0;
}

ol, ul {
  margin: 1rem 0 1.5rem 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

.site-footer {
  margin-top: 3.5rem;
  padding: 2rem 1.25rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.site-footer p {
  margin-bottom: 0.4rem;
}

@media (max-width: 640px) {
  .site-header h1 {
    font-size: 1.5rem;
  }
  
  .site-nav {
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
  }
}
