/* ============================================================
   Prompt Gallery — Main Stylesheet
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary:        #7C3AED;
  --primary-light:  #8B5CF6;
  --primary-dark:   #6D28D9;
  --accent:         #EC4899;
  --accent2:        #06B6D4;
  --success:        #10B981;
  --warning:        #F59E0B;
  --danger:         #EF4444;

  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.12);
  --shadow:     0 4px 16px rgba(0,0,0,.15);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.25);

  --transition: 0.2s ease;
  --font:       'Inter', system-ui, sans-serif;

  /* Light theme (default) */
  --bg:         #F5F3FF;
  --bg2:        #FFFFFF;
  --surface:    #FFFFFF;
  --surface2:   #F3F4F6;
  --text:       #1A1A2E;
  --text2:      #4B5563;
  --text3:      #9CA3AF;
  --border:     #E5E7EB;
  --header-bg:  rgba(255,255,255,0.9);
  --card-hover: #F0EDFF;
}

[data-theme="dark"] {
  --bg:         #0D0D1A;
  --bg2:        #13131F;
  --surface:    #1A1A2E;
  --surface2:   #1F1F32;
  --text:       #E2E8F0;
  --text2:      #9CA3AF;
  --text3:      #6B7280;
  --border:     #2D2D45;
  --header-bg:  rgba(13,13,26,0.9);
  --card-hover: #22223A;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;          /* safety net against accidental horizontal scroll */
  max-width: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul { list-style: none; }
input, textarea, select { font-family: inherit; }

/* ---------- Utility ---------- */
.container { max-width: 1320px; margin: 0 auto; padding: 0 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.mt-2 { margin-top: .5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.gap-4 { gap: 1rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.4rem; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600;
  transition: all var(--transition); cursor: pointer; border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,58,237,.4); }
.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--card-hover); }
.btn-accent {
  background: linear-gradient(135deg, var(--accent), #DB2777);
  color: #fff;
}
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(236,72,153,.4); }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: .4rem .9rem; font-size: .8rem; }
.btn-icon { padding: .6rem; border-radius: 50%; }

/* ---------- Site Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  height: 64px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: .6rem; }
.logo-icon { width: 36px; height: 36px; flex-shrink: 0; }
.logo-img { height: 44px; width: auto; display: block; flex-shrink: 0; }
.logo-img-footer { height: 56px; }
.logo-text { font-size: 1.1rem; font-weight: 700; color: var(--text); white-space: nowrap; }
@media (max-width: 480px) { .logo-img { height: 38px; } }
.logo-text strong { color: var(--primary); }

/* Main nav */
.main-nav { display: flex; align-items: center; gap: .25rem; flex: 0 0 auto; }
.nav-link {
  display: flex; align-items: center; gap: .25rem;
  padding: .45rem .75rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: var(--text2);
  transition: all var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--primary); background: rgba(124,58,237,.1); }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-toggle { background: none; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 220px; max-height: 380px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: .5rem; display: none; z-index: 200;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(-8px);
  transition: opacity .2s, transform .2s;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
  opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0);
}
.dropdown-item {
  display: flex; align-items: center; gap: .4rem;
  padding: .45rem .65rem; border-radius: var(--radius-sm);
  font-size: .82rem; color: var(--text2);
  transition: all var(--transition);
  white-space: nowrap;
}
.dropdown-item:hover { background: var(--card-hover); color: var(--primary); }
.cat-icon { font-size: 1rem; }

/* Header search */
.header-search { flex: 1 1 auto; min-width: 0; max-width: 380px; position: relative; }
.search-form { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: .75rem; width: 16px; height: 16px; color: var(--text3); pointer-events: none; }
.search-input {
  width: 100%; padding: .55rem .75rem .55rem 2.25rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); font-size: .875rem; color: var(--text);
  transition: all var(--transition);
}
.search-input:focus { outline: none; border-color: var(--border); background: var(--surface2); box-shadow: none; }
.search-suggestions {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; z-index: 300;
  display: none;
}
.search-suggestions.active { display: block; }
.suggestion-item {
  padding: .6rem 1rem; font-size: .875rem; color: var(--text2);
  cursor: pointer; transition: background var(--transition);
  display: flex; align-items: center; gap: .5rem;
}
.suggestion-item:hover { background: var(--card-hover); color: var(--primary); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: .35rem; flex-shrink: 0; }
.action-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--text2); transition: all var(--transition);
}
.action-btn:hover { background: var(--surface2); color: var(--primary); }
.action-btn svg { width: 20px; height: 20px; }
.fav-badge {
  position: absolute; top: 0; right: 0;
  background: var(--accent); color: #fff;
  font-size: .65rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }

