/*
Theme Name: Homa World
Theme URI: https://example.com/homa-world
Author: Senior WP Dev
Author URI: https://example.com
Description: پلتفرم آموزشی دنیای هما — قالب اختصاصی وردپرس برای دوره‌ها و مقالات آموزشی، راست‌به‌چپ و واکنش‌گرا. ساخته شده بر اساس طراحی React/TypeScript اصلی.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: homa-world
Tags: education, rtl, custom-colors, custom-menu, custom-logo, responsive-layout, translation-ready
*/

/* =========================================================
   1. CSS RESET / NORMALIZE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

/* =========================================================
   2. DESIGN TOKENS (matches original theme.css custom properties)
   ========================================================= */
:root {
  --font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;

  /* brand palette */
  --homa-black: #000000;       /* true black — footer only */
  --black: #0d2b29;            /* "black" everywhere else (overridden in original Tailwind config) */
  --homa-green: #0d2b29;
  --homa-mint: #aefff5;
  --homa-coral: #ea4040;
  --homa-peach: #ffb973;
  --page-bg: #fafafa;
  --white: #ffffff;

  /* greys */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;

  --yellow-50: #fffbeb;
  --yellow-200: #fde68a;
  --yellow-600: #d97706;
  --red-50: #fef2f2;
  --red-500: #ef4444;

  /* radius */
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* shadow */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

  --container-max: 1280px;
}

/* =========================================================
   3. BASE / TYPOGRAPHY
   ========================================================= */
html {
  direction: rtl;
  font-family: var(--font-family);
  font-size: 16px;
}

body {
  background: var(--page-bg);
  color: var(--black);
  font-family: var(--font-family);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { font-weight: 500; line-height: 1.4; }

.site-main { flex: 1 0 auto; padding-bottom: 5rem; }
@media (min-width: 768px) { .site-main { padding-bottom: 0; } }

/* font-weight helpers used throughout (Tailwind font-bold / font-black / font-medium) */
.fw-medium { font-weight: 500; }
.fw-bold { font-weight: 700; }
.fw-black { font-weight: 900; }

/* =========================================================
   4. LAYOUT HELPERS
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1rem;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(1, 1fr); }
.grid-3 { grid-template-columns: repeat(1, 1fr); }
.grid-4 { grid-template-columns: repeat(1, 1fr); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.text-center { text-align: center; }
.text-justify { text-align: justify; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

.section { padding-top: 4rem; padding-bottom: 0; }
.section + .section { margin-top: 4rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: 0; right: 1rem; z-index: 999;
  background: var(--black); color: #fff;
  padding: 0.75rem 1.25rem; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  transform: translateY(-100%);
  transition: transform .15s ease;
}
.skip-link:focus { transform: translateY(0); }

/* =========================================================
   5. BUTTONS (matches components/ui/Button.tsx)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  border-radius: var(--radius-lg);
  transition: transform .15s ease, opacity .15s ease, background-color .15s ease;
  border: none;
  cursor: pointer;
  line-height: 1.5;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

.btn-primary { background: var(--homa-green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { opacity: .9; }
.btn-secondary { background: var(--homa-mint); color: var(--black); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { opacity: .9; }
.btn-accent { background: var(--homa-coral); color: #fff; box-shadow: var(--shadow-sm); }
.btn-accent:hover { opacity: .9; }
.btn-outline { background: #fff; color: var(--black); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(0,0,0,.05); }

.btn-sm { padding: .375rem .75rem; font-size: .875rem; }
.btn-md { padding: .625rem 1.25rem; font-size: 1rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; }

.btn-icon { padding: 0; width: 2.5rem; height: 2.5rem; }
.btn-block { width: 100%; }

/* =========================================================
   6. CARD (matches components/ui/Card.tsx)
   ========================================================= */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* =========================================================
   7. FORM FIELDS (matches components/ui/Input.tsx)
   ========================================================= */
.field { display: flex; flex-direction: column; gap: .25rem; width: 100%; }
.field label { font-weight: 700; margin-bottom: .5rem; display: block; font-size: .95rem; }
.input,
input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="search"], input[type="number"], textarea, select {
  height: 3rem;
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: #fff;
  padding: .5rem 1rem;
  font-size: 1rem;
  transition: box-shadow .15s ease, border-color .15s ease;
}
textarea { height: auto; min-height: 8rem; padding-top: .75rem; }
.input:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--homa-green);
}
.input::placeholder, input::placeholder { color: var(--gray-500); }
.field-error .input, .field-error input { border-color: var(--homa-coral); }
.field-error .input:focus, .field-error input:focus { box-shadow: 0 0 0 2px var(--homa-coral); }
.field-error-msg { color: var(--homa-coral); font-size: .875rem; font-weight: 500; }

