/* Scoped to SPM feed sections; inherits existing accessibility and theme styles. */
.spm-pp-bbc { --rss-bg: #fff; --rss-text: #20202a; --rss-muted: #5c5c69; --rss-border: #b99af5; color: var(--rss-text); }
[data-bs-theme="dark"] .spm-pp-bbc { --rss-bg: #0b011d; --rss-text: #f5f2fb; --rss-muted: #bab2ca; --rss-border: #8054bd; }
.spm-pp-bbc *, .spm-pp-bbc *::before, .spm-pp-bbc *::after { box-sizing: border-box; }
.spm-pp-bbc [hidden] { display: none !important; }
.spm-pp-bbc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.spm-pp-bbc-card { min-width: 0; padding: .85rem; border: 1px solid var(--rss-border); border-radius: 1rem; background: var(--rss-bg); overflow-wrap: anywhere; }
.spm-pp-bbc-title { font-size: 1.05em; line-height: 1.4; margin: 0 0 .65rem; font-weight: 650; }
.spm-pp-bbc-title a, .spm-pp-bbc-meta a { color: inherit; text-decoration: none; }
.spm-pp-bbc-title a:hover, .spm-pp-bbc-meta a:hover { text-decoration: underline; }
.spm-pp-bbc-media { position: relative; aspect-ratio: 16 / 9; background: #161020; border-radius: .3rem; overflow: hidden; }
.spm-pp-bbc-image-link, .spm-pp-bbc-play { display: block; width: 100%; height: 100%; }
.spm-pp-bbc-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.spm-pp-bbc-play { position: relative; padding: 0; border: 0; background: transparent; color: #fff; cursor: pointer; }
.spm-pp-bbc-play-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: #17062ddd; border: 2px solid #fff; font-size: 1.35rem; padding-left: .15rem; }
.spm-pp-bbc-player { display: block; width: 100%; height: 100%; border: 0; }
.spm-pp-bbc-video-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .4rem; }
.spm-pp-bbc-close { border: 1px solid var(--rss-border); border-radius: .4rem; background: var(--rss-bg); color: var(--rss-text); padding: .45rem .7rem; min-height: 44px; font: inherit; cursor: pointer; }
.spm-pp-bbc-source-link { color: var(--rss-text); padding: .5rem 0; text-decoration: underline; }
.spm-pp-bbc-summary { font-size: .93em; line-height: 1.65; margin: .7rem 0; }
.spm-pp-bbc-meta { font-size: .8em; color: var(--rss-muted); margin-top: .7rem; }
.spm-pp-bbc-meta a { display: inline-block; padding: .4rem 0; }
.spm-pp-bbc-status { color: var(--rss-muted); font-size: .9em; margin: 0 0 .8rem; }
.spm-pp-bbc-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.spm-pp-bbc-controls .btn { min-height: 44px; }
.spm-pp-bbc :is(a, button, iframe):focus-visible { outline: 3px solid #6610f2; outline-offset: 3px; }
[data-bs-theme="dark"] .spm-pp-bbc :is(a, button, iframe):focus-visible { outline-color: #ffd568; }
@media (max-width: 991.98px) { .spm-pp-bbc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .spm-pp-bbc-grid { grid-template-columns: minmax(0, 1fr); } }

/* SPM Magazine 1: repeating 2 large + 4 compact + 3 medium stories. */
.spm-pp-bbc-magazine .spm-pp-bbc-magazine-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.spm-pp-bbc-magazine .spm-pp-bbc-card { grid-column: span 6; border: 0; border-bottom: 1px solid var(--rss-border); border-radius: 0; padding: 0 0 .9rem; background: transparent; }
.spm-pp-bbc-magazine .spm-pp-bbc-title { margin-top: .65rem; }
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+3),
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+4),
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+5),
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+6) { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: .4rem .8rem; align-items: start; }
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+3) .spm-pp-bbc-media,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+4) .spm-pp-bbc-media,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+5) .spm-pp-bbc-media,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+6) .spm-pp-bbc-media { grid-column: 2; grid-row: 1 / 3; }
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+3) .spm-pp-bbc-title,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+4) .spm-pp-bbc-title,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+5) .spm-pp-bbc-title,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+6) .spm-pp-bbc-title { grid-column: 1; grid-row: 1; margin: 0; }
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+3) .spm-pp-bbc-meta,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+4) .spm-pp-bbc-meta,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+5) .spm-pp-bbc-meta,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+6) .spm-pp-bbc-meta { grid-column: 1; grid-row: 2; margin: 0; }
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+3) .spm-pp-bbc-summary,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+4) .spm-pp-bbc-summary,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+5) .spm-pp-bbc-summary,
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+6) .spm-pp-bbc-summary { display: none; }
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+7),
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+8),
.spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(9n+9) { grid-column: span 4; }
/* Give embedded video controls enough room, including compact slots. */
.spm-pp-bbc-magazine .spm-pp-bbc-card.spm-pp-bbc-magazine-video { display: block; }
.spm-pp-bbc-magazine .spm-pp-bbc-card.spm-pp-bbc-magazine-video .spm-pp-bbc-media { width: 100%; }
.spm-pp-bbc-magazine .spm-pp-bbc-card.spm-pp-bbc-magazine-video .spm-pp-bbc-title { margin-top: .65rem; }
@media (max-width: 767.98px) {
 .spm-pp-bbc-magazine .spm-pp-bbc-magazine-grid { grid-template-columns: minmax(0, 1fr); }
 .spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(n) { grid-column: auto; display: block; }
 .spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(n) .spm-pp-bbc-title { margin: .65rem 0; }
 .spm-pp-bbc-magazine .spm-pp-bbc-card:nth-child(n) .spm-pp-bbc-meta { margin: .7rem 0 0; }
}

/* SPM Magazine 1 v0.1.2 — permanent approved presentation settings. */
/* Limit only the Bootstrap container that directly holds a Magazine. */
.container-fluid:has(> .spm-pp-bbc-magazine) {
  max-width: 1440px;
  margin-right: auto;
  margin-left: auto;
}
/* Also support embeds without a Bootstrap wrapper. */
.spm-pp-bbc-magazine {
  width: 100%;
  max-width: 1440px;
  margin-right: auto;
  margin-left: auto;
}
.spm-pp-bbc-magazine .spm-pp-bbc-image,
.spm-pp-bbc-magazine .spm-pp-bbc-media {
  border-radius: 20px;
}
/* Tablet and desktop; retain the original font sizes below 768px. */
@media (min-width: 768px) {
  .spm-pp-bbc-magazine .spm-pp-bbc-title { font-size: 1.4em; }
  .spm-pp-bbc-magazine .spm-pp-bbc-summary { font-size: 1.00em; }
}

/* Tablet override, including the 1024px boundary. */
@media (min-width: 768px) and (max-width: 1024px) {
  .spm-pp-bbc-magazine .spm-pp-bbc-title { font-size: 1.2em; }
}
