/* ==========================================================================
   NEXTAI Editorial Homepage Styles
   1. הסיפור של היום (Lead Story of the Day)
   2. 5 דברים שצריך לדעת היום (Daily Digest 5 Bullets)
   3. טיקר NEXTAI (Real-time AI Market & Index Ticker)
   4. מבזקים — עמודה חיה בצד לצד מדורי התוכן
   ========================================================================== */

:root {
  --desk-ink: #182234;
  --desk-text-muted: #64748b;
  --desk-border: #e2e8f0;
  --desk-border-subtle: #edf0f4;
  --desk-accent: #5952d6;
  --desk-green: #10b981;
  --desk-red: #ef4444;
}

/* ==========================================================================
   1. הסיפור של היום (Story of the Day)
   ========================================================================== */
.story-of-the-day-section {
  padding: 20px 0 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--desk-border);
}
.story-roof-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--desk-border-subtle);
}
.story-roof-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.story-roof-pill {
  display: inline-flex;
  align-items: center;
  background: var(--desk-ink);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.story-roof-sep {
  color: #cbd5e1;
  font-size: 12px;
}
.story-roof-cat {
  font-size: 13px;
  font-weight: 700;
  color: var(--desk-accent);
  text-decoration: none;
}
.story-roof-cat:hover {
  text-decoration: underline;
}
.story-roof-date {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--desk-text-muted);
}

/* Lead Card: 58% Media / 42% Content */
.story-lead-card {
  display: grid;
  grid-template-columns: 58fr 42fr;
  gap: 32px;
  align-items: stretch;
}
.story-lead-media {
  min-width: 0;
}
.story-lead-img-wrap {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 420px;
  border-radius: 6px;
  overflow: hidden;
  background-color: #0f172a;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}
.story-lead-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.story-lead-card:hover .story-lead-img {
  transform: scale(1.02);
}

.story-lead-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: 4px 0;
}
.story-lead-title {
  font-size: clamp(24px, 2.3vw, 34px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: var(--desk-ink);
}
.story-lead-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.story-lead-title a:hover {
  color: var(--desk-accent);
}
.story-lead-excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: #475569;
  margin: 0 0 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-lead-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--desk-border-subtle);
  margin-top: auto;
}
.story-lead-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--desk-text-muted);
}
.story-meta-dot {
  color: #cbd5e1;
}
.story-read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--desk-accent);
  text-decoration: none;
  transition: gap 0.2s ease;
}
.story-read-link:hover {
  gap: 8px;
}
.story-read-link svg {
  transform: scaleX(-1);
}

/* ==========================================================================
   2. 5 דברים שצריך לדעת היום (5 Things to Know Today)
   ========================================================================== */
.five-things-section {
  padding: 20px 0 24px;
  background: #f8fafc;
  border-bottom: 1px solid var(--desk-border);
}
.five-things-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--desk-border);
}
.five-things-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
}
.five-things-badge {
  background: rgba(89, 82, 214, 0.1);
  color: var(--desk-accent);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}
.five-things-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--desk-ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.five-things-subtitle {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--desk-text-muted);
}

.five-things-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
}
.five-things-item {
  padding: 0 16px;
  border-left: 1px solid var(--desk-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  height: 100%;
}
.five-things-item:first-child {
  padding-right: 0;
}
.five-things-item:last-child {
  padding-left: 0;
  border-left: none;
}
.five-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.five-item-num {
  font-size: 17px;
  font-weight: 800;
  color: var(--desk-accent);
  letter-spacing: -0.01em;
  font-feature-settings: 'tnum';
}
.five-item-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--desk-text-muted);
}
.five-item-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 6px;
  color: var(--desk-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.five-item-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.five-item-title a:hover {
  color: var(--desk-accent);
}
.five-item-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.five-item-meta {
  margin-top: auto;
}
.five-item-time {
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
}

/* ==========================================================================
   3. טיקר NEXTAI (Ticker Strip)
   ========================================================================== */
.nextai-ticker-strip {
  background: #0c1322;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: 42px;
  overflow: hidden;
}
.ticker-inner {
  display: flex;
  align-items: stretch;
  height: 100%;
}
.ticker-index-box {
  background: #141d30;
  color: #ffffff;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  z-index: 10;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.ticker-index-box:hover {
  background: #1c2842;
}
.ticker-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--desk-green);
  box-shadow: 0 0 8px var(--desk-green);
  animation: ticker-pulse 1.8s infinite;
}
@keyframes ticker-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
.ticker-index-label {
  font-size: 12.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.ticker-index-val {
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
  font-feature-settings: 'tnum';
}
.ticker-index-badge.up {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

.ticker-track-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  direction: ltr;
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  animation: ticker-marquee 35s linear infinite;
  will-change: transform;
}
.ticker-track:hover {
  animation-play-state: paused;
}
@keyframes ticker-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-stock-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #ffffff;
  text-decoration: none;
  font-size: 12.5px;
  transition: opacity 0.15s ease;
}
.ticker-stock-item:hover {
  opacity: 0.85;
}
.stock-sym {
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.stock-name {
  font-size: 11px;
  color: #94a3b8;
}
.stock-price {
  font-weight: 600;
  color: #e2e8f0;
  font-feature-settings: 'tnum';
}
.stock-chg {
  font-size: 11px;
  font-weight: 700;
}
.stock-chg.up {
  color: #34d399;
}
.stock-chg.down {
  color: #f87171;
}

/* ==========================================================================
   4. מבזקים — עמודה חיה בצד לצד מדורי האתר (Section 4)
   ========================================================================== */
.live-desk-section {
  padding: 28px 0 36px;
  background: #ffffff;
}
.live-desk-grid {
  display: grid;
  grid-template-columns: 68fr 32fr;
  gap: 32px;
  align-items: start;
}

/* Main Column: Desks */
.live-desk-main {
  min-width: 0;
}
.desk-block {
  margin-bottom: 32px;
}
.desk-block:last-child {
  margin-bottom: 0;
}
.desk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--desk-ink);
}
.desk-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.desk-accent-bar {
  width: 4px;
  height: 18px;
  border-radius: 2px;
}
.markets-bar { background: #10b981; }
.magazine-bar { background: var(--desk-accent); }
.business-bar { background: #3b82f6; }

.desk-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--desk-ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.desk-more-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--desk-accent);
  text-decoration: none;
  transition: gap 0.2s ease;
}
.desk-more-link:hover {
  gap: 8px;
}
.desk-more-link svg {
  transform: scaleX(-1);
}

