/*
 * СЕДУМ ДЕНА: bridges between sections (crosslinks lane).
 * Four shapes: --top (one strong link), --rail (2 to 4 stories), --inline (one line in an article),
 * --end ("Од другите рубрики", 3 to 4 stories, each in its own section colour). --quiet on games.
 * Colour comes from data-sec on the element (the story's section): --sd-c, --sd-c-text.
 */

.sd-bridge { min-width: 0; }

.sd-bridge__head {
  margin: 0 0 var(--ed-rule-gap);
  font-family: var(--ed-sans);
  font-size: var(--ed-fs-label);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-ink);
}

.sd-bridge__kicker {
  display: block;
  font-family: var(--ed-sans);
  font-size: var(--ed-fs-label);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sd-c-text);
}

/* ------------------------------------------------------------------ top: one strong link */

.sd-bridge--top {
  border-top: 3px solid var(--sd-c);
}
.sd-bridge--top .sd-bridge__link {
  display: block;
  padding: var(--ed-s3) 0 var(--ed-s4);
  border-bottom: 1px solid var(--ed-line);
  color: inherit;
  text-decoration: none;
}
.sd-bridge--top .sd-bridge__headline {
  display: block;
  margin-top: 6px;
  font-family: var(--ed-head);
  font-size: var(--ed-fs-sm);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ed-ink);
  text-wrap: balance;
  transition: color 0.15s var(--ed-ease);
}
.sd-bridge--top .sd-bridge__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ed-s3);
  margin-top: var(--ed-s2);
  font-family: var(--ed-sans);
  font-size: var(--ed-fs-label);
  font-weight: 500;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  color: var(--ed-ink-4);
}
.sd-bridge__arrow { flex: none; color: var(--sd-c-text); transition: transform 0.15s var(--ed-ease); }
.sd-bridge--top .sd-bridge__link:hover .sd-bridge__headline { color: var(--ed-ink-3); }
.sd-bridge--top .sd-bridge__link:hover .sd-bridge__arrow { transform: translateX(3px); }
.sd-bridge--top .sd-bridge__link:focus-visible { outline: 2px solid var(--sd-c); outline-offset: 2px; }

/* ------------------------------------------------------------------ rail: two to four stories */

.sd-bridge--rail {
  padding-top: var(--ed-rule-gap);
  border-top: 1px solid var(--ed-ink);
}
.sd-bridge--rail .sd-bridge__head { margin-bottom: var(--ed-s3); }
.sd-bridge--rail .ed-story--thumb { --ed-thumb: 80px; }
.sd-bridge--rail .ed-kicker { margin-bottom: 4px; }
.sd-bridge--rail .ed-meta { margin-top: 6px; }
@media (min-width: 740px) {
  .sd-bridge--rail .ed-story--thumb { --ed-thumb: 88px; }
}

/* ------------------------------------------------------------------ inline: one line in the text */

.sd-bridge--inline {
  margin: var(--ed-block-gap) 0;
  padding: 2px 0 2px var(--ed-s4);
  border-left: 3px solid var(--sd-c);
}
.sd-bridge--inline .sd-bridge__line { margin: 0; }
.sd-bridge--inline .sd-bridge__kicker { margin-bottom: 4px; }
.sd-bridge--inline .sd-bridge__headline {
  font-family: var(--ed-head);
  font-size: var(--ed-fs-xs);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ed-ink);
  text-decoration: underline;
  text-decoration-color: var(--ed-line-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s var(--ed-ease), color 0.15s var(--ed-ease);
}
.sd-bridge--inline .sd-bridge__headline:hover { color: var(--ed-ink-3); text-decoration-color: var(--sd-c); }

/* ------------------------------------------------------------------ end: "Од другите рубрики" */

.sd-bridge--end {
  margin-top: var(--ed-block-gap);
  padding-top: var(--ed-rule-gap);
  border-top: 1px solid var(--ed-ink);
}
.sd-bridge__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ed-item-gap);
}
.sd-bridge__item {
  padding-top: var(--ed-s3);
  border-top: 3px solid var(--sd-c);
}
.sd-bridge__item .ed-kicker { margin-bottom: 5px; }

