/* Global shell — loads after blog.css (Bootstrap 3) */

@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&display=swap");

/* ——— Theme tokens ——— */
:root {
  --site-bg: #0f1419;
  --site-surface: #171d26;
  --site-elevated: #1e2630;
  --site-text: #e8eaed;
  --site-text-muted: #9aa3ad;
  --site-accent: #c9a227;
  --site-accent-hover: #e4c04a;
  --site-accent-soft: rgba(201, 162, 39, 0.15);
  --site-border: rgba(255, 255, 255, 0.08);
  --site-header-bg: rgba(15, 20, 25, 0.85);
  --site-nav-hover: rgba(255, 255, 255, 0.05);
  --site-overlay: rgba(255, 255, 255, 0.08);
  --site-shadow: rgba(0, 0, 0, 0.35);
  --site-code-color: #e6db74;
  --site-bg-grad-1: rgba(201, 162, 39, 0.12);
  --site-bg-grad-2: rgba(62, 120, 142, 0.08);
  --site-alert-success-bg: rgba(46, 160, 67, 0.15);
  --site-alert-success-fg: #7ee787;
  --site-alert-success-border: rgba(46, 160, 67, 0.35);
  --site-alert-info-bg: rgba(56, 139, 253, 0.12);
  --site-alert-info-fg: #79c0ff;
  --site-alert-info-border: rgba(56, 139, 253, 0.35);
  --site-alert-warn-bg: rgba(210, 153, 34, 0.15);
  --site-alert-warn-fg: #e3b341;
  --site-alert-warn-border: rgba(210, 153, 34, 0.35);
  --site-alert-danger-bg: rgba(248, 81, 73, 0.12);
  --site-alert-danger-fg: #ff7b72;
  --site-alert-danger-border: rgba(248, 81, 73, 0.35);
  --site-radius: 12px;
  --site-font-sans: "Bricolage Grotesque", system-ui, sans-serif;
  --site-font-serif: "Source Serif 4", Georgia, serif;
  --site-header-h: 4rem;
}

[data-theme="light"] {
  --site-bg: #f8f9fa;
  --site-surface: #ffffff;
  --site-elevated: #f0f1f3;
  --site-text: #1a1d21;
  --site-text-muted: #5a6270;
  --site-accent: #9a7b1a;
  --site-accent-hover: #7a6010;
  --site-accent-soft: rgba(154, 123, 26, 0.12);
  --site-border: rgba(0, 0, 0, 0.1);
  --site-header-bg: rgba(248, 249, 250, 0.88);
  --site-nav-hover: rgba(0, 0, 0, 0.04);
  --site-overlay: rgba(0, 0, 0, 0.06);
  --site-shadow: rgba(0, 0, 0, 0.1);
  --site-code-color: #8b5e0b;
  --site-bg-grad-1: rgba(201, 162, 39, 0.06);
  --site-bg-grad-2: rgba(62, 120, 142, 0.04);
  --site-alert-success-bg: rgba(46, 160, 67, 0.1);
  --site-alert-success-fg: #1a7f37;
  --site-alert-success-border: rgba(46, 160, 67, 0.3);
  --site-alert-info-bg: rgba(56, 139, 253, 0.08);
  --site-alert-info-fg: #0969da;
  --site-alert-info-border: rgba(56, 139, 253, 0.3);
  --site-alert-warn-bg: rgba(210, 153, 34, 0.1);
  --site-alert-warn-fg: #9a6700;
  --site-alert-warn-border: rgba(210, 153, 34, 0.3);
  --site-alert-danger-bg: rgba(248, 81, 73, 0.08);
  --site-alert-danger-fg: #cf222e;
  --site-alert-danger-border: rgba(248, 81, 73, 0.3);
}

html {
  font-size: 62.5%;
}

