/* =============================================
   MatrimonialToday Q&A — style.css
   Clean Red + White theme, fully responsive
   ============================================= */

/* ---- CSS Variables ---- */
:root {
  --red:        #c0392b;
  --red-dark:   #a93226;
  --red-light:  #e74c3c;
  --red-pale:   #fdf2f0;
  --red-border: #f5c6c0;
  --white:      #ffffff;
  --bg:         #f7f8fa;
  --gray-100:   #f1f3f5;
  --gray-200:   #e9ecef;
  --gray-300:   #dee2e6;
  --gray-400:   #adb5bd;
  --gray-500:   #868e96;
  --gray-600:   #495057;
  --gray-800:   #212529;
  --text:       #1a1a2e;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 4px rgba(0,0,0,.07);
  --shadow:     0 4px 20px rgba(0,0,0,.09);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.13);
  --transition: .22s ease;
  --header-h:   66px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { border: none; background: none; cursor: pointer; font: inherit; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--red);
  height: var(--header-h);
  transition: box-shadow var(--transition);
}
.site-header.scrolled {
  box-shadow: 0 2px 20px rgba(192,57,43,.15);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-img-title {
  height: 40px;
  width: auto;
  object-fit: contain;
}
.logo-fallback {
  display: none; /* shown via JS if image fails */
  align-items: center;
  gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.logo-heart { color: var(--red); font-size: 20px; }
.logo-qa {
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  letter-spacing: .5px;
}

/* Search */
.search-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
}
.search-wrap form {
  display: flex;
  align-items: center;
  background: var(--gray-100);
  border: 1.5px solid var(--gray-200);
  border-radius: 50px;
  padding: 0 6px 0 38px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-wrap form:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,57,43,.12);
  background: var(--white);
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 13px;
  pointer-events: none;
}
.search-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 8px;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
  min-width: 0;
}
.search-wrap input::placeholder { color: var(--gray-400); }
.search-btn {
  background: var(--red);
  color: #fff;
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.search-btn:hover { background: var(--red-dark); }

/* Search suggestions */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 200;
  overflow: hidden;
}
.search-suggestions.visible { display: block; }
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: var(--gray-600);
  cursor: pointer;
  transition: background var(--transition);
}
.suggestion-item:hover { background: var(--red-pale); color: var(--red); }
.suggestion-item .fa-search { color: var(--gray-400); font-size: 11px; flex-shrink: 0; }
.si-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-visit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--red);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-visit:hover {
  background: var(--red);
  color: #fff;
}

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* Mobile nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px 16px;
  background: var(--white);
  border-top: 1px solid var(--gray-100);
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-600);
  transition: background var(--transition);
}
.mobile-nav-link:hover { background: var(--red-pale); color: var(--red); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,.85);
  margin-top: auto;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 52px 24px 36px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
}
.footer-brand {}
.footer-logo-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  text-decoration: none;
}
.footer-logo-img {
  height: 52px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 8px;
  padding: 6px 10px;
  display: block;
}
.footer-logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}
.footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  line-height: 1.6;
  margin-bottom: 18px;
}
.footer-social {
  display: flex;
  gap: 8px;
}
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.35);
  color: #ffffff;
  font-size: 14px;
  transition: all var(--transition);
  background: rgba(255,255,255,.08);
}
.social-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Footer columns */
.footer-links-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 14px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--red-light); }

/* Footer bottom */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
  padding: 18px 24px;
  font-size: 12.5px;
  color: rgba(255,255,255,.35);
}
.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: var(--red-light); }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  border: 1.5px solid transparent;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  box-shadow: 0 4px 14px rgba(192,57,43,.35);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border-color: var(--gray-300);
  color: var(--gray-600);
}
.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-pale);
}
.btn-sm { padding: 7px 15px; font-size: 12.5px; }

/* ============================================
   LAYOUT / CONTAINER
   ============================================ */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding: 28px 0 48px;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--red) 0%, #8b1a1a 100%);
  color: #fff;
  padding: 56px 24px 52px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { position: relative; }
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.2;
  margin-bottom: 14px;
  font-weight: 700;
}
.hero-sub {
  font-size: 15px;
  opacity: .85;
  max-width: 520px;
  margin: 0 auto 26px;
}
.hero-cta { margin-bottom: 36px; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  font-size: 30px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  line-height: 1;
}
.hero-stat-label { font-size: 12px; opacity: .7; margin-top: 4px; }

/* ============================================
   QUESTION CARDS
   ============================================ */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.questions-list { display: flex; flex-direction: column; gap: 12px; }
