/* ============================================================
   Viktorina.live — Blog Stylesheet
   Fonts: Inter (body) + Playfair Display (headings)
   ============================================================ */

/* ── Reset + Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cream:       #faf9f7;
  --white:       #ffffff;
  --navy:        #1e3a5f;
  --navy-light:  #2a5082;
  --gold:        #c9a84c;
  --gold-light:  #e2c375;
  --text-dark:   #1a1a2e;
  --text-mid:    #4b5563;
  --text-light:  #9ca3af;
  --border:      #e8e4de;
  --card-shadow: 0 2px 8px rgba(0,0,0,.07);
  --card-hover:  0 8px 28px rgba(0,0,0,.13);
  --radius:      10px;
  --radius-sm:   6px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  background: var(--cream);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* ── Header ───────────────────────────────────────────────── */
.blog-header {
  background: var(--navy);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.blog-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.blog-header__brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.blog-header__brand:hover { color: var(--gold-light); }

.blog-header__nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.blog-header__nav a {
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  font-weight: 500;
  transition: color .2s;
}

.blog-header__nav a:hover { color: var(--gold-light); }

/* ── Page title ───────────────────────────────────────────── */
.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 1.75rem;
  line-height: 1.25;
}

/* ── Category badge ───────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: rgba(30,58,95,.1);
  color: var(--navy);
}

.badge:hover { background: rgba(30,58,95,.18); }

/* ── Meta line ────────────────────────────────────────────── */
.meta {
  font-size: .82rem;
  color: var(--text-light);
  margin-bottom: .6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.meta a { color: var(--navy); font-weight: 500; }
.meta a:hover { color: var(--gold); }

/* ── Cards (post list) ────────────────────────────────────── */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform .22s ease, box-shadow .22s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-hover);
}

.card__cover {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card__body {
  padding: 1.25rem 1.4rem 1.4rem;
}

.card__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: .5rem;
}

.card__title a { color: var(--navy); }
.card__title a:hover { color: var(--gold); }

.card__excerpt {
  color: var(--text-mid);
  font-size: .93rem;
  line-height: 1.65;
  margin-top: .4rem;
}

/* ── Featured card (first post) ──────────────────────────── */
.card--featured {
  border-top: 3px solid var(--gold);
}

.card--featured .card__cover { height: 280px; }

.card--featured .card__title {
  font-size: 1.5rem;
}

/* ── Single Post ──────────────────────────────────────────── */
.post-header { margin-bottom: 2rem; }

.post-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: .75rem;
}

.post-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

/* ── Prose (post body) ────────────────────────────────────── */
.prose {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.prose h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  margin: 2.25rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--border);
}

.prose h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 1.75rem 0 .5rem;
}

.prose p { margin-bottom: 1.25rem; }

.prose ul, .prose ol {
  margin: 0 0 1.25rem 1.5rem;
}

.prose li { margin-bottom: .4rem; }

.prose blockquote {
  border-left: 4px solid var(--gold);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-mid);
  font-style: italic;
  background: rgba(201,168,76,.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.prose hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2rem 0;
}

.prose img {
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

.prose a {
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--gold); }

/* ── Back link ────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 500;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  transition: color .2s;
}

.back-link:hover { color: var(--gold); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  gap: .5rem;
  margin-top: 2rem;
  justify-content: center;
}

.pagination a {
  padding: .5rem 1.1rem;
  background: var(--navy);
  color: var(--white);
  border-radius: 30px;
  font-size: .88rem;
  font-weight: 500;
  transition: background .2s, transform .15s;
}

.pagination a:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-mid);
}

/* ── Admin bar ────────────────────────────────────────────── */
.admin-bar {
  background: #7f1d1d;
  color: #fff;
  padding: .6rem 1.25rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  border-radius: var(--radius-sm);
  font-size: .88rem;
}

.admin-bar a { color: #fca5a5; font-weight: 500; }
.admin-bar a:hover { color: #fff; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .45rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
}

.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn-primary   { background: var(--navy); color: #fff; }
.btn-danger    { background: #7f1d1d; color: #fff; }
.btn-secondary { background: #6b7280; color: #fff; }

/* ── Admin Table ──────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f3f4f6; font-weight: 600; font-size: .85rem; color: var(--text-mid); }

/* ── Forms ────────────────────────────────────────────────── */
label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .3rem;
  color: var(--text-dark);
}

input, textarea, select {
  width: 100%;
  padding: .55rem .75rem;
  margin-bottom: 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  background: var(--white);
  transition: border-color .2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--navy);
}

.error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  color: #991b1b;
  font-size: .9rem;
}

/* ── TipTap Editor ────────────────────────────────────────── */
#editor-wrap {
  border: 1.5px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-height: 320px;
  padding: .85rem 1rem;
  background: var(--white);
  outline: none;
  font-size: .97rem;
  line-height: 1.75;
}

#editor-wrap:focus-within { border-color: var(--navy); }

.toolbar {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: .4rem .6rem;
  background: #f8f7f5;
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  border-bottom: none;
}

.toolbar button {
  padding: .22rem .6rem;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 4px;
  cursor: pointer;
  font-size: .8rem;
  transition: background .15s;
}

.toolbar button:hover { background: var(--border); }

/* ── Status badges (admin) ────────────────────────────────── */
.status-badge {
  padding: .15rem .55rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
}

.status-published { background: #dcfce7; color: #166534; }
.status-draft     { background: #fef9c3; color: #854d0e; }

/* ── Media Queries ────────────────────────────────────────── */
@media (max-width: 600px) {
  .container { padding: 1.25rem .85rem; }
  .card--featured .card__cover { height: 200px; }
  .card--featured .card__title { font-size: 1.2rem; }
  .blog-header__nav { gap: 1rem; }
}

@media (min-width: 700px) {
  .posts-list { gap: 1.5rem; }
  .card__cover { height: 220px; }
  .card--featured .card__cover { height: 320px; }
}
