/* House advertisement for Pandemonium. A full-width band that hangs under the
   site header and shares its side gutters. All text is live HTML. */
@font-face{font-family:'Sponsor Display';src:url('assets/sponsors/big-shoulders-display-800.woff2') format('woff2');font-weight:800;font-style:normal;font-display:swap}

.site-sponsor{
  --ad-ink:#0e0d09;
  --ad-bone:#f7f0d2;
  --ad-dust:#b8ad92;
  --ad-sun:#b9442f;
  --ad-gutter:34px;
  box-sizing:border-box;
  margin:0;
  border-bottom:1px solid #2f2a22;
  background:var(--ad-ink);
  color:var(--ad-bone);
  font-family:'IBM Plex Sans',Arial,sans-serif;
}
.site-sponsor *{box-sizing:border-box}

.site-sponsor-card{
  position:relative;
  display:grid;
  grid-template-columns:auto auto minmax(0,1fr) auto;
  align-items:center;
  column-gap:20px;
  min-height:104px;
  padding:14px var(--ad-gutter);
  overflow:hidden;
  color:inherit;
  text-decoration:none;
}

/* The brand art fills whatever room is left between the copy and the button. */
.site-sponsor-card::before{
  content:'';
  order:2;
  align-self:stretch;
  margin-block:-14px;
  background:url('assets/sponsors/pandemonium-sun-band.webp') 62% 50%/auto 100% no-repeat;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 16%,#000 84%,transparent);
  mask-image:linear-gradient(90deg,transparent,#000 16%,#000 84%,transparent);
}

/* Starts the headline font downloading with the stylesheet. */
.site-sponsor-card::after{content:'A';position:absolute;visibility:hidden;font:800 1px 'Sponsor Display'}

.site-sponsor-logo{order:0;display:block;width:76px;height:76px;border-radius:50%}

.site-sponsor-copy{order:1;display:grid;gap:3px;min-width:0}
.site-sponsor-brand{display:flex;align-items:center;gap:9px;font-size:12px;line-height:16px;color:var(--ad-dust);white-space:nowrap}
.site-sponsor-brand b{font-weight:600;color:var(--ad-bone)}
.site-sponsor-brand span{padding-left:9px;border-left:1px solid #5b5241}

.site-sponsor-messages{display:grid}
.site-sponsor-message{grid-area:1/1;display:grid;align-content:start;gap:1px;visibility:hidden;opacity:0;animation:site-sponsor-turn 20s linear infinite both}
.site-sponsor-message:first-child{visibility:visible;opacity:1}
.site-sponsor-message:nth-child(1){animation-delay:-20s}
.site-sponsor-message:nth-child(2){animation-delay:-15s}
.site-sponsor-message:nth-child(3){animation-delay:-10s}
.site-sponsor-message:nth-child(4){animation-delay:-5s}
.site-sponsor-message strong{font:800 29px/1.05 'Sponsor Display','Arial Narrow',Impact,sans-serif;letter-spacing:.02em;text-transform:uppercase;text-wrap:balance}
.site-sponsor-message span{font-size:14.5px;line-height:1.4;color:var(--ad-dust);text-wrap:pretty}

/* Each message holds for five seconds: a blade-edge wipe in, a short fade out. */
@keyframes site-sponsor-turn{
  0%{visibility:hidden;opacity:0;clip-path:polygon(0 -10%,0 -10%,-6% 110%,0 110%)}
  .2%{visibility:visible;opacity:1}
  2.4%{opacity:1;clip-path:polygon(0 -10%,112% -10%,106% 110%,0 110%)}
  23.6%{opacity:1;clip-path:polygon(0 -10%,112% -10%,106% 110%,0 110%)}
  25%,100%{visibility:hidden;opacity:0;clip-path:polygon(0 -10%,112% -10%,106% 110%,0 110%)}
}
@keyframes site-sponsor-fade{0%{visibility:hidden;opacity:0}3%,22%{visibility:visible;opacity:1}25%,100%{visibility:hidden;opacity:0}}
.site-sponsor-card:is(:hover,:focus-visible) .site-sponsor-message{animation-play-state:paused!important}

.site-sponsor-cta{
  order:3;
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  margin-top:10px;
  padding:0 18px;
  border-radius:2px;
  background:var(--ad-bone);
  color:var(--ad-ink);
  font-size:15px;
  font-weight:600;
  line-height:1;
  white-space:nowrap;
  transition:background-color .15s,color .15s;
}
.site-sponsor-cta svg{flex:none}
/* The extra selector weight keeps page-level link rules from underlining the
   copy or pushing the focus ring outside the band. */
.site-sponsor a.site-sponsor-card:hover{text-decoration:none}
.site-sponsor a.site-sponsor-card:hover .site-sponsor-cta{background:var(--ad-sun);color:#fff8e6}
.site-sponsor a.site-sponsor-card:focus-visible{outline:2px solid var(--ad-bone);outline-offset:-6px}

.site-sponsor-label{
  position:absolute;
  top:9px;
  right:var(--ad-gutter);
  font-size:10.5px;
  line-height:1;
  letter-spacing:.04em;
  color:#9c927b;
  pointer-events:none;
}

/* Page content starts a consistent distance below the band. */
.site-sponsor+main:is(.section-content,.items-layout,.item-detail,.bestiary-layout,.reader-layout){padding-top:28px}
.site-sponsor+.section-content .section-intro{align-items:start}
.atlas-page:not(.section-page) .map-stage{height:clamp(420px,calc(100dvh - var(--site-header-height,112px) - var(--site-sponsor-height,105px) - 38px),900px)}

/* Gutters follow the header's own breakpoints. */
@media(max-width:1100px){
  .site-sponsor{--ad-gutter:24px}
  .site-sponsor-card{column-gap:16px}
  .site-sponsor-message strong{font-size:26px}
  .site-sponsor-message span{font-size:13.5px}
}
@media(max-width:1000px){
  .site-sponsor{--ad-gutter:16px}
  .atlas-page:not(.section-page) .map-stage{height:clamp(360px,calc(100dvh - var(--site-header-height,112px) - var(--site-sponsor-height,105px) - 38px),850px)}
}
@media(max-width:860px){
  .site-sponsor-card::before{visibility:hidden}
}
@media(max-width:760px){
  /* Reserve enough height for every message to keep the band stable. */
  .site-sponsor-card{grid-template-columns:auto minmax(0,1fr) auto;column-gap:12px;min-height:82px;padding-block:12px}
  .site-sponsor-copy{align-self:start}
  .site-sponsor-card::before{display:none}
  .site-sponsor-logo{width:56px;height:56px}
  .site-sponsor-cta{align-self:end;width:44px;min-height:40px;margin-top:0;padding:0;justify-content:center}
  .site-sponsor-cta span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .site-sponsor-brand{font-size:11.5px;line-height:15px}
  .site-sponsor-label{top:14px}
  .site-sponsor-message strong{font-size:21px}
  .site-sponsor-message span{font-size:12.5px;line-height:1.35}
  .site-sponsor+main:is(.section-content,.items-layout,.item-detail,.bestiary-layout,.reader-layout){padding-top:20px}
}
@media(max-width:479px){
  .site-sponsor-card{min-height:99px}
}
@media(max-width:410px){
  .site-sponsor-card{min-height:121px}
}
@media(max-width:399px){
  .site-sponsor-brand span{display:none}
}
@media(max-width:330px){
  .site-sponsor-card{min-height:139px}
  .site-sponsor-logo{width:48px;height:48px}
}
@media(max-height:500px){
  .atlas-page:not(.section-page) .map-stage{min-height:200px;height:clamp(200px,calc(100dvh - var(--site-header-height,112px) - var(--site-sponsor-height,105px) - 38px),850px)}
}
/* Reduced motion keeps the four messages but swaps the wipe for a plain fade.
   !important is needed because site-shell.css switches every animation off. */
@media(prefers-reduced-motion:reduce){
  .site-sponsor-message{animation:site-sponsor-fade 20s linear infinite both!important}
  .site-sponsor-message:nth-child(1){animation-delay:-20s!important}
  .site-sponsor-message:nth-child(2){animation-delay:-15s!important}
  .site-sponsor-message:nth-child(3){animation-delay:-10s!important}
  .site-sponsor-message:nth-child(4){animation-delay:-5s!important}
}
@media print{.site-sponsor{display:none}}
