/*
Theme Name: کارگاه (Karesh)
Theme URI: https://mimtools.ir
Author: Mohamad Alidokht
Description: قالب شخصی و مدرن وردپرس برای نمایش ابزارها و ماژول‌های کوچکی که می‌سازید. هر ابزار به صورت کارت نمایش داده می‌شود؛ برخی به سایت دیگری لینک می‌شوند و برخی به عنوان «به‌زودی» بدون لینک نمایش داده می‌شوند.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Author URI: https://mimtools.ir
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: karesh
Tags: dark, rtl-language-support, custom-post-type, one-column, right-sidebar

این قالب برای وردپرس نسخه ۷ و PHP نسخه ۸.۳ نوشته شده است.
*/

/* ==========================================================================
   DESIGN TOKENS
   Concept: "کارگاه" (Workshop) — a personal digital workshop at night.
   Warm workbench-lamp amber against deep charcoal, not neon-tech green.
   ========================================================================== */

:root {
  /* Color */
  --karesh-bg: #16140f;              /* deep warm charcoal, not pure black */
  --karesh-bg-soft: #1e1b15;         /* card / panel background */
  --karesh-bg-soft-2: #262119;       /* raised panel / hover */
  --karesh-line: #33301f;            /* hairline borders */
  --karesh-text: #ede7d9;            /* warm off-white */
  --karesh-text-dim: #a89f88;        /* secondary text */
  --karesh-text-faint: #6b6350;      /* tertiary / disabled text */
  --karesh-amber: #e0a341;           /* workbench-lamp accent */
  --karesh-amber-bright: #f3bd5e;    /* hover state */
  --karesh-amber-dim: #6b4f22;       /* muted accent for borders */
  --karesh-copper: #c1673f;          /* secondary accent, sparingly used */
  --karesh-green-live: #7a9b5c;      /* status: active tool */

  /* Type */
  --font-display: 'Vazirmatn', 'Tahoma', sans-serif;
  --font-body: 'Vazirmatn', 'Tahoma', sans-serif;
  --font-mono: 'Vazirmatn', monospace;

  /* Layout */
  --container-width: 1180px;
  --radius-card: 14px;
  --radius-small: 8px;
  --space-section: clamp(64px, 8vw, 120px);
}

/* ==========================================================================
   RESET / BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--karesh-bg);
  color: var(--karesh-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  position: relative;
}

/* subtle geometric texture, evokes Persian tile grids without being literal */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--karesh-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--karesh-line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.08;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 0%, transparent 70%);
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 0.5em;
  color: var(--karesh-text);
}

.container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 24px;
  position: relative;
  z-index: 1;
}

.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
}

/* focus visibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--karesh-amber);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   SITE HEADER
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(22, 20, 15, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--karesh-line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 18px;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-branding .logo-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.site-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  color: var(--karesh-text);
}

.site-title a { color: var(--karesh-text); }

.site-description {
  font-size: 13px;
  color: var(--karesh-text-faint);
  margin: 0;
}

.primary-nav ul {
  display: flex;
  gap: 28px;
}

.primary-nav a {
  font-size: 15px;
  color: var(--karesh-text-dim);
  transition: color 0.2s ease;
  position: relative;
}

.primary-nav a:hover { color: var(--karesh-amber); }

.primary-nav a::after {
  content: "";
  position: absolute;
  right: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--karesh-amber);
  transition: width 0.25s ease;
}

.primary-nav a:hover::after { width: 100%; }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  padding-block: clamp(60px, 10vw, 110px) clamp(40px, 6vw, 70px);
  position: relative;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--karesh-amber);
  border: 1px solid var(--karesh-amber-dim);
  background: rgba(224, 163, 65, 0.06);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
  opacity: 0;
  animation: fade-up 0.7s ease forwards;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--karesh-amber);
  box-shadow: 0 0 8px 2px rgba(224, 163, 65, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

.hero h1 {
  font-size: clamp(34px, 5.2vw, 58px);
  max-width: 16ch;
  opacity: 0;
  animation: fade-up 0.8s ease 0.1s forwards;
}

.hero h1 .accent { color: var(--karesh-amber); }

.hero-lede {
  font-size: 18px;
  color: var(--karesh-text-dim);
  max-width: 56ch;
  margin-top: 18px;
  opacity: 0;
  animation: fade-up 0.8s ease 0.2s forwards;
}

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 40px;
  opacity: 0;
  animation: fade-up 0.8s ease 0.3s forwards;
}

.hero-stat .num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--karesh-amber);
  display: block;
}

.hero-stat .label {
  font-size: 13px;
  color: var(--karesh-text-faint);
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ==========================================================================
   TOOLS SECTION
   ========================================================================== */