label.checkbox-row, label.radio-row {
  display: flex; align-items: center; gap: .5rem; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] {
  width: 1rem; height: 1rem; accent-color: var(--homa-green);
  height: auto;
}

/* =========================================================
   8. BADGES / TAGS
   ========================================================= */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-weight: 700; font-size: .75rem; padding: .25rem .5rem;
}
.badge-black { background: var(--black); color: #fff; }
.badge-green { background: var(--homa-green); color: #fff; border-radius: var(--radius-full); }
.badge-rating {
  display: inline-flex; align-items: center; gap: .25rem; font-size: .875rem;
  font-weight: 700; color: var(--yellow-600);
}
.badge-rating-boxed { background: var(--yellow-50); border: 1px solid var(--yellow-200); padding: 0 .25rem; }

.pill {
  padding: .375rem 1rem; border-radius: var(--radius-full); font-weight: 500; cursor: pointer;
  transition: background-color .15s ease;
  background: var(--gray-100); color: var(--gray-700);
}
.pill:hover { background: var(--gray-200); }
.pill.is-active { background: var(--homa-green); color: #fff; }

/* dashed divider used repeatedly as a visual accent */
.dashed-divider { border-top: 2px dashed var(--gray-300); }

/* =========================================================
   9. SITE HEADER
   ========================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--gray-200);
}
/* When the WP admin toolbar is showing (i.e. a logged-in user is viewing
   the site), it's fixed at the very top of the viewport too — without this,
   the sticky header also pins itself to top:0 and ends up scrolling half-
   hidden underneath the toolbar. Push it down by the toolbar's own height
   instead (32px desktop, 46px on the ≤782px breakpoint where WP's own
   toolbar CSS switches to its taller mobile version). */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}
.site-header__inner {
  height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.site-header__left { display: flex; align-items: center; gap: 1.5rem; }
.site-logo { font-size: 1.5rem; font-weight: 900; color: var(--black); }
.site-logo span { color: var(--homa-coral); }

.primary-nav { display: none; align-items: center; gap: 1rem; }
@media (min-width: 768px) { .primary-nav { display: flex; } }
.primary-nav a {
  font-weight: 500; font-size: 1.125rem; color: var(--black);
  padding-bottom: 2px; transition: color .15s ease;
}
.primary-nav a:hover { color: var(--homa-green); }
.primary-nav a.is-active { color: var(--homa-green); border-bottom: 2px solid var(--homa-green); }

.site-header__right { display: flex; align-items: center; gap: 1rem; }
.header-search { position: relative; display: none; }
@media (min-width: 768px) { .header-search { display: flex; } }
.header-search input {
  border: 1px solid var(--gray-300); border-radius: var(--radius-full);
  background: var(--gray-50); font-size: .875rem; padding: .375rem 2.5rem .375rem 1rem;
  height: auto;
}
.header-search svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); }

.header-cta { display: none; }
@media (min-width: 768px) { .header-cta { display: block; } }

.menu-toggle { display: block; }
@media (min-width: 768px) { .menu-toggle { display: none; } }

.mobile-menu {
  display: none; position: absolute; top: 4rem; right: 0; left: 0;
  background: #fff; border-bottom: 1px solid var(--gray-200);
  flex-direction: column; padding: 1rem; gap: 1rem; box-shadow: var(--shadow-sm);
}
.mobile-menu.is-open { display: flex; }
.mobile-menu a {
  font-weight: 500; font-size: 1.125rem; border-bottom: 1px solid var(--gray-100); padding-bottom: .5rem;
}
@media (min-width: 768px) { .mobile-menu { display: none !important; } }

/* =========================================================
   10. SITE FOOTER
   ========================================================= */
.site-footer {
  background: var(--homa-black); color: #fff;
  border-top: 4px solid var(--homa-green); margin-top: 3rem;
}
.site-footer__inner { padding: 3rem 0; display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .site-footer__inner { grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 2rem; } }
.site-footer h3 { font-size: 1.5rem; font-weight: 900; margin-bottom: 1rem; }
.site-footer h3 span { color: var(--homa-coral); }
.site-footer h4 { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; color: var(--homa-peach); }
.site-footer p { color: var(--gray-300); line-height: 1.7; font-size: .95rem; }
.site-footer ul { display: flex; flex-direction: column; gap: .5rem; }
.site-footer a { transition: color .15s ease; }
.site-footer a:hover { color: var(--homa-mint); }
.newsletter-form { display: flex; gap: .5rem; }
.newsletter-form input {
  flex: 1; color: #000; border: 2px solid var(--homa-mint); border-radius: 0; height: auto; padding: .5rem .75rem;
}
.newsletter-form input:focus { border-color: var(--homa-coral); box-shadow: none; }
.newsletter-form button {
  background: var(--homa-mint); color: #000; padding: 0 1rem; font-weight: 700;
  border: 2px solid var(--homa-mint); transition: all .15s ease;
}
.newsletter-form button:hover { background: var(--homa-coral); color: #fff; border-color: var(--homa-coral); }

/* =========================================================
   11. MOBILE BOTTOM NAV
   ========================================================= */
.mobile-bottom-nav {
  display: flex; position: fixed; bottom: 0; right: 0; left: 0; z-index: 50;
  background: #fff; border-top: 1px solid var(--gray-200);
  align-items: center; justify-content: space-around; padding: .5rem;
}
@media (min-width: 768px) { .mobile-bottom-nav { display: none; } }
.mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: .25rem; color: var(--black); }
.mobile-bottom-nav span { font-size: .625rem; font-weight: 700; }

/* =========================================================
   12. MEMPHIS DECORATIVE IMAGE BLOCK
   ========================================================= */
.memphis { position: relative; overflow: hidden; }
.memphis::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.05); pointer-events: none; }
.memphis svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.memphis-homa-green { background: var(--homa-green); }
.memphis-homa-mint { background: var(--homa-mint); }
.memphis-homa-coral { background: var(--homa-coral); }
.memphis-homa-peach { background: var(--homa-peach); }

