/*
 * Stable-path stylesheet for the PHP-generated /blog pages AND the admin UI.
 *
 * Deliberately NOT a reuse of Next's compiled Tailwind bundle: that bundle
 * lives under a content-hashed /_next/static/... path that changes on any
 * unrelated site deploy, which would 404 against the generated blog pages
 * living outside the normal deploy mirror. This file is a plain committed
 * asset instead, updated by hand if the brand look changes materially.
 *
 * Colors copied from app/globals.css — keep in sync by hand.
 */

:root {
  --color-brand: #e6392c;
  --color-brand-dark: #c92e22;
  --color-surface: #f2f1ee;
  --color-card: #ffffff;
  --color-ink: #111111;
  --color-muted: #6b7280;
  --font-body: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

a { color: inherit; }

.blog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-card);
  border-bottom: 1px solid #e5e7eb;
}
.blog-logo { font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.blog-nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.blog-nav a { text-decoration: none; font-size: 0.9rem; }
.blog-nav a:hover { color: var(--color-brand); }

.blog-footer {
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.blog-footer a { text-decoration: underline; }

main { max-width: 48rem; margin: 0 auto; padding: 2.5rem 1.5rem; }
.blog-index { max-width: 72rem; }

.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--color-brand); margin: 0; }
h1 { font-size: 2.25rem; line-height: 1.2; margin: 0.5rem 0 1rem; }
.blog-intro { color: var(--color-muted); max-width: 40rem; }
.blog-breadcrumb { font-size: 0.85rem; color: var(--color-muted); }
.blog-meta { color: var(--color-muted); font-size: 0.85rem; }

.blog-hero { margin: 1.5rem 0; border-radius: 1.25rem; overflow: hidden; }
.blog-hero img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }

.blog-body h2 { font-size: 1.4rem; margin-top: 2rem; }
.blog-body p { margin: 1rem 0; }
.blog-body a { color: var(--color-brand); }
.blog-body img { display: block; max-width: 100%; height: auto; margin: 1.5rem 0; border-radius: 1.25rem; }

.blog-cta { margin-top: 2.5rem; }
.button, button[type="submit"] {
  display: inline-block;
  background: var(--color-brand);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button[type="submit"]:hover { background: var(--color-brand-dark); }

.blog-grid { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.blog-grid li a {
  display: flex; flex-direction: column; height: 100%;
  background: var(--color-card); border-radius: 1rem; overflow: hidden;
  text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.blog-card-image { aspect-ratio: 4/3; }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-body h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.blog-card-body p { margin: 0 0 0.75rem; color: var(--color-muted); font-size: 0.9rem; flex: 1; }

/* --- admin UI --- */
.blog-admin main { max-width: 40rem; }
.admin-login { max-width: 22rem; margin: 4rem auto; text-align: center; }
.admin-error { color: var(--color-brand-dark); font-weight: 600; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.admin-topbar a { text-decoration: underline; font-size: 0.9rem; }

form label { display: block; margin-bottom: 1.25rem; font-weight: 600; font-size: 0.9rem; }
form input[type="text"], form input[type="date"], form input[type="password"], form input[type="file"], form textarea {
  display: block; width: 100%; margin-top: 0.4rem; padding: 0.6rem 0.75rem;
  border: 1px solid #d1d5db; border-radius: 0.5rem; font: inherit; font-weight: 400;
}
#editor { background: #fff; margin-top: 0.4rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid #e5e7eb; font-size: 0.9rem; }
.link-button { background: none; border: none; padding: 0; color: var(--color-brand-dark); text-decoration: underline; cursor: pointer; font: inherit; }