.desk-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.desk-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}
.desk-card-media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 4px;
  overflow: hidden;
  background-color: #0f172a;
  margin-bottom: 8px;
}
.desk-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.desk-card:hover .desk-card-img {
  transform: scale(1.03);
}
.desk-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.desk-card-cat {
  font-size: 11px;
  font-weight: 700;
  color: var(--desk-accent);
  margin-bottom: 3px;
}
.desk-card-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.32;
  margin: 0 0 6px;
  color: var(--desk-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desk-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.desk-card-title a:hover {
  color: var(--desk-accent);
}
.desk-card-excerpt {
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desk-card-time {
  margin-top: auto;
  font-size: 11.5px;
  font-weight: 500;
  color: #94a3b8;
}

/* Sidebar Column: Live Flashes (מבזקים) */
.live-desk-sidebar {
  min-width: 0;
}
.flashes-sticky-box {
  position: sticky;
  top: 80px;
  background: #ffffff;
  border: 1px solid var(--desk-border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(24, 34, 52, 0.04);
}
.flashes-box-header {
  background: var(--desk-ink);
  color: #ffffff;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flashes-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flashes-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--desk-red);
  box-shadow: 0 0 8px var(--desk-red);
  animation: flashes-pulse 1.4s infinite;
}
@keyframes flashes-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}
.flashes-box-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.02em;
}
.flashes-box-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  padding: 2px 7px;
  border-radius: 3px;
}

.flashes-list {
  max-height: 600px;
  overflow-y: auto;
  padding: 4px 0;
}
.flash-row {
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}
.flash-row:last-child {
  border-bottom: none;
}
.flash-row:hover {
  background-color: #f8fafc;
}
.flash-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.flash-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--desk-accent);
  font-feature-settings: 'tnum';
}
.flash-cat-pill {
  font-size: 10.5px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 6px;
  border-radius: 2px;
}
.flash-headline {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--desk-ink);
}
.flash-headline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}
.flash-headline a:hover {
  color: var(--desk-accent);
}

.flashes-box-footer {
  padding: 10px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--desk-border);
  text-align: center;
}
.flashes-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--desk-accent);
  text-decoration: none;
  transition: gap 0.2s ease;
}
.flashes-all-btn:hover {
  gap: 8px;
}
.flashes-all-btn svg {
  transform: scaleX(-1);
}

/* ==========================================================================
   Responsive Adaptations & Precision Mobile Polish
   ========================================================================== */
@media (max-width: 1024px) {
  .story-lead-card {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .story-lead-img-wrap {
    aspect-ratio: 16 / 9;
    min-height: 0;
    max-height: 380px;
  }
  .five-things-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  .five-things-item {
    border-left: none;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--desk-border);
  }
  .five-things-item:last-child {
    border-bottom: none;
  }
  .live-desk-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .live-desk-sidebar {
    order: -1; /* Elevate live flashes right after ticker on tablets/mobile! */
    width: 100%;
  }
  .flashes-sticky-box {
    position: static;
    border-radius: 8px;
  }
  .flashes-list {
    max-height: 260px;
  }
}

