/* Ads (FMEC_Banners, ZSM Ads 2.0): five formats x four tones, drawn from a few fields, or a ready graphic that keeps its proportions.
 * The label ("Reklama" / "Autopromocja") is a small tag above the ad's surface at the right - never on top of the creative. Front and admin preview. */
.fmec-bn, .fmec-bn-pop {
  --bn-bg: #fff; --bn-fg: #06323a; --bn-muted: #4b666c; --bn-line: rgba(7, 60, 66, .14); --bn-accent: #0a7873; --bn-pad: #eef5f5; --bn-tag: #5d767b;
  --bn-cta-bg: rgba(18, 184, 174, .13); --bn-cta-fg: #0a6c68; --bn-link: #0a6c68; --bn-shadow: 0 8px 22px rgba(6, 50, 58, .06);
  color: var(--bn-fg); box-sizing: border-box; font-family: inherit; line-height: 1.45;
}
.fmec-bn *, .fmec-bn-pop * { box-sizing: border-box; }
.fmec-bn.is-sand, .fmec-bn-pop.is-sand { --bn-bg: #fbf4e2; --bn-fg: #3a2b0a; --bn-muted: #7a6330; --bn-line: #ead9a6; --bn-accent: #b7791f; --bn-pad: #f6ecd0; --bn-cta-bg: rgba(230, 173, 60, .26); --bn-cta-fg: #6b4204; --bn-link: #8a5a0a; --bn-shadow: 0 8px 22px rgba(120, 84, 10, .07); }
.fmec-bn.is-dark, .fmec-bn-pop.is-dark { --bn-bg: #05414a; --bn-fg: #fff; --bn-muted: rgba(255, 255, 255, .78); --bn-line: rgba(255, 255, 255, .14); --bn-accent: #f0c764; --bn-pad: #05343d; --bn-cta-bg: #efc25a; --bn-cta-fg: #2a1a04; --bn-link: #f0c764; --bn-shadow: 0 10px 26px rgba(3, 42, 49, .2); }
.fmec-bn.is-glass, .fmec-bn-pop.is-glass { --bn-bg: rgba(255, 255, 255, .62); --bn-line: rgba(7, 60, 66, .12); --bn-shadow: 0 6px 18px rgba(6, 50, 58, .05); }
.fmec-bn.is-glass .fmec-bn-link, .fmec-bn-pop.is-glass .fmec-bn-pop-card { -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }

.fmec-bn { position: relative; display: grid; gap: 4px; margin: 22px 0; max-width: 100%; container-type: inline-size; }
.fmec-bn.in-top, .fmec-bn.in-bottom, .fmec-bn.is-wide { width: min(calc(100% - 56px), var(--fmec-max, 1500px)); margin-inline: auto; }
.fmec-bn.in-top { margin-top: 14px; margin-bottom: 4px; }
.fmec-bn.in-bottom { margin-top: 26px; margin-bottom: 34px; }
.fmec-bn.in-side { margin: 16px 0 0; }
.fmec-bn.in-between { grid-column: 1 / -1; margin: 10px 0; }
.fmec-bn.is-gone { display: none; }

/* the label: small, at the right, above the surface (outside the creative); the optional close sits next to it */
.fmec-bn-head { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 14px; }
.fmec-bn-tag { flex: none; font: 600 10px / 1.2 var(--pg-mono, "IBM Plex Mono", ui-monospace, Consolas, monospace); letter-spacing: .12em; text-transform: uppercase; color: var(--bn-tag); white-space: nowrap; }
.fmec-bn-x { display: grid; place-items: center; width: 20px; height: 20px; margin: -3px 0; padding: 0; border: 0; border-radius: 50%; background: rgba(6, 50, 58, .08); color: #4b666c; font: 400 15px / 1 Arial, sans-serif; cursor: pointer; transition: background-color .18s ease; }
.fmec-bn-x:hover { background: rgba(6, 50, 58, .18); }
.fmec-bn-x:focus-visible, .fmec-bn-ctl:focus-visible { outline: 2px solid #e6ad3c; outline-offset: 1px; }

.fmec-bn-link { position: relative; display: block; color: inherit; text-decoration: none; background: var(--bn-bg); border: 1px solid var(--bn-line); box-shadow: var(--bn-shadow); transition: border-color .2s ease; }
a.fmec-bn-link:hover { border-color: var(--bn-accent); }
a.fmec-bn-link:focus-visible { outline: 3px solid rgba(230, 173, 60, .85); outline-offset: 3px; }

.fmec-bn-title { display: block; font-size: 16.5px; line-height: 1.25; font-weight: 800; letter-spacing: -.005em; }
.fmec-bn-text { display: block; font-size: 14.5px; line-height: 1.5; color: var(--bn-muted); }
.fmec-bn-cta { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 14px; font-weight: 800; color: var(--bn-link); }
.fmec-bn-cta i { font-style: normal; transition: transform .2s ease; }
a.fmec-bn-link:hover .fmec-bn-cta i { transform: translateX(3px); }
.fmec-bn-body { display: grid; gap: 3px; min-width: 0; }
.fmec-bn-media { display: block; flex: none; overflow: hidden; border-radius: 12px; background: rgba(255, 255, 255, .5); }
.fmec-bn-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fmec-bn-media.is-logo { background: transparent; border-radius: 50%; }
.fmec-bn-media.is-logo img { object-fit: contain; }

/* strip: one line */
.fmec-bn.is-strip .fmec-bn-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 7px 14px; border-radius: 14px; }
.fmec-bn.is-strip .fmec-bn-media { width: 26px; height: 26px; border-radius: 8px; }
.fmec-bn.is-strip .fmec-bn-media.is-logo { border-radius: 50%; }
.fmec-bn.is-strip .fmec-bn-body { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; gap: 2px 12px; }
.fmec-bn.is-strip .fmec-bn-title { flex: none; font-size: 14.5px; }
.fmec-bn.is-strip .fmec-bn-text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.fmec-bn.is-strip .fmec-bn-cta { font-size: 13.5px; }

/* note: a small card with an accent */
.fmec-bn.is-note .fmec-bn-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 13px 16px; border-radius: 16px; border-left: 4px solid var(--bn-accent); }
.fmec-bn.is-note .fmec-bn-media { width: 48px; height: 48px; }
.fmec-bn.is-note.in-side .fmec-bn-link { grid-template-columns: auto minmax(0, 1fr); }
.fmec-bn.is-note.in-side .fmec-bn-cta { grid-column: 1 / -1; }

/* card: for a column */
.fmec-bn.is-card .fmec-bn-link { display: grid; gap: 10px; padding: 16px; border-radius: 18px; }
.fmec-bn.is-card .fmec-bn-media { width: 44px; height: 44px; }
.fmec-bn.is-card.has-cover .fmec-bn-media { width: 100%; height: auto; aspect-ratio: 16 / 7; max-height: 120px; border-radius: 12px; }
.fmec-bn.is-card .fmec-bn-title { font-size: 17.5px; }
.fmec-bn.is-card .fmec-bn-cta { justify-self: start; padding: 8px 15px; border-radius: 999px; background: var(--bn-cta-bg); color: var(--bn-cta-fg); }

/* band: a low strip across */
.fmec-bn.is-band .fmec-bn-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; min-height: 84px; padding: 14px 22px; border-radius: 20px; }
.fmec-bn.is-band .fmec-bn-media { width: 56px; height: 56px; }
.fmec-bn.is-band.has-cover .fmec-bn-media { width: 92px; height: 64px; border-radius: 12px; }
.fmec-bn.is-band .fmec-bn-title { font-size: 19px; }
.fmec-bn.is-band .fmec-bn-text { font-size: 15px; }
.fmec-bn.is-band .fmec-bn-cta { padding: 10px 18px; border-radius: 999px; background: var(--bn-cta-bg); color: var(--bn-cta-fg); }

/* graphic: the picture IS the ad and keeps its proportions (never cropped, never stretched). A wide one fills the width of its place (at most 1.25x its own pixels or the editor's limit);
   when its proportions are far from a panorama it is shown whole inside a calm box of the tone (contain), not cut. A tall one keeps its height. */
.fmec-bn.is-poster .fmec-bn-link { display: block; padding: 0; border: 0; background: transparent; box-shadow: none; }
.fmec-bn.is-poster a.fmec-bn-link:hover { transform: none; }
.fmec-bn-poster { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--bn-line); box-shadow: var(--bn-shadow); background: var(--bn-pad); }
.fmec-bn.is-poster.art-wide { max-width: min(100%, var(--bn-art-w, 100%)); }
.fmec-bn.is-poster.art-wide .fmec-bn-poster { max-height: var(--bn-max-h, 420px); object-fit: contain; }
.fmec-bn.in-side.is-poster.art-wide .fmec-bn-poster { max-height: none; }
.fmec-bn.in-top.is-poster.art-wide, .fmec-bn.in-bottom.is-poster.art-wide, .fmec-bn.is-wide.is-poster.art-wide { width: min(calc(100% - 56px), var(--bn-art-w, 1500px)); max-width: none; }
.fmec-bn.is-poster.art-tall { width: min(100%, var(--bn-art-w, 100%)); max-width: 100%; margin-inline: auto; } /* a definite width: a container-type box in a grid/flex column would shrink to nothing with auto margins */
.fmec-bn.is-poster.art-tall .fmec-bn-poster { width: 100%; height: auto; max-height: min(78vh, 780px); object-fit: contain; }
.fmec-bn.in-top.is-poster.art-tall, .fmec-bn.in-bottom.is-poster.art-tall, .fmec-bn.is-wide.is-poster.art-tall { width: min(calc(100% - 56px), var(--bn-art-w, 360px)); max-width: none; }

