/* =========================================================
   SRB — Style Addons v3
   ========================================================= */

/* ─── Skip Link ──────────────────────────────────────────── */
.skip-link {
  position: fixed;
  top: -80px;
  right: 20px;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  z-index: 9999;
  transition: top 0.2s ease;
  text-decoration: none;
}
.skip-link:focus { top: 0; outline: 3px solid var(--gold); outline-offset: 2px; }

/* ─── Fade-up (IntersectionObserver triggered) ───────────── */
.fade-up {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.58s ease, transform 0.58s ease;
  will-change: opacity, transform;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}
@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── Topbar contrast fix ────────────────────────────────── */
.topbar-tagline { color: rgba(255,255,255,0.75); }
@media (max-width: 640px) {
  .topbar-tagline { display: none; }
}

/* ─── Navbar Active State ────────────────────────────────── */
.nav-links a.active {
  color: var(--navy);
  font-weight: 700;
  background: rgba(26,47,74,0.06);
  border-radius: var(--radius-sm);
}
/* Remove !important from nav-cta */
.nav-links .nav-cta {
  background: var(--navy);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 3px 12px rgba(26,47,74,0.25);
}
.nav-links .nav-cta:hover {
  background: var(--navy-mid);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(26,47,74,0.32);
}

/* ══════════════════════════════════════════════════════════
   BUTTON HOVER FIXES — All buttons audited
   ══════════════════════════════════════════════════════════ */

/* ── 1. midrag-link — FIXED: was changing to same color (invisible) ── */
/*    Base: background: white-to-cream, color: var(--navy-deep)        */
/*    Bug:  hover only did color: var(--navy) — barely different!       */
.midrag-link:hover {
  background: linear-gradient(135deg, #f5edd9 0%, #e8dcc6 100%) !important;
  border-color: rgba(184,144,60,0.35) !important;
  color: var(--navy-deep) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 20px 44px rgba(15,30,48,0.28) !important;
}

/* ── 2. service-link — FIXED: better hover with underline + opacity ── */
/*    Base: color: var(--gold), button-style text                       */
.service-link:hover {
  color: var(--navy) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── 3. article-read-more — add smooth color transition ─────────────── */
.article-read-more {
  transition: color 0.22s ease, border-color 0.22s ease, background 0.22s ease !important;
}

/* ── 4. CTA gold button — add brightness on hover ───────────────────── */
/*    Base: gold gradient. Hover: only transform+shadow (no bg change)  */
.cta-actions .btn-primary:hover,
.cta-actions .btn-gold:hover {
  filter: brightness(1.08);
}

/* ── 5. btn-gold general — brighten on hover ─────────────────────────── */
.btn-gold:hover { filter: brightness(1.06); }

/* ── 6. Footer gold button ──────────────────────────────────────────── */
.footer .btn-gold:hover { filter: brightness(1.1); }

/* ── 7. Footer links ────────────────────────────────────────────────── */
.footer ul li a {
  transition: color 0.2s ease;
}
.footer ul li a:hover { color: var(--gold-light); }

/* ── 8. Modal close button ──────────────────────────────────────────── */
.service-modal-close:focus-visible,
.service-modal-actions .btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════
   CARD HOVER — will-change for smooth GPU compositing
   ══════════════════════════════════════════════════════════ */
.service-card {
  will-change: transform;
}
.service-card-media {
  overflow: hidden;
}
.service-card-media img {
  transition: transform 0.38s ease;
  will-change: transform;
}
.service-card:hover .service-card-media img {
  transform: scale(1.04);
}

.article-card-media {
  overflow: hidden;
}
.article-card-media img {
  transition: transform 0.38s ease;
  will-change: transform;
}
.article-card:hover .article-card-media img {
  transform: scale(1.04);
}

/* ══════════════════════════════════════════════════════════
   HAMBURGER BUTTON
   ══════════════════════════════════════════════════════════ */
.hamburger {
  display: none;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  cursor: pointer;
  color: var(--navy);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
  flex-shrink: 0;
}
.hamburger:hover { border-color: var(--navy); background: rgba(26,47,74,0.05); }
.hamburger:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.hamburger-line {
  width: 20px;
  height: 2px;
  background: var(--navy);
  border-radius: 999px;
  display: block;
  transition: transform 0.25s ease, opacity 0.25s ease;
  transform-origin: center;
}
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════════════════════
   MOBILE NAV OVERLAY — visibility+opacity (no display flash)
   ══════════════════════════════════════════════════════════ */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,38,0.52);
  z-index: 198;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ══════════════════════════════════════════════════════════
   MOBILE NAV DRAWER — RIGHT side (correct for RTL Hebrew)
   FIXED: was using inset-inline-end which = LEFT in RTL!
   ══════════════════════════════════════════════════════════ */
.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(82vw, 300px);
  background: #fff;
  z-index: 199;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);          /* Off-screen to the RIGHT */
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -10px 0 40px rgba(10,22,38,0.16);
}
.mobile-nav.open { transform: translateX(0); }