/* Hamburger */
.hamburger { flex-direction: column; gap: 5px; display: none; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }

/* ---------- Mobile Nav ---------- */
.mobile-nav-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--surface); overflow-y: auto;
  transform: translateX(100%); transition: transform .3s ease;
}
.mobile-nav-overlay.open { transform: translateX(0); }
.mobile-nav-inner { padding: 1.5rem; }
.mobile-nav-close {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface2); color: var(--text);
  font-size: 1.1rem; margin-bottom: 1.5rem;
}
.mobile-nav-link {
  display: block; padding: .75rem .5rem;
  font-size: 1rem; font-weight: 500; color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}
.mobile-nav-link:hover { color: var(--primary); }
.mobile-nav-divider {
  padding: 1rem .5rem .5rem;
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text3);
}
.mobile-cat-link { font-size: .9rem; padding: .6rem .5rem; }

/* ---------- Sections ---------- */
.section { padding: 3.5rem 0; }
.section-sm { padding: 2rem 0; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.section-title {
  font-size: 1.5rem; font-weight: 800;
  display: flex; align-items: center; gap: .5rem;
}
.section-title .emoji { font-size: 1.3rem; }
.section-link { font-size: .875rem; color: var(--primary); font-weight: 600; }
.section-link:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--bg) 0%, rgba(124,58,237,.08) 50%, var(--bg) 100%);
  padding: 5rem 0 3.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(124,58,237,.15), transparent);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(1.6rem, 4.5vw, 3.25rem);
  font-weight: 800; line-height: 1.18;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 60%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 1rem;
}
.hero-sub { font-size: clamp(.95rem, 2.5vw, 1.15rem); color: var(--text2); max-width: 520px; margin: 0 auto 2rem; }
.hero-search {
  display: flex; align-items: center; gap: .75rem;
  max-width: 600px; width: 100%; margin: 0 auto;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-xl); padding: .5rem .5rem .5rem 1.25rem;
  box-shadow: var(--shadow-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-search:focus-within {
  border-color: var(--border);
  box-shadow: var(--shadow-lg);
}
.hero-search-input {
  flex: 1 1 auto; min-width: 0;   /* min-width:0 lets the input shrink — fixes mobile overflow */
  background: none; border: none; outline: none;
  font-size: 1rem; color: var(--text);
}
.hero-search .btn { flex-shrink: 0; }
.hero-search-input::placeholder { color: var(--text3); }
.hero-pills {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem;
  margin-top: 1.25rem;
}
.hero-pill {
  padding: .35rem .9rem; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: .8rem; color: var(--text2); cursor: pointer;
  transition: all var(--transition);
}
.hero-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.hero-stats {
  display: flex; justify-content: center; gap: 2rem;
  margin-top: 2.5rem;
}
.hero-stat { text-align: center; }
.hero-stat-num { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.hero-stat-label { font-size: .8rem; color: var(--text3); }

/* ---------- Prompt Grid (cards scaled 1.4×) ---------- */
/* Cards support per-image aspect ratio (1448×1086 = 4:3, 1200×628 = ~16:9). */
/* v3 — true CSS Grid (3 fixed cols on desktop). Images keep natural aspect ratio. */
.prompt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;            /* cards keep their own height — no forced stretch */
}
.prompt-grid .prompt-card { width: 100%; margin-bottom: 0; }

/* 3 columns down to 768px; 2 on tablet; 1 on phone */
@media (max-width: 768px) { .prompt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; } }
@media (max-width: 480px) { .prompt-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Professional Prompt Card  (Dribbble / Behance style)
   ============================================================ */
.prompt-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  break-inside: avoid; margin-bottom: 1rem;
}
.prompt-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,.22);
  border-color: rgba(124,58,237,.35);
}