.q-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 22px;
  transition: all var(--transition);
  display: block;
  text-decoration: none;
  color: inherit;
}
.q-card:hover {
  border-color: var(--red-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.q-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
  line-height: 1.45;
}
.q-card:hover .q-title { color: var(--red); }
.q-excerpt {
  font-size: 13.5px;
  color: var(--gray-500);
  line-height: 1.6;
  margin-bottom: 12px;
}
.q-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.q-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--gray-400);
}
.q-meta-item.answers { color: var(--red); }
.q-badge {
  background: var(--red-pale);
  color: var(--red);
  border: 1px solid var(--red-border);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 600;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.sidebar-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-title .icon { color: var(--red); }
.ask-card {
  background: linear-gradient(135deg, #fff5f4, var(--white));
  border-color: var(--red-border);
}
.ask-card p { font-size: 13px; color: var(--gray-500); margin-bottom: 14px; }
.ask-card .btn {
  width: 100%;
  justify-content: center;
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.ask-card .btn:hover { background: var(--red-dark); }
.tags-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  transition: all var(--transition);
  cursor: pointer;
}
.tag:hover { background: var(--red-pale); border-color: var(--red-border); color: var(--red); }
.recent-ans { display: flex; flex-direction: column; gap: 10px; }
.recent-ans li {
  font-size: 12.5px;
  color: var(--gray-500);
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  line-height: 1.5;
}
.recent-ans li:hover { background: var(--red-pale); }
.recent-ans strong {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}

/* ============================================
   QUESTION DETAIL
   ============================================ */
.detail-layout {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--gray-400);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--red); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--gray-300); }
.q-detail-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 24px;
}
.q-detail-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}
.q-detail-content {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.75;
  white-space: pre-line;
  margin-bottom: 20px;
}
.q-detail-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-100);
}
.views-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--gray-400);
}
.share-group { display: flex; align-items: center; gap: 8px; }
.share-label { font-size: 12px; color: var(--gray-400); }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--white);
}
.share-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-pale); }

/* Answers */
.answers-section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px 28px;
}
.answers-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-100);
}
.answers-count {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
}
.answers-count span { color: var(--red); }
.answer-card {
  border-bottom: 1px solid var(--gray-100);
  padding: 20px 0;
}
.answer-card:last-of-type { border-bottom: none; }
.answer-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.author-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
}
.author-name { font-weight: 600; font-size: 14px; }
.author-time { font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.answer-text { font-size: 14.5px; color: var(--gray-600); line-height: 1.75; white-space: pre-line; }

/* Write answer form */
.write-answer {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px solid var(--gray-100);
}
.write-answer-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.write-answer-title .icon { color: var(--red); }

/* ============================================
   ASK PAGE
   ============================================ */
.ask-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.page-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 32px 34px;
}
.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}
.page-sub {
  color: var(--gray-500);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group { margin-bottom: 22px; }
.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}
.form-label span { color: var(--red); }
.form-input, .form-textarea {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(192,57,43,.1);
}
.form-textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.char-count { font-size: 11.5px; color: var(--gray-400); text-align: right; margin-top: 4px; }
.char-count.warn { color: var(--red); }
.form-tip {
  background: var(--red-pale);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 8px;
}
.form-submit {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
}
.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--red);
  color: var(--red);
}
.page-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.page-btn.disabled { opacity: .4; pointer-events: none; }
.page-dots { color: var(--gray-400); padding: 0 4px; }

/* ============================================
   ALERTS / TOAST
   ============================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-error   { background: #fff5f4; border: 1px solid var(--red-border); color: var(--red); }
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: toastIn .3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity .3s, transform .3s;
}
.toast.success { background: #1a7a3c; }
.toast.error { background: var(--red-dark); }
@keyframes toastIn {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ============================================
   FLOATING ACTION BUTTON
   ============================================ */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 20px rgba(192,57,43,.45);
  z-index: 90;
  transition: all var(--transition);
  text-decoration: none;
}
.fab:hover { background: var(--red-dark); transform: scale(1.08); }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state { text-align: center; padding: 56px 20px; color: var(--gray-500); }
.empty-icon { font-size: 44px; color: var(--gray-300); margin-bottom: 16px; }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ============================================
   SEARCH RESULT HEADER
   ============================================ */
