/* ═══ NamePedia — main.css (non-critical, loaded async) ══════════════════════
   Critical above-fold CSS is inlined in layout.php.
   This file covers sections, components and responsive breakpoints.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Name search form ────────────────────────────────────────────────────────── */
.name-search {
  display: flex;
  gap: .5rem;
  margin: 1.5rem auto 0;
  max-width: 520px;
  width: 100%;
}
.name-search__input {
  flex: 1;
  padding: .75rem 1rem;
  font-size: 1.05rem;
  border: 2px solid var(--c-border);
  border-radius: var(--r);
  background: #fff;
  color: var(--c-text);
  outline: none;
  transition: border-color .2s;
}
.name-search__input:focus {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.name-search__btn {
  padding: .75rem 1.5rem;
  background: var(--c-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.name-search__btn:hover { background: #1d4ed8; }
@media (max-width: 480px) {
  .name-search { flex-direction: column; }
  .name-search__btn { width: 100%; }
}

/* ── Name card image ────────────────────────────────────────────────────────── */
.name-card-fig {
  margin: 1rem 0 1.25rem;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(37,99,235,0.15);
  max-width: 600px;
}
.name-card-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

/* ── Name intro paragraph ────────────────────────────────────────────────────── */
.name-section--intro {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.name-intro {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
  background: var(--c-surface);
  border-left: 4px solid var(--c-accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--r) var(--r) 0;
}

/* ── Numerology grid ─────────────────────────────────────────────────────────── */
.numerology-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}
@media (max-width: 640px) {
  .numerology-grid { grid-template-columns: 1fr; }
}
.num-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1rem;
}
.num-badge {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--c-accent);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.num-badge--soul { background: #7c3aed; }
.num-badge--pers { background: #0891b2; }
.num-info { flex: 1; }
.num-info strong { display: block; font-size: .85rem; margin-bottom: .3rem; }
.num-info p { font-size: .82rem; color: var(--c-muted); line-height: 1.5; margin: 0; }
.numerology-disclaimer { font-size: .75rem; color: var(--c-muted); margin-top: .5rem; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  margin-top: 3rem;
  padding: 2rem 1rem;
  font-size: .875rem;
  color: var(--c-muted);
}
.site-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer nav a { color: var(--c-muted); }

/* ── Stats bar ─────────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 110px;
}
.stat-val { font-size: 1.2rem; font-weight: 700; color: var(--c-accent); }
.stat-lbl { font-size: .75rem; color: var(--c-muted); text-transform: uppercase;
            letter-spacing: .04em; }

/* ── Sections ──────────────────────────────────────────────────────────────── */
.name-section {
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}
.name-section:first-child { border-top: none; }
.name-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--c-text);
}
.name-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: .5rem;
}

/* ── Etymology grid ─────────────────────────────────────────────────────────── */
.etym-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) { .etym-grid { grid-template-columns: 1fr; } }

.etym-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
}
.origin-tag { margin-bottom: .5rem; }

/* ── Badge ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: .75rem;
  font-weight: 600;
  padding: .15rem .5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.lang-variants { font-size: .875rem; color: var(--c-muted); margin-top: .5rem; }

/* ── Geo bars ───────────────────────────────────────────────────────────────── */
.geo-bars { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.geo-row  { display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.geo-country { width: 130px; flex-shrink: 0; font-weight: 500; }
.geo-bar-wrap { flex: 1; background: var(--c-border); border-radius: 999px; height: 10px;
               overflow: hidden; }
.geo-bar-fill { display: block; height: 100%; background: var(--c-accent);
               border-radius: 999px; transition: width .3s; }
.geo-pct { width: 40px; text-align: right; color: var(--c-muted); font-size: .8rem; }

/* ── Trend chart ────────────────────────────────────────────────────────────── */
.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100px;
  margin-top: 1rem;
  padding: 0 .5rem;
  border-bottom: 2px solid var(--c-border);
}
.trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: .25rem;
}
.trend-bar {
  width: 100%;
  background: var(--c-accent);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height .3s;
}
.trend-label { font-size: .6rem; color: var(--c-muted); white-space: nowrap; }

/* ── Tags list ──────────────────────────────────────────────────────────────── */
.tags-list { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.tag {
  display: inline-block;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  padding: .2rem .7rem;
  font-size: .875rem;
}

/* ── Famous people ──────────────────────────────────────────────────────────── */
.famous-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.famous-item a {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  font-size: .9rem;
  transition: border-color .15s;
}
.famous-item a:hover { border-color: var(--c-accent); text-decoration: none; }
.external-icon { font-size: .75rem; color: var(--c-muted); }
.famous-disclaimer { font-size: .8rem; color: var(--c-muted); margin-top: .75rem; }

/* ── FAQ ────────────────────────────────────────────────────────────────────── */
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
}
.faq-q { font-weight: 700; margin-bottom: .5rem; font-size: .95rem; }
.faq-a { color: var(--c-muted); font-size: .9rem; line-height: 1.6; }

