/* =====================================================
   global.css — Shared styles for all pages
   Fucking Amazing Design System (RTL Hebrew)
   ===================================================== */

/* ── Design Tokens ─────────────────────────────────── */
:root {
  --color-primary:        #3e64de;
  --color-primary-hover:  #395bca;
  --color-primary-light:  #eef1fb;
  --color-dark-blue:      #0b395e;
  --color-btn-blue:       #1e73be;
  --color-text:           #212327;
  --color-text-muted:     #5a5e66;
  --color-border:         #cdcfd5;
  --color-bg-gray:        #e3e5eb;
  --color-bg-light:       #f5f6f8;
  --color-white:          #ffffff;
  --color-header-bg:      #ffffff;   /* light header */
  --color-footer-bg:      #1a1d22;
  --color-success:        #2e9e5b;

  --font-family:          'Rubik', sans-serif;
  --font-size-body:       14px;
  --font-size-sm:         12px;
  --font-size-menu:       12px;
  --font-size-h1:         23px;
  --font-size-h2:         20px;
  --font-size-h3:         18px;
  --font-size-h4:         17px;

  --line-height-body:     1.8;
  --line-height-heading:  1.4;

  --container-width:      1216px;
  --container-padding:    20px;

  --radius-sm:            3px;
  --radius-md:            8px;
  --radius-btn:           3px;
  --radius-btn-product:   11px;
  --radius-card:          8px;
  --radius-full:          9999px;

  --shadow-card:          6px 6px 9px rgba(0,0,0,0.20);
  --shadow-card-hover:    8px 8px 20px rgba(0,0,0,0.28);
  --shadow-header:        0 1px 4px rgba(0,0,0,0.07);

  --transition-fast:      0.15s ease;
  --transition-base:      0.25s ease;

  --z-header:             1000;
  --z-backdrop:            999;

  --nav-mobile-max-h:     480px;
  --page-transition-ms:   280ms;
}

/* ══════════════════════════════════════════════════
   PAGE TRANSITIONS
══════════════════════════════════════════════════ */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

body {
  animation: pageFadeIn var(--page-transition-ms) ease both;
}

body.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--page-transition-ms) ease,
              transform var(--page-transition-ms) ease;
  pointer-events: none;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-family);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  direction: rtl;
  text-align: right;
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

img   { max-width: 100%; height: auto; display: block; }
a     { color: inherit; text-decoration: none; }
ul    { list-style: none; }
button { font-family: var(--font-family); }

/* ── Layout ────────────────────────────────────────── */
.container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* ══════════════════════════════════════════════════
   SITE HEADER — white / light
══════════════════════════════════════════════════ */
.site-header {
  background-color: var(--color-header-bg);
  border-bottom: 1px solid #e8eaef;
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  box-shadow: var(--shadow-header);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 10px;
  gap: 16px;
  direction: ltr; /* logo LEFT, nav RIGHT regardless of page RTL */
}

/* Logo */
.site-logo a { display: flex; align-items: center; }
.site-logo img { max-width: 170px; height: auto; }
.site-logo-fallback {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
}
.site-logo-fallback span { color: var(--color-primary); }

/* Main nav */
.main-nav {
  display: flex;
  align-items: center;
  flex: 1;
  direction: rtl;          /* בית on RIGHT, רכישה מהירה on LEFT */
  justify-content: flex-start; /* flex-start in RTL = pack to RIGHT */
  flex-wrap: wrap;
}

.main-nav a {
  color: var(--color-text);
  font-size: var(--font-size-menu);
  letter-spacing: 0.6px;
  padding: 8px 12px;
  white-space: nowrap;
  transition: color var(--transition-fast);
}
.main-nav a:hover { color: var(--color-primary); }
.main-nav a.active { color: var(--color-primary); font-weight: 600; }

/* "רכישה מהירה" in the nav gets button treatment */
.main-nav a.nav-purchase {
  background: var(--color-primary);
  color: #fff !important;
  border-radius: var(--radius-btn);
  padding: 6px 14px;
  font-weight: 500;
  margin-inline-start: 6px;
  transition: background var(--transition-base);
}
.main-nav a.nav-purchase:hover { background: var(--color-primary-hover); }


/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 22px;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  min-width: 40px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.hamburger:hover { background: var(--color-bg-gray); }