body.nav-open { overflow: hidden; }

/* ── Header ── */
.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: linear-gradient(180deg, #fff 0%, #faf8f4 100%);
}
.mobile-nav-brand { display: flex; flex-direction: column; }
.mobile-nav-title {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.mobile-nav-subtitle {
  font-size: 11px;
  color: var(--gold);
  font-weight: 600;
  margin-top: 2px;
}
.mobile-nav-close {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.mobile-nav-close:hover { border-color: var(--navy); background: rgba(26,47,74,0.05); }
.mobile-nav-close:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ── Links ── */
.mobile-nav-links {
  flex: 1;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-soft);
  transition: background 0.2s ease, color 0.2s ease;
  text-decoration: none;
  border: 1px solid transparent;
}
.mobile-nav-links a::after {
  content: '‹';
  font-size: 16px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateX(-4px);
}
.mobile-nav-links a:hover {
  background: rgba(26,47,74,0.05);
  color: var(--navy);
}
.mobile-nav-links a:hover::after { opacity: 1; transform: translateX(0); }
.mobile-nav-links a.active {
  background: rgba(26,47,74,0.07);
  color: var(--navy);
  font-weight: 700;
  border-color: var(--border-soft);
}
.mobile-nav-divider {
  height: 1px;
  background: var(--border-soft);
  margin: 6px 14px;
}

/* ── Footer ── */
.mobile-nav-footer {
  padding: 14px 14px 20px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(0deg, #faf8f4 0%, #fff 100%);
  flex-shrink: 0;
}
.mobile-nav-footer .btn {
  width: 100%;
  justify-content: center;
  font-size: 14.5px;
}
.mobile-nav-footer .btn-outline:hover {
  border-color: var(--navy);
  background: rgba(26,47,74,0.04);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  .nav-links  { display: none; }
}

/* QA fix: keep the mobile drawer fully hidden until JS opens it */
.mobile-nav[hidden],
.mobile-nav-overlay[hidden] {
  display: none !important;
}


/* Mobile article links refinement */
.mobile-nav-section-title {
  font-weight: 800;
  color: var(--navy-deep, #0f2438);
}
.mobile-nav-sub-links {
  margin: 0 0 8px 0;
  padding: 6px 14px 10px;
  border-radius: 16px;
  background: rgba(246, 241, 232, 0.72);
  border: 1px solid rgba(203, 164, 92, 0.22);
}
.mobile-nav-sub-links a {
  display: block;
  padding: 10px 6px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--text, #26384a);
  border-bottom: 1px solid rgba(15, 36, 56, 0.08);
}
.mobile-nav-sub-links a:last-child {
  border-bottom: 0;
}

@media (max-width: 640px) {
  .articles-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: stretch;
  }
  .filter-btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
    white-space: normal;
    line-height: 1.25;
  }
}

/* Article filters polish - v3 */
.articles-filter{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:10px;
}
.articles-filter .filter-btn{
  white-space:nowrap;
}
@media (max-width: 640px){
  .articles-filter{
    justify-content:center;
    gap:8px;
    padding-inline:12px;
  }
  .articles-filter .filter-btn{
    font-size:13px;
    padding:10px 14px;
    line-height:1.2;
  }
}
