/* ═══ RSS Feed Block ═══ */

/* ── Flex-wrap override ── */
.is-layout-flex:has(> .rss-feed-block),
.is-layout-flex:has(.rss-feed-block),
.is-nowrap:has(> .rss-feed-block),
.is-nowrap:has(.rss-feed-block) {
  flex-wrap: wrap !important;
}

/* ── Editor: block wrapper as flex child ── */
.is-layout-flex > [data-type="atmp/rss-feed"] {
  flex: 1 0 200px !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* ── Block sizing ── */
.rss-feed-block {
  width: var(--rfb-width, 100%);
  max-width: var(--rfb-max-width, none);
  min-width: var(--rfb-min-width, 0);
  margin-left: var(--rfb-ml, 0);
  margin-right: var(--rfb-mr, auto);
  padding-top: var(--rfb-pt, 30px);
  padding-bottom: var(--rfb-pb, 30px);
}

/* ── Title ── */
.rfb-title {
  margin-bottom: 24px;
  font-size: 1.8rem;
}

/* ── Grid Layout ── */
.rss-feed-block--grid .rfb-items {
  display: grid;
  grid-template-columns: repeat(var(--rfb-columns, 2), 1fr);
  gap: 24px;
}

/* ── List Layout ── */
.rss-feed-block--list .rfb-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rss-feed-block--list .rfb-card {
  flex-direction: row;
}

.rss-feed-block--list .rfb-card__image {
  flex: 0 0 200px;
  max-width: 200px;
  height: auto;
}

/* ── Card ── */
.rfb-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.rfb-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ── Card Image ── */
.rfb-card__image {
  overflow: hidden;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

.rfb-card__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* ── Card Content ── */
.rfb-card__content {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ── Card Meta (date + source) ── */
.rfb-card__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.rfb-card__date {
  font-size: 0.85rem;
  color: #777;
}

.rfb-card__source {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #e67e22;
  background: #fef5ec;
  padding: 2px 8px;
  border-radius: 3px;
}

/* ── Card Title ── */
.rfb-card__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.rfb-card__title a {
  color: #1a1a1a;
  text-decoration: none;
}

.rfb-card__title a:hover {
  color: #1e3a5f;
}

/* ── Card Excerpt ── */
.rfb-card__excerpt {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.5;
  margin: 0 0 12px;
}

/* ── Read More Link ── */
.rfb-card__readmore {
  font-size: 0.85rem;
  font-weight: 700;
  color: #c51162;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.rfb-card__readmore:hover {
  text-decoration: underline;
}

.rfb-card__readmore i {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.rfb-card__readmore:hover i {
  transform: translateX(3px);
}

/* ═══ Ticker Layout ═══ */

.rfb-ticker {
  overflow: hidden;
  position: relative;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  padding: 12px 0;
}

.rfb-ticker__track {
  display: flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translate3d(0, 0, 0);
}

.rfb-ticker__item,
.rfb-ticker__item:hover,
.rfb-ticker__item:focus,
.rfb-ticker__item:visited {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none !important;
  color: #1a1a1a;
  padding: 4px 0;
  transition: color 0.15s ease;
}

.rfb-ticker__item:hover {
  color: #1e3a5f;
}

.rfb-ticker__source {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #e67e22;
  background: #fef5ec;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.rfb-ticker__headline {
  font-weight: 600;
  font-size: 0.9rem;
}

.rfb-ticker__date {
  font-size: 0.75rem;
  color: #999;
  flex-shrink: 0;
}

.rfb-ticker__separator {
  color: #ccc;
  margin: 0 16px;
  flex-shrink: 0;
  font-size: 0.8rem;
}

/* ═══ Magazine Layout ═══ */

.rss-feed-block--magazine .rfb-items {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Featured card */
.rfb-card--featured {
  border-radius: 8px;
}

.rfb-card--featured .rfb-card__image {
  height: 260px;
}

.rfb-card--featured .rfb-card__title {
  font-size: 1.4rem;
}

.rfb-card--featured .rfb-card__excerpt {
  font-size: 1rem;
}

/* Compact items column */
.rfb-magazine__rest {
  display: flex;
  flex-direction: column;
  gap: 0;
}

a.rfb-card--compact {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  padding: 14px 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
  overflow: visible;
}

a.rfb-card--compact:first-child {
  border-top: 1px solid #eee;
}

a.rfb-card--compact:hover {
  background: #f9f9f9;
  box-shadow: none;
}

a.rfb-card--compact .rfb-card__content {
  padding: 0;
  flex: 1;
  min-width: 0;
}

a.rfb-card--compact .rfb-card__meta {
  margin-bottom: 4px;
}

a.rfb-card--compact .rfb-card__title {
  font-size: 0.95rem;
  margin: 0;
  white-space: normal;
}

.rfb-card--compact__arrow {
  color: #bbb;
  font-size: 0.7rem;
  margin-left: 12px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

a.rfb-card--compact:hover .rfb-card--compact__arrow {
  transform: translateX(3px);
  color: #1e3a5f;
}

/* ── No Results ── */
.rfb-no-results {
  text-align: center;
  color: #888;
  padding: 40px 20px;
  font-size: 0.95rem;
}

/* ── Mobile ── */
@media (max-width: 767px) {
  .rss-feed-block {
    width: var(--rfb-mobile-width, 100%);
    max-width: var(--rfb-mobile-max-width, none);
    min-width: var(--rfb-mobile-min-width, 0);
    margin-left: var(--rfb-mobile-ml, 0);
    margin-right: var(--rfb-mobile-mr, auto);
  }

  .rss-feed-block--grid .rfb-items {
    grid-template-columns: 1fr;
  }

  .rss-feed-block--list .rfb-card {
    flex-direction: column;
  }

  .rss-feed-block--list .rfb-card__image {
    flex: none;
    max-width: none;
  }

  .rfb-card__content {
    padding: 16px 20px;
  }

  .rfb-card__title {
    font-size: 1.1rem;
  }

  /* Magazine: stack vertically on mobile */
  .rss-feed-block--magazine .rfb-items {
    grid-template-columns: 1fr;
  }

  .rfb-card--featured .rfb-card__image {
    height: 180px;
  }

  .rfb-card--featured .rfb-card__title {
    font-size: 1.2rem;
  }
}
