/* ─── Los Santos Times ── Main Stylesheet ─────────────────────────────── */

:root {
  --ink:       #0d0d0d;
  --ink-soft:  #2c2c2c;
  --ink-muted: #5c5c5c;
  --paper:     #f5f0e8;
  --paper-off: #ede7d9;
  --paper-dark:#d9d1c0;
  --red:       #c8102e;
  --red-dark:  #9e0c24;
  --navy:      #1a2d4a;
  --gold:      #b8922a;
  --serif:     'Playfair Display', Georgia, serif;
  --body:      'Source Serif 4', Georgia, serif;
  --cond:      'Barlow Condensed', sans-serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.12);
  --shadow-md: 0 4px 16px rgba(0,0,0,.15);
}

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

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  min-height: 100vh;
  /* subtle paper texture */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='.04'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── HEADER ──────────────────────────────────────────────────────────── */

.site-header {
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .35rem 2rem;
  border-bottom: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--cond);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.header-login-link {
  color: var(--gold);
  transition: color .2s;
}
.header-login-link:hover { color: #fff; }

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: .8rem 2rem;
}

.brand-rule { flex: 1; height: 1px; background: var(--ink); }

.brand-center { text-align: center; line-height: 1; }

.brand-kicker,
.brand-tagline {
  display: block;
  font-family: var(--cond);
  font-size: .65rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--ink);
  line-height: 1;
  margin: .25rem 0;
  white-space: nowrap;
  transition: color .2s;
}
.brand-name:hover { color: var(--red); }

.header-nav {
  border-top: 1px solid var(--paper-dark);
  background: var(--ink);
}
.nav-inner {
  display: flex;
  align-items: center;
  overflow-x: auto;
  padding: 0 1.5rem;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-cat {
  font-family: var(--cond);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--paper-off);
  padding: .7rem 1rem;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.nav-cat:hover {
  color: #fff;
  border-color: var(--cat-color, var(--red));
}
.nav-home { color: #fff; }

/* ── LAYOUT ──────────────────────────────────────────────────────────── */

.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

.page-wrap { padding: 2rem 0 4rem; }

/* ── SECTION LABELS ──────────────────────────────────────────────────── */

.section-label {
  font-family: var(--cond);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--paper-dark);
}

/* ── HERO / FEATURED ─────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  border: 1px solid var(--ink);
  margin: 2rem 0 2.5rem;
  animation: fadeUp .6s ease both;
}

.hero-main {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  background: var(--ink);
}

.hero-main img {
  position: absolute;
  inset: 0;
  opacity: .7;
  transition: transform .6s ease;
}
.hero-main:hover img { transform: scale(1.03); }

.hero-main-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 60%);
  color: #fff;
}

.hero-kicker {
  font-family: var(--cond);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .5rem;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: .75rem;
}
.hero-title a { color: #fff; transition: color .2s; }
.hero-title a:hover { color: var(--gold); }

.hero-sub {
  font-size: .9rem;
  color: rgba(255,255,255,.8);
  font-style: italic;
}

.hero-sidebar {
  border-left: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
}

.hero-sidebar-item {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--paper-dark);
  flex: 1;
  transition: background .2s;
}
.hero-sidebar-item:last-child { border-bottom: none; }
.hero-sidebar-item:hover { background: var(--paper-off); }

.hsi-cat {
  font-family: var(--cond);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--cat, var(--red));
  margin-bottom: .3rem;
}

.hsi-title {
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.hsi-title a:hover { color: var(--red); }

/* ── ARTICLE GRID ────────────────────────────────────────────────────── */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.grid-2-1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* ── ARTICLE CARD ────────────────────────────────────────────────────── */

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--paper-dark);
  background: #fff;
  transition: box-shadow .25s, transform .25s;
  animation: fadeUp .5s ease both;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-img-wrap {
  display: block;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--paper-dark);
}
.card--large .card-img-wrap { aspect-ratio: 16/10; }
.card-img-wrap img { transition: transform .5s ease; }
.card:hover .card-img-wrap img { transform: scale(1.04); }

.card-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy), var(--ink));
}
.card-no-img span {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 900;
  color: rgba(255,255,255,.15);
  letter-spacing: .1em;
}

.card-body { padding: 1rem 1.1rem 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .35rem; }

.card-cat {
  font-family: var(--cond);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--cat, var(--red));
}

.card-title {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.25;
}
.card--normal .card-title { font-size: 1.05rem; }
.card--large  .card-title { font-size: 1.35rem; }
.card--small  .card-title { font-size: .9rem; }

.card-title a:hover { color: var(--red); }

.card-sub {
  font-size: .82rem;
  color: var(--ink-muted);
  font-style: italic;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: .75rem;
  font-family: var(--cond);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: .25rem;
}

/* ── DIVIDER ─────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--paper-dark);
  margin: 2.5rem 0;
}

/* ── ARTICLE FULL PAGE ───────────────────────────────────────────────── */

.article-wrap {
  max-width: 780px;
  margin: 0 auto;
}

.article-header { margin-bottom: 2rem; }

.article-cat {
  font-family: var(--cond);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
}

.article-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.15;
  margin: .5rem 0 .75rem;
}

