/* ==========================================
   DailyPulse — Main Stylesheet
   Aesthetic: Editorial newspaper, refined
   ========================================== */

:root {
  --ink:       #0a0a0a;
  --ink-soft:  #3d3d3d;
  --ink-muted: #7a7a7a;
  --paper:     #f8f5f0;
  --paper-2:   #ffffff;
  --rule:      #d4c9bb;
  --accent:    #b5292a;
  --accent-2:  #e8a800;
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Georgia', sans-serif;
  --max-w:     1200px;
  --radius:    3px;
  --shadow:    0 2px 12px rgba(0,0,0,0.08);
}

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

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

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Header ───────────────────────────────────── */
.site-header {
  background: var(--paper-2);
  border-bottom: 3px double var(--ink);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.header-date {
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.site-logo {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -.02em;
  color: var(--ink);
  text-align: center;
}
.site-logo:hover { color: var(--accent); transition: color .2s; }
.header-tagline {
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: right;
}
.site-nav {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .5rem 2rem;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.nav-link {
  padding: .4rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all .2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Main content ─────────────────────────────── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 2rem;
}

/* ── Featured article ─────────────────────────── */
.featured-article {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  margin-bottom: 3rem;
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .3s;
}
.featured-article:hover { box-shadow: 0 8px 32px rgba(0,0,0,.12); }
.featured-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}
.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.featured-article:hover .featured-image img { transform: scale(1.03); }
.featured-content {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 4px solid var(--accent);
}
.featured-title {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  margin: .5rem 0 1rem;
}
.featured-summary {
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

/* ── Category badge ───────────────────────────── */
.category-badge {
  position: absolute;
  top: .75rem;
  left: .75rem;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .2rem .6rem;
  z-index: 1;
}
.category-badge.large {
  position: static;
  display: inline-block;
  margin-bottom: .75rem;
  font-size: .7rem;
}

/* ── Article date ─────────────────────────────── */
.article-date {
  font-size: .75rem;
  color: var(--ink-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Read more ────────────────────────────────── */
.read-more {
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .05em;
  transition: letter-spacing .2s;
}
.read-more:hover { letter-spacing: .1em; }

/* ── News grid ────────────────────────────────── */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}
.news-card {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow .3s, transform .2s;
}
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.news-card:hover .card-image img { transform: scale(1.05); }
.card-content {
  padding: 1.25rem;
}
.card-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: .35rem 0 .6rem;
}
.card-summary { font-size: .875rem; color: var(--ink-soft); line-height: 1.6; }

/* ── Placeholder image ────────────────────────── */
.placeholder-img {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--rule),
    var(--rule) 1px,
    transparent 1px,
    transparent 10px
  );
  background-color: #eee;
}

/* ── Pagination ───────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}
.page-btn {
  padding: .6rem 1.4rem;
  border: 1px solid var(--ink);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .05em;
  transition: all .2s;
}
.page-btn:hover { background: var(--ink); color: var(--paper); }
.page-info { font-size: .85rem; color: var(--ink-muted); }

/* ── Empty state ──────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--ink-muted);
  font-size: 1.1rem;
}

/* ── Article page ─────────────────────────────── */
.article-page { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 2rem; }
.article-container { max-width: 760px; margin: 0 auto; }

.breadcrumb {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-size: .8rem;
  color: var(--ink-muted);
  margin-bottom: 2rem;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }

.article-header { margin-bottom: 2rem; }
.article-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.15;
  margin: .5rem 0 1rem;
}
.article-meta {
  display: flex;
  gap: 1.5rem;
  font-size: .8rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.article-summary {
  font-size: 1.15rem;
  color: var(--ink-soft);
  line-height: 1.7;
  border-left: 4px solid var(--accent-2);
  padding-left: 1rem;
  margin-bottom: 2rem;
}
.article-hero {
  width: 100%;
  margin-bottom: 2rem;
  border: 1px solid var(--rule);
}
.article-hero img { width: 100%; max-height: 500px; object-fit: cover; }
.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-soft);
}
.article-body p { margin-bottom: 1.25rem; }

