/* ===========================================================
   Brandingnuts Blog — Brand Styles
   Brand blue: #1f579f | White background | Clean readable font
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --blue:       #1f579f;
  --blue-dk:    #174280;
  --blue-lt:    #EAF1FB;
  --blue-mid:   #D0E3F7;
  --ink:        #1A1A2E;
  --body:       #374151;
  --muted:      #6B7280;
  --bg:         #FFFFFF;
  --bg-soft:    #F7F9FC;
  --card:       #FFFFFF;
  --border:     #E5EAF2;
  --border-dk:  #CBD5E1;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 1px 3px rgba(31,87,159,.08), 0 4px 16px rgba(31,87,159,.05);
  --font:       'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--body);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; transition: color .15s; }
a:hover { color: var(--blue-dk); }
img { display: block; max-width: 100%; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

/* ══════════════════════════════════════════════
   PUBLIC — HEADER
══════════════════════════════════════════════ */
.site-header {
  background: var(--blue);
  padding: 0;
  border-bottom: 3px solid var(--blue-dk);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.01em;
}
.site-logo span {
  opacity: .75;
  font-weight: 500;
}
.site-nav a {
  color: rgba(255,255,255,.75);
  font-size: 14px;
  font-weight: 500;
  margin-left: 28px;
  transition: color .15s;
}
.site-nav a:hover { color: #fff; }

/* ══════════════════════════════════════════════
   PUBLIC — HERO
══════════════════════════════════════════════ */
.blog-hero {
  background: var(--blue);
  padding: 48px 0 44px;
  color: #fff;
}
.blog-hero h1 {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.2;
}
.blog-hero p {
  color: rgba(255,255,255,.7);
  font-size: 15px;
  max-width: 520px;
  line-height: 1.65;
}

/* ══════════════════════════════════════════════
   PUBLIC — CATEGORY PILL
══════════════════════════════════════════════ */
.cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--blue);
  background: var(--blue-lt);
  padding: 3px 10px;
  border-radius: 4px;
  width: fit-content;
}

/* ══════════════════════════════════════════════
   PUBLIC — LATEST STRIP (homepage top)
══════════════════════════════════════════════ */
.latest-strip { padding: 40px 0 8px; }
.latest-strip h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--blue);
  margin-bottom: 20px;
}
.latest-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
}

/* ══════════════════════════════════════════════
   PUBLIC — CARDS
══════════════════════════════════════════════ */
.latest-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  color: var(--body);
}
.latest-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--blue-mid);
}
.latest-card.featured { grid-row: span 2; }

.latest-card .thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--blue-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.latest-card.featured .thumb { aspect-ratio: 16/10; }
.latest-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.latest-card .thumb .ph {
  font-size: 36px;
  font-weight: 800;
  color: var(--blue);
  opacity: .25;
}

.latest-card .body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.latest-card h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
.latest-card.featured h3 { font-size: 20px; }
.latest-card p.excerpt {
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;
}
.latest-card .meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════
   PUBLIC — ALL POSTS GRID
══════════════════════════════════════════════ */
.all-posts { padding: 40px 0 64px; }
.all-posts h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
  margin-bottom: 20px;
}
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.posts-grid .latest-card h3 { font-size: 14px; }

/* ══════════════════════════════════════════════
   PUBLIC — SINGLE POST
══════════════════════════════════════════════ */
.post-header { padding: 44px 0 24px; }
.post-header h1 {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
  margin: 12px 0 10px;
}
.post-header .meta { color: var(--muted); font-size: 13px; }

.post-cover {
  width: 100%;
  aspect-ratio: 16/7;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--blue-lt);
  margin-bottom: 8px;
}
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.post-content {
  padding: 28px 0 56px;
  font-size: 16px;
  line-height: 1.85;
  max-width: 740px;
  color: var(--body);
}
.post-content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 36px 0 12px;
}
.post-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin: 26px 0 10px;
}
.post-content p { margin-bottom: 18px; }
.post-content img { max-width: 100%; border-radius: var(--radius); margin: 20px 0; }
.post-content ul,
.post-content ol { margin: 0 0 18px 24px; }
.post-content li { margin-bottom: 6px; }
.post-content blockquote {
  border-left: 3px solid var(--blue);
  padding: 10px 18px;
  color: var(--muted);
  font-style: italic;
  margin: 24px 0;
  background: var(--blue-lt);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.post-content code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 14px;
}
.post-content a { color: var(--blue); text-decoration: underline; }