body {
  font-family: var(--site-font-serif);
  font-size: 1.7rem;
  line-height: 1.65;
  color: var(--site-text);
  background-color: var(--site-bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 100% -20%, var(--site-bg-grad-1), transparent 50%),
    radial-gradient(ellipse 80% 60% at -10% 50%, var(--site-bg-grad-2), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

body.page-home {
  overflow-x: hidden;
}

a {
  color: var(--site-accent);
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

a:hover,
a:focus {
  color: var(--site-accent-hover);
  text-decoration: none;
}

a:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 3px;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--site-border);
  background: var(--site-header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem 2rem;
  min-height: var(--site-header-h);
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.site-brand {
  font-family: var(--site-font-sans);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--site-text) !important;
  text-decoration: none !important;
  flex-shrink: 0;
}

.site-brand:hover {
  color: var(--site-accent) !important;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.2rem;
  font-family: var(--site-font-sans);
  font-size: 1.4rem;
  font-weight: 500;
}

.site-nav > a,
.site-nav .site-nav__link {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  color: var(--site-text-muted) !important;
  text-decoration: none !important;
}

.site-nav > a:hover,
.site-nav .site-nav__link:hover {
  color: var(--site-text) !important;
  background: var(--site-nav-hover);
}

/* Theme toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  width: 3.2rem;
  height: 3.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--site-text-muted);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--site-accent);
  background: var(--site-accent-soft);
  border-color: var(--site-accent);
}
.theme-toggle svg { width: 1.6rem; height: 1.6rem; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.site-header__extra {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header__extra .navbar-form {
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

.site-header__extra .form-control {
  background: var(--site-elevated);
  border: 1px solid var(--site-border);
  color: var(--site-text);
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  height: auto;
  font-size: 1.4rem;
  min-width: 16rem;
}

.site-header__extra .form-control:focus {
  border-color: var(--site-accent);
  box-shadow: 0 0 0 2px var(--site-accent-soft);
}

.site-header__extra .form-control::placeholder {
  color: var(--site-text-muted);
}

/* ——— Main ——— */
.site-main {
  padding-top: 2.4rem;
  padding-bottom: 4rem;
}

.site-main.container {
  max-width: 920px;
}

/* Flash messages */
.site-main .alert {
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius);
  font-family: var(--site-font-sans);
  font-size: 1.4rem;
}

.site-main .alert-success {
  background: var(--site-alert-success-bg);
  color: var(--site-alert-success-fg);
  border-color: var(--site-alert-success-border);
}

.site-main .alert-info {
  background: var(--site-alert-info-bg);
  color: var(--site-alert-info-fg);
  border-color: var(--site-alert-info-border);
}

.site-main .alert-warning {
  background: var(--site-alert-warn-bg);
  color: var(--site-alert-warn-fg);
  border-color: var(--site-alert-warn-border);
}

.site-main .alert-danger {
  background: var(--site-alert-danger-bg);
  color: var(--site-alert-danger-fg);
  border-color: var(--site-alert-danger-border);
}

.site-main .alert .close {
  color: inherit;
  opacity: 0.7;
  text-shadow: none;
}

/* Page title (inner pages) */
.site-main .page-header {
  margin-top: 0;
  padding-bottom: 1.6rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--site-border);
}

.site-main .page-header h1 {
  font-family: var(--site-font-sans);
  font-weight: 700;
  font-size: 2.8rem;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--site-text);
}

/* Forms (login, etc.) */
.site-panel {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.4rem 2.8rem;
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: var(--site-radius);
  box-shadow: 0 24px 48px var(--site-shadow);
}

.site-panel .form-horizontal .control-label {
  font-family: var(--site-font-sans);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--site-text-muted);
  padding-top: 0.9rem;
}

.site-panel .form-control {
  background: var(--site-elevated);
  border: 1px solid var(--site-border);
  color: var(--site-text);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  font-size: 1.5rem;
  height: auto;
}

.site-panel .form-control:focus {
  border-color: var(--site-accent);
  box-shadow: 0 0 0 2px var(--site-accent-soft);
}

.site-panel .btn-default,
.site-panel .btn-primary {
  font-family: var(--site-font-sans);
  font-weight: 600;
  font-size: 1.4rem;
  padding: 0.85rem 2rem;
  border-radius: 999px;
  border: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.site-panel .btn-primary {
  background: linear-gradient(135deg, #c9a227, #a67c1a);
  color: #0f1419;
}

.site-panel .btn-primary:hover {
  background: linear-gradient(135deg, #d4ae32, #b8891f);
  color: #0f1419;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201, 162, 39, 0.35);
}

.site-panel .btn-default {
  background: var(--site-elevated);
  color: var(--site-text);
  border: 1px solid var(--site-border);
}

.site-panel .btn-default:hover {
  background: var(--site-overlay);
  color: var(--site-text);
}

.site-panel--intro > p:first-child {
  margin-top: 0;
  color: var(--site-text-muted);
}

/* Headings in legacy blog content */
.site-main h2,
.site-main h3,
.site-main h4 {
  font-family: var(--site-font-sans);
  color: var(--site-text);
}

.site-main p {
  color: var(--site-text-muted);
}

.site-main p a {
  color: var(--site-accent);
}

/* Blog index tags (until blog templates are redesigned) */
.site-main .blog-tag {
  background: var(--site-elevated);
  color: var(--site-text-muted);
}

.site-main .blog-tag::before {
  background: var(--site-accent);
  box-shadow: none;
}

.site-main .blog-tag::after {
  background: transparent;
  border-left-color: var(--site-elevated);
}

.site-main .blog-tag:hover {
  background: var(--site-accent-soft);
  color: var(--site-accent);
}

.site-main .blog-tag:hover::after {
  border-left-color: var(--site-accent-soft);
}

.site-main h3 a {
  color: var(--site-text);
}

.site-main h3 a:hover {
  color: var(--site-accent);
}
