/* Spinelli Daily Briefing (cards + grids, Inter/Merriweather friendly). */
.spinelli-briefing {
  margin-top: 2.5rem;
}

.spinelli-briefing .briefing-header h2 {
  font-family: 'Merriweather', Georgia, serif;
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  margin: 0 0 .25rem;
}
.spinelli-briefing .briefing-header .desc {
  color: var(--muted, #5b657a);
  margin: 0 0 1.2rem;
}

.briefing-section { margin: 1.6rem 0 2.2rem; }
.briefing-section h3 {
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  margin: 0 0 .9rem;
}

/* Grids */
.grid {
  display: grid;
  gap: 1rem;
}
.grid-featured {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.grid-recent {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Card */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 0 rgba(10,20,30,.06), 0 6px 18px rgba(10,20,30,.05);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}

/* All card thumbnails: force 16:9 and crop to keep rows uniform */
.card .thumb img {
  width: 100%;
  height: auto;        /* override HTML height="..." so aspect-ratio can work */
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Inline video players in cards */
.feed-embed.video {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
}

/* Maintain a 16:9 box even before the video paints (HTML5 <video> case) */
.feed-embed.video::before {
  content: "";
  display: block;
  padding-top: 56.25%; /* 16:9 */
}

.feed-embed.video video,
.feed-embed.video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: cover;
}

.card-link { color: inherit; text-decoration: none; display: block; }
.card .body { padding: .85rem .95rem 1rem; }
.card .title {
  font-size: 1rem;
  line-height: 1.35;
  margin: 0 0 .45rem;
  font-weight: 700;
}
.card .excerpt {
  color: var(--muted, #5b657a);
  font-size: .92rem;
  margin: 0 0 .6rem;
}
.card .source {
  display: inline-block;
  font-size: .78rem;
  color: #334155;
  background: #eef2ff;
  padding: .2rem .45rem;
  border-radius: .4rem;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 0 rgba(10,20,30,.06), 0 14px 30px rgba(10,20,30,.08);
}

/* Topics Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}
.topic-col {
  background: #fff;
  border-radius: 12px;
  padding: .8rem .9rem;
  box-shadow: 0 1px 0 rgba(10,20,30,.05), 0 6px 16px rgba(10,20,30,.04);
}
.topic-badge {
  display: inline-block;
  font-weight: 700;
  font-size: .8rem;
  color: #0a4fff;
  background: #e6efff;
  padding: .25rem .5rem;
  border-radius: .5rem;
  margin-bottom: .55rem;
}
.topic-item {
  display: block;
  padding: .38rem 0;
  text-decoration: none;
  color: #0b0f19;
  border-bottom: 1px dashed rgba(10,20,30,.08);
}
.topic-item:last-child { border-bottom: 0; }
.topic-item .ti-title {
  font-size: .93rem;
  line-height: 1.35;
}
.topic-item:hover .ti-title {
  text-decoration: underline;
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .card .title { font-size: .98rem; }
  .card .excerpt { font-size: .9rem; }
}

/* Inline “… more / less” link for excerpts */
.spinelli-briefing .excerpt .spinelli-excerpt-toggle {
  font-size: 0.9em;
  font-weight: 700;
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 0.06em;
  cursor: pointer;
  margin-left: 0.15em;
  color: inherit; /* keep same color as the excerpt text */
}

/* === 3-column layout for Recent Recommendations === */
.spinelli-briefing .grid-recent-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: flex-start;
}

.spinelli-briefing .recent-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.spinelli-briefing .recent-col-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #64748b);
  margin: 0 0 0.25rem;
}

/* Reuse base .card styling; this class just marks these as "recent" cards */
.spinelli-briefing .recent-col .card-recent {
  /* no extra styles needed for now; hook available if you want later */
}

/* Optional: subtle visual differences for Dr. Spinelli columns */
.spinelli-briefing .card-dr-video .source,
.spinelli-briefing .recent-col-dr-videos .source {
  background: #e0f2fe;
  color: #0f172a;
}

.spinelli-briefing .card-dr-article .source,
.spinelli-briefing .recent-col-dr-articles .source {
  background: #fef3c7;
  color: #78350f;
}

/* --- Inline video players at top of cards --- */
.spinelli-briefing .feed-embed.video {
  position: relative;
  width: 100%;
  border-radius: 1.25rem 1.25rem 0 0;
  overflow: hidden;
  background: #000;
  margin: 0 0 0.75rem;
}

/* Native <video> fills the container */
.spinelli-briefing .feed-embed.video video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

/* iframe-based embeds (YouTube, etc.) also fill container */
.spinelli-briefing .feed-embed.video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Overlay play / mute buttons */
.spinelli-briefing .spinelli-video-card .spinelli-video-btn {
  position: absolute;
  z-index: 2;
  border: none;
  outline: none;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.75);
  color: #f9fafb;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.spinelli-briefing .spinelli-video-card .spinelli-video-btn-play {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 0.6rem 0.9rem 0.6rem 0.85rem;
  border-radius: 999px;
  font-size: 1.4rem;
}

.spinelli-briefing .spinelli-video-card .spinelli-video-btn-mute {
  right: 0.75rem;
  bottom: 0.75rem;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Icon glyphs via ::before so JS only toggles data-state */
.spinelli-briefing .spinelli-video-card .spinelli-video-btn-mute::before {
  content: "🔇";
}
.spinelli-briefing .spinelli-video-card .spinelli-video-btn-mute[data-state="unmuted"]::before {
  content: "🔊";
}

/* Hide play button once video is playing */
.spinelli-briefing .spinelli-video-card .spinelli-video-btn-play[data-state="playing"] {
  opacity: 0;
  pointer-events: none;
}

/* Subtle hover feedback */
.spinelli-briefing .spinelli-video-card .spinelli-video-btn:hover {
  transform: translate(-50%, -50%) scale(1.04);
}
.spinelli-briefing .spinelli-video-card .spinelli-video-btn-mute:hover {
  transform: scale(1.08);
}
/* Spinelli: for locally-uploaded videos, use only the native <video> controls */
.feed-embed.video[data-spinelli-branch="local-attachment"] .spinelli-video-btn {
  display: none !important;
}
