@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
  --ink: #1a1a2e;
  --ink-light: #2d2d44;
  --paper: #faf9f6;
  --paper-warm: #f4f1eb;
  --accent: #c8622a;
  --accent-light: #e8845a;
  --accent-pale: #fdf0ea;
  --gold: #d4a843;
  --muted: #7a7a8e;
  --border: #e2ddd6;
  --white: #ffffff;
  --success: #2d7a4f;
  --error: #c0392b;
  --pending: #b7760d;
  --shadow: 0 2px 20px rgba(26,26,46,0.08);
  --shadow-lg: 0 8px 40px rgba(26,26,46,0.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
}

/* NAV */
nav {
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav-logo span { color: var(--accent-light); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active { color: var(--white); }

.nav-cta {
  background: var(--accent);
  color: var(--white) !important;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-weight: 600 !important;
  transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--accent-light) !important; }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.3s;
}

/* HERO */
.hero {
  background: var(--ink);
  padding: 6rem 2rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200,98,42,0.2) 0%, transparent 70%);
}

.hero-inner { position: relative; max-width: 800px; margin: 0 auto; }

.hero-tag {
  display: inline-block;
  background: rgba(200,98,42,0.2);
  color: var(--accent-light);
  border: 1px solid rgba(200,98,42,0.4);
  padding: 0.35rem 1rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero h1 em { color: var(--accent-light); font-style: italic; }

.hero p {
  color: rgba(255,255,255,0.65);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
  letter-spacing: 0.2px;
}

.btn-primary { background: var(--accent); color: var(--white); }
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(200,98,42,0.35); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--ink-light); }

/* SECTION */
.section { padding: 5rem 2rem; }
.section-inner { max-width: 1200px; margin: 0 auto; }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 3rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

/* POST GRID */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.post-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--ink-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.post-card-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(200,98,42,0.3), transparent 60%);
}

.post-card-category-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--accent);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-card-icon {
  font-size: 2.5rem;
  opacity: 0.3;
  position: relative;
}

.post-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }

.post-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  text-decoration: none;
  display: block;
}

.post-card-title:hover { color: var(--accent); }

.post-card-excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
}

.post-card-author { font-weight: 600; color: var(--ink-light); }

/* CATEGORIES */
.categories-section { background: var(--paper-warm); }

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.category-chip {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.category-chip:hover, .category-chip.active {
  border-color: var(--accent);
  background: var(--accent-pale);
  color: var(--accent);
}

.category-chip-icon { font-size: 1.5rem; }
.category-chip-name { font-size: 0.85rem; font-weight: 600; }

/* FORM */
.form-section { background: var(--white); }

.form-container {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: 16px;
  padding: 3rem;
  border: 1px solid var(--border);
}

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

.form-group { display: flex; flex-direction: column; gap: 0.5rem; }

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-light);
  letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,98,42,0.12);
}

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

/* ALERTS */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  display: none;
}

.alert.show { display: block; }
.alert-success { background: #d4edda; color: var(--success); border: 1px solid #b8dacc; }
.alert-error { background: #fdecea; color: var(--error); border: 1px solid #f5c6c6; }

/* PAGINATION */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.page-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: var(--white); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* SEARCH BAR */
.search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-bar input, .search-bar select {
  padding: 0.65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.search-bar input { flex: 1; min-width: 200px; }
.search-bar input:focus, .search-bar select:focus { border-color: var(--accent); }

/* STATS */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
}

.stat-number {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-label { font-size: 0.85rem; color: var(--muted); font-weight: 500; margin-top: 0.25rem; }

/* FOOTER */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 3rem 2rem 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 2rem;
}

.footer-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.footer-brand-name span { color: var(--accent-light); }

.footer-h { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--white); margin-bottom: 1rem; }

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: rgba(255,255,255,0.55); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--white); }

.footer-bottom { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }

/* SINGLE POST */
.post-hero {
  background: var(--ink);
  padding: 5rem 2rem 4rem;
}

.post-hero-inner { max-width: 800px; margin: 0 auto; }

.post-hero-category {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 0.3rem 0.9rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.25rem;
}

.post-hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

.post-meta-row strong { color: var(--white); }

.post-body {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 2rem;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink-light);
}

.post-body p { margin-bottom: 1.5rem; }
.post-body h2, .post-body h3 { font-family: 'Playfair Display', serif; margin: 2rem 0 1rem; }

/* LOADING */
.loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: 'Playfair Display', serif; color: var(--ink); margin-bottom: 0.5rem; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--ink);
    padding: 1rem 2rem 1.5rem;
    gap: 1rem;
  }
  .nav-hamburger { display: flex; }
  .nav-inner { position: relative; }

  .form-grid { grid-template-columns: 1fr; }
  .form-container { padding: 2rem 1.25rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .post-grid { grid-template-columns: 1fr; }
  .hero { padding: 4rem 1.5rem 3rem; }
  .section { padding: 3rem 1.5rem; }
}

/* ─── Share button on cards ─── */
.share-btn-card {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 0.22rem 0.65rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.share-btn-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-pale);
}

/* Make entire card a pointer — already set via onclick but ensures visual */
.post-card {
  cursor: pointer;
}
/* Prevent text-select on card click */
.post-card { user-select: none; }
/* But allow selecting inside the body text via normal reading */
.post-card-body p, .post-card-excerpt { user-select: text; }