/* a photo as the background of a text banner: the text sits on it, readable */
.fmec-bn.has-bg { --bn-fg: #fff; --bn-muted: rgba(255, 255, 255, .86); --bn-line: rgba(255, 255, 255, .2); --bn-accent: #f0c764; --bn-link: #f0c764; --bn-cta-bg: #efc25a; --bn-cta-fg: #2a1a04; --bn-shadow: 0 10px 26px rgba(3, 42, 49, .22); }
.fmec-bn.has-bg .fmec-bn-link { background: linear-gradient(100deg, rgba(3, 38, 46, .92) 0%, rgba(3, 38, 46, .74) 46%, rgba(3, 38, 46, .22) 100%), var(--bn-img) center / cover; }
.fmec-bn.is-card.has-bg .fmec-bn-link { min-height: 210px; align-content: end; background: linear-gradient(0deg, rgba(3, 38, 46, .94) 0%, rgba(3, 38, 46, .6) 55%, rgba(3, 38, 46, .12) 100%), var(--bn-img) center / cover; }
.fmec-bn.is-band.has-bg .fmec-bn-link { min-height: 108px; }
.fmec-bn.is-note.has-bg .fmec-bn-link, .fmec-bn.is-strip.has-bg .fmec-bn-link { border-left-color: #f0c764; }

/* a tall ad in a side column stays in view while the article is read (under the header, ends with its column; where the column is the one that follows, it simply travels with it) */
@media (min-width: 901px) {
  .fmec-bn.in-side { position: sticky; top: calc(var(--pg-sticky, 70px) + var(--fm-follow-bar, 0px) + 18px); }
}

/* devices */
@media (max-width: 760px) { .fmec-bn.only-desktop, .fmec-bn-pop.only-desktop { display: none; } }
@media (min-width: 761px) { .fmec-bn.only-mobile, .fmec-bn-pop.only-mobile { display: none; } }
@media (max-width: 760px) {
  .fmec-bn { margin: 18px 0; }
  .fmec-bn.in-top, .fmec-bn.in-bottom, .fmec-bn.is-wide { width: calc(100% - 32px); }
  .fmec-bn.in-top.is-poster.art-wide, .fmec-bn.in-bottom.is-poster.art-wide, .fmec-bn.is-wide.is-poster.art-wide { width: min(calc(100% - 32px), var(--bn-art-w, 1500px)); }
  .fmec-bn.is-poster.art-wide .fmec-bn-poster { max-height: var(--bn-max-h-m, 420px); }
}
/* narrow place (a phone, or a column): the same ad re-flows */
@container (max-width: 620px) {
  .fmec-bn.is-strip .fmec-bn-link { flex-wrap: wrap; padding: 9px 12px; }
  .fmec-bn.is-strip .fmec-bn-body { flex: 1 1 calc(100% - 40px); flex-wrap: wrap; }
  .fmec-bn.is-strip .fmec-bn-text { white-space: normal; overflow: visible; }
  .fmec-bn.is-band .fmec-bn-link { grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; padding: 14px 16px; }
  .fmec-bn.is-band .fmec-bn-cta { grid-column: 1 / -1; justify-content: center; }
  .fmec-bn.is-band .fmec-bn-media { width: 46px; height: 46px; }
}
@container (max-width: 480px) {
  .fmec-bn.is-note .fmec-bn-link { grid-template-columns: auto minmax(0, 1fr); }
  .fmec-bn.is-note .fmec-bn-cta { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ overlays: centred window, drawer from the side, corner toast, half-page panel */
.fmec-bn-pop { position: fixed; z-index: 131; left: 14px; bottom: calc(var(--fmec-live-bar-height, 0px) + var(--fmec-dock-h, 0px) + 16px + env(safe-area-inset-bottom, 0px)); width: min(340px, calc(100vw - 28px)); opacity: 0; pointer-events: none; transform: translateY(18px); transition: opacity .3s ease, transform .3s cubic-bezier(.22, .7, .2, 1); }
.fmec-bn-pop[hidden] { display: none !important; }
.fmec-bn-pop.is-in { opacity: 1; pointer-events: auto; transform: none; }
.fmec-bn-pop.is-leaving { opacity: 0; pointer-events: none; transform: translateY(12px); }
.fmec-bn-pop-card { position: relative; overflow: hidden; border-radius: 18px; background: var(--bn-bg); border: 1px solid var(--bn-line); box-shadow: 0 16px 44px rgba(6, 50, 58, .22); }
.fmec-bn-pop-bar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 8px 8px 0 14px; }
.fmec-bn-pop-bar .fmec-bn-tag { --bn-tag: var(--bn-muted); }
.fmec-bn-ctl { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(6, 50, 58, .08); color: var(--bn-muted); font: 400 19px / 1 Arial, sans-serif; cursor: pointer; transition: background-color .18s ease; }
.fmec-bn-pop.is-dark .fmec-bn-ctl { background: rgba(255, 255, 255, .14); color: #fff; }
.fmec-bn-ctl:hover { background: rgba(6, 50, 58, .2); }
.fmec-bn-pop.is-dark .fmec-bn-ctl:hover { background: rgba(255, 255, 255, .3); }
.fmec-bn-pop .fmec-bn-link { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 12px; padding: 8px 14px 14px; border: 0; background: transparent; box-shadow: none; }
.fmec-bn-pop .fmec-bn-media { width: 52px; height: 52px; }
.fmec-bn-pop .fmec-bn-cta { grid-column: 1 / -1; justify-self: start; padding: 8px 15px; border-radius: 999px; background: var(--bn-cta-bg); color: var(--bn-cta-fg); }
.fmec-bn-pop a.fmec-bn-link:hover { transform: none; }
.fmec-bn-pop.is-poster .fmec-bn-link { display: block; padding: 8px 10px 10px; }
.fmec-bn-pop.is-poster .fmec-bn-poster { width: 100%; height: auto; max-height: min(60vh, 560px); object-fit: contain; margin-inline: auto; }
.fmec-bn-pop.is-poster.is-sheet { max-width: 520px; }
.fmec-bn-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--bn-accent); transform-origin: left center; transform: scaleX(1); opacity: .75; }
.fmec-bn-pop.is-timing .fmec-bn-timer { animation: fmbn-timer var(--bn-dur, 10s) linear forwards; }
.fmec-bn-pop.is-paused .fmec-bn-timer { animation-play-state: paused; }
@keyframes fmbn-timer { to { transform: scaleX(0); } }

/* centred window: a calm modal, 30% of the screen up to 480 px, dimmed page behind, closed by the cross, Esc or a click on the dimmed page */
.fmec-bn-pop.is-center { inset: 0; width: auto; z-index: 1500; display: grid; place-items: center; padding: 16px; transform: none; transition: opacity .28s ease; }
.fmec-bn-pop.is-center.is-leaving { transform: none; }
.fmec-bn-backdrop { position: absolute; inset: 0; background: rgba(4, 30, 36, .5); }
.fmec-bn-pop.is-center .fmec-bn-pop-card { position: relative; width: clamp(280px, 30vw, var(--bn-pop-w, 480px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; transform: translateY(10px) scale(.97); transition: transform .3s cubic-bezier(.22, .7, .2, 1); }
.fmec-bn-pop.is-center.has-maxw .fmec-bn-pop-card { width: min(var(--bn-pop-w), calc(100vw - 32px)); }
.fmec-bn-pop.is-center.is-in .fmec-bn-pop-card { transform: none; }
.fmec-bn-pop.is-center .fmec-bn-pop-card:focus { outline: none; }
.fmec-bn-pop.is-center .fmec-bn-pop-card:focus-visible { outline: 3px solid rgba(230, 173, 60, .85); outline-offset: 3px; }
.fmec-bn-pop.is-center .fmec-bn-link { grid-template-columns: 1fr; padding: 6px 18px 18px; }
.fmec-bn-pop.is-center.is-poster .fmec-bn-link { padding: 6px 12px 12px; }
.fmec-bn-pop.is-center .fmec-bn-title { font-size: 19px; }
.fmec-bn-pop.is-center .fmec-bn-media { width: 52px; height: 52px; }
.fmec-bn-pop.is-center .fmec-bn-cta { justify-self: stretch; justify-content: center; }

/* drawer from the side: right by default, at most 40% of the screen; folds to about half the height */
.fmec-bn-pop.is-slide { top: auto; bottom: calc(var(--fmec-live-bar-height, 0px) + var(--fmec-dock-h, 0px) + 76px + env(safe-area-inset-bottom, 0px)); width: clamp(280px, 40vw, var(--bn-pop-w, 360px)); }
.fmec-bn-pop.is-slide.is-right { left: auto; right: 0; transform: translateX(108%); }
.fmec-bn-pop.is-slide.is-left { left: 0; right: auto; transform: translateX(-108%); }
.fmec-bn-pop.is-slide.is-in { transform: none; }
.fmec-bn-pop.is-slide.is-right.is-leaving { transform: translateX(108%); }
.fmec-bn-pop.is-slide.is-left.is-leaving { transform: translateX(-108%); }
.fmec-bn-pop.is-slide.is-right .fmec-bn-pop-card { border-radius: 18px 0 0 18px; border-right: 0; }
.fmec-bn-pop.is-slide.is-left .fmec-bn-pop-card { border-radius: 0 18px 18px 0; border-left: 0; }
.fmec-bn-pop.is-slide .fmec-bn-link { grid-template-columns: 1fr; }
.fmec-bn-pop.is-slide .fmec-bn-media { width: 100%; height: auto; aspect-ratio: 16 / 7; max-height: 110px; }
.fmec-bn-pop.is-slide .fmec-bn-media.is-logo { width: 46px; height: 46px; aspect-ratio: auto; }
.fmec-bn-pop.is-slide.is-poster .fmec-bn-poster { max-height: min(46vh, 420px); }
/* folded to about half the height: the line, the headline and the button stay, the picture and the sentence go */
.fmec-bn-pop.is-slide.is-folded .fmec-bn-media, .fmec-bn-pop.is-slide.is-folded .fmec-bn-text { display: none; }
.fmec-bn-pop.is-slide.is-folded.is-poster .fmec-bn-poster { max-height: min(16vh, 130px); }
.fmec-bn-pop.is-slide.is-folded .fmec-bn-link { gap: 6px; padding-bottom: 12px; }
.fmec-bn-pop.is-folded [data-bn-fold] span { display: inline-block; transform: rotate(180deg); }

.fmec-bn-pop.is-sheet { left: 0; right: 0; width: auto; max-width: 680px; margin-inline: auto; bottom: calc(var(--fmec-live-bar-height, 0px) + var(--fmec-dock-h, 0px) + env(safe-area-inset-bottom, 0px)); transform: translateY(105%); }
.fmec-bn-pop.is-sheet.is-in { transform: none; }
.fmec-bn-pop.is-sheet.is-leaving { transform: translateY(105%); }
.fmec-bn-pop.is-sheet .fmec-bn-pop-card { max-height: 50vh; overflow: auto; border-radius: 20px 20px 0 0; border-bottom: 0; }
.fmec-bn-pop.is-sheet .fmec-bn-pop-bar::before { content: ""; position: absolute; left: 50%; top: 7px; width: 38px; height: 4px; margin-left: -19px; border-radius: 3px; background: rgba(6, 50, 58, .2); }
.fmec-bn-pop.is-dark.is-sheet .fmec-bn-pop-bar::before { background: rgba(255, 255, 255, .3); }
.fmec-bn-pop.is-sheet .fmec-bn-pop-bar { padding-top: 16px; }
.fmec-bn-pop.is-sheet .fmec-bn-link { padding-bottom: 18px; }

/* admin preview: the overlay drawn in place */
.fmec-bn-pop.is-preview { position: static; width: 100%; max-width: 360px; transform: none !important; opacity: 1; margin: 0; pointer-events: auto; }
.fmec-bn-pop.is-preview.is-center { display: block; padding: 0; }
.fmec-bn-pop.is-preview.is-center .fmec-bn-pop-card { width: 100%; max-height: none; transform: none; }
.fmec-bn-pop.is-preview.is-sheet, .fmec-bn-pop.is-preview.is-slide { max-width: 360px; }
.fmec-bn-pop.is-preview.is-slide { width: 100%; }

@media (max-width: 760px) {
  .fmec-bn-pop { left: 10px; right: 10px; width: auto; }
  .fmec-bn-pop.is-slide { width: min(300px, calc(100vw - 30px)); top: auto; bottom: calc(var(--fmec-live-bar-height, 0px) + var(--fmec-dock-h, 0px) + 86px + env(safe-area-inset-bottom, 0px)); }
  .fmec-bn-pop.is-slide.is-right { left: auto; right: 0; }
  .fmec-bn-pop.is-slide.is-left { left: 0; right: auto; }
  .fmec-bn-pop.is-sheet { left: 0; right: 0; }
  .fmec-bn-pop.is-center { left: 0; right: 0; padding: 16px; }
  .fmec-bn-pop.is-center .fmec-bn-pop-card { width: min(calc(100vw - 32px), 420px); max-height: min(78vh, 560px); }
  .fmec-bn-pop.is-preview { left: auto; right: auto; }
}
@media print { .fmec-bn, .fmec-bn-pop { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .fmec-bn-link, .fmec-bn-cta i, .fmec-bn-pop, .fmec-bn-pop-card { transition: none !important; }
  .fmec-bn-pop.is-timing .fmec-bn-timer { animation: none; }
  .fmec-bn-pop.is-center .fmec-bn-pop-card { transform: none; }
}