/* ── Mobile nav — slide-down drawer ── */
.mobile-nav {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  /* keep in the DOM always so transition works */
}
.mobile-nav.open {
  max-height: var(--nav-mobile-max-h);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.mobile-nav a {
  color: var(--color-text);
  font-size: 15px;
  font-weight: 400;
  padding: 14px 24px;
  border-bottom: 1px solid #f0f2f6;
  min-height: 52px;
  display: flex;
  align-items: center;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover  { background: var(--color-bg-gray); color: var(--color-primary); }
.mobile-nav a.active { color: var(--color-primary); font-weight: 600; background: var(--color-primary-light); }
.mobile-nav a.nav-purchase-mobile {
  background: var(--color-primary);
  color: #fff !important;
  font-weight: 600;
  margin: 12px 24px;
  border-radius: var(--radius-btn);
  justify-content: center;
  border: none;
  border-radius: var(--radius-btn-product);
}
.mobile-nav a.nav-purchase-mobile:hover { background: var(--color-primary-hover); }

/* ── Backdrop overlay ── */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: var(--z-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.nav-backdrop.visible {
  opacity: 1;
  pointer-events: all;
}

/* ══════════════════════════════════════════════════
   SITE FOOTER
══════════════════════════════════════════════════ */
.site-footer {
  background: var(--color-footer-bg);
  color: rgba(255,255,255,0.65);
  padding-block: 48px 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand .footer-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}
.footer-brand p { font-size: 13px; line-height: 1.7; }

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition-fast);
}
.footer-links a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  font-size: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

/* ══════════════════════════════════════════════════
   SCROLL-TO-TOP
══════════════════════════════════════════════════ */
.scroll-top-btn {
  position: fixed;
  bottom: 28px;
  inset-inline-start: 28px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  width: 46px;
  height: 46px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 999;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--transition-base), transform var(--transition-base), background var(--transition-fast);
  box-shadow: 0 4px 14px rgba(62,100,222,0.4);
}
.scroll-top-btn.visible { opacity: 1; transform: translateY(0); }
.scroll-top-btn:hover   { background: var(--color-primary-hover); }

/* ══════════════════════════════════════════════════
   SHARED TYPOGRAPHY & COMPONENTS
══════════════════════════════════════════════════ */
.section-title {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-dark-blue);
  margin-bottom: 20px;
  line-height: var(--line-height-heading);
}
.section-title.center { text-align: center; }
.section-title.white  { color: #fff; }

.section-subtitle {
  font-size: 15px;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}
.section-subtitle.center { text-align: center; }

/* ── Buttons ── */
.btn-product {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-btn-blue);
  color: #fff;
  padding: 13px 30px;
  border-radius: var(--radius-btn-product);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 600;
  border: 4px solid var(--color-btn-blue);
  letter-spacing: 1px;
  transition: background var(--transition-base), border-color var(--transition-base), transform var(--transition-fast);
  cursor: pointer;
}
.btn-product:hover {
  background: var(--color-text);
  border-color: var(--color-text);
  transform: translateY(-1px);
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  padding: 18px 52px;
  border-radius: var(--radius-btn-product);
  font-family: var(--font-family);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  transition: background var(--transition-base), transform var(--transition-fast), box-shadow var(--transition-base);
}
.btn-cta:hover {
  background: var(--color-primary-hover);
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(62,100,222,0.35);
}

/* ── Inner-page hero banner ── */
.page-hero {
  background: linear-gradient(135deg, var(--color-dark-blue) 0%, #0e4d80 100%);
  color: #fff;
  padding-block: 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(62,100,222,0.22) 0%, transparent 65%);
  pointer-events: none;
}
.page-hero .container { position: relative; }
.page-hero h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
}
.page-hero .lead {
  font-size: 16px;
  opacity: 0.85;
  max-width: 600px;
  margin-inline: auto;
  line-height: 1.7;
}

/* ── Page body ── */
.page-body { padding-block: 72px; }

/* ── Article content area ── */
.article-content {
  max-width: 720px;
  margin-inline: auto;
}
.article-content h2 {
  font-size: var(--font-size-h2);
  font-weight: 700;
  color: var(--color-dark-blue);
  margin-block: 36px 16px;
  line-height: var(--line-height-heading);
}
.article-content h3 {
  font-size: var(--font-size-h3);
  font-weight: 700;
  color: var(--color-dark-blue);
  margin-block: 28px 12px;
}
.article-content p {
  margin-bottom: 18px;
  line-height: 1.9;
  font-size: 15px;
}
.article-content ul,
.article-content ol {
  margin-block: 16px 24px;
  padding-inline-start: 24px;
}
.article-content li {
  margin-bottom: 10px;
  line-height: 1.75;
  font-size: 15px;
}
.article-content ul li { list-style: disc; }
.article-content ol li { list-style: decimal; }

.article-cta {
  margin-top: 56px;
  padding: 40px;
  background: var(--color-primary-light);
  border-radius: var(--radius-card);
  text-align: center;
}
.article-cta p {
  font-size: 16px;
  margin-bottom: 20px;
  color: var(--color-dark-blue);
  font-weight: 500;
}

/* ── Article cards (shared on articles + home) ── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 40px;
}
.article-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.article-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card-hover); }
.article-card-icon {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #dde6ff 100%);
  padding: 32px;
  text-align: center;
  font-size: 48px;
  line-height: 1;
  overflow: hidden;
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.article-card-icon img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}
.article-card:hover .article-card-icon img {
  transform: scale(1.06);
}
.article-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.article-card-body h3 {
  font-size: var(--font-size-h3);
  font-weight: 700;
  color: var(--color-dark-blue);
  margin-bottom: 10px;
  line-height: var(--line-height-heading);
}
.article-card-body p {
  font-size: 14px;
  line-height: 1.75;
  color: var(--color-text-muted);
  flex: 1;
  margin-bottom: 20px;
}
.read-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 2px;
  display: inline-block;
  transition: color var(--transition-fast);
}
.read-more:hover { color: var(--color-primary-hover); border-color: var(--color-primary-hover); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid   { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-nav  { display: none; }
  .hamburger { display: flex; }
  .articles-grid { grid-template-columns: 1fr; }
  .footer-grid   { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .page-hero h1  { font-size: 24px; }
  .page-body     { padding-block: 48px; }
}