/* ══════════════════════════════════════════════
   PUBLIC — FAQ SECTION (on each post)
══════════════════════════════════════════════ */
.post-faqs {
  max-width: 740px;
  padding: 0 0 56px;
}
.post-faqs h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue-lt);
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color .2s;
}
.faq-item:hover { border-color: var(--blue-mid); }
.faq-toggle {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font);
}
.faq-toggle:focus { outline: 2px solid var(--blue); outline-offset: -2px; }
.faq-q {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: var(--blue-lt);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
  transition: background .2s, transform .25s;
}
.faq-item.open .faq-icon {
  background: var(--blue);
  color: #fff;
  transform: rotate(45deg);
}
.faq-item.open { border-color: var(--blue); }
.faq-item.open .faq-toggle { background: var(--blue-lt); }
.faq-answer {
  display: none;
  padding: 0 20px 18px;
  font-size: 14px;
  color: var(--body);
  line-height: 1.75;
  background: #fff;
}
.faq-item.open .faq-answer { display: block; }

/* ══════════════════════════════════════════════
   PUBLIC — FOOTER
══════════════════════════════════════════════ */
.site-footer {
  background: var(--blue);
  padding: 28px 0;
  text-align: center;
  color: rgba(255,255,255,.55);
  font-size: 13px;
}
.site-footer a {
  color: rgba(255,255,255,.75);
  text-decoration: underline;
}
.site-footer a:hover { color: #fff; }

/* ══════════════════════════════════════════════
   SHARED — EMPTY STATE
══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--muted);
}
.empty-state a { color: var(--blue); text-decoration: underline; }

/* ══════════════════════════════════════════════
   RESPONSIVE — PUBLIC
══════════════════════════════════════════════ */
@media (max-width: 860px) {
  .latest-grid { grid-template-columns: 1fr 1fr; }
  .latest-card.featured { grid-column: span 2; grid-row: auto; }
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .post-header h1 { font-size: 26px; }
  .blog-hero h1 { font-size: 26px; }
}
@media (max-width: 560px) {
  .latest-grid { grid-template-columns: 1fr; }
  .latest-card.featured { grid-column: span 1; }
  .posts-grid { grid-template-columns: 1fr; }
  .site-nav a { margin-left: 16px; font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════
   ADMIN PANEL STYLES
══════════════════════════════════════════════════════════ */
.admin-body { background: var(--bg-soft); min-height: 100vh; }

.admin-header {
  background: var(--blue);
  padding: 0;
  border-bottom: 3px solid var(--blue-dk);
}
.admin-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 15px;
  padding-bottom: 15px;
}
.admin-header .logo {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.admin-header .logo span { opacity: .7; font-weight: 500; }
.admin-header nav a {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  margin-left: 20px;
  font-weight: 500;
  transition: color .15s;
}
.admin-header nav a:hover { color: #fff; }

.admin-wrap { max-width: 1060px; margin: 0 auto; padding: 32px 24px 60px; }

.admin-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-title-row h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, opacity .15s;
  font-family: var(--font);
}
.btn:hover { background: var(--blue-dk); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-dk);
  color: var(--body);
}
.btn-outline:hover { background: var(--bg-soft); color: var(--ink); }
.btn-danger { background: #C13B2A; }
.btn-danger:hover { background: #A0301F; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* Table */
.admin-table {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-collapse: collapse;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th {
  background: var(--bg-soft);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg-soft); }

.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.status-published { background: #E1F5EE; color: #085041; }
.status-draft { background: var(--blue-lt); color: var(--blue-dk); }

.admin-actions a { margin-right: 14px; font-size: 13px; font-weight: 500; }
.admin-actions a { color: var(--blue); }
.admin-actions .delete-link { color: #C13B2A; }

/* Forms */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 760px;
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.form-group .hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-dk);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31,87,159,.1);
}
textarea.form-control { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.current-cover { margin-bottom: 10px; }
.current-cover img { max-width: 200px; border-radius: var(--radius); display: block; border: 1px solid var(--border); }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 20px;
  font-weight: 500;
}
.alert-success { background: #E1F5EE; color: #085041; border: 1px solid #A7E3CC; }
.alert-error { background: #FCEBEB; color: #791F1F; border: 1px solid #F5B8B8; }

/* Dashboard stats */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.dash-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.dash-stat .num {
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 4px;
}
.dash-stat .lbl {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
@media (max-width: 600px) { .dash-stats { grid-template-columns: 1fr; } }

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 38px 34px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.login-card .logo {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  text-align: center;
  color: var(--blue);
}
.login-card .sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 26px;
}
.login-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