/* Phones: the small-thumb layout (text left, picture right). */
@media (max-width: 739px) {
  .sd-bridge--end .sd-bridge__item.has-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    column-gap: var(--ed-s3);
    align-items: start;
  }
  .sd-bridge--end .sd-bridge__item .ed-story__media { grid-column: 2; grid-row: 1; aspect-ratio: 1 / 1; }
  .sd-bridge--end .sd-bridge__item .ed-story__body { grid-column: 1; grid-row: 1; }
  .sd-bridge--end .ed-story--sm .ed-story__headline { font-size: var(--ed-fs-xs); line-height: 1.22; }
}
@media (min-width: 740px) {
  .sd-bridge__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--ed-s6); row-gap: var(--ed-block-gap); }
  .sd-bridge__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .sd-bridge__grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sd-bridge__grid { column-gap: calc(2 * var(--ed-col-pad)); }
}

/* Games: a quiet text block under the board. */
.sd-bridge--quiet { border-top-color: var(--ed-line-2); }
.sd-bridge--quiet .sd-bridge__head { color: var(--ed-ink-4); }
.sd-bridge--quiet .sd-bridge__item { padding-top: 10px; border-top-width: 2px; }
.sd-bridge--quiet .ed-story__headline { font-weight: 500; }
@media (min-width: 740px) {
  .sd-bridge--quiet .sd-bridge__grid { row-gap: var(--ed-s4); }
}

/* ------------------------------------------------------------------ platform pass: the quiet band
   "Од другите рубрики" sits on a quiet neutral panel; each story keeps its own section colour in its
   top rule and kicker. Pictures zoom slowly under a desktop pointer. The games' quiet block stays bare. */