/* ── Image wrap ─────────────────────── */
.pc-img-wrap {
  position: relative; overflow: hidden;
  background: var(--surface2);   /* no fixed ratio — height follows the image */
}
.pc-img-link { display: block; width: 100%; }
.pc-img {
  width: 100%; height: auto; display: block;   /* full image, natural aspect ratio */
  transition: transform .5s cubic-bezier(.25,.46,.45,.94);
}
.prompt-card:hover .pc-img { transform: scale(1.07); }

/* ── Category badge on image ────────── */
.pc-cat-badge {
  position: absolute; bottom: 10px; left: 10px;
  padding: .28rem .72rem;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff; font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  border-radius: 999px; text-decoration: none;
  transition: background .2s;
}
.pc-cat-badge:hover { background: rgba(124,58,237,.8); }

/* ── Prompt ID badge on image (top-left) ── */
.pc-id-badge {
  position: absolute; top: 10px; left: 10px;
  padding: .2rem .5rem;
  font-size: .7rem; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  color: #fff; background: rgba(17,24,39,.72);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px; pointer-events: none;
}

/* ── Fav button on image corner ─────── */
.pc-fav-btn {
  position: absolute; top: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; cursor: pointer;
}
.pc-fav-btn:hover    { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.1); }
.pc-fav-btn.favorited { background: var(--accent); border-color: var(--accent); color: #fff; }
.pc-fav-btn.favorited svg { fill: #fff; }

/* ── Card body ──────────────────────── */
.pc-body { padding: .75rem .85rem .4rem; flex: 1; }
.pc-title {
  font-size: .92rem; font-weight: 700; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin: 0;
  /* Always reserve 2 lines so 1-line and 2-line titles align across the row */
  min-height: calc(1.4em * 2);
}
.pc-title a { color: inherit; text-decoration: none; }
.pc-title a:hover { color: var(--primary); }

.pc-meta {
  display: flex; align-items: center; gap: .75rem;
  margin-top: .45rem;
}
.pc-stat {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .72rem; color: var(--text3); font-weight: 500;
}
.pc-stat svg { opacity: .6; }

/* Like (heart) button on card */
.pc-like-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .15rem .55rem;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text3); font-size: .72rem; font-weight: 600;
  border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.pc-like-btn:hover {
  background: rgba(236,72,153,.12);
  border-color: var(--accent);
  color: var(--accent);
}
.pc-like-btn.liked {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.pc-like-btn.liked svg { fill: #fff; }
.pc-like-btn.bump { animation: heart-bump .35s ease; }
@keyframes heart-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ── Card footer / CTA ──────────────── */
.pc-footer {
  display: flex; align-items: center; gap: .45rem;
  padding: .5rem .85rem .75rem;
}
.pc-copy-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem .75rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; border-radius: 9px;
  font-size: .8rem; font-weight: 700; text-decoration: none;
  transition: all .2s; white-space: nowrap; letter-spacing: .01em;
  box-shadow: 0 2px 8px rgba(124,58,237,.25);
}
.pc-copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124,58,237,.45);
  filter: brightness(1.08);
}

.pc-share-btn {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; cursor: pointer;
}
.pc-share-btn:hover {
  background: rgba(124,58,237,.1);
  border-color: var(--primary); color: var(--primary);
  transform: scale(1.06);
}

/* Difficulty / NSFW badges (top-left on image) */
.pc-badges {
  position: absolute; top: 10px; left: 10px;
  display: flex; flex-direction: column; gap: 5px;
  z-index: 2; pointer-events: none;
}
.pc-diff-badge {
  display: inline-block; padding: .2rem .6rem;
  color: #fff; font-size: .65rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* FAQ section (visible + Schema.org structured) */
.faq-section {
  max-width: 780px; margin: 3rem auto 2rem;
  padding: 1.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px;
}
.faq-title {
  font-size: 1.25rem; font-weight: 800; margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: .5rem;
}
.faq-title::before { content: '❓'; }
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: .85rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--text);
  padding: .4rem 0; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::after {
  content: '+'; font-size: 1.4rem; font-weight: 300; color: var(--primary);
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-answer { padding: .6rem 0 .4rem; color: var(--text2); font-size: .9rem; line-height: 1.65; }

/* Category page: main grid + sidebar (responsive) */
.cat-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2.5rem;
  align-items: start;
}
.cat-sidebar { position: sticky; top: 80px; }
@media (max-width: 900px) {
  .cat-layout { grid-template-columns: 1fr; gap: 1.75rem; }
  .cat-sidebar { position: static; }
}

