/* ==========================================================================
   Inner pages on the mark system — the template
   --------------------------------------------------------------------------
   Pilot: /vodenje-drustvenih-mreza/. Load after /assets/css/mark-system.css.
   An inner page that moves to the system needs:
     <meta name="theme-color" content="#060709">            dark overscroll
     <body class="mk" data-nav-surface="stage">             tokens + nav tone
     the inline sprite (<svg class="mk-sprite">…)           glyphs, cursor
     <header class="mk-pagehead mk-night">                  night page head
     sections: .mk-band + .mk-day / .mk-wash / .mk-night, each after the
               first with .mk-cut (the slot in its top edge)
     closing:  <section class="mk-close mk-night mk-cut">
   and /assets/js/mark-system.js (deferred). Without JS it is all visible.
   ========================================================================== */

/* Dark-topped page: the overscroll above the head and below the footer */
html {
  background: var(--night);
}

/* ── Page head: the night stage ───────────────────────────────────────── */
.mk-pagehead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding: calc(var(--nav-h) + var(--m-2)) 0 var(--m-ri);
}

/* the stage's beam, aimed at the presented object */
.mk-pagehead::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle min(40vmax, 720px) at var(--mx, 74%) var(--my, 46%), rgba(252, 212, 163, .09), transparent 62%),
    radial-gradient(ellipse 50% 60% at 76% 50%, rgba(130, 153, 187, .06), transparent 70%);
  pointer-events: none;
}

.mk-pagehead .crumbs,
.mk-pagehead .crumbs a {
  color: var(--n-muted);
}

.mk-pagehead .crumbs a:hover {
  color: var(--n-ink);
}

.mk-pagehead .crumbs li+li::before {
  color: var(--n-line);
}

.mk-pagehead .crumbs [aria-current] {
  color: var(--n-ink);
}

.mk-pagehead__grid {
  display: grid;
  gap: var(--m-2) var(--m);
  align-items: center;
  margin-top: var(--m-2);
}

@media (min-width: 960px) {
  .mk-pagehead__grid {
    grid-template-columns: minmax(0, 4.18fr) minmax(0, 3.18fr);
  }
}

.mk-pagehead h1 {
  margin-top: var(--m);
  /* phones: "za klubove i barove" (8.3em) just fills the column, which also
     keeps the h1 clearly larger than the lede, so it stays the LCP element */
  font-size: clamp(2rem, 10.6vw, var(--t5));
  line-height: .96;
  letter-spacing: -0.045em;
}

/* the h1 breaks only between its phrases */
.mk-pagehead h1 span {
  white-space: nowrap;
}

@media (min-width: 960px) {
  .mk-pagehead h1 {
    font-size: clamp(2.8rem, 5vw, var(--t5));
  }

  /* one phrase per line, but the spans stay inline (a generated line
     break before each), so the whole heading is one text block and stays
     the LCP element; display:block made each line its own candidate */
  .mk-pagehead h1 span::before {
    content: "\A";
    white-space: pre;
  }
}

.mk-pagehead .lede {
  margin-top: var(--m);
  max-width: 44ch;
  color: var(--n-ink);
}

.mk-pagehead .btn-row {
  margin-top: var(--m-2);
}

.mk-pagehead__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--m-q) var(--m);
  margin-top: var(--m-2);
  padding-top: var(--m-h);
  border-top: 1px solid var(--n-line);
  font-size: .9rem;
  color: var(--n-muted);
}

.mk-pagehead__meta strong {
  color: var(--n-ink);
  font-weight: 500;
}

/* The presented object stands inside the mark's open ring; the ring's four
   verticals run through the whole head */
.mk-pagehead__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: min(92vw, 560px);
}

.mk-pagehead__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, 600px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  overflow: visible;
  color: var(--n-ink);
  pointer-events: none;
}

.mk-pagehead__ringshape {
  fill: url(#mk-chrome);
  fill-opacity: .16;
  stroke: var(--sun);
  stroke-opacity: .5;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.mk-pagehead__ring .g-line {
  stroke: var(--sun);
  stroke-opacity: .22;
}

.mk-pagehead__stage .mock {
  position: relative;
  width: min(100%, 420px);
}

@media (max-width: 959px) {
  .mk-pagehead__stage {
    min-height: 0;
    padding: var(--m) 0;
  }

  .mk-pagehead__ring {
    width: min(112%, 520px);
  }
}

/* the drawn ring arrives with the page: the slot opens on the mock */
.mk-js .mk-pagehead__stage .mock {
  animation: mk-slot var(--dur-4) .25s both;
}

.mk-js .mk-pagehead__ring {
  animation: mk-ring-in 1.8s var(--ease-arrive) both;
}

/* scale and fade only: a rotation briefly widened the page in Firefox */
@keyframes mk-ring-in {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.94);
  }
}

