/*
Theme Name: Shvoong Results
Theme URI: https://shvoong.co.il
Description: Custom race results theme
Version: 2.17
Author: Shvoong
*/

/* ===== ARCHIVE / POST CARDS — match homepage .category-card aesthetic =====
   Used on /category/* pages where Elementor's Posts widget renders article
   cards. Goal: rounded 18px corners, soft border, subtle base shadow that
   lifts on hover, Heebo title in blue-dark, consistent height & padding. */
/* Force Heebo on the entire footer too — its inline-styled headings
   and link lists otherwise inherit Elementor's default font on
   archive/single pages where the giant non-front wp_head CSS is
   short-circuited. */
footer, footer *,
.footer-grid, .footer-grid *,
.footer-col, .footer-col *,
.footer-brand, .footer-brand *,
.footer-bottom, .footer-bottom * {
  font-family: 'Heebo', sans-serif !important;
}

/* Force Heebo across every Elementor element that participates in the
   archive card UI — Elementor's own kit CSS otherwise wins via higher
   specificity and pulls a sans-serif fallback. */
.elementor-widget-heading .elementor-heading-title,
.elementor-widget-archive-posts,
.elementor-widget-posts,
.elementor-posts-container,
.elementor-post,
.elementor-post *,
.elementor-post__card,
.elementor-post__card *,
.elementor-post__title,
.elementor-post__title a,
.elementor-post__excerpt,
.elementor-post__excerpt p,
.elementor-post__meta-data,
.elementor-post__meta-data *,
.elementor-post-date,
.elementor-post__badge {
  font-family: 'Heebo', sans-serif !important;
}

.elementor-post__card {
  background: #fff !important;
  border-radius: 18px !important;
  overflow: hidden !important;
  border: 1px solid var(--c-line, #e2e8f0) !important;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15,30,61,0.05)) !important;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  position: relative;
}
.elementor-post__card:hover {
  transform: translateY(-6px);
  border-color: var(--c-blue, #3B82C4) !important;
  box-shadow: var(--shadow-lg, 0 12px 30px rgba(15,30,61,0.12)) !important;
}

.elementor-post__thumbnail__link {
  display: block !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  position: relative;
}
.elementor-post__thumbnail {
  height: 160px !important;
  overflow: hidden !important;
  position: relative;
}
.elementor-post__thumbnail::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(37,99,168,0) 35%, rgba(15,30,61,.18) 100%);
  pointer-events: none;
}
.elementor-post__thumbnail img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  transition: transform .35s ease;
}
.elementor-post__card:hover .elementor-post__thumbnail img { transform: scale(1.05); }