/* Auto internal links inside SEO content blocks */
.auto-link { color: var(--primary); text-decoration: none; border-bottom: 1px dotted var(--primary); }
.auto-link:hover { border-bottom-style: solid; }

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed; bottom: 1.75rem; right: 1.5rem; z-index: 400;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(124,58,237,.45);
  display: none;          /* fully hidden until JS adds .visible */
  cursor: pointer; border: none;
  transition: transform .2s, background .2s;
}
.back-to-top.visible { display: flex; }
.back-to-top:hover   { background: var(--primary-dark); transform: translateY(-2px); }
.back-to-top svg     { width: 18px; height: 18px; }

/* ---------- Load More ---------- */
.load-more-wrap {
  display: flex; justify-content: center; padding: 2rem 0;
}
.load-more-btn {
  padding: .75rem 2.5rem; border-radius: var(--radius-lg);
  background: var(--surface); border: 2px solid var(--border);
  color: var(--text); font-size: .95rem; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: .5rem;
}
.load-more-btn:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(124,58,237,.06);
}
.load-more-btn:disabled { opacity: .5; cursor: not-allowed; }
.load-more-btn .spinner-sm {
  width: 16px; height: 16px; border: 2px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .6s linear infinite; display: none;
}
.load-more-btn.loading .spinner-sm { display: block; }
.load-more-btn.loading span       { display: none; }

/* ---------- Prompt count chip ---------- */
.result-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .9rem; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--text2);
  margin-bottom: 1.25rem;
}