/* ── Night bands ──────────────────────────────────────────────────────── */
.mk-band.mk-night .mk-stat strong {
  color: var(--n-ink);
}

.mk-band.mk-night .mk-stats {
  margin-top: var(--m-R);
}

.mk-band.mk-night .btn-row {
  margin-top: var(--m-2);
}

/* The offer band: the open ring, large and cropped by the band's right
   edge, in the warm highlight; the heading at display size */
.mk-offer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
}

.mk-offer::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  right: calc(var(--m-D) * -0.9);
  width: calc(var(--m-D) * 2.6);
  aspect-ratio: 1;
  transform: translateY(-50%);
  background: linear-gradient(160deg, rgba(252, 212, 163, .22), rgba(130, 153, 187, .1));
  -webkit-mask: var(--mk-ring-url) center / contain no-repeat;
  mask: var(--mk-ring-url) center / contain no-repeat;
  pointer-events: none;
}

.mk-offer h2 {
  font-size: clamp(var(--t3), 6vw, var(--t5));
}

@media (max-width: 899px) {
  .mk-offer::before {
    top: auto;
    bottom: calc(var(--m-3) * -1);
    right: calc(var(--m-D) * -1.2);
    transform: none;
    opacity: .7;
  }
}

.mk-offer .split__body>.lede:first-child {
  color: var(--n-ink);
}

/* ── Steps with five parts: the head's sentence is not needed ─────────── */
@media (min-width: 901px) {
  .mk-band .mk-head:not(:has(.lede)) {
    grid-template-areas: "mark mark" "title title";
  }
}

/* ── Plans ────────────────────────────────────────────────────────────── */
.mk-plan__idx {
  display: flex;
  align-items: center;
  gap: var(--m-h);
  color: var(--muted);
}

.mk-plan__idx .mk-glyph {
  width: var(--m-2);
  height: var(--m-2);
  color: var(--ink);
}

/* ── Comparison table on the system: square, ruled, mono heads ────────── */
.mk-table {
  margin-top: var(--m-R);
  border: 0;
  border-radius: 0;
}

/* the table closes on one rule under its last row, across every column
   (site.css drops the last row's cell borders; on phones the last row has
   empty cells, so the rule broke off under them) */
body.mk .mk-table table {
  border-collapse: collapse;
  border-bottom: 1px solid var(--hairline);
}

body.mk .mk-table thead th {
  font-family: var(--mono);
  font-size: var(--t-1);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border-bottom: 1px solid var(--ink);
}

body.mk .mk-table th,
body.mk .mk-table td {
  border-color: var(--hairline);
}

body.mk .mk-table tbody tr:hover {
  background: var(--wash);
}

.mk-note {
  margin-top: var(--m);
  color: var(--muted);
  font-size: .92rem;
}

body.mk .mk-band>.shell>.mk-note {
  margin-top: var(--m);
}

/* ── Lists: the slot is the bullet ────────────────────────────────────── */
.mk-list ul {
  list-style: none;
  padding: 0;
}

.mk-list ul li {
  position: relative;
  padding-left: var(--m-2);
}

.mk-list ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .3em;
  width: calc(var(--m) * .34);
  height: .9em;
  background: var(--ink);
}

.mk-list ul li+li {
  margin-top: var(--m);
}

/* ── Closing band: the construction drawing and the last call ─────────── */
.mk-close {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  padding: var(--m-D) 0 var(--m-ri);
}

.mk-close__mark {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: max(0px, calc((100vw - var(--shell)) / 2));
  width: min(46vw, 640px);
  height: auto;
  aspect-ratio: 1;
  transform: translateY(-50%);
  overflow: visible;
}

.mk-close h2 {
  margin-top: var(--m);
  max-width: 13ch;
  font-size: clamp(var(--t3), 7vw, var(--t6));
  line-height: .94;
  letter-spacing: -0.05em;
}

.mk-close .lede {
  margin-top: var(--m);
  max-width: 44ch;
}

.mk-close .btn-row {
  margin-top: var(--m-2);
}

@media (max-width: 900px) {
  .mk-close__mark {
    top: var(--m);
    right: -24vw;
    width: 96vw;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .mk-js .mk-pagehead__stage .mock,
  .mk-js .mk-pagehead__ring {
    animation: none;
  }
}