/* ── Sidebar widgets ────────────────────────────────────────────────────────── */
.widget-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--c-accent);
}
.related-widget { background: var(--c-surface); border-radius: var(--r); padding: 1rem; }
.related-list { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.related-list a { font-size: .9rem; }

/* Popular widget */
.popular-widget { margin-top: 1rem; }
.popular-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.popular-item a { font-size: .9rem; flex: 1; }
.popular-count { font-size: .75rem; color: var(--c-muted); white-space: nowrap; }

/* Trending badge */
.trending-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: .2em .55em;
  border-radius: 99px;
  vertical-align: middle;
  margin-left: .4rem;
  background: #ff4500;
  color: #fff;
  line-height: 1.4;
}
.trending-badge--warm { background: #e8a000; }

/* Searches stat card accent */
.stat-card--searches .stat-val { color: var(--c-accent); }
.stat-card--time .stat-val { color: var(--c-success); }

/* ── Hub pages ──────────────────────────────────────────────────────────────── */
.hub-hero { padding: 2rem 0 1.5rem; }
.hub-hero h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: .5rem; }
.hub-desc { color: var(--c-muted); margin-top: .5rem; max-width: 600px; }

/* A–Z grid */
.az-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: .5rem;
  margin: 1.5rem 0 2rem;
}
.az-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .75rem .5rem;
  border-radius: var(--r);
  border: 1px solid var(--c-border);
  text-decoration: none;
  transition: border-color .15s, background .15s;
}
.az-card--active { background: var(--c-bg); cursor: pointer; }
.az-card--active:hover { border-color: var(--c-accent); background: #eff6ff; text-decoration: none; }
.az-card--empty { background: var(--c-surface); cursor: default; opacity: .4; }
.az-letter { font-size: 1.4rem; font-weight: 800; color: var(--c-text); }
.az-card--active .az-letter { color: var(--c-accent); }
.az-count { font-size: .7rem; color: var(--c-muted); }

/* Names grid (letter hub) */
.names-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0;
}
.name-card { background: var(--c-surface); border: 1px solid var(--c-border);
             border-radius: var(--r); overflow: hidden; }
.name-card__link {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .75rem 1rem;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.name-card:hover { border-color: var(--c-accent); }
.name-card__link:hover { background: #eff6ff; text-decoration: none; }
.name-card__full { font-weight: 600; color: var(--c-text); }
.name-card__origin { font-size: .75rem; color: var(--c-muted); }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.pagination__btn {
  display: inline-block;
  padding: .5rem 1.25rem;
  background: var(--c-accent);
  color: #fff;
  border-radius: var(--r);
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  transition: background .15s;
}
.pagination__btn:hover { background: var(--c-accent-dk); text-decoration: none; color: #fff; }
.pagination__btn--disabled {
  background: var(--c-surface);
  color: var(--c-muted);
  border: 1px solid var(--c-border);
  cursor: default;
}
.pagination__info { font-size: .9rem; color: var(--c-muted); }

/* ── Empty state ────────────────────────────────────────────────────────────── */
.empty-state { color: var(--c-muted); padding: 2rem; text-align: center; }

/* ── RTL overrides (Arabic) ─────────────────────────────────────────────────── */
[dir="rtl"] .stats-bar,
[dir="rtl"] .geo-row,
[dir="rtl"] .tags-list { flex-direction: row-reverse; }
[dir="rtl"] .content-grid { direction: rtl; }
[dir="rtl"] .site-nav { margin-left: 0; margin-right: auto; }

/* ── Name meaning highlight ─────────────────────────────────────────────────── */
.name-meaning {
  font-size: .9rem;
  color: var(--c-text);
  background: #eff6ff;
  border-left: 3px solid var(--c-accent);
  padding: .4rem .75rem;
  border-radius: 0 var(--r) var(--r) 0;
  margin-bottom: .5rem;
}

/* ── Ad wrapper (label + slot) ──────────────────────────────────────────────── */
.ad-wrap {
  margin: 1.5rem 0;
  text-align: center;
}
.ad-label {
  display: block;
  font-size: .65rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .25rem;
  opacity: .7;
}

/* ── Sidebar sticky wrapper ─────────────────────────────────────────────────── */
.sidebar-sticky {
  position: sticky;
  top: 72px;          /* just below the sticky site-header (~60px) + gap */
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
@media (max-width: 800px) {
  .sidebar-sticky { position: static; }
}