/* ---------- Skeleton Loader ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--card-hover) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton-card { height: 280px; }
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }

/* ---------- Category Cards ---------- */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.category-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  display: block; text-decoration: none;
}
.category-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,.2);
}
.category-card-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--surface2);
}
.category-card-thumb .cat-thumb-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease;
}
.category-card:hover .cat-thumb-img { transform: scale(1.06); }
.cat-thumb-gen {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.cat-thumb-gen span {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}
.category-card-body { padding: .75rem .9rem 1rem; }
.category-card-name { font-weight: 700; font-size: .9rem; color: var(--text); }
.category-card-count { font-size: .72rem; color: var(--text3); margin-top: .2rem; }

/* ---------- Tag Cloud ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag-pill {
  padding: .35rem .9rem; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: .8rem; color: var(--text2); transition: all var(--transition);
}
.tag-pill:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.tag-pill.lg { font-size: .95rem; padding: .45rem 1.1rem; }
.tag-pill.sm { font-size: .7rem; padding: .25rem .65rem; }

/* ---------- Collections Carousel ---------- */
.collections-scroll {
  display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.collection-card {
  flex: 0 0 240px; border-radius: var(--radius-lg); overflow: hidden;
  position: relative; scroll-snap-align: start; transition: transform var(--transition);
}
.collection-card:hover { transform: scale(1.03); }
.collection-card-img { width: 100%; height: 160px; object-fit: cover; background: var(--surface2); }
.collection-card-body {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8), transparent);
  padding: 1.25rem .9rem .75rem;
}
.collection-card-title { font-size: .95rem; font-weight: 700; color: #fff; }
.collection-card-count { font-size: .75rem; color: rgba(255,255,255,.7); }

/* ---------- Prompt Detail ---------- */
.prompt-detail-layout {
  display: grid; grid-template-columns: 1fr 420px; gap: 2.5rem;
  align-items: start; padding: 2.5rem 0;
}
.prompt-detail-image-wrap { position: sticky; top: 80px; }
.prompt-detail-image {
  width: 100%; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.prompt-detail-image img { width: 100%; display: block; object-fit: cover; }
.image-gallery {
  display: flex; gap: .5rem; margin-top: .75rem;
}
.gallery-thumb {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  object-fit: cover; cursor: pointer; opacity: .6;
  transition: opacity var(--transition); border: 2px solid transparent;
}
.gallery-thumb:hover, .gallery-thumb.active { opacity: 1; border-color: var(--primary); }
.prompt-detail-body { display: flex; flex-direction: column; gap: 1.25rem; }
.prompt-detail-title {
  font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; line-height: 1.2;
}
.prompt-stats {
  display: flex; gap: 1.25rem; flex-wrap: wrap;
}
.stat-item { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text2); }
.stat-item svg { width: 16px; height: 16px; }

/* ── Prompt ID badge (detail page) ── */
.prompt-id-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .1rem 0 .9rem; }
.prompt-id-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; font-size: .82rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary); background: rgba(124,58,237,.1);
  border: 1px solid rgba(124,58,237,.35);
  border-radius: 8px; cursor: pointer;
  transition: background .2s, transform .1s;
}
.prompt-id-badge:hover { background: rgba(124,58,237,.18); }
.prompt-id-badge:active { transform: scale(.97); }
.prompt-id-badge svg { width: 14px; height: 14px; }
.prompt-id-hint { font-size: .75rem; color: var(--text3); }
.prompt-text-box {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1rem 1rem 1.1rem;
  position: relative;
}
.prompt-text-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); margin-bottom: .5rem; }
.prompt-text { font-size: .925rem; line-height: 1.7; color: var(--text); white-space: pre-wrap; }
.copy-prompt-btn {
  position: absolute; top: .75rem; right: .75rem;
  padding: .4rem .85rem; background: var(--primary); color: #fff;
  border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600;
  transition: all var(--transition);
}
.copy-prompt-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.tags-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.detail-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.download-btn {
  display: flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: .85rem; font-weight: 600; color: var(--text);
  transition: all var(--transition);
}
.download-btn:hover { background: var(--card-hover); border-color: var(--primary); color: var(--primary); }
.report-link { font-size: .78rem; color: var(--text3); cursor: pointer; }
.report-link:hover { color: var(--danger); }
.prev-next-nav { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.nav-arrow {
  display: flex; align-items: center; gap: .5rem;
  font-size: .85rem; color: var(--text2); transition: color var(--transition);
  max-width: 45%;
}
.nav-arrow:hover { color: var(--primary); }
.nav-arrow.next { flex-direction: row-reverse; text-align: right; }


/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(120%);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; padding: .7rem 1.5rem;
  border-radius: 999px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 8px 24px rgba(124,58,237,.4);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  z-index: 9000; white-space: nowrap;
  display: none;           /* fully hidden until JS adds .show */
  opacity: 0;
}
.toast.show { display: block; opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Share Sheet ---------- */
.share-sheet {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 900;
  background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.25rem 1.5rem 2rem;
  transform: translateY(100%); transition: transform .3s;
  box-shadow: var(--shadow-lg);
  display: none;          /* hidden until JS adds .open */
}
.share-sheet.open { display: block; transform: translateY(0); }
.share-backdrop {
  position: fixed; inset: 0; z-index: 850;
  background: rgba(0,0,0,.5); display: none;
}
.share-backdrop.open { display: block; }
.share-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.share-sheet-title { font-weight: 700; font-size: 1rem; }
.share-sheet-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.share-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .75rem;
}
.share-btn {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  padding: .75rem .5rem; border-radius: var(--radius);
  background: var(--surface2); border: 1px solid var(--border);
  font-size: .75rem; font-weight: 600; color: var(--text2);
  transition: all var(--transition); cursor: pointer;
}
.share-btn:hover { background: var(--card-hover); color: var(--primary); border-color: var(--primary); }
.share-btn-icon { font-size: 1.5rem; }

