/* AF Universal CMS themes, layered ON TOP of original MAIN public CSS. */
body.cms-theme-nebula{--bg:#090d18;--bg2:#10172b;--panel:#151c30;--panel2:#1a2340;--line:#334059;--accent:#a77cfe;--accent2:#c6a5ff;background:radial-gradient(circle at 72% 8%,#241b46,#080c16 60%)}
body.cms-theme-backstage{--bg:#090a0a;--bg2:#16120f;--panel:#1b1613;--panel2:#241a13;--line:#48372e;--accent:#ed8734;--accent2:#ffba70;background:radial-gradient(circle at 66% 0%,#352016,#080909 64%)}
body.cms-theme-signature{--bg:#f5f2e9;--bg2:#ece8dd;--panel:#fffdf9;--panel2:#efeadf;--line:#c4beb0;--text:#1d2530;--muted:#5f6972;--accent:#5979a4;--accent2:#345d90;background:linear-gradient(#f5f2e9,#e8e6e1);color:var(--text)}
body.cms-theme-signature .card,body.cms-theme-signature .panel,body.cms-theme-signature .empty-state{background:#fffdfa;color:#1d2530}
body.cms-theme-signature .article-card h3 a,body.cms-theme-signature .article-card p{color:#1d2530}
body.cms-theme-signature .site-header,body.cms-theme-signature .sop-site-header{background:#1d2530!important}
body.cms-theme-signature .sop-shared-footer{background:#e8e4db;color:#253241}
body.cms-theme-nebula .sop-site-header.sop-site-header .sop-site-nav .active{border-color:#a77cfe!important;color:#c6a5ff!important}
body.cms-theme-backstage .sop-site-header.sop-site-header .sop-site-nav .active{border-color:#ef893c!important;color:#ef893c!important}
body.sop-public .section-head .eyebrow{color:var(--cms-custom-accent)}
@media(max-width:680px){body.cms-theme-signature .sop-site-header.sop-site-header .sop-site-nav{background:#1d2530}}

/* Standalone layout: nav on the LEFT and site name/future logo on the RIGHT. */
.sop-site-header.sop-site-header{justify-content:flex-start!important}
.sop-site-header.sop-site-header .sop-site-nav{order:0!important;justify-content:flex-start!important;margin-left:0!important}
.sop-site-header.sop-site-header .sop-site-brand{order:2!important;margin-left:auto!important;text-align:right}
.sop-site-header.sop-site-header .sop-nav-toggle{order:1!important}

/* Exactly two cards per row, four newest per language. No empty banner rail. */
body.sop-public .home-layout.cms-home-no-banner{display:block!important;width:min(960px,calc(100vw - 36px))!important;max-width:960px!important;margin-inline:auto!important}
body.sop-public .home-layout.cms-home-no-banner .home-magazine{width:100%!important}
body.sop-public .home-article-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:24px!important}
body.sop-public .home-article-grid .article-card{min-width:0}
@media(max-width:760px){
  .sop-site-header.sop-site-header .sop-nav-toggle{order:0!important}
  .sop-site-header.sop-site-header .sop-site-brand{order:1!important;margin-left:auto!important}
  .sop-site-header.sop-site-header .sop-site-nav{order:2!important}
  body.sop-public .home-article-grid{grid-template-columns:1fr!important;gap:18px!important}
}

/* Standalone v0.2.3: desktop dropdown fits its actual parent rather than a MAIN-sized flyout. */
@media (min-width:1101px){
 body.sop-public .sop-site-header.sop-site-header .sop-site-nav .nav-item.has-submenu>.submenu{
  left:0;right:auto;width:max-content;min-width:100%;max-width:170px;padding:4px;
 }
 body.sop-public .sop-site-header.sop-site-header .sop-site-nav .nav-item.has-submenu>.submenu a{
  padding:8px 9px;white-space:normal;overflow-wrap:break-word;font-size:12px;line-height:1.25;
 }
}

/* Standalone v0.2.8k: display an existing image logo more prominently.
 * A portrait-ish original (e.g. 1400x876) is limited by height, not by its source width.
 * Keep the image uncropped and preserve its aspect ratio. Change the fixed header
 * offset ONLY when a logo is used; plain-text branding remains unchanged.
 */
html:has(body.sop-public .sop-site-header img.cms-header-logo){
  --cms-logo-header-height:92px;
  --cms-logo-max-height:78px;
  scroll-padding-top:calc(var(--cms-logo-header-height) + 14px)!important;
}
body.sop-public:has(> .sop-site-header img.cms-header-logo){
  padding-top:var(--cms-logo-header-height)!important;
}
body.sop-public .sop-site-header.sop-site-header:has(img.cms-header-logo){
  height:var(--cms-logo-header-height)!important;
  min-height:var(--cms-logo-header-height)!important;
  padding-block:6px!important;
}
body.sop-public .sop-site-header.sop-site-header .sop-site-brand img.cms-header-logo{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:min(260px,27vw)!important;
  max-height:var(--cms-logo-max-height)!important;
  min-width:0;
  object-fit:contain;
  object-position:right center;
  flex:0 1 auto;
}
@media(max-width:1100px){
  html:has(body.sop-public .sop-site-header img.cms-header-logo){
    --cms-logo-header-height:82px;
    --cms-logo-max-height:66px;
  }
  body.sop-public .sop-site-header.sop-site-header:has(img.cms-header-logo){
    padding-block:6px!important;
  }
  body.sop-public .sop-site-header.sop-site-header .sop-site-brand img.cms-header-logo{
    max-width:min(225px,55vw)!important;
  }
  /* The mobile menu opens immediately below the taller header. */
  body.sop-public .sop-site-header.sop-site-header:has(img.cms-header-logo) .sop-site-nav{
    top:100%!important;
    max-height:calc(100dvh - var(--cms-logo-header-height))!important;
  }
}
@media(max-width:480px){
  html:has(body.sop-public .sop-site-header img.cms-header-logo){
    --cms-logo-header-height:74px;
    --cms-logo-max-height:58px;
  }
  body.sop-public .sop-site-header.sop-site-header:has(img.cms-header-logo){
    padding-block:5px!important;
  }
  body.sop-public .sop-site-header.sop-site-header .sop-site-brand img.cms-header-logo{
    max-width:min(180px,56vw)!important;
  }
}

/* UNIVERSAL CMS v0.2.8l: compact mobile homepage (show, radio, live).
 * Desktop unchanged. The three information tiles become one full-width
 * schedule tile plus two small side-by-side action tiles. Keep all links
 * and next-show times visible; only non-essential mobile teaser copy hides.
 */
@media (max-width:760px){
  body.sop-public .home-layout{padding-top:18px}
  body.sop-public .cms-sop-radio-row{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    margin-bottom:14px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-next-tile{grid-column:1 / -1}
  body.sop-public .cms-sop-radio-row .cms-sop-listen-tile:last-child{grid-column:1 / -1}
  body.sop-public .cms-sop-radio-row .cms-sop-radio-tile{
    min-height:0;
    min-width:0;
    padding:10px 11px;
    border-radius:9px;
    overflow-wrap:anywhere;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-tile-kicker{
    font-size:.60rem;
    letter-spacing:.055em;
    line-height:1.25;
    margin:0 0 7px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-radio-tile h3{
    font-size:.91rem;
    line-height:1.24;
    margin:0 0 4px;
  }
  /* Compact action tiles need their titles, not a multi-line decorative kicker. */
  body.sop-public .cms-sop-radio-row .cms-sop-listen-tile .cms-sop-tile-kicker,
  body.sop-public .cms-sop-radio-row .cms-sop-live-tile .cms-sop-tile-kicker{display:none}
  body.sop-public .cms-sop-radio-row .cms-sop-next-main{
    flex:0 0 auto;
    align-items:center;
    gap:10px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-show-art{
    width:54px;
    height:58px;
    flex:0 0 54px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-broadcast-date,
  body.sop-public .cms-sop-radio-row .cms-sop-broadcast-time{
    font-size:.74rem;
    line-height:1.28;
    margin:0 0 2px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-next-empty{
    flex:0 0 auto;
    gap:9px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-next-empty .cms-sop-microphone{
    font-size:1.5rem;
    flex:0 0 44px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-next-empty p{
    font-size:.74rem;
    line-height:1.3;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-show-description{display:none}
  body.sop-public .cms-sop-radio-row .cms-sop-listen-main,
  body.sop-public .cms-sop-radio-row .cms-sop-live-main{
    display:block;
    flex:0 0 auto;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-listen-icon,
  body.sop-public .cms-sop-radio-row .cms-sop-live-icon{
    width:36px;
    height:36px;
    flex:0 0 36px;
    font-size:1.35rem;
    border-radius:8px;
    margin:0 0 7px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-listen-main p,
  body.sop-public .cms-sop-radio-row .cms-sop-live-main p{display:none}
  body.sop-public .cms-sop-radio-row .cms-sop-tile-link{
    font-size:.72rem;
    line-height:1.35;
    margin-top:8px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-listen-tile .cms-sop-tile-link{
    font-size:.70rem;
    letter-spacing:-.015em;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-live-empty{
    font-size:.69rem;
    line-height:1.3;
    margin-top:7px;
  }
  body.sop-public .cms-sop-radio-row .cms-sop-sync-note{
    font-size:.67rem;
    margin-top:5px;
  }
  /* Future-proof the mobile limit; homepage SQL already selects four. */
  body.sop-public .home-article-grid > .article-card:nth-of-type(n+5){display:none!important}
}


/* UNIVERSAL CMS v0.2.8u — mobile frontend navigation / background guardrails.
 * The top-level menu label already expands its submenu. The repeated first
 * submenu-parent-link is a legacy desktop/mobile navigation helper: hide it
 * on mobile, but keep the actual child links and desktop behavior intact.
 */
@media (max-width:1100px){
  body.sop-public .sop-site-header.sop-site-header .sop-site-nav .submenu > a.submenu-parent-link{
    display:none!important;
  }
}
/* Avoid the browser's default white root background showing through to the
 * right/below full-page sections on mobile. No changes to cards or content.
 * :has() scopes this to the public frontend, not the administration.
 */
html:has(> body.sop-public){
  background-color:#080b10;
}
html:has(> body.sop-public.cms-theme-signature){
  background-color:#f5f2e9;
}
body.sop-public{
  min-height:100vh;
  min-height:100dvh;
}
/* The homepage width must be relative to the padded main container, not
 * the viewport. Viewport-based sizing caused a narrow horizontal overrun
 * at intermediate tablet widths (observed at 760 CSS pixels).
 */
@media (max-width:1100px){
  body.sop-public .home-layout.cms-home-no-banner{
    width:100%!important;
    max-width:960px!important;
  }
}
