/**
 * pages.css — أنماط الصفحات المساعدة: الصفحة الرئيسية ولوحة التحكم
 * (تُكمّل base.css و themes.css)
 */

/* ==================== أساسيات الأزرار ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-solid { background: var(--brand, #2f6b4f); color: var(--on-brand, #fff); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: #b3261e; color: #fff; }
.btn-add { background: var(--brand); color: var(--on-brand); }
.btn-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 0.35rem;
  font: inherit;
  font-size: 0.82rem;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.btn-mini:hover { border-color: var(--brand); color: var(--brand); }
.btn-mini.danger:hover { border-color: #b3261e; color: #b3261e; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

/* ==================== الصفحة الرئيسية ==================== */

.home-hero {
  position: relative;
  padding: clamp(3rem, 9vw, 6rem) 1.25rem clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--surface-2), transparent 60%),
    var(--bg);
}
.home-hero::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.home-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 6vw, 3.4rem);
  margin: 0.8rem 0 0.6rem;
  color: var(--brand);
}
.home-lead {
  max-width: 46rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  line-height: 1.9;
}
.home-mark {
  width: 84px;
  height: 84px;
  margin: 0 auto;
}
.home-mark svg { width: 100%; height: 100%; display: block; }
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.8rem;
}

.home-section { padding: clamp(2.5rem, 6vw, 4rem) 1.25rem; }
.home-section > .wrap { max-width: 1180px; margin: 0 auto; }
.home-subtitle {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin: 0 0 0.4rem;
  text-align: center;
}
.home-hint { text-align: center; color: var(--muted); margin: 0 0 2rem; }

.theme-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
}
.theme-card {
  border: 1px solid var(--line);
  border-radius: var(--radius, 16px);
  background: var(--surface);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm, 0 2px 10px rgba(0, 0, 0, 0.05));
}
.theme-card h3 { margin: 0.6rem 0 0.35rem; font-family: var(--font-head); font-size: 1.1rem; }
.theme-card p { margin: 0; color: var(--muted); font-size: 0.93rem; line-height: 1.8; }
.theme-swatches { display: flex; gap: 0.4rem; }
.theme-swatches i {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.site-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.site-tile {
  display: block;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius, 16px);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.site-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.12)); }
.site-tile strong { display: block; font-family: var(--font-head); font-size: 1.15rem; margin-bottom: 0.3rem; }
.site-tile span { color: var(--muted); font-size: 0.88rem; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.feature {
  border-inline-start: 3px solid var(--accent);
  padding: 0.4rem 1rem;
}
.feature h3 { margin: 0 0 0.3rem; font-family: var(--font-head); font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); line-height: 1.85; font-size: 0.94rem; }

.steps { counter-reset: step; display: grid; gap: 0.9rem; }
.step {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step::before {
  content: counter(step);
  flex: 0 0 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 700;
}
.step p { margin: 0; color: var(--muted); line-height: 1.85; }

/* ==================== لوحة التحكم ==================== */

.admin-page .site-header { position: sticky; top: 0; z-index: 40; }

.admin-main { max-width: 1180px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 4rem; }

.admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius, 16px);
  background: var(--surface);
  padding: clamp(1.1rem, 3vw, 1.8rem);
  box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,.05));
  max-width: 540px;
  display: grid;
  gap: 1rem;
}
.admin-card .btn-solid { justify-self: start; }

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 1.2rem;
}
.admin-toolbar input {
  flex: 1 1 260px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.1rem;
}
.site-card { max-width: none; gap: 0.55rem; }
.site-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.site-card-head .card-title { margin: 0; }
.site-card .card-text { font-size: 0.9rem; color: var(--muted); margin: 0; }
.site-link { margin: 0.2rem 0 0.4rem; }
.site-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.2rem; }
.site-actions .btn { padding: 0.5rem 0.8rem; font-size: 0.86rem; }

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}
.chip.is-active { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.admin-toolbar + .admin-grid { margin-top: 0; }
#achFilters .chip, .filters .chip { cursor: pointer; }