/* ═══════════════════════════════════════════════════════════════
   main.css — אורי שי, מאמן רכיבת סוסים מערבית
   Western/Yellowstone palette | RTL | Mobile First | Dark Mode
═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ───────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800&family=Assistant:wght@300;400;600;700&display=swap');

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Western Palette */
  --brown:        #8B4513;
  --brown-dark:   #6B3410;
  --brown-light:  #A0522D;
  --gold:         #D4A017;
  --gold-light:   #E8B84B;
  --beige:        #F5E6CC;
  --beige-dark:   #EDD5A3;
  --cream:        #FDF8F0;
  --black:        #1A1209;
  --charcoal:     #2D2416;

  /* Light Mode */
  --bg:           #FDF8F0;
  --bg-secondary: #F5E6CC;
  --surface:      #FFFFFF;
  --surface-2:    #FAF4E8;
  --text:         #1A1209;
  --text-muted:   #6B5A3E;
  --text-light:   #9C8565;
  --border:       #DCC9A0;
  --border-light: #EDD5A3;
  --shadow:       rgba(139, 69, 19, 0.12);
  --shadow-md:    rgba(139, 69, 19, 0.2);

  /* Brand */
  --primary:      #8B4513;
  --primary-dark: #6B3410;
  --primary-light:#A0522D;
  --accent:       #D4A017;
  --accent-light: #E8B84B;

  /* Status */
  --success:      #2D7A2D;
  --error:        #C0392B;
  --warning:      #E67E22;
  --info:         #2980B9;

  /* Layout */
  --max-width:    1200px;
  --nav-height:   70px;
  --radius:       8px;
  --radius-lg:    16px;
  --radius-xl:    24px;

  /* Transitions */
  --transition:   0.25s ease;
  --transition-slow: 0.4s ease;
}

[data-theme="dark"] {
  --bg:           #1A1209;
  --bg-secondary: #2D2416;
  --surface:      #2D2416;
  --surface-2:    #3D3020;
  --text:         #F5E6CC;
  --text-muted:   #C4A882;
  --text-light:   #8C7550;
  --border:       #4A3828;
  --border-light: #3D3020;
  --shadow:       rgba(0, 0, 0, 0.4);
  --shadow-md:    rgba(0, 0, 0, 0.6);
  --primary:      #C4651F;
  --primary-dark: #A0522D;
  --primary-light:#D4783A;
  --accent:       #E8B84B;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Heebo', 'Assistant', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.65;
  direction: rtl;
  text-align: right;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--primary-dark); }

ul, ol { list-style: none; }

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }
h4 { font-size: 1.2rem; }
h5 { font-size: 1.05rem; }
h6 { font-size: 0.95rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── Layout ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px)  { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

.section {
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .section { padding: 4rem 0; }
}

@media (min-width: 1024px) {
  .section { padding: 5rem 0; }
}

.section-title {
  text-align: center;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

/* ── Navigation ─────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 12px var(--shadow);
  transition: background var(--transition);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary);
}

.nav-logo img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 50%;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

.nav-links a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-whatsapp-nav {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: #25D366;
  color: #fff;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background var(--transition), transform var(--transition);
}

.btn-whatsapp-nav:hover {
  background: #1DA851;
  color: #fff;
  transform: translateY(-1px);
}

@media (min-width: 768px) {
  .btn-whatsapp-nav { display: flex; }
}

.dark-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition), transform var(--transition);
  cursor: pointer;
}

.dark-toggle:hover {
  background: var(--border);
  transform: rotate(20deg);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

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

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-height);
  right: 0;
  left: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 1rem;
  z-index: 99;
  box-shadow: 0 8px 24px var(--shadow-md);
}

.mobile-menu.open { display: block; }

.mobile-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text);
  font-weight: 500;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.mobile-menu a:hover {
  background: var(--bg-secondary);
  color: var(--primary);
}

/* ── Hero Section ────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: center;
  background: linear-gradient(
    135deg,
    var(--brown-dark) 0%,
    var(--brown) 40%,
    var(--brown-light) 100%
  );
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('/public/images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero p {
  color: var(--beige);
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2rem;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.btn-secondary {
  background: var(--accent);
  color: var(--black);
  border-color: var(--accent);
}

.btn-secondary:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--black);
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-ghost:hover {
  background: var(--primary);
  color: #fff;
}

.btn-ghost-white {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.7);
}

.btn-ghost-white:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: #fff;
}

.btn-sm { padding: 0.45rem 1rem; font-size: 0.875rem; }
.btn-lg { padding: 0.9rem 2rem; font-size: 1.1rem; }
.btn-full { width: 100%; }

.btn-whatsapp {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
}

.btn-whatsapp:hover {
  background: #1DA851;
  border-color: #1DA851;
  color: #fff;
}

/* ── WhatsApp Float Button ───────────────────────────────────── */
.whatsapp-float {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}

.whatsapp-float:hover {
  transform: scale(1.1) rotate(-8deg);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.6);
  color: #fff;
}

/* ── Forms ───────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  color: var(--text);
}

.form-label .required {
  color: var(--error);
  margin-right: 0.2rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  direction: rtl;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.15);
}

.form-control::placeholder { color: var(--text-light); }

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

.form-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.form-success {
  color: var(--success);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.honeypot-field {
  display: none !important;
  visibility: hidden !important;
}

/* ── Grid Layouts ────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@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(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown));
  color: #fff;
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.page-header h1 { color: #fff; margin-bottom: 0.5rem; }
.page-header p  { color: var(--beige); font-size: 1.1rem; margin: 0; }

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 0.75rem 0;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--primary); }
.breadcrumb span { color: var(--text-light); }

/* ── Alert / Notice ──────────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-weight: 500;
  border-right: 4px solid;
  direction: rtl;
}

.alert-success {
  background: #E8F5E9;
  color: #1B5E20;
  border-color: var(--success);
}

.alert-error {
  background: #FFEBEE;
  color: #B71C1C;
  border-color: var(--error);
}

.alert-warning {
  background: #FFF3E0;
  color: #BF360C;
  border-color: var(--warning);
}

.alert-info {
  background: #E3F2FD;
  color: #0D47A1;
  border-color: var(--info);
}

[data-theme="dark"] .alert-success { background: #1B3A1F; color: #81C784; }
[data-theme="dark"] .alert-error   { background: #3B1414; color: #EF9A9A; }
[data-theme="dark"] .alert-warning { background: #3B2A14; color: #FFCC80; }
[data-theme="dark"] .alert-info    { background: #0D2137; color: #90CAF9; }

/* ── Badge ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge-primary   { background: var(--primary);  color: #fff; }
.badge-accent    { background: var(--accent);   color: var(--black); }
.badge-success   { background: var(--success);  color: #fff; }
.badge-error     { background: var(--error);    color: #fff; }
.badge-free      { background: #27AE60;         color: #fff; }
.badge-paid      { background: var(--accent);   color: var(--black); }
.badge-available { background: var(--success);  color: #fff; }
.badge-sold      { background: var(--text-light); color: #fff; }

/* ── Footer ──────────────────────────────────────────────────── */
.footer {
  background: var(--charcoal);
  color: var(--beige);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
}

.footer h4 {
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer a {
  color: var(--beige-dark);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer a:hover { color: var(--gold-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ── Loading Spinner ─────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utilities ───────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-primary{ color: var(--primary); }
.text-accent { color: var(--accent); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.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;
}

/* ── Accessibility ───────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Divider ─────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}

.divider-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  width: 60px;
  margin: 0.5rem auto 2rem;
}