.search-header { background: var(--white); border-bottom: 1px solid var(--gray-200); padding: 20px 24px; }
.search-query { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
@keyframes fadeUp  { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideIn { from { opacity:0; transform:translateX(16px); } to { opacity:1; transform:translateX(0); } }

.anim-fadein  { animation: fadeIn  .45s ease both; }
.anim-fadeup  { animation: fadeUp  .45s ease both; }
.anim-slide   { animation: slideIn .4s ease both; }

.stagger > *:nth-child(1)  { animation-delay: .04s; }
.stagger > *:nth-child(2)  { animation-delay: .08s; }
.stagger > *:nth-child(3)  { animation-delay: .12s; }
.stagger > *:nth-child(4)  { animation-delay: .16s; }
.stagger > *:nth-child(5)  { animation-delay: .20s; }
.stagger > *:nth-child(6)  { animation-delay: .24s; }
.stagger > *:nth-child(7)  { animation-delay: .28s; }
.stagger > *:nth-child(8)  { animation-delay: .32s; }
.stagger > *:nth-child(9)  { animation-delay: .36s; }
.stagger > *:nth-child(10) { animation-delay: .40s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-links-group { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --header-h: 58px; }
  .header-actions { display: none; }
  .hamburger { display: flex; }
  .search-wrap { max-width: none; }
  .btn-visit span { display: none; }
  .q-detail-card { padding: 20px 18px; }
  .answers-section { padding: 18px 16px; }
  .page-card { padding: 22px 18px; }
  .ask-page, .detail-layout { padding: 18px 14px 48px; }
  .fab { display: flex; }
  .footer-links-group { grid-template-columns: 1fr; }
  .hero { padding: 40px 18px 36px; }
  .hero-stats { gap: 20px; }
}

@media (max-width: 480px) {
  .search-btn { padding: 6px 10px; font-size: 12px; }
  .form-submit { flex-direction: column-reverse; }
  .form-submit .btn { width: 100%; justify-content: center; }
  .q-detail-footer { flex-direction: column; align-items: flex-start; }
  .footer-inner { padding: 36px 16px 24px; }
}
/* ============================================
   PRELOADER
   ============================================ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s ease, visibility .4s ease;
}
#preloader.preloader-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: preloaderPop .5s ease both;
}
@keyframes preloaderPop {
  from { opacity: 0; transform: scale(.88); }
  to   { opacity: 1; transform: scale(1); }
}
.preloader-logo {
  width: 180px;
  height: auto;
  max-height: 100px;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(192,57,43,.18));
  animation: preloaderPulse 1.6s ease-in-out infinite;
}
@keyframes preloaderPulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(1.04); opacity: .88; }
}
.preloader-bar {
  width: 200px;
  height: 4px;
  background: #f1f3f5;
  border-radius: 99px;
  overflow: hidden;
}
.preloader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #c0392b, #e74c3c);
  border-radius: 99px;
  transition: width .25s ease;
}
.preloader-text {
  font-size: 13px;
  color: #adb5bd;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: .5px;
}

/* ============================================
   ANSWER PAGE — (was inline in question.php)
   ============================================ */
.answer-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--red-pale);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  margin-left: auto;
}
.answer-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.helpful-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--transition);
}
.helpful-btn:hover  { border-color: var(--red); color: var(--red); }
.helpful-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
/* ===== IMAGE UPLOAD ZONE ===== */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  background: #fafafa;
  transition: border-color var(--transition), background var(--transition);
  overflow: hidden;
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--red);
  background: #fff5f5;
}
.upload-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 20px;
  cursor: pointer;
}
.upload-icon { font-size: 36px; color: var(--red); opacity: .7; }
.upload-text  { font-size: 14px; font-weight: 600; color: var(--gray-700); }
.upload-hint  { font-size: 12px; color: var(--gray-400); }

/* Preview grid */
.img-preview-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 14px;
}
.img-preview-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
}
.img-preview-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}
.img-remove-btn {
  position: absolute;
  top: 5px; right: 5px;
  background: rgba(0,0,0,.65);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 22px; height: 22px;
  font-size: 11px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.img-remove-btn:hover { background: var(--red); }
.img-name {
  font-size: 10px;
  color: var(--gray-500);
  text-align: center;
  padding: 4px 6px;
  background: var(--gray-100);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== QUESTION IMAGE DISPLAY ===== */
.q-images-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.q-img-thumb {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--gray-200);
  transition: transform .2s, border-color .2s;
  flex: 0 0 auto;
}
.q-img-thumb img {
  width: 160px;
  height: 120px;
  object-fit: cover;
  display: block;
}
.q-img-thumb:hover { transform: scale(1.03); border-color: var(--red); }
.q-img-zoom {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.q-img-thumb:hover .q-img-zoom { opacity: 1; }
@media (max-width: 600px) {
  .q-img-thumb img { width: 120px; height: 90px; }
}

/* ===== LIGHTBOX ===== */
.img-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.img-lightbox.open { display: flex; }
.img-lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0,0,0,.5);
  object-fit: contain;
}
.lightbox-close {
  position: absolute;
  top: 18px; right: 22px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-close:hover { background: var(--red); }