/* ============================================================
   Garage131 Blog — Shared Styles
   Hand-authored static CSS; no Angular, no Tailwind.
   ============================================================ */

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

:root,
html[data-theme='light'] {
  --blue:        #3b82f6;
  --blue-dark:   #2563eb;
  --text:        #0f172a;
  --text-muted:  #475569;
  --text-light:  #94a3b8;
  --bg:          #f0f4f8;
  --bg-card:     #ffffff;
  --bg-subtle:   #f1f5f9;
  --border:      #e2e8f0;
  --radius:      8px;
  --max-prose:   68ch;
  --tag-bg:      #eff6ff;
  --quote-bg:    #eff6ff;
  /* Header is always visually dark — adapts per theme like the app sidebar */
  --header-bg:         #1e293b;
  --header-border:     #334155;
  --header-link:       #94a3b8;
  --header-link-hover: #f0f4f8;
}

html[data-theme='dark'] {
  --blue:        #3b82f6;
  --blue-dark:   #60a5fa;
  --text:        #f5f0eb;
  --text-muted:  #c8bfb5;
  --text-light:  #8c8078;
  --bg:          #100e0c;
  --bg-card:     #1c1916;
  --bg-subtle:   #2a2622;
  --border:      #3a3530;
  --tag-bg:      rgba(59, 130, 246, 0.15);
  --quote-bg:    rgba(59, 130, 246, 0.08);
  /* Warm Stone dark sidebar tones */
  --header-bg:         #110f0d;
  --header-border:     #2a2520;
  --header-link:       #8c8078;
  --header-link-hover: #f5f0eb;
}

html { font-size: 16px; }

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

/* ── Site header ────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo {
  height: 35px;
  width: 65px;
  object-fit: contain;
  display: block;
}

.site-header .desktop-nav { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 80px;
  padding-right: 4px;
}

.site-header nav a {
  color: var(--header-link);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.site-header nav a:hover { color: var(--header-link-hover); }

.site-header .cta-btn {
  background: var(--blue);
  color: #ffffff !important;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s;
}

.site-header .cta-btn:hover { background: var(--blue-dark) !important; }

/* ── Hamburger button ────────────────────────────────────────── */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 20px;
  height: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  overflow: visible;
}

.hamburger span {
  display: block;
  width: 16px;  /* shorter bars = smaller X arms */
  height: 2px;
  background: var(--header-link-hover);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* spans sit at y≈0, 6, 12 in a 14px container; center = 7px */
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ── Mobile nav menu ─────────────────────────────────────────── */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: 6px 0;
  min-width: 200px;
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 200;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 12px 16px;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu a:hover { background: var(--bg-subtle); }

.menu-icon {
  width: 24px;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.submenu-icon {
  width: 20px;
  text-align: center;
  color: var(--text-light);
  flex-shrink: 0;
  font-size: 0.875rem;
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 20px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
  border-radius: 0 0 12px 12px;
}

.theme-toggle:hover { background: var(--bg-subtle); }

.submenu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 0.95rem;
  padding: 12px 16px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.1s;
}

.submenu-toggle span { flex: 1; }

.submenu-toggle:hover { background: var(--bg-subtle); }

.submenu-arrow {
  font-size: 0.7rem;
  color: var(--text-light);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: auto;
}

.submenu-toggle.open .submenu-arrow { transform: rotate(180deg); }

.submenu {
  display: none;
  flex-direction: column;
}

.submenu.open {
  display: flex;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.submenu a {
  padding: 10px 16px 10px 16px !important;
  font-size: 0.9rem;
  color: var(--text-muted) !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px;
}

/* ── Page wrapper ───────────────────────────────────────────── */
.page-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── Blog index ─────────────────────────────────────────────── */
.blog-index-header { margin-bottom: 40px; }

.blog-index-header h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 8px;
}

.blog-index-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0;
}

.article-list { display: flex; flex-direction: column; gap: 24px; }

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.article-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
}

.article-card .tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.article-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.3;
}

.article-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 16px;
  line-height: 1.6;
}

.article-card .meta {
  color: var(--text-light);
  font-size: 0.8rem;
}

/* ── Article page ───────────────────────────────────────────── */
.article-wrapper {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.article-meta {
  margin-bottom: 32px;
}

.article-meta .tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.article-meta h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 0 0 12px;
}

.article-meta .byline {
  color: var(--text-light);
  font-size: 0.875rem;
}

.article-meta .byline strong { color: var(--text-muted); }

.article-body { font-size: 1.05rem; }

.article-body p { margin: 0 0 1.4em; }

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.2em 0 0.6em;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.8em 0 0.4em;
}

.article-body ul, .article-body ol {
  padding-left: 1.5em;
  margin: 0 0 1.4em;
}

.article-body li { margin-bottom: 0.4em; }

.article-body strong { color: var(--text); }

.article-body a { color: var(--blue); }
.article-body a:hover { color: var(--blue-dark); }

.article-body blockquote {
  border-left: 4px solid var(--blue);
  margin: 1.6em 0;
  padding: 12px 20px;
  background: var(--quote-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  font-style: italic;
}

/* ── CTA box ────────────────────────────────────────────────── */
.cta-box {
  background: var(--blue);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 32px 36px;
  margin: 48px 0 0;
  text-align: center;
}

.cta-box h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.cta-box p {
  font-size: 0.95rem;
  margin: 0 0 20px;
  opacity: 0.88;
}

.cta-box a {
  display: inline-block;
  background: #ffffff;
  color: var(--blue) !important;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 10px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: opacity 0.15s;
}

.cta-box a:hover { opacity: 0.9; }

/* ── Breadcrumb ─────────────────────────────────────────────── */
.breadcrumb {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 20px 24px 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { margin: 0 6px; }

/* ── Site footer ────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 40px;
}

.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--blue); }
.site-footer .footer-links { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-bottom: 12px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .article-meta h1 { font-size: 1.7rem; }
  .page-wrapper, .article-wrapper { padding-top: 32px; padding-bottom: 60px; }
  .article-card { padding: 20px; }
  .cta-box { padding: 24px 20px; }
}