/* ---------- Search Page ---------- */
.search-filters {
  display: flex; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-select {
  padding: .5rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: .875rem; cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }
.search-result-count { font-size: .9rem; color: var(--text2); margin-bottom: 1.5rem; }
.search-result-count strong { color: var(--text); }
.related-searches { margin-top: 2.5rem; }
.related-searches h3 { font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.no-results {
  text-align: center; padding: 4rem 2rem;
}
.no-results-emoji { font-size: 4rem; margin-bottom: 1rem; }
.no-results h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: .5rem; }
.no-results p { color: var(--text2); margin-bottom: 1.5rem; }

/* ---------- Category / Tag / Collection Page Header ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--surface) 0%, rgba(124,58,237,.06) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
}
.page-hero-inner { display: flex; align-items: center; gap: 1.5rem; }
.page-hero-icon {
  width: 72px; height: 72px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; flex-shrink: 0;
}
.page-hero-title { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 800; }
.page-hero-desc { color: var(--text2); margin-top: .4rem; }
.page-hero-count { font-size: .85rem; color: var(--text3); margin-top: .25rem; }

/* ---------- Trending Filters ---------- */
.trending-filters {
  display: flex; gap: .5rem; margin-bottom: 1.75rem; flex-wrap: wrap;
}
.filter-btn {
  padding: .45rem 1rem; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: .85rem; font-weight: 600; color: var(--text2);
  transition: all var(--transition); cursor: pointer;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: .35rem; padding: 2.5rem 0 .5rem; flex-wrap: wrap;
}
.page-btn {
  min-width: 38px; padding: .5rem .85rem;
  border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: .875rem; font-weight: 600; color: var(--text2);
  text-align: center; text-decoration: none;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--card-hover); color: var(--primary); border-color: var(--primary); }
.page-btn.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
  pointer-events: none; box-shadow: 0 2px 8px rgba(124,58,237,.35);
}
.page-ellipsis {
  padding: .5rem .25rem; color: var(--text3); font-size: .9rem;
  user-select: none;
}
.page-info {
  text-align: center; padding: .5rem 0 1.25rem;
  font-size: .8rem; color: var(--text3);
}
.page-info strong { color: var(--text2); }

/* ---------- Breadcrumb ---------- */
.breadcrumb { margin-bottom: 1.25rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.bc-item { display: flex; align-items: center; gap: .25rem; font-size: .8rem; color: var(--text3); }
.bc-item a { color: var(--text2); }
.bc-item a:hover { color: var(--primary); }
.bc-current span { color: var(--text); }
.bc-sep { color: var(--text3); }

/* ---------- Newsletter ---------- */
.newsletter-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-xl); padding: 3rem 2rem;
  text-align: center; color: #fff; margin: 2rem 0;
}
.newsletter-section h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: .5rem; }
.newsletter-section p { opacity: .85; margin-bottom: 1.5rem; }
.newsletter-form-inline {
  display: flex; gap: .5rem; max-width: 440px; margin: 0 auto;
}
.newsletter-input {
  flex: 1; padding: .7rem 1.1rem;
  background: rgba(255,255,255,.2); border: 1.5px solid rgba(255,255,255,.4);
  border-radius: var(--radius-lg); color: #fff; font-size: .9rem;
}
.newsletter-input::placeholder { color: rgba(255,255,255,.65); }
.newsletter-input:focus { outline: none; background: rgba(255,255,255,.3); }

/* ---------- Loading Spinner ---------- */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes confetti-drop {
  0%   { transform: translateY(0) rotate(0deg);    opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}

/* ---------- Report Modal ---------- */
.report-modal {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.report-modal.open { opacity: 1; pointer-events: all; }
.report-modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 1.75rem; width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
}
.report-modal-box h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.report-modal-box textarea {
  width: 100%; padding: .75rem; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); resize: vertical; min-height: 100px;
  font-size: .875rem; margin-bottom: 1rem;
}
.report-modal-box textarea:focus { outline: none; border-color: var(--primary); }
.report-options { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.report-option { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .9rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 3.5rem 0 1.5rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem; margin-bottom: 2.5rem;
}
.footer-tagline { font-size: .875rem; color: var(--text2); margin: .75rem 0 1.25rem; line-height: 1.6; }
.footer-newsletter h4 { font-size: .875rem; font-weight: 700; margin-bottom: .6rem; }
.newsletter-form { display: flex; gap: .5rem; }
.newsletter-form .newsletter-input {
  flex: 1; padding: .5rem .9rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: .85rem;
}
.newsletter-form .newsletter-input:focus { outline: none; border-color: var(--primary); }
.footer-heading { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text3); margin-bottom: .9rem; }
.footer-links li + li { margin-top: .5rem; }
.footer-links a { font-size: .875rem; color: var(--text2); transition: color var(--transition); }
.footer-links a:hover { color: var(--primary); }
.footer-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.footer-tags .tag-pill { font-size: .75rem; padding: .25rem .65rem; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1.25rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  font-size: .8rem; color: var(--text3);
}

