/* ==========================================================================
   06 — COMPONENTS
   نقشه، برچسب «به‌زودی»، پیام شیشه‌ای، ابزارک‌ها، ردیف‌های تماس، مودال‌ها، انتقال صفحه، انگلیسی
   ========================================================================== */

/*---------------------------------*\
  MAP — فقط با کلیک کاربر لود می‌شود
\*---------------------------------*/
.mapbox { background: var(--glass-fill-strong); }
.map-load {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: center;
  color: var(--ink-1);
  font-size: var(--fs-body);
  font-weight: var(--fw-500);
  background:
    radial-gradient(60% 60% at 50% 40%, hsla(210, 100%, 62%, 0.22), transparent 70%),
    var(--glass-fill-strong);
  transition: opacity var(--t-med), visibility var(--t-med);
}
.map-load .icon-box { width: 56px; height: 56px; border-radius: var(--r-md); transition: transform var(--t-med) var(--ease-spring); }
.map-load .icon-box .icon-svg { width: 26px; height: 26px; }
.map-load:hover .icon-box { transform: scale(1.1); }
.map-load small { color: var(--ink-3); font-size: var(--fs-caption); font-weight: var(--fw-300); }
.mapbox.is-loaded .map-load { opacity: 0; visibility: hidden; pointer-events: none; }

/*---------------------------------*\
  «به‌زودی تکمیل می‌شود» — برای حذف: attribute data-soon را از آیتم پاک کنید
\*---------------------------------*/
[data-soon] .project-img::after,
[data-soon] .blog-banner-box::after {
  content: "به‌زودی تکمیل می‌شود";
  position: absolute;
  inset-inline-start: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  color: var(--ink-0);
  font-size: var(--fs-micro);
  font-weight: var(--fw-500);
  line-height: 1.4;
  background: var(--soon-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge);
  pointer-events: none;
}

/*---------------------------------*\
  TOAST — جایگزین alert()
\*---------------------------------*/
.toast-wrap {
  position: fixed;
  top: 16px;
  right: 16px;
  left: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 440px;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--r-md);
  color: var(--ink-0);
  font-size: var(--fs-small);
  font-weight: var(--fw-500);
  line-height: 1.6;
  background: var(--toast-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-edge);
  pointer-events: auto;
  animation: toast-in 0.4s var(--ease-spring) both;
}
.toast::before {
  content: "✓";
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  font-weight: var(--fw-700);
  color: hsl(230, 30%, 12%);
  background: linear-gradient(135deg, hsl(150, 80%, 70%), hsl(170, 80%, 60%));
}
.toast.is-error::before { content: "!"; background: linear-gradient(135deg, hsl(350, 90%, 72%), hsl(20, 95%, 66%)); }
.toast.is-leaving { animation: toast-out 0.3s var(--ease-out) both; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-10px) scale(0.96); }
}

/*---------------------------------*\
  UTILITIES & ACCESSIBILITY
\*---------------------------------*/
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 300;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  color: var(--on-accent);
  background: var(--btn-grad);
  font-size: var(--fs-small);
  font-weight: var(--fw-600);
  box-shadow: var(--glow-blue);
  transform: translateY(-200%);
  transition: transform var(--t-fast);
}
.skip-link:focus { transform: none; }

/* فیلد دام (honeypot) — برای کاربر واقعی نامرئی است */
.hp-field {
  position: absolute !important;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/*---------------------------------*\
  CONTACT ROWS — کل ردیف (آیکون + متن) لینک است
\*---------------------------------*/
.contact-item { display: block; padding: 0; }
.contact-item > a,
.contact-item > .contact-item-static {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border-radius: inherit;
  color: inherit;
}
.contact-item > a:hover .icon-box,
.contact-item > a:focus-visible .icon-box { color: var(--on-accent); background: var(--accent-grad); border-color: transparent; }
.contact-item > a:hover .contact-link,
.contact-item > a:focus-visible .contact-link { color: var(--cyan-blue); }
.contact-item .icon-box { transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }

/*---------------------------------*\
  MODALS — بیرون از کارت‌ها، همیشه وسط صفحه‌ی دیده‌شده
\*---------------------------------*/
body > .modal-container {
  position: fixed;
  inset: 0;
  height: 100dvh;
}
.modal-container { align-items: center; }

/* مودال جزئیات پروژه: عکس بالا، متن پایین */
.project-modal {
  display: block;
  max-width: 640px;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.project-modal .modal-img-wrapper { margin: 0; display: block; }
.project-modal .project-modal-img-box {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: none;
  overflow: hidden;
  background: var(--solid-surface);
}
.project-modal .project-modal-img-box img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.project-modal .modal-content { padding: 22px 24px 26px; }
.project-modal .modal-close-btn { color: #fff; background: hsla(230, 30%, 8%, 0.55); border-color: hsla(0, 0%, 100%, 0.25); }
.project-modal .modal-title { padding-inline-end: 0; margin-bottom: 8px; }
.project-modal .modal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.project-modal .modal-meta .project-category,
.project-modal .modal-meta .status-chip { margin: 0; }
.status-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  color: hsl(30, 90%, 28%);
  background: hsla(42, 100%, 62%, 0.85);
  font-size: var(--fs-micro);
  font-weight: var(--fw-600);
}
html:not([data-theme="light"]) .status-chip { color: hsl(42, 100%, 78%); background: hsla(42, 100%, 60%, 0.16); border: 1px solid hsla(42, 100%, 70%, 0.35); }
.project-modal [data-project-modal-text] p { margin-bottom: 14px; }
.modal-subtitle {
  margin: 18px 0 10px;
  color: var(--ink-0);
  font-size: var(--fs-body);
  font-weight: var(--fw-600);
}
.feature-list { display: grid; gap: 8px; margin-bottom: 4px; }
.feature-list li {
  position: relative;
  padding-inline-start: 22px;
  color: var(--ink-2);
  font-size: var(--fs-small);
  font-weight: var(--fw-300);
  line-height: 1.75;
}
.feature-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 10px hsla(210, 100%, 65%, 0.5);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 4px 12px;
  border-radius: var(--r-pill);
  color: var(--ink-1);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  font-size: var(--fs-caption);
  font-weight: var(--fw-500);
  direction: ltr;
  unicode-bidi: isolate;
}
.project-modal .project-modal-link { margin-top: 22px; width: 100%; max-width: none; }
.project-modal .modal-note {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  background: var(--chip-bg);
  font-size: var(--fs-caption);
}
@media (min-width: 580px) {
  .project-modal { display: block; flex-direction: initial; padding: 0; }
  .project-modal .modal-img-wrapper { margin: 0; }
  .project-modal .modal-content { padding: 26px 30px 30px; }
  .project-modal .project-modal-link { width: auto; min-width: 220px; }
}

/*---------------------------------*\
  PAGE TRANSITION — خروج نرم صفحه قبل از ورود صفحه‌ی بعد
\*---------------------------------*/
article.is-leaving { animation: article-out 0.16s ease-in both; }
@keyframes article-out {
  to { opacity: 0; transform: translateY(-8px); }
}

/*---------------------------------*\
  ENGLISH (LTR) — متن‌های تولیدشده با CSS
\*---------------------------------*/
html[lang="en"] [data-soon] .project-img::after,
html[lang="en"] [data-soon] .blog-banner-box::after { content: "Coming soon"; }
html[lang="en"] .info-content .name { letter-spacing: 0; }
html[lang="en"] .navbar-label { letter-spacing: 0; }