/* Share buttons */
.article-share {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 2rem 0;
  font-size: .85rem;
}
.share-btn {
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
  border: 1px solid;
  background: none;
  transition: all .2s;
}
.share-btn.twitter  { border-color: #1da1f2; color: #1da1f2; }
.share-btn.twitter:hover  { background: #1da1f2; color: #fff; }
.share-btn.facebook { border-color: #1877f2; color: #1877f2; }
.share-btn.facebook:hover { background: #1877f2; color: #fff; }
.share-btn.copy     { border-color: var(--ink-muted); color: var(--ink-muted); }
.share-btn.copy:hover { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Related articles */
.related-articles { border-top: 3px double var(--ink); padding-top: 2rem; margin-top: 2rem; }
.related-title {
  font-family: var(--font-head);
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
}
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.related-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink);
  transition: color .2s;
}
.related-card:hover { color: var(--accent); }
.related-card img {
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 1px solid var(--rule);
}

/* ── Footer ───────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: .85rem;
  color: var(--ink-muted);
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .header-inner { grid-template-columns: 1fr; text-align: center; }
  .header-date, .header-tagline { display: none; }
  .featured-article { grid-template-columns: 1fr; }
  .featured-image { aspect-ratio: 16/9; }
  .featured-content { border-left: none; border-top: 4px solid var(--accent); }
  .news-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .main-content, .article-page { padding: 1.5rem 1rem; }
}

/* ── Admin styles ─────────────────────────────── */
.admin-body {
  background: #f0f2f5;
  font-family: var(--font-body);
}
.admin-sidebar {
  position: fixed; top: 0; left: 0; height: 100vh; width: 240px;
  background: #1a1a2e; color: #e0e0e0; padding: 0;
  display: flex; flex-direction: column;
  z-index: 100;
}
.admin-brand {
  padding: 1.5rem;
  font-family: var(--font-head);
  font-size: 1.4rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #fff;
}
.admin-brand span { color: var(--accent); }
.admin-nav { flex: 1; padding: 1rem 0; }
.admin-nav a {
  display: block; padding: .75rem 1.5rem;
  font-size: .9rem; color: #aaa;
  transition: all .2s; letter-spacing: .03em;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.08); color: #fff; border-left: 3px solid var(--accent); }
.admin-nav a.active { font-weight: 600; }
.admin-logout { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.1); }
.admin-logout a { color: #888; font-size: .85rem; transition: color .2s; }
.admin-logout a:hover { color: var(--accent); }

.admin-main { margin-left: 240px; padding: 2rem; min-height: 100vh; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem;
}
.admin-title { font-family: var(--font-head); font-size: 1.8rem; font-weight: 700; }
.btn {
  padding: .6rem 1.4rem; font-size: .875rem; font-weight: 600;
  border: none; cursor: pointer; letter-spacing: .04em; transition: all .2s;
  display: inline-flex; align-items: center; gap: .4rem;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #8a1e1f; }
.btn-secondary { background: #e0e0e0; color: var(--ink); }
.btn-secondary:hover { background: #ccc; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #b02a37; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }

.admin-card {
  background: #fff; border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 1.5rem;
}
.admin-card-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid #eee;
  font-weight: 600; font-size: .9rem; color: var(--ink-soft);
  letter-spacing: .04em; text-transform: uppercase;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  padding: .75rem 1.5rem; text-align: left; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted);
  border-bottom: 2px solid #eee; font-weight: 600;
}
.admin-table td { padding: .85rem 1.5rem; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fafafa; }
.admin-table img { width: 60px; height: 40px; object-fit: cover; border-radius: 2px; }

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--ink-soft); }
.form-control {
  width: 100%; padding: .65rem .9rem;
  border: 1px solid #ddd; border-radius: 3px;
  font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
  background: #fff;
}
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,41,42,.1); }
textarea.form-control { resize: vertical; min-height: 200px; }
select.form-control { cursor: pointer; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-full { grid-column: 1/-1; }

.alert { padding: .85rem 1.25rem; border-radius: 3px; margin-bottom: 1.25rem; font-size: .9rem; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: #fff; padding: 1.5rem; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-left: 4px solid var(--accent); }
.stat-number { font-size: 2rem; font-weight: 700; font-family: var(--font-head); }
.stat-label { font-size: .8rem; color: var(--ink-muted); letter-spacing: .06em; text-transform: uppercase; margin-top: .25rem; }

.published-badge { padding: .2rem .6rem; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 2px; }
.published-badge.yes { background: #d4edda; color: #155724; }
.published-badge.no  { background: #f8d7da; color: #721c24; }

/* Login page */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #1a1a2e;
}
.login-box { background: #fff; padding: 3rem; width: 100%; max-width: 400px; border-radius: 4px; }
.login-logo { font-family: var(--font-head); font-size: 2rem; font-weight: 900; text-align: center; margin-bottom: .5rem; }
.login-logo span { color: var(--accent); }
.login-sub { text-align: center; color: var(--ink-muted); font-size: .85rem; margin-bottom: 2rem; letter-spacing: .05em; text-transform: uppercase; }
.login-btn { width: 100%; padding: .85rem; background: var(--accent); color: #fff; border: none; font-size: 1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; margin-top: .5rem; transition: background .2s; }
.login-btn:hover { background: #8a1e1f; }

@media (max-width: 900px) {
  .admin-sidebar { position: static; width: 100%; height: auto; flex-direction: row; }
  .admin-main { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