/* ---------- Prompt of the Day Banner ---------- */
.potd-banner {
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(236,72,153,.1));
  border: 1px solid rgba(124,58,237,.3);
  border-radius: var(--radius-xl); padding: 1.5rem; margin: 2rem 0;
  display: flex; gap: 1.5rem; align-items: center;
}
.potd-badge {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: .7rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; padding: .25rem .65rem; border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .prompt-detail-layout { grid-template-columns: 1fr; }
  .prompt-detail-image-wrap { position: static; }
  .main-nav { display: none; }
  .header-search { max-width: 260px; }
  .hamburger { display: flex; }
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-search { padding: .35rem .35rem .35rem 1rem; }
  .modal-inner { grid-template-columns: 1fr; }
  .modal-mobile-bar { display: flex; }
  .header-search { display: none; }
  .hero-stats { gap: 1rem 1.5rem; flex-wrap: wrap; }
  .section { padding: 2.5rem 0; }
  .newsletter-form-inline { flex-direction: column; }
  .potd-banner { flex-direction: column; text-align: center; }
  .potd-banner img { margin: 0 auto; }
  /* Category / page hero: stack image above text */
  .page-hero-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .page-hero { padding: 1.75rem 0; }
  /* Admin tables scroll horizontally instead of breaking layout */
  .admin-card { overflow-x: auto; }
}

@media (max-width: 480px) {
  .hero { padding: 2.25rem 0 2rem; }
  .hero-title { font-size: 1.55rem; line-height: 1.22; }
  .hero-sub { font-size: .92rem; }
  .hero-search { padding: .3rem .3rem .3rem .9rem; gap: .4rem; }
  .hero-search .btn { padding: .6rem 1rem; font-size: .85rem; }
  .hero-search-input { font-size: .9rem; }
  .hero-stat-num { font-size: 1.2rem; }
  .hero-stat-label { font-size: .72rem; }
  .detail-actions { flex-direction: column; }
  .detail-actions .btn { width: 100%; justify-content: center; }
  .section-title { font-size: 1.2rem; }
  .page-hero-title { font-size: 1.45rem; }
  .page-hero-desc { font-size: .88rem; }
  .breadcrumb ol { font-size: .78rem; }
  .prompt-detail-title { font-size: 1.3rem; }
}

@media (max-width: 360px) {
  .hero-title { font-size: 1.35rem; }
  .hero-sub { font-size: .85rem; }
  .hero-pill { font-size: .72rem; padding: .3rem .7rem; }
}

/* ============================================================
   Blog (article reader + listing cards)
   ============================================================ */