@media (max-width: 768px) {
  /* Section 1: Lead Story */
  .story-of-the-day-section {
    padding: 14px 0 18px;
  }
  .story-roof-bar {
    margin-bottom: 10px;
    padding-bottom: 6px;
  }
  .story-roof-pill {
    font-size: 10.5px;
    padding: 2px 7px;
  }
  .story-lead-img-wrap {
    aspect-ratio: 16 / 9;
    min-height: 0;
    border-radius: 6px;
  }
  .story-lead-title {
    font-size: 20px;
    line-height: 1.25;
    margin-bottom: 8px;
  }
  .story-lead-excerpt {
    font-size: 13.5px;
    line-height: 1.48;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .story-lead-footer {
    padding-top: 10px;
  }
  .story-lead-meta {
    font-size: 11.5px;
  }

  /* Section 2: 5 Things - Sleek Scannable Briefing Rows */
  .five-things-section {
    padding: 12px 0 14px;
  }
  .five-things-header {
    margin-bottom: 8px;
    padding-bottom: 4px;
  }
  .five-things-title {
    font-size: 16px;
  }
  .five-things-subtitle {
    display: none;
  }
  .five-things-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .five-things-item {
    display: grid;
    grid-template-columns: 26px 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    padding: 7px 10px;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    background: #ffffff;
    border-left: 1px solid #edf2f7;
  }
  .five-item-top {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
  }
  .five-item-num {
    font-size: 13px;
    font-weight: 800;
    color: var(--desk-accent);
    background: rgba(89, 82, 214, 0.08);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .five-item-cat {
    display: none;
  }
  .five-item-title {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    font-size: 13px;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .five-item-desc {
    display: none; /* Hide heavy paragraph on mobile for high density */
  }
  .five-item-meta {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    margin-top: 2px;
  }
  .five-item-time {
    font-size: 10.5px;
    color: #94a3b8;
  }

  /* Section 3: Ticker */
  .nextai-ticker-strip {
    height: 38px;
  }
  .ticker-index-box {
    padding: 0 10px;
    gap: 6px;
  }
  .ticker-index-label {
    font-size: 11px;
  }
  .ticker-index-val {
    font-size: 12px;
  }
  .ticker-index-badge.up {
    font-size: 10.5px;
    padding: 1px 4px;
  }
  .ticker-stock-item {
    font-size: 12px;
    gap: 4px;
  }

  /* Section 4: Live Desk & Flashes */
  .live-desk-section {
    padding: 18px 0 28px;
  }
  .desk-block {
    margin-bottom: 22px;
  }
  .desk-header {
    margin-bottom: 10px;
    padding-bottom: 6px;
  }
  .desk-title {
    font-size: 17px;
  }
  .desk-more-link {
    font-size: 11.5px;
  }
  
  /* Desks Mobile Hierarchy: Card 1 Lead + Cards 2&3 Compact Horizontal Rows */
  .desk-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .desk-card:first-child .desk-card-media {
    aspect-ratio: 16 / 9;
    margin-bottom: 8px;
  }
  .desk-card:first-child .desk-card-title {
    font-size: 15px;
    margin-bottom: 4px;
  }
  .desk-card:first-child .desk-card-excerpt {
    font-size: 12.5px;
    line-height: 1.45;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  /* Secondary stories in desk: Clean horizontal split (Text on right in RTL, Thumbnail on left) */
  .desk-card:nth-child(n+2) {
    display: grid;
    grid-template-columns: 1fr 76px;
    gap: 12px;
    align-items: center;
    padding-top: 9px;
    padding-bottom: 2px;
    border-top: 1px solid #f1f5f9;
  }
  .desk-card:nth-child(n+2) .desk-card-body {
    grid-column: 1 / 2;
    min-width: 0;
  }
  .desk-card:nth-child(n+2) .desk-card-media {
    grid-column: 2 / 3;
    margin-bottom: 0;
    aspect-ratio: 16 / 10;
    height: 50px;
    width: 76px;
    border-radius: 4px;
    flex-shrink: 0;
  }
  .desk-card:nth-child(n+2) .desk-card-cat {
    font-size: 10px;
    margin-bottom: 2px;
  }
  .desk-card:nth-child(n+2) .desk-card-title {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .desk-card:nth-child(n+2) .desk-card-excerpt {
    display: none;
  }
  .desk-card:nth-child(n+2) .desk-card-time {
    font-size: 11px;
  }

  /* Live Flashes Box on Mobile */
  .flashes-box-header {
    padding: 10px 14px;
  }
  .flashes-title-group {
    gap: 6px;
  }
  .flashes-box-title {
    font-size: 14.5px;
  }
  .flashes-list {
    max-height: 240px;
  }
  .flash-row {
    padding: 9px 12px;
  }
  .flash-time {
    font-size: 11px;
  }
  .flash-cat-pill {
    font-size: 10px;
    padding: 1px 5px;
  }
  .flash-headline {
    font-size: 12.5px;
    line-height: 1.35;
  }
  .flashes-box-footer {
    padding: 8px 12px;
  }
  .flashes-all-btn {
    font-size: 11.5px;
    padding: 4px 10px;
  }
}