.article-sub {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.5;
  border-left: 3px solid var(--red);
  padding-left: 1rem;
  margin-bottom: 1.25rem;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-family: var(--cond);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-top: 1px solid var(--paper-dark);
  border-bottom: 1px solid var(--paper-dark);
  padding: .6rem 0;
}
.article-byline .sep { color: var(--paper-dark); }

.article-cover {
  margin: 1.5rem 0;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 1px solid var(--paper-dark);
}

.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-soft);
}
.article-body p   { margin-bottom: 1.4em; }
.article-body h2  { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; margin: 2rem 0 .75rem; color: var(--ink); }
.article-body h3  { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.article-body blockquote {
  border-left: 4px solid var(--red);
  padding: .75rem 1.5rem;
  margin: 2rem 0;
  background: var(--paper-off);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--navy);
}

/* ── ADMIN LAYOUT ────────────────────────────────────────────────────── */

.admin-body {
  display: flex;
  min-height: 100vh;
  background: #f0ede7;
  font-family: var(--cond);
}

.admin-sidebar {
  width: 240px;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: -.01em;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.admin-sidebar-brand small {
  display: block;
  font-family: var(--cond);
  font-size: .65rem;
  font-weight: 400;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: .2rem;
}

.admin-nav { padding: 1rem 0; flex: 1; }

.admin-nav-label {
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: .6rem 1.25rem .3rem;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1.25rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  transition: background .2s, color .2s;
}
.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.admin-nav a.active { border-left: 3px solid var(--red); }

.admin-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .75rem;
  color: rgba(255,255,255,.5);
}
.admin-user strong { display: block; color: #fff; font-size: .82rem; }

.admin-main {
  flex: 1;
  padding: 2rem;
  overflow-x: hidden;
}

.admin-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 900;
  margin-bottom: 1.5rem;
  color: var(--ink);
  border-bottom: 2px solid var(--paper-dark);
  padding-bottom: .75rem;
}

/* ── ADMIN CARDS / STATS ─────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--paper-dark);
  padding: 1.25rem;
  text-align: center;
}
.stat-card .stat-num {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: .25rem;
}

/* ── FORM STYLES ─────────────────────────────────────────────────────── */

.form-card {
  background: #fff;
  border: 1px solid var(--paper-dark);
  padding: 2rem;
  max-width: 900px;
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: .4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid var(--paper-dark);
  background: var(--paper);
  font-family: var(--body);
  font-size: .95rem;
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,45,74,.1);
}

.form-group textarea { min-height: 320px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── BUTTONS ─────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--cond);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .6rem 1.25rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }

.btn-secondary { background: var(--navy); color: #fff; }
.btn-secondary:hover { background: #0f1e30; }

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: #fff; }

.btn-danger { background: #8b1a1a; color: #fff; }
.btn-danger:hover { background: #6a1010; }

.btn-sm { padding: .4rem .85rem; font-size: .7rem; }

/* ── TABLE ───────────────────────────────────────────────────────────── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--paper-dark);
}
.data-table th {
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: .75rem 1rem;
  background: var(--ink);
  color: var(--paper);
  text-align: left;
}
.data-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--paper-dark);
  font-size: .875rem;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--paper-off); }

/* ── BADGE ───────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  font-family: var(--cond);
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .2rem .5rem;
}
.badge-pub    { background: #d4edda; color: #155724; }
.badge-draft  { background: #fff3cd; color: #856404; }
.badge-arch   { background: #e2e3e5; color: #383d41; }

/* ── ALERT ───────────────────────────────────────────────────────────── */

.alert {
  padding: .75rem 1rem;
  font-family: var(--cond);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .05em;
  margin-bottom: 1.25rem;
  border-left: 4px solid;
}
.alert-success { background: #d4edda; color: #155724; border-color: #28a745; }
.alert-error   { background: #f8d7da; color: #721c24; border-color: var(--red); }

/* ── LOGIN PAGE ──────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E");
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  background: var(--paper);
  border-top: 5px solid var(--red);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  animation: fadeUp .5s ease;
}

.login-brand {
  text-align: center;
  margin-bottom: 2rem;
}
.login-brand h1 {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 900;
}
.login-brand p {
  font-family: var(--cond);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: .25rem;
}

/* ── CATEGORY PAGE ───────────────────────────────────────────────────── */

.cat-header {
  border-bottom: 3px solid var(--cat-color, var(--red));
  padding-bottom: .75rem;
  margin-bottom: 2rem;
}
.cat-header h1 {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 900;
}

/* ── PAGINATION ──────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-top: 2.5rem;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  font-family: var(--cond);
  font-size: .8rem;
  font-weight: 700;
  border: 1px solid var(--paper-dark);
  background: #fff;
  transition: background .2s, color .2s;
}
.pagination a:hover { background: var(--ink); color: #fff; }
.pagination .current { background: var(--red); color: #fff; border-color: var(--red); }

/* ── ANIMATIONS ──────────────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:nth-child(4) { animation-delay: .24s; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .hero-sidebar { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .header-brand { padding: .6rem 1rem; gap: 1rem; }
  .brand-name { font-size: 2rem; }
  .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .container { padding: 0 1rem; }
}
