/* ==========================================================================
   TechRS — home.css
   Hero, headlines aside, community cards, newsletter banner.
   Depends on tokens from core.css. RTL-first, logical properties only.
   ========================================================================== */

/* ─────────────────────────────────────────────
   Hero — stacked on mobile, 2:1 split >= 1024px
   ───────────────────────────────────────────── */
.home-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-grid);
  margin-block: var(--space-8) var(--space-16);
}
@media (min-width: 1024px) {
  .home-hero {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    align-items: stretch;
  }
}

.hero-lead {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-md), var(--ring-inset-light);
  position: relative;
  transition: box-shadow var(--transition), border-color var(--transition-fast);
}
.hero-lead:hover {
  box-shadow: var(--shadow-lg), var(--glow-cyan-edge);
  border-color: var(--chip-cyan-border);
}
.hero-lead:focus-within {
  border-color: var(--focus-ring);
}

.hero-media {
  display: block;
  overflow: hidden;
}
.hero-media img {
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform var(--transition);
}
.hero-lead:hover .hero-media img {
  transform: scale(1.02);
}

.hero-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.hero-title {
  font-size: var(--step-3);
  font-weight: 800;
  line-height: var(--leading-tight);
}
.hero-title a {
  color: var(--text-primary);
  transition: color var(--transition-fast);
}
.hero-title a:hover {
  color: var(--accent-text);
}
/* Stretch the headline link over the whole lead card */
.hero-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hero-summary {
  color: var(--text-secondary);
  font-size: var(--step-1);
  line-height: 1.6;
  max-inline-size: 60ch;
}

/* ─────────────────────────────────────────────
   Headlines aside
   ───────────────────────────────────────────── */
.hero-headlines {
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  background:
    var(--gradient-mesh),
    var(--bg-card);
  border: 1px solid var(--border-glass);
  align-self: stretch;
}

.hero-headlines-title {
  font-size: var(--step-0);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  border-inline-start: 3px solid var(--brand-cyan);
  padding-inline-start: var(--space-2);
  margin-block-end: var(--space-3);
}

.hero-headlines ul {
  display: flex;
  flex-direction: column;
}
.hero-headlines li {
  padding-block: var(--space-3);
  border-block-end: 1px solid var(--border-glass);
}
.hero-headlines li:last-child {
  border-block-end: 0;
  padding-block-end: 0;
}
.hero-headlines li a {
  display: block;
  font-weight: 700;
  line-height: var(--leading-snug);
  color: var(--text-primary);
  transition: color var(--transition-fast);
}
.hero-headlines li a:hover {
  color: var(--accent-text);
}
.hero-headlines time {
  display: block;
  margin-block-start: var(--space-1);
  font-size: var(--step--1);
  color: var(--text-muted);
}

/* ─────────────────────────────────────────────
   Home sections
   ───────────────────────────────────────────── */
.home-section {
  margin-block: var(--space-16);
}

/* ─────────────────────────────────────────────
   Community
   ───────────────────────────────────────────── */
/* The community/related headings sit outside a .section-head row */
.community-block > h2 {
  margin-block-end: var(--space-6);
}

.community-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-grid);
}
@media (min-width: 640px) {
  .community-cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

.community-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition-fast);
}
.community-card:hover {
  transform: translateY(-4px);
  border-color: var(--chip-cyan-border);
  box-shadow: var(--shadow-md), var(--glow-cyan-edge);
}
.community-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 48px;
  block-size: 48px;
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  flex-shrink: 0;
}
.community-icon .icon {
  inline-size: 26px;
  block-size: 26px;
}
.community-icon--telegram {
  color: #29a9eb;
}
.community-icon--youtube {
  color: #ff4d4d;
}
.community-card-body {
  display: flex;
  flex-direction: column;
}
.community-card-title {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--accent-text);
  margin-block-end: var(--space-1);
}
.community-card-text {
  display: block;
  color: var(--text-secondary);
  font-size: var(--step--1);
  line-height: 1.65;
}

/* ─────────────────────────────────────────────
   Vulns home widget ("קריטיות השבוע")
   The homepage doesn't load vulns.css, so the widget's rules live here.
   .badge variants come from core.css; the CVE link and freshness line are
   targeted by element to leave .cve-link/.vulns-freshness owned by vulns.css.
   ───────────────────────────────────────────── */
.vulns-widget {
  padding: var(--space-6);
  border-radius: var(--radius-2xl);
}
/* the widget's head row (div.section-head — element-scoped to keep the
   class owned by core.css) and its freshness line */
.vulns-widget > div:first-child {
  margin-block-end: var(--space-3);
}
.vulns-widget > div:first-child p {
  color: var(--text-muted);
  font-size: var(--step--1);
}

.vulns-widget-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding-block: var(--space-3);
  border-block-end: 1px solid var(--border-glass);
}
.vulns-widget-list li:last-child {
  border-block-end: 0;
}
.vulns-widget-list a {
  font-family: var(--font-mono); /* Latin CVE ids only */
  font-size: 0.95em;
  color: var(--accent-text);
  white-space: nowrap;
}
.vulns-widget-list a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.widget-product {
  flex: 1 1 8rem;
  min-inline-size: 0;
  color: var(--text-muted);
  font-size: var(--step--1);
  overflow-wrap: anywhere;
}

.section-more-row {
  margin-block-start: var(--space-4);
}

/* ─────────────────────────────────────────────
   Newsletter banner
   ───────────────────────────────────────────── */
.newsletter-banner {
  margin-block: var(--space-16) var(--space-8);
  padding: clamp(2rem, 5vw, 3.5rem);
  border-radius: var(--radius-2xl);
  text-align: center;
  background:
    var(--gradient-mesh),
    var(--bg-card);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-md), var(--ring-inset-light);
}
.newsletter-banner h2 {
  font-size: var(--step-2);
  font-weight: 800;
  margin-block-end: var(--space-3);
}
.newsletter-banner p {
  color: var(--text-secondary);
  max-inline-size: 48ch;
  margin-inline: auto;
  margin-block-end: var(--space-6);
}

/* Launch/empty-state welcome hero (shown when no articles are published yet) */
.welcome-hero {
  text-align: center;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1.25rem, 5vw, 3rem);
  border-radius: var(--radius-2xl);
  background:
    radial-gradient(680px 360px at 50% 0%, rgba(25, 196, 220, 0.12), transparent 65%),
    var(--bg-card);
  margin-block-end: var(--space-8);
}
.welcome-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-block-end: var(--space-3);
}
.welcome-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-3);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  margin-block-end: var(--space-4);
}
.welcome-lead {
  max-inline-size: 60ch;
  margin-inline: auto;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-block-end: var(--space-6);
}
.welcome-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}