.blog-excerpt {
  font-size: .82rem; color: var(--text2); line-height: 1.5;
  margin-top: .3rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card .pc-title { -webkit-line-clamp: 3; min-height: 0; }

/* ── Article reader page ─────────────── */
.blog-article-wrap { padding: 1.5rem 0 3rem; }
.blog-article {
  max-width: 760px; margin: 0 auto;
}
.blog-article-header { margin-bottom: 1.75rem; }
.blog-article-title {
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  font-weight: 800; line-height: 1.2;
  letter-spacing: -.01em;
  margin: .5rem 0 1rem;
}
.blog-article-meta {
  display: flex; flex-wrap: wrap; gap: .5rem;
  font-size: .85rem; color: var(--text3);
  margin-bottom: 1rem;
}
.blog-updated { color: var(--success, #10B981); font-weight: 600; }
.blog-article-excerpt {
  font-size: 1.05rem; color: var(--text2);
  line-height: 1.6; font-weight: 500;
  padding: 1rem 1.25rem;
  background: var(--surface); border-left: 3px solid var(--primary);
  border-radius: 8px;
}
.blog-cover {
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius-lg); overflow: hidden;
}
.blog-cover img { width: 100%; height: auto; display: block; }

/* Article body — generous typography for readability */
.blog-content {
  font-size: 1.05rem; line-height: 1.75; color: var(--text);
  word-wrap: break-word;
}
.blog-content > * + * { margin-top: 1.1rem; }
.blog-content h2 {
  font-size: 1.55rem; font-weight: 800; line-height: 1.3;
  margin: 2.25rem 0 1rem; letter-spacing: -.01em;
}
.blog-content h3 {
  font-size: 1.25rem; font-weight: 700; line-height: 1.35;
  margin: 1.75rem 0 .75rem;
}
.blog-content h4 { font-size: 1.1rem; font-weight: 700; margin: 1.25rem 0 .5rem; }
.blog-content p { margin: 0 0 1rem; }
.blog-content a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.blog-content a:hover { color: var(--primary-dark, var(--primary)); filter: brightness(1.2); }
.blog-content ul, .blog-content ol { padding-left: 1.5rem; margin: 0 0 1.1rem; }
.blog-content li { margin-bottom: .4rem; }
.blog-content img {
  max-width: 100%; height: auto; border-radius: 10px;
  display: block; margin: 1.5rem auto;
}
.blog-content blockquote {
  margin: 1.5rem 0;
  padding: .9rem 1.25rem;
  border-left: 4px solid var(--primary);
  background: var(--surface);
  border-radius: 0 8px 8px 0;
  font-style: italic; color: var(--text2);
}
.blog-content pre {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem 1.15rem;
  font-size: .88rem; line-height: 1.55;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.blog-content code {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: .9em;
  background: var(--surface2); padding: .1em .35em; border-radius: 4px;
}
.blog-content pre code { background: transparent; padding: 0; }
.blog-content hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.blog-tags {
  margin: 2rem 0 1rem;
  font-size: .85rem;
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
}
.blog-share-row {
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}

/* Mobile fine-tuning for blog */
@media (max-width: 640px) {
  .blog-article-wrap { padding: .75rem 0 2rem; }
  .blog-article-excerpt { font-size: .98rem; padding: .85rem 1rem; }
  .blog-content { font-size: 1rem; line-height: 1.7; }
  .blog-content h2 { font-size: 1.35rem; margin-top: 1.75rem; }
  .blog-content h3 { font-size: 1.1rem; }
  .blog-cover { margin: 1.25rem 0 1.5rem; }
}

/* ============================================================
   WhatsApp floating button (admin-controlled)
   ============================================================ */
.wa-float-wrap {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 401;
  width: 56px; height: 56px;
}
.wa-float-pulse {
  position: absolute; inset: 0; width: 56px; height: 56px;
  border-radius: 50%; background: #25D366;
  animation: wa-pulse 2.4s ease-out infinite; pointer-events: none;
}
.wa-float {
  position: absolute; inset: 0; z-index: 1;       /* fills the wrap (56px desktop / 52px mobile) */
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #25D366; color: #fff; text-decoration: none;
  box-shadow: 0 6px 22px rgba(37,211,102,.45);
  transition: transform .2s, box-shadow .2s;
}
.wa-float:hover,
.wa-float:focus-visible { transform: scale(1.08); box-shadow: 0 10px 30px rgba(37,211,102,.6); }
.wa-float-icon { width: 32px; height: 32px; }
@keyframes wa-pulse {
  0%   { transform: scale(1);   opacity: .55; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}
/* When the WhatsApp button is present, lift the back-to-top above it */
.has-wa-float .back-to-top { bottom: 5.6rem; }

@media (max-width: 480px) {
  .wa-float-wrap { right: 1rem; bottom: 1rem; width: 52px; height: 52px; }
  .wa-float-pulse { width: 52px; height: 52px; }
  .wa-float-icon { width: 29px; height: 29px; }
  .has-wa-float .back-to-top { bottom: 5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-float-pulse { animation: none; opacity: 0; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ---------- Focus visible ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Selection ---------- */
::selection { background: rgba(124,58,237,.25); }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .modal-overlay, .toast, .share-sheet { display: none; }
}