.tools-section {
  padding-block: var(--space-section);
  border-top: 1px solid var(--karesh-line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(26px, 3.4vw, 36px);
}

.section-head p {
  color: var(--karesh-text-dim);
  font-size: 15px;
  max-width: 46ch;
  margin: 8px 0 0;
}

.tools-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tools-filter button {
  background: transparent;
  border: 1px solid var(--karesh-line);
  color: var(--karesh-text-dim);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tools-filter button:hover {
  border-color: var(--karesh-amber-dim);
  color: var(--karesh-text);
}

.tools-filter button.is-active {
  background: var(--karesh-amber);
  border-color: var(--karesh-amber);
  color: #1a1610;
  font-weight: 700;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

@media (max-width: 900px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .tools-grid { grid-template-columns: 1fr; }
}

.tool-card {
  background: var(--karesh-bg-soft);
  border: 1px solid var(--karesh-line);
  border-radius: var(--radius-card);
  padding: 26px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
  opacity: 0;
  transform: translateY(14px);
  animation: fade-up 0.6s ease forwards;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(180px 120px at 85% -10%, rgba(224,163,65,0.10), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.tool-card.is-live:hover {
  transform: translateY(-5px);
  border-color: var(--karesh-amber-dim);
  background: var(--karesh-bg-soft-2);
}

.tool-card.is-live:hover::before { opacity: 1; }

.tool-card.is-soon {
  opacity: 0.62;
}

.tool-card.is-soon:hover { opacity: 0.8; }

.tool-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-small);
  background: var(--karesh-bg-soft-2);
  border: 1px solid var(--karesh-line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.tool-card.is-live:hover .tool-icon {
  transform: rotate(-6deg) scale(1.05);
  border-color: var(--karesh-amber-dim);
}

.tool-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-card p.tool-desc {
  color: var(--karesh-text-dim);
  font-size: 14.5px;
  margin: 0 0 20px;
  min-height: 44px;
}

.tool-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-weight: 600;
}

.tool-status.live {
  color: var(--karesh-green-live);
  background: rgba(122, 155, 92, 0.12);
}

.tool-status.live .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--karesh-green-live);
}

.tool-status.soon {
  color: var(--karesh-text-faint);
  background: rgba(255,255,255,0.04);
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 14px;
  color: var(--karesh-amber);
  font-weight: 600;
}

.tool-link .arrow {
  transition: transform 0.25s ease;
  display: inline-block;
}

.tool-card.is-live:hover .tool-link .arrow {
  transform: translateX(-4px);
}

.tool-card-inner-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

/* lock glyph for coming-soon cards */
.tool-lock {
  position: absolute;
  top: 22px;
  left: 22px;
  color: var(--karesh-text-faint);
  font-size: 16px;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.tools-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--karesh-text-faint);
  border: 1px dashed var(--karesh-line);
  border-radius: var(--radius-card);
}

.tools-empty strong {
  display: block;
  color: var(--karesh-text-dim);
  font-size: 17px;
  margin-bottom: 8px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  border-top: 1px solid var(--karesh-line);
  padding-block: 44px;
  margin-top: var(--space-section);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer p {
  color: var(--karesh-text-faint);
  font-size: 13.5px;
  margin: 0;
}

.footer-signature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--karesh-text-faint);
}

.footer-signature .flicker {
  color: var(--karesh-amber);
  animation: flicker 3.2s ease-in-out infinite;
}

@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: 0.4; }
  96% { opacity: 1; }
  98% { opacity: 0.55; }
}

/* ==========================================================================
   SINGLE TOOL PAGE (in case a tool has its own page/post)
   ========================================================================== */

.single-tool-header {
  padding-block: 60px 30px;
  border-bottom: 1px solid var(--karesh-line);
}

.single-tool-header .tool-status { margin-bottom: 18px; }

.entry-content {
  max-width: 72ch;
  padding-block: 40px;
  color: var(--karesh-text-dim);
}

.entry-content h2, .entry-content h3 { color: var(--karesh-text); margin-top: 1.4em; }
.entry-content p { margin: 0 0 1.2em; }
.entry-content a { color: var(--karesh-amber); border-bottom: 1px solid var(--karesh-amber-dim); }

/* ==========================================================================
   RESPONSIVE HEADER NAV (simple mobile collapse)
   ========================================================================== */

@media (max-width: 720px) {
  .primary-nav ul { gap: 16px; }
  .primary-nav a { font-size: 13.5px; }
  .hero-stats { gap: 22px; flex-wrap: wrap; }
}