/* =========================================================
   13. BREADCRUMBS
   ========================================================= */
.breadcrumbs {
  display: flex; gap: .5rem; font-size: .875rem; color: var(--gray-500);
  font-weight: 500; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.breadcrumbs a:hover { color: #000; }
.breadcrumbs .current { color: #000; }

/* =========================================================
   14. UTIL: line clamp
   ========================================================= */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* =========================================================
   15. NOTICES
   ========================================================= */
.notice { padding: 1rem 1.25rem; border-radius: var(--radius-lg); font-weight: 700; margin-bottom: 1.5rem; }
.notice-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.notice-error { background: var(--red-50); color: #991b1b; border: 1px solid #fecaca; }

/* =========================================================
   16. RESPONSIVE TEXT HELPERS used inline by templates
   ========================================================= */
.text-90 { font-size: .9rem; }

/* ── Footer copyright bar (full-width, editable via 🦶 فوتر admin panel) ── */
.site-footer__copyright {
	background: rgba(0,0,0,.15);
	border-top: 1px solid rgba(255,255,255,.08);
}
.site-footer__copyright-inner {
	padding: 1rem 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	font-size: .85rem;
	color: var(--gray-400);
	text-align: center;
}
.site-footer__copyright-inner a {
	color: var(--homa-mint);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