.sd-bridge--end:not(.sd-bridge--quiet) {
  margin-inline: calc(-1 * var(--ed-gutter));
  padding: var(--ed-s5) var(--ed-gutter) var(--ed-s6);
  background: var(--ed-bg-2);
}
@media (min-width: 740px) {
  .sd-bridge--end:not(.sd-bridge--quiet) { margin-inline: 0; padding: var(--ed-s5) var(--ed-s6) var(--ed-s8); }
}
.sd-bridge--end .sd-bridge__item .ed-story__headline a { transition: color 0.15s var(--ed-ease); }
.sd-bridge--end .sd-bridge__item:hover .ed-story__headline a { color: var(--ed-ink-3); }
.sd-bridge--end .sd-bridge__item .ed-story__media { overflow: hidden; }
.sd-bridge--end .sd-bridge__item .ed-story__media img { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (hover: hover) and (pointer: fine) {
  .sd-bridge--end .sd-bridge__item:hover .ed-story__media img { transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .sd-bridge__arrow,
  .sd-bridge--top .sd-bridge__headline,
  .sd-bridge--inline .sd-bridge__headline { transition: none; }
  .sd-bridge--top .sd-bridge__link:hover .sd-bridge__arrow { transform: none; }
  .sd-bridge--end .sd-bridge__item .ed-story__media img,
  .sd-bridge--end .sd-bridge__item .ed-story__headline a { transition: none; }
  .sd-bridge--end .sd-bridge__item:hover .ed-story__media img { transform: none; }
}

/* ------------------------------------------------------------------ final polish (owner, 2026-11-26)
   One wording everywhere ("Од другите рубрики", render.php). The end block is a quiet band that fades
   sideways from the page's own wash (oklch where it can), under a hairline of the page colour; the
   head speaks in the page colour; each story keeps its own section colour in its rule and kicker.
   When the block enters the window its rules draw in from the left, the stories follow in reading
   order and the pictures open with a short wipe. Headlines take an underline that draws in. */

.sd-bridge {
  --br-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --br-rule: color-mix(in srgb, var(--sd-c, var(--ed-ink)) 22%, var(--ed-line));
}
.sd-bridge--end:not(.sd-bridge--quiet) {
  border-top: 1px solid var(--br-rule);
  background: linear-gradient(90deg, var(--sd-c-wash-2, var(--ed-bg-2)) 0%, var(--sd-c-wash, var(--ed-bg-2)) 45%, rgb(255 255 255 / 0.5) 100%);
}
@supports (color: oklch(from red l c h)) {
  .sd-bridge { --br-rule: color-mix(in oklab, var(--sd-c, var(--ed-ink)) 22%, var(--ed-line)); }
  .sd-bridge--end:not(.sd-bridge--quiet) {
    background: linear-gradient(90deg in oklab, var(--sd-c-wash-2, var(--ed-bg-2)) 0%, var(--sd-c-wash, var(--ed-bg-2)) 45%, oklch(1 0 0 / 0.5) 100%);
  }
}
.sd-bridge--end .sd-bridge__head,
.sd-bridge--rail .sd-bridge__head { color: var(--sd-c-text, var(--ed-ink)); }
.sd-bridge--quiet .sd-bridge__head { color: var(--ed-ink-4); }

/* Headlines: an underline that draws in (180ms); a visible focus in the story's colour. */
.sd-bridge .ed-story__headline a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.18s var(--br-ease), color 0.18s var(--br-ease);
}
.sd-bridge .ed-story:hover .ed-story__headline a,
.sd-bridge .ed-story__headline a:focus-visible { background-size: 100% 1px; color: var(--ed-ink); }
.sd-bridge a:focus-visible { outline: 2px solid var(--sd-c-text, var(--ed-ink)); outline-offset: 2px; }
.sd-bridge--end .sd-bridge__item:hover .ed-story__headline a { color: var(--ed-ink); }
.sd-bridge--rail li { transition: background-color 0.18s var(--br-ease); }

/* The end block entering the window (its wrapper carries data-reveal): rules, stories, pictures. */
.sd-bridge__item { position: relative; border-top-color: transparent; }
.sd-bridge__item::before {
  content: "";
  position: absolute;
  top: calc(-1 * var(--br-w, 3px)); left: 0; right: 0;
  height: var(--br-w, 3px);
  background: var(--sd-c);
  transform-origin: 0 50%;
}
.sd-bridge--quiet .sd-bridge__item { --br-w: 2px; }
html.js-motion [data-reveal]:not(.is-in) .sd-bridge__item::before { transform: scaleX(0); }
html.js-motion [data-reveal]:not(.is-in) .sd-bridge__item { opacity: 0; transform: translate3d(0, 10px, 0); }
html.js-motion [data-reveal]:not(.is-in) .sd-bridge__item .ed-story__media img { clip-path: inset(0 100% 0 0); scale: 1.04; }
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item,
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item::before,
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item .ed-story__media img {
  transition: opacity 0.46s var(--br-ease), transform 0.46s var(--br-ease), clip-path 0.52s var(--br-ease), scale 0.52s var(--br-ease);
}
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item:nth-child(2),
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item:nth-child(2)::before { transition-delay: 70ms; }
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item:nth-child(3),
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item:nth-child(3)::before { transition-delay: 140ms; }
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item:nth-child(4),
html.js-motion [data-reveal]:not(.is-done) .sd-bridge__item:nth-child(4)::before { transition-delay: 210ms; }

@media (prefers-reduced-motion: reduce) {
  .sd-bridge .ed-story__headline a, .sd-bridge--rail li { transition: none; }
  html.js-motion [data-reveal] .sd-bridge__item,
  html.js-motion [data-reveal] .sd-bridge__item::before,
  html.js-motion [data-reveal] .sd-bridge__item .ed-story__media img { opacity: 1; transform: none; clip-path: none; scale: none; }
}

@media print {
  .sd-bridge { display: none; }
}

/* ------------------------------------------------------------------ round 6: rail and end band, two jobs
   The rail block is a timed text list of what is new elsewhere (desktop rails only); the end band is
   the picture band that keeps the reader going. On phones, where the rail would stack into the page,
   only the end band shows. Neither repeats a story of the other (render.php marks what it printed). */
.sd-bridge--rail .sd-bridge__list > li { padding-block: var(--ed-s3); }
.sd-bridge--rail .sd-bridge__list > li + li { border-top: 1px solid var(--ed-line); }
.sd-bridge--rail .ed-story--text .ed-story__headline { font-size: var(--ed-fs-xs); line-height: 1.25; }
.sd-bridge--rail .ed-story--text { display: flex; flex-direction: column; }
@media (max-width: 1023.98px) {
  .sd-bridge--rail { display: none; }
}