/* =====================================================
   HatLand — Base: fonts, tokens, reset, typography, buttons
   ===================================================== */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn-ExtraBold.woff2') format('woff2');
  font-weight: 800; font-style: normal; font-display: swap;
}

:root {
  /* رنگ‌ها — همه از طریق کاستومایزر قابل تغییر هستند (خروجی در <head>) */
  --hl-primary: #C2593B;
  --hl-primary-dark: #A34727;
  --hl-primary-soft: rgba(194, 89, 59, .09);
  --hl-ink: #211D19;
  --hl-ink-soft: #6E655B;
  --hl-bg: #FAF6F0;
  --hl-surface: #FFFFFF;
  --hl-line: #EAE2D8;
  --hl-accent: #D9A441;
  --hl-success: #3D8361;
  --hl-danger: #C0392B;

  --hl-radius: 14px;
  --hl-radius-lg: 22px;
  --hl-radius-sm: 9px;
  --hl-shadow: 0 10px 30px -12px rgba(33, 29, 25, .14);
  --hl-shadow-lg: 0 24px 60px -20px rgba(33, 29, 25, .22);
  --hl-container: 1240px;
  --hl-header-h: 84px;

  --hl-font: 'Vazirmatn', 'Tahoma', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--hl-font);
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--hl-ink);
  background: var(--hl-bg);
  overflow-x: hidden;
}
img, video, canvas, svg { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--hl-primary); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3, h4, h5, h6 { line-height: 1.55; font-weight: 800; color: var(--hl-ink); }
p { margin-block: 0 1em; }
p:last-child { margin-bottom: 0; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--hl-primary); color: #fff; }

:focus-visible { outline: 2px solid var(--hl-primary); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 999;
  background: var(--hl-ink); color: #fff; padding: 10px 18px; border-radius: var(--hl-radius-sm);
}
.skip-link:focus { inset-inline-start: 8px; }

/* ---------- Layout helpers ---------- */
.hl-container { max-width: var(--hl-container); margin-inline: auto; padding-inline: 20px; }
.hl-section { padding-block: clamp(48px, 7vw, 84px); }
.hl-screen-reader-text, .screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; width: 1px;
  overflow: hidden; position: absolute !important; word-wrap: normal !important;
}

/* ---------- Section head ---------- */
.hl-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: clamp(26px, 4vw, 42px); }
.hl-section-head .hl-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--hl-primary); font-weight: 700; font-size: 13.5px; letter-spacing: .3px;
}
.hl-eyebrow::before { content: ''; width: 26px; height: 2.5px; border-radius: 3px; background: var(--hl-primary); }
.hl-section-head h2 { font-size: clamp(21px, 3.2vw, 30px); margin-top: 4px; }
.hl-section-head .hl-sub { color: var(--hl-ink-soft); font-size: 14px; margin-top: 6px; max-width: 560px; }
.hl-more {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 14px; color: var(--hl-ink);
  border: 1.5px solid var(--hl-line); border-radius: 999px; padding: 10px 18px; background: var(--hl-surface);
  transition: all .25s ease;
}
.hl-more:hover { background: var(--hl-ink); color: #fff; border-color: var(--hl-ink); }

/* ---------- Buttons ---------- */
.hl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 700; font-size: 14.5px; line-height: 1; padding: 14px 26px;
  border-radius: 999px; border: 1.5px solid transparent;
  transition: all .25s cubic-bezier(.4,0,.2,1); white-space: nowrap;
}
.hl-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.hl-btn--primary { background: var(--hl-primary); color: #fff; box-shadow: 0 10px 22px -10px rgba(194,89,59,.55); }
.hl-btn--primary:hover { background: var(--hl-primary-dark); color: #fff; transform: translateY(-2px); }
.hl-btn--dark { background: var(--hl-ink); color: #fff; }
.hl-btn--dark:hover { background: var(--hl-primary); color: #fff; transform: translateY(-2px); }
.hl-btn--ghost { border-color: var(--hl-ink); color: var(--hl-ink); background: transparent; }
.hl-btn--ghost:hover { background: var(--hl-ink); color: #fff; }
.hl-btn--light { background: #fff; color: var(--hl-ink); }
.hl-btn--light:hover { background: var(--hl-primary); color: #fff; }
.hl-btn--sm { padding: 10px 18px; font-size: 13px; }
.hl-btn--lg { padding: 17px 34px; font-size: 15.5px; }
.hl-btn[disabled], .hl-btn.loading { opacity: .65; pointer-events: none; }

/* ---------- Forms ---------- */
.hl-input, .hl-select, textarea {
  width: 100%; background: var(--hl-surface);
  border: 1.5px solid var(--hl-line); border-radius: var(--hl-radius);
  padding: 13px 18px; font-size: 14.5px; transition: border-color .2s, box-shadow .2s;
}
.hl-input::placeholder, textarea::placeholder { color: #A79D91; }
.hl-input:focus, .hl-select:focus, textarea:focus {
  outline: none; border-color: var(--hl-primary);
  box-shadow: 0 0 0 4px var(--hl-primary-soft);
}
.hl-label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }

/* ---------- Icons ---------- */
.hl-icon { width: 20px; height: 20px; display: inline-flex; flex-shrink: 0; }
.hl-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hl-icon--fill svg { fill: currentColor; stroke: none; }

/* ---------- Badge / chip ---------- */
.hl-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: var(--hl-primary-soft); color: var(--hl-primary);
}
.hl-badge--dark { background: var(--hl-ink); color: #fff; }

/* ---------- Toast ---------- */
.hl-toast {
  position: fixed; bottom: 24px; inset-inline-start: 24px; z-index: 99999;
  background: var(--hl-ink); color: #fff; padding: 14px 22px;
  border-radius: var(--hl-radius); font-size: 14px; font-weight: 500;
  box-shadow: var(--hl-shadow-lg); display: flex; align-items: center; gap: 10px;
  transform: translateY(120%); opacity: 0; transition: all .35s cubic-bezier(.34,1.3,.64,1);
  max-width: min(420px, calc(100vw - 48px));
}
.hl-toast.is-visible { transform: translateY(0); opacity: 1; }
.hl-toast--success { background: var(--hl-success); }
.hl-toast--error { background: var(--hl-danger); }
.hl-toast .hl-icon { width: 18px; height: 18px; }

/* ---------- Reveal animation ---------- */
.hl-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s cubic-bezier(.22,1,.36,1); }
.hl-reveal.is-inview { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hl-reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Back to top ---------- */
.hl-top-btn {
  position: fixed; bottom: 24px; inset-inline-end: 24px; z-index: 900;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--hl-ink); color: #fff; display: grid; place-items: center;
  box-shadow: var(--hl-shadow); opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: all .3s ease;
}
.hl-top-btn.is-visible { opacity: 1; visibility: visible; transform: none; }
.hl-top-btn:hover { background: var(--hl-primary); }
.hl-top-btn .hl-icon { width: 18px; height: 18px; }

/* ---------- Pagination ---------- */
.hl-pagination { display: flex; justify-content: center; margin-top: 44px; }
.hl-pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.hl-pagination .page-numbers {
  min-width: 44px; height: 44px; padding-inline: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 12px; background: var(--hl-surface); border: 1.5px solid var(--hl-line);
  font-weight: 700; font-size: 14px; transition: all .2s ease;
}
.hl-pagination .page-numbers.current { background: var(--hl-ink); color: #fff; border-color: var(--hl-ink); }
.hl-pagination .page-numbers:not(.current):hover { border-color: var(--hl-primary); color: var(--hl-primary); }
.hl-pagination .page-numbers.dots { border: 0; background: none; }

/* ---------- Helpers ---------- */
.hl-grid { display: grid; gap: 22px; }
.hl-center { text-align: center; }
.hl-hidden { display: none !important; }
@media (max-width: 640px) {
  body { font-size: 15px; }
  .hl-section-head { flex-direction: column; align-items: flex-start; }
}