/* Year/category badge — chip in the top corner of the image */
.elementor-post__badge {
  position: absolute !important;
  top: 12px !important; right: 12px !important;
  background: rgba(15,23,42,.72) !important;
  color: #fff !important;
  font-size: .72rem !important;
  font-weight: 700 !important;
  padding: .25rem .8rem !important;
  border-radius: 100px !important;
  letter-spacing: .3px;
  z-index: 2 !important;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.elementor-post__avatar { display: none !important; }

.elementor-post__text {
  padding: 1.1rem 1.2rem .4rem !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1;
}
.elementor-post__title {
  margin: 0 !important;
  font-family: 'Heebo', sans-serif !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  line-height: 1.4 !important;
  color: var(--c-blue-dark, #1a3a5c) !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.elementor-post__title a {
  color: inherit !important;
  text-decoration: none !important;
}
.elementor-post__title a:hover { color: var(--c-blue, #3B82C4) !important; }
.elementor-post__excerpt p {
  font-size: .85rem !important;
  color: var(--c-muted, #64748b) !important;
  line-height: 1.5 !important;
  margin: .4rem 0 0 !important;
}

/* Date row at the bottom — matches the homepage's bottom-meta rhythm
   (subtle border-top, small muted text, a dot for visual punctuation). */
.elementor-post__meta-data {
  margin-top: auto !important;
  padding: .7rem 1.2rem 1rem !important;
  font-size: .82rem !important;
  font-weight: 600;
  color: var(--c-muted, #64748b) !important;
  border-top: 1px solid var(--c-line-soft, #f1f5f9) !important;
  display: flex !important;
  align-items: center;
  gap: .5rem;
}
.elementor-post__meta-data::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-green, #A4D232);
  flex-shrink: 0;
}
.elementor-post-date { font-variant-numeric: tabular-nums; }

/* Grid spacing — make sure cards breathe consistently */
.elementor-posts-container { gap: 1rem; }

/* Compact archive cards — short image, tight padding, smaller title.
   Keeps the homepage aesthetic but shrinks the overall card height. */
.elementor-post__thumbnail { height: 110px !important; }
.elementor-post__text { padding: .7rem .9rem .3rem !important; }
.elementor-post__title { font-size: .92rem !important; line-height: 1.35 !important; -webkit-line-clamp: 2 !important; }
.elementor-post__meta-data { padding: .5rem .9rem .7rem !important; font-size: .74rem !important; }
.elementor-post__meta-data::before { width: 5px; height: 5px; }

/* Drop the year/category badge that sat on top of the image — redundant
   now that the page hero already announces the category. */
.elementor-post__badge { display: none !important; }

@media (max-width: 768px) {
  .elementor-post__thumbnail { height: 130px !important; }
  .elementor-post__title { font-size: .95rem !important; }
}


/* ===== ARCHIVE HERO — branded banner above the category cards ===== */

/* Hide Elementor's generic "אירועים בקטגוריה: X" heading on category
   pages; our PHP-rendered .archive-hero replaces it with a richer one. */
body.category .elementor-widget-heading { display: none !important; }

/* The Elementor archive template renders its own blue breadcrumb hero
   section below our .archive-hero — drop it (our hero already carries the
   title + crumb). :has() targets the section wrapping the breadcrumbs
   widget; a wp_footer JS fallback covers browsers without :has(). */
.elementor-location-archive .elementor-section:has(.elementor-widget-breadcrumbs) {
  display: none !important;
}

/* On single posts hide the whole Elementor section that wraps the
   Theme Post Title widget — not just the widget itself. The section
   has a .elementor-background-overlay div that would otherwise stay
   on screen as an empty banner once the widget is removed.

   The :has() selector is supported in all evergreen browsers (Chrome
   105+, Safari 15.4+, Firefox 121+). */
body.single .elementor-section:has(.elementor-widget-theme-post-title) {
  display: none !important;
}
/* JS fallback target + extra-aggressive widget hide so old browsers
   without :has() still drop at least the duplicate <h1>. */
body.single .elementor-widget-theme-post-title,
body.single [data-widget_type="theme-post-title.default"] {
  display: none !important;
  height: 0 !important;
  visibility: hidden !important;
}

.archive-hero {
  position: relative;
  background: #0f1e3d;
  color: #fff;
  text-align: center;
  padding: 1.4rem 1rem;
  min-height: 180px;
  max-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  direction: rtl;
}
.archive-hero-bg {
  position: absolute; inset: 0;
  /* Same photo + tint stack the homepage hero uses, so every archive /
     event page wears the same backdrop. */
  background:
    linear-gradient(135deg, rgba(15,30,61,0.85) 0%, rgba(37,99,168,0.55) 55%, rgba(15,30,61,0.85) 100%),
    radial-gradient(circle at 22% 50%, rgba(164,210,50,0.18) 0%, transparent 55%),
    url('https://images.unsplash.com/photo-1476480862126-209bfaa8edc8?w=1600&q=80') center/cover no-repeat;
  pointer-events: none;
}
.archive-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  width: 100%;
}
.archive-hero-crumbs {
  font-family: 'Heebo', sans-serif;
  font-size: .82rem;
  color: rgba(255,255,255,0.82);
  margin-bottom: .55rem;
  display: flex;
  gap: .4rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.archive-hero-crumbs a {
  color: #c4ec5e;
  text-decoration: none;
  font-weight: 700;
  transition: color .15s;
}
.archive-hero-crumbs a:hover { color: #fff; }
.archive-hero-crumbs .sep { opacity: .55; }
.archive-hero-title {
  font-family: 'Heebo', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0;
  color: #fff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.archive-hero-sub {
  font-family: 'Heebo', sans-serif;
  font-size: .95rem;
  color: rgba(255,255,255,0.88);
  max-width: 720px;
  margin: .55rem auto 0;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .archive-hero { padding: 1.1rem .9rem; min-height: 140px; }
  .archive-hero-title { font-size: 1.45rem; }
  .archive-hero-crumbs { font-size: .76rem; }
  .archive-hero-sub { font-size: .85rem; }
}


/* ===== ACTIVE TOP-NAV SPORT =====
   The green underline follows the current category. <body> gets a sport-<slug>
   class (set in functions.php); we light up the matching top-level nav link.
   Replaces the old hard-coded class="active" that was stuck on "תוצאות ריצה". */
body.sport-running   header nav > ul > li > a[href$="/category/running/"],
body.sport-bicycle   header nav > ul > li > a[href$="/category/bicycle/"],
body.sport-triathlon header nav > ul > li > a[href$="/category/triathlon/"],
body.sport-swimming  header nav > ul > li > a[href$="/category/swimming/"],
body.sport-iaa       header nav > ul > li > a[href$="/category/iaa/"] {
  color: var(--c-blue, #3B82C4) !important;
  border-bottom-color: var(--c-green, #A4D232) !important;
}


/* ===== FOOTER — mobile/tablet 2-up (50% / 50%) =====
   On narrow screens the 4 sport columns sit two-per-row; the brand block spans
   the full width on top. Loaded site-wide (style.css), with !important so it
   wins over the per-page footer media queries in functions.php & front-page.php. */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr !important; gap: 1.6rem 1.25rem !important; }
  .footer-brand { grid-column: 1 / -1 !important; }
}


