/* ViZZ redesign 2026 — CMS content screen, and the plugin typography scope.
   Loads after vizz-tokens.css (tokens, primitives) and vizz-shell.css (the
   box-sizing reset, --ink-rgb, the motion variables). Breakpoints match the
   shell: 900px (narrow) and 620px (mobile).

   Two independent things live here:

     1. `.vizz-content*` — the two-column page frame, which is the designer's
        and stays in the template.
     2. `.djangocms-plugin-styles` — a typography scope put on the element that
        wraps a placeholder, so the HTML an editor already typed into a
        djangocms_text_ckeditor plugin picks up the redesign's type, colour and
        spacing without anyone re-editing a single page. It is deliberately
        self-contained: drop the class on any wrapper, on any template, and the
        markup inside it is styled.

   There is no page-title band on this screen on purpose — most existing pages
   open with their own <h1> inside the first text plugin (38 of them across the
   59 `left_column` placeholders), and a band would double every one of them.
   The h1 rule below is what gives those their size. */

/* ── page frame ───────────────────────────────────────────────────── */

.vizz-content {
  /* Narrower than the rest of the redesign on purpose. `--page-max` (1500px)
     is right for the home grid and the search results, but this screen is
     running prose, and a 1500px frame puts the main column at ~1050px — far
     past a comfortable measure.

     1280px is a little wider than the template this replaces (Bootstrap
     3.3.7's `.container` is 1170px). Every number on this screen is chosen to
     land the reading column on exactly 800px — up from the old ~750px, and
     well short of the ~1050px a full `--page-max` frame would give:

         1280 frame − 2×40 padding − 320 sidebar − 80 gap = 800

     which is about 84 characters at 17px. The sidebar is 320px because the
     partner logos are 156px and sit two abreast; change either of those and
     the reading column moves.

     The header and footer keep `--page-max`, exactly as the old site had a
     full-width header band over a `.container` of content. Both are centred,
     so the content reads as a deliberately narrower column rather than as
     something misaligned. */
  --content-max: 1280px;

  /* <body> is a column flex container (vizz-shell.css); without the explicit
     width the auto side margins switch off the stretch and this box shrinks to
     fit-content. Same reason as .vizz-search. */
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: clamp(36px, 4.5vw, 72px) var(--page-pad) clamp(56px, 7vw, 96px);
}

/* Full-width positioning context for .vizz-pagehead-alt, which bleeds to the
   right edge of the page. It wraps <main> and nothing else.

   It exists so the bleed can be measured against the DOCUMENT's width rather
   than the window's. The obvious `right: calc(50% - 50vw)` is wrong: `vw`
   counts the scrollbar and the document does not, so the wedge landed half a
   scrollbar past the page and opened a horizontal scrollbar — 5px of real,
   draggable sideways scroll. `overflow-x: clip` on <html> did not stop it
   (verified in Chrome: the rule applies, the page still scrolls). This
   wrapper is a flex item of <body>, so it stretches to exactly the document
   width, and `right: 0` against it is exact at any scrollbar width.

   Deliberately no `overflow` here — that would clip the bleed, and it would
   also risk taking the sidebar inside out of `position: sticky`. */
.vizz-content-bleed { position: relative; }

/* Content first in source order, sidebar second — the old Bootstrap template
   reversed the two with push/pull so the sidebar came first in the HTML. Here
   the visual order is the same and the reading order is the honest one. */
.vizz-content__grid {
  /* Lifts the text and the sidebar above the corner bleed, which paints from
     the top-right of .vizz-content. */
  position: relative;
  z-index: 1;

  display: grid;
  /* 320px exactly: two 156px partner logos plus the 4px gutter between them,
     so #right_column_content lays out two-up the way it did on the old site.
     A flexible track let the column fall under 316px and dropped them to one
     per row. */
  grid-template-columns: minmax(0, 1fr) 320px;
  /* Fixed rather than viewport-scaled: the frame is capped at 1280px, so a vw
     gap would keep growing after the container had stopped and walk the
     reading column off its 800px. Below 900px the grid is one column and this
     becomes the row gap between the content and the sidebar under it. */
  gap: 80px;
  align-items: start;
}
.vizz-content__main { min-width: 0; }
.vizz-content__side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* The air between the sub-nav and the partner logos under it. */
  gap: 28px;
  /* Sticks while the (usually much longer) main column scrolls past. 78px is
     the sticky header's height plus a little air. Safe because everything in
     this column is short — the sub-nav and six logos. If `right_column` ever
     carries enough content to make the column taller than the viewport, its
     bottom becomes unreachable while scrolling; drop the sticky then. */
  position: sticky;
  top: 78px;
}

/* ── page-head image ─────────────────────────────────────────────── */

/* The historical Arena panorama the old site used as its `.small-header`
   (static/img/small-header.jpg, 1437×336, already monochrome). Two looks, and
   the class on the element is the only switch between them — same arrangement
   as .vizz-sidenav / .vizz-sidenav-alt:

       <div class="vizz-pagehead">       a framed band above the content
       <div class="vizz-pagehead-alt">   a bleed in the top-right corner

   They are not variants of one layout. The band is in flow and pushes the page
   down; the bleed is taken out of flow entirely and takes no vertical space at
   all, so the title still starts at the top of the page and the image sits
   behind the corner. Because `position: absolute` removes it from flow, both
   can live on the same element in the same place in the template.

   The image is a CSS background rather than an <img>: it is decoration, it
   crops rather than scales, and there is nothing to caption. To let editors
   change it per page later, give the element `style="--pagehead-img:"`
   from a plugin and the var below picks it up. */

.vizz-pagehead,
.vizz-pagehead-alt {
  --pagehead-img: url("../../img/small-header.jpg");

  background-image: var(--pagehead-img);
  background-size: cover;
  background-repeat: no-repeat;
}

/* Version 1 — a framed band, the full width of the content column. */
.vizz-pagehead {
  /* The source is 4.28:1, so at the 1200px content width its natural height is
     280px. This crops it to a band — shorter than the old 335px header, which
     pushed the page title well below the fold. */
  height: clamp(140px, 16vw, 220px);
  margin-bottom: clamp(32px, 4vw, 56px);
  border-radius: var(--radius-lg);
  /* `bottom` keeps the Arena and the rooftops in frame when the band crops;
     centring it would cut the skyline off and show mostly blank sky. */
  background-position: center bottom;
}

/* Version 2 — a corner bleed. The image runs off the right edge of the window
   and dissolves on a diagonal as it comes down-left towards the sub-nav, so
   the sidebar reads over clear page rather than over photograph. */
.vizz-pagehead-alt {
  position: absolute;
  /* Anchored to .vizz-content-bleed, which is exactly as wide as the document
     and starts at the top of <main> — so this is the page's top-right corner,
     with no scrollbar arithmetic. */
  top: 0;
  right: 0;
  /* Wide on purpose. The fade runs on a shallow diagonal, so it needs a long
     run to finish: at 1000px the mask was still ~30% opaque when it hit the
     element's own left edge, and that showed as a hard vertical seam. At this
     width the gradient is spent before the box ends and the diagonal is the
     only edge anyone sees. */
  width: min(100vw, 1500px);
  height: clamp(200px, 25vw, 360px);
  /* Anchored to the image's own right end, which is where the Arena sits. */
  background-position: right top;

  /* 193deg points down and slightly left, so the gradient starts opaque in the
     top-right corner and runs out towards the sub-nav below it. The angle is
     roughly perpendicular to the diagonal the fade should read along; turn it
     towards 180deg to make the boundary flatter, towards 225deg to stand it up.
     mask rather than opacity, so it fades to the page rather than to grey.

     The 50% end stop is not a look, it is the seam. Moving from the box's
     right edge to its left along the top consumes ~48% of the gradient (the
     axis is W·sin θ + H·cos θ long), so anything past ~50% leaves the mask
     still partly opaque where the box ends — at 58% that was a 32-level step
     down the left edge, plainly visible. Ending at 50% lands on ~3% alpha
     there, a 2-level step. Re-derive it if the width, height or angle move. */
  -webkit-mask-image: linear-gradient(193deg, #000 4%, transparent 50%);
  mask-image: linear-gradient(193deg, #000 4%, transparent 50%);
}

/* Without mask support the bleed would be a hard-edged block over the corner,
   which is worse than no image — the framed band is the sane fallback. Same
   caution vizz-shell.css takes over color-mix(). */
@supports not ((mask-image: url("")) or (-webkit-mask-image: url(""))) {
  .vizz-pagehead-alt { display: none; }
}

/* ── sidebar: sub-navigation ──────────────────────────────────────── */

.vizz-sidenav {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 10px;
}
.vizz-sidenav__item {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
  text-decoration: none;
  transition: background var(--motion-duration) var(--motion-ease);
}
.vizz-sidenav__item:hover {
  background: rgba(var(--ink-rgb), 0.06);
  color: var(--color-text);
  text-decoration: none;
}
/* The page you are on gets the accent fill. `ancestor` is the branch you are
   inside when you are on a page deeper than this level — tinted, not filled.
   (Not `descendant`: every item in this list is a descendant of the selected
   page whenever you are on that page's own level, so it marks all of them.) */
.vizz-sidenav__item[aria-current="page"] {
  background: var(--color-accent-200);
  color: var(--color-accent-800);
}
.vizz-sidenav__item--ancestor { color: var(--color-accent-700); }

/* ── sidebar: sub-navigation, alternative ─────────────────────────── */

/* A drop-in alternative to .vizz-sidenav above, which stays exactly as it is.
   Swap ONE word in redesign-2026/menus/sidebar_menu.html:

       <nav class="vizz-sidenav">   ->   <nav class="vizz-sidenav-alt">

   and nothing else changes — the items keep their `vizz-sidenav__item` class
   and their modifiers, so the template markup, the `aria-current` and the
   `--ancestor` state all carry over untouched. Everything below is a
   descendant selector on .vizz-sidenav-alt, which outranks the flat
   .vizz-sidenav__item rules above it, so whichever class is on the <nav> wins
   cleanly and the two can never both apply.

   The design: the filled card becomes an editorial list on a rail. Items sit
   on a hairline divider instead of inside a box, and a segment of the left
   rail lights up in accent for the item you are hovering or on. It suits the
   long labels in this menu ("Građa obuhvaćena digitalizacijom") better than a
   fill does, because the marker is a fixed 2px rail rather than a block of
   colour whose size follows the wrapped text. */

.vizz-sidenav-alt {
  /* Owns nothing from .vizz-sidenav, so switching is a genuine swap: no
     background, no radius, no padding — just the rail. */
  border-left: 2px solid var(--color-divider);
}

.vizz-sidenav-alt .vizz-sidenav__item {
  position: relative;
  display: block;
  padding: 13px 8px 13px 18px;
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
  /* Resting items sit back a little so the current one reads as the only
     full-ink row in the list. */
  color: rgba(var(--ink-rgb), 0.78);
  text-decoration: none;
  transition: color var(--motion-duration) var(--motion-ease),
              background-color var(--motion-duration) var(--motion-ease);
}

/* Divider above every item but the first. An inset shadow rather than a
   border-top, so it cannot add to the item's height and shift the rail. */
.vizz-sidenav-alt .vizz-sidenav__item + .vizz-sidenav__item {
  box-shadow: inset 0 1px 0 var(--hairline);
}

/* The rail segment. `left: -2px` lands it exactly on the nav's own border —
   the item's containing block starts inside that border — so it reads as the
   rail lighting up rather than as a second line beside it. Scaled from the
   centre so it grows out to meet the item's full height. */
.vizz-sidenav-alt .vizz-sidenav__item::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-accent);
  transform: scaleY(0);
  transition: transform var(--motion-duration) var(--motion-ease);
}

.vizz-sidenav-alt .vizz-sidenav__item:hover {
  color: var(--color-text);
  background: rgba(var(--ink-rgb), 0.04);
  text-decoration: none;
}
.vizz-sidenav-alt .vizz-sidenav__item:hover::before { transform: scaleY(1); }

/* The page you are on: full accent rail, accent ink, and the only weight jump
   in the list. No fill, unlike .vizz-sidenav. */
.vizz-sidenav-alt .vizz-sidenav__item[aria-current="page"] {
  background: transparent;
  color: var(--color-accent-800);
  font-weight: 600;
}
.vizz-sidenav-alt .vizz-sidenav__item[aria-current="page"]::before {
  transform: scaleY(1);
  background: var(--color-accent-600);
}

/* Same meaning as in .vizz-sidenav: the branch you are inside when you are on
   a page below this level. Tinted, no rail. */
.vizz-sidenav-alt .vizz-sidenav__item--ancestor { color: var(--color-accent-700); }

/* ── sidebar: partner logos ───────────────────────────────────────── */

/* Carried over from the template this replaces, markup and all: six links at
   the images' natural 156×89, floated left with a 4px gutter, cleared by the
   trailing <div class="clearer">. This is main.css's `#right_column_content
   img` rule, unchanged.

   An earlier pass here rebuilt the block as a padded auto-fill grid with
   `mix-blend-mode: multiply`, which scaled every logo down to ~124px and
   spread them out — the logos are flat artwork with their own backgrounds, so
   they want to sit flush at their own size, not be treated as a tile set. */
#right_column_content { padding-top: 4px; }
#right_column_content img {
  float: left;
  margin: 0 4px 4px 0;
  /* .djangocms-plugin-styles rounds images; this block sits outside it, but be
     explicit — the logos are squared off. */
  border-radius: 0;
  transition: filter var(--motion-duration) var(--motion-ease);
}

/* Hover lifts each box slightly. brightness() rather than opacity: these are
   flat artwork with their own solid backgrounds, and fading them toward the
   white page would wash out the label text inside. brightness() lightens the
   ground and the ink together, so the logo keeps its contrast.

   The float is on the <img>, so the wrapping <a> has no box of its own to
   hang this on — but hovering the image still matches `a:hover`, since the
   image is the anchor's own content. Keyboard users get it too. */
#right_column_content a:hover img,
#right_column_content a:focus-visible img { filter: brightness(1.04); }

#right_column_content .clearer { clear: both; }

/* ══════════════════════════════════════════════════════════════════════
   .djangocms-plugin-styles — typography for editor-authored plugin HTML
   ══════════════════════════════════════════════════════════════════════

   Everything below is scoped to the class and nothing above it is, so this
   block can be lifted into any other redesign template as-is. Selectors stay
   at one class + one element so a plugin's own class (`.btn`, `.vizz-pill`)
   still wins where it should. */

.djangocms-plugin-styles {
  /* The vertical rhythm, from main.css, which set `p, h1…h6 { margin: 0 0 25px }`
     with 30px under h1/h2 and `margin-bottom: 0` on a main-content h4. Flat px
     rather than em on purpose: an em resolves against the element's OWN size,
     so `1.45em` under a 32px h2 is 46px, not the 25px it is under a paragraph,
     and the rhythm comes apart exactly where the headings are. */
  --flow: 25px;
  --flow-lg: 30px;

  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text);
  /* An editor's content can carry a wide table or a long unbroken URL; this
     keeps either from pushing the grid column wider than its track. */
  overflow-wrap: break-word;
}

/* The wrapper owns the outer spacing, so the first and last plugin do not add
   a stray margin on top of the template's padding. */
.djangocms-plugin-styles > :first-child { margin-top: 0; }
.djangocms-plugin-styles > :last-child { margin-bottom: 0; }

/* ── headings ─────────────────────────────────────────────────────── */

.djangocms-plugin-styles h1,
.djangocms-plugin-styles h2,
.djangocms-plugin-styles h3,
.djangocms-plugin-styles h4,
.djangocms-plugin-styles h5,
.djangocms-plugin-styles h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-heading-weight);
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-wrap: balance;
  /* A heading takes a run-in above AND the shared flow below. An earlier pass
     here gave them `0.5em` below, so every heading hugged the paragraph under
     it while floating well clear of the one above — which is what made the
     text plugins read wrong. Per-level values follow. */
  margin: 38px 0 var(--flow);
}

/* The page title. Sized between the section h2 (clamp(26px,2.2vw,34px), doc 01)
   and the hero h1 — this is the largest type on a content page but it is not
   the landing page. */
.djangocms-plugin-styles h1 {
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.022em;
  /* The page title: nothing above it, 30px under, as main.css had. */
  margin-top: 0;
  margin-bottom: var(--flow-lg);
}
/* Doc 01, "Section h2". */
.djangocms-plugin-styles h2 {
  font-size: clamp(25px, 2.2vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.022em;
  margin-top: 46px;
  margin-bottom: var(--flow-lg);
}
.djangocms-plugin-styles h3 {
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.25;
}
/* main.css: `.main-content h4 { margin-bottom: 0 }`. The existing pages lean on
   this — "Časopisi:", "Godišnjaci:", "Dnevne novine:" on /hr/zavicajna-zbirka/
   are h4 labels that belong directly on top of the line they introduce. */
.djangocms-plugin-styles h4 {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 0;
}
/* Only h4 is the run-in: main.css zeroed `.main-content h4` alone and left
   h5/h6 on the group's 25px. Giving h5 a zero bottom too collided it with
   whatever followed — an h5 above a <dt> read as one doubled-up bold line.
   Neither h5 nor h6 appears in any current text plugin; this is defensive. */
.djangocms-plugin-styles h5 {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: var(--flow);
}
/* The smallest heading reads as the design's kicker/eyebrow (doc 01: 10px/600,
   letter-spacing .08–.11em, uppercase, accent-700). */
.djangocms-plugin-styles h6 {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent-700);
  margin-top: 30px;
  margin-bottom: 10px;
}

/* An h2/h3 straight after an h1 is a subtitle, not a new section, so it does
   not take the full 1.9em run-in. */
.djangocms-plugin-styles h1 + h2,
.djangocms-plugin-styles h1 + h3,
.djangocms-plugin-styles h2 + h3,
.djangocms-plugin-styles h3 + h4 { margin-top: 0; }

/* ── body copy ────────────────────────────────────────────────────── */

.djangocms-plugin-styles p { margin: 0 0 var(--flow); text-wrap: pretty; }

/* CKEditor writes an empty paragraph, or one holding only a <br>, wherever the
   editor pressed Enter twice. Rendered it becomes a ~28px gap that no one
   asked for, on top of the margin that is already there. */
.djangocms-plugin-styles p:empty { display: none; }

.djangocms-plugin-styles strong,
.djangocms-plugin-styles b {
  font-weight: 700;
  color: var(--color-text);
}
.djangocms-plugin-styles em,
.djangocms-plugin-styles i { font-style: italic; }
.djangocms-plugin-styles u { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.djangocms-plugin-styles s,
.djangocms-plugin-styles del { color: rgba(var(--ink-rgb), 0.55); }
.djangocms-plugin-styles mark {
  background: var(--color-accent-200);
  color: var(--color-accent-800);
  padding: 0 3px;
  border-radius: 3px;
}
.djangocms-plugin-styles small { font-size: 0.82em; color: rgba(var(--ink-rgb), 0.62); }
.djangocms-plugin-styles abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
}
/* Default sub/sup shift the line box and open the leading on the line they sit
   on; a relative offset at 0 line-height does not. */
.djangocms-plugin-styles sub,
.djangocms-plugin-styles sup {
  font-size: 0.72em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}
.djangocms-plugin-styles sup { top: -0.5em; }
.djangocms-plugin-styles sub { bottom: -0.25em; }

/* ── links ────────────────────────────────────────────────────────── */

/* vizz-tokens.css colours every <a> `--color-accent` (#a8c520) — a light
   yellow-green that is a FILL, never text: it measures 1.9:1 on white. Body
   links are the accent TEXT colour, `--color-accent-700` (#5f7a09, 5.5:1), per
   01-design-tokens.md. Underlined, because in running prose colour alone is
   not a sufficient cue (WCAG 1.4.1). */
.djangocms-plugin-styles a {
  color: var(--color-accent-700);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(95, 122, 9, 0.4);
  text-underline-offset: 3px;
  transition: color var(--motion-duration) var(--motion-ease),
              text-decoration-color var(--motion-duration) var(--motion-ease);
}
.djangocms-plugin-styles a:hover {
  color: var(--color-accent-800);
  text-decoration-color: currentColor;
}
.djangocms-plugin-styles a:visited { color: var(--color-accent-800); }

/* Plugins that render their own component — a djangocms_frontend Link set to a
   button context emits `.btn`, and `.btn`/`.btn-primary`/`.btn-secondary` are
   already ViZZ components in vizz-tokens.css. Opt those out of the prose link
   treatment so the component styling comes through intact. */
.djangocms-plugin-styles a.btn,
.djangocms-plugin-styles a.vizz-pill,
.djangocms-plugin-styles a.vizz-chip {
  color: var(--color-text);
  text-decoration: none;
}
.djangocms-plugin-styles a.btn-primary,
.djangocms-plugin-styles a.btn-primary:visited { color: var(--color-accent-ink); }
.djangocms-plugin-styles a.btn:hover,
.djangocms-plugin-styles a.vizz-pill:hover,
.djangocms-plugin-styles a.vizz-chip:hover { text-decoration: none; }
/* An image wrapped in a link must not pick up an underline either. */
.djangocms-plugin-styles a:has(> img) { text-decoration: none; }

/* ── lists ────────────────────────────────────────────────────────── */

.djangocms-plugin-styles ul,
.djangocms-plugin-styles ol {
  margin: 0 0 var(--flow);
  padding-left: 1.4em;
}
.djangocms-plugin-styles li { margin-bottom: 0.4em; text-wrap: pretty; }
.djangocms-plugin-styles li:last-child { margin-bottom: 0; }
/* A nested list belongs to the item above it, so it loses the block margin and
   keeps only the indent. */
.djangocms-plugin-styles li > ul,
.djangocms-plugin-styles li > ol { margin: 0.4em 0 0; }

/* ::marker takes colour and font but not size on every engine, so the bullet is
   tinted rather than resized. */
.djangocms-plugin-styles ul > li::marker { color: var(--color-accent-600); }
.djangocms-plugin-styles ol > li::marker {
  color: var(--color-accent-700);
  font-family: var(--font-heading);
  font-weight: 600;
}
.djangocms-plugin-styles ul ul { list-style-type: circle; }
.djangocms-plugin-styles ul ul ul { list-style-type: square; }

.djangocms-plugin-styles dl { margin: 0 0 var(--flow); }
.djangocms-plugin-styles dt { font-weight: 700; }
.djangocms-plugin-styles dd { margin: 0 0 0.7em; padding-left: 1.4em; }

/* ── quotes, rules, code ──────────────────────────────────────────── */

.djangocms-plugin-styles blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--color-accent);
  font-size: 1.06em;
  line-height: 1.6;
  color: rgba(var(--ink-rgb), 0.82);
}
.djangocms-plugin-styles blockquote > :last-child { margin-bottom: 0; }
.djangocms-plugin-styles blockquote cite,
.djangocms-plugin-styles figcaption cite {
  display: block;
  margin-top: 0.6em;
  font-size: 13px;
  font-style: normal;
  color: rgba(var(--ink-rgb), 0.55);
}

.djangocms-plugin-styles hr {
  height: 0;
  margin: 2.2em 0;
  border: 0;
  border-top: 1px solid var(--color-divider);
}

.djangocms-plugin-styles code,
.djangocms-plugin-styles kbd,
.djangocms-plugin-styles samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--color-neutral-200);
  border-radius: var(--radius-sm);
  padding: 0.12em 0.4em;
}
.djangocms-plugin-styles pre {
  margin: 0 0 var(--flow);
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--color-neutral-200);
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.55;
}
.djangocms-plugin-styles pre code { background: none; padding: 0; font-size: inherit; }

/* ── media ────────────────────────────────────────────────────────── */

/* The width/height attributes djangocms_picture writes are the intrinsic size;
   without the auto height the image distorts once max-width clamps it. */
.djangocms-plugin-styles img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.djangocms-plugin-styles figure { margin: 1.6em 0; }
.djangocms-plugin-styles figure img { display: block; }
.djangocms-plugin-styles figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(var(--ink-rgb), 0.55);
  text-wrap: pretty;
}

/* Editors float images with an inline `style="float: left;"` (the only float in
   the existing content) and clear them with the legacy `<div class="clearer">`
   that the template this replaces relied on. Both keep working. */
.djangocms-plugin-styles img[style*="float: left"],
.djangocms-plugin-styles img[style*="float:left"] { margin: 4px 24px 14px 0; }
.djangocms-plugin-styles img[style*="float: right"],
.djangocms-plugin-styles img[style*="float:right"] { margin: 4px 0 14px 24px; }
.djangocms-plugin-styles .clearer { clear: both; }

.djangocms-plugin-styles iframe,
.djangocms-plugin-styles video {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius-md);
}

/* ── tables ───────────────────────────────────────────────────────── */

/* The wrapper is what scrolls when a table is wider than its column; a bare
   overflow on the table itself does nothing. CKEditor does not emit one, so
   the fallback is the table's own horizontal scroll. */
.djangocms-plugin-styles .table-responsive { overflow-x: auto; margin-bottom: 1.4em; }

.djangocms-plugin-styles table {
  width: 100%;
  margin: 0 0 1.4em;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.djangocms-plugin-styles th,
.djangocms-plugin-styles td {
  text-align: left;
  vertical-align: top;
  padding: 11px 16px 11px 0;
  border-bottom: 1px solid var(--color-divider);
}
.djangocms-plugin-styles th {
  font-family: var(--font-body);
  font-weight: 600;
  color: rgba(var(--ink-rgb), 0.62);
}
.djangocms-plugin-styles thead th { border-bottom-color: rgba(var(--ink-rgb), 0.28); }
.djangocms-plugin-styles caption {
  caption-side: bottom;
  padding-top: 10px;
  font-size: 13px;
  color: rgba(var(--ink-rgb), 0.55);
  text-align: left;
}

/* ── forms inside plugins (the contact form plugin) ───────────────── */

.djangocms-plugin-styles label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}
.djangocms-plugin-styles input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]),
.djangocms-plugin-styles select,
.djangocms-plugin-styles textarea {
  width: 100%;
  max-width: 520px;
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--color-text);
}
.djangocms-plugin-styles textarea { min-height: 150px; resize: vertical; }
.djangocms-plugin-styles input[type="submit"],
.djangocms-plugin-styles button[type="submit"] {
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background var(--motion-duration) var(--motion-ease);
}
.djangocms-plugin-styles input[type="submit"]:hover,
.djangocms-plugin-styles button[type="submit"]:hover { background: var(--color-accent-600); }

/* ── markup the project's own plugin templates emit ───────────────── */

/* These classes come from templates in this repo and from djangocms_frontend,
   not from anything an editor typed, and they used to be styled by
   static/css/main.css — which the redesign does not load. Without the rules
   below the plugins still render, but unstyled: the picture plugin stops
   floating, the file plugin's icon and label sit on separate lines and the
   contact form's submit button loses its fill. Sources, in order:
     .content_image / .maximize  — templates/cms/plugins/picture.html
     .plugin_file / .filetitle / .filesize — templates/djangocms_file/default/
     .contact-form / .form-group / .alert / .btn-green — templates/cms_plugins/
     .spacer                     — typed into text plugin bodies (106 of them)
     .float-start / .img-fluid / .link-primary — djangocms_frontend, Bootstrap 5 */

/* The old PicturePlugin wrapper: a floated 280×270 thumbnail that opens the
   full image. main.css used `padding-right: 30px`; margin is the same effect
   here and collapses correctly against the paragraph below. */
.djangocms-plugin-styles .content_image {
  float: left;
  max-width: 100%;
  margin: 4px 30px 18px 0;
}
.djangocms-plugin-styles .content_image a,
.djangocms-plugin-styles a.maximize { display: block; text-decoration: none; }
.djangocms-plugin-styles .content_image img { display: block; }

/* Bootstrap 5 float utilities, emitted by djangocms_frontend's image plugin.
   `img-fluid` needs nothing — max-width/height are already the img default
   above — but the floats need the text gutter the utility does not carry. */
.djangocms-plugin-styles .float-start { float: left; margin: 4px 26px 16px 0; }
.djangocms-plugin-styles .float-end { float: right; margin: 4px 0 16px 26px; }
.djangocms-plugin-styles .float-none { float: none; }
.djangocms-plugin-styles .d-block { display: block; }
.djangocms-plugin-styles .mx-auto { margin-inline: auto; }
.djangocms-plugin-styles .w-100 { width: 100%; }
.djangocms-plugin-styles .text-center { text-align: center; }
.djangocms-plugin-styles .text-start { text-align: left; }
.djangocms-plugin-styles .text-end { text-align: right; }
/* Bootstrap's own link colour would be #0d6efd here; keep it in the palette. */
.djangocms-plugin-styles .link-primary { color: var(--color-accent-700); }

/* An editor's section break. main.css drew it as a dotted #C5B79D rule; the
   redesign has one divider colour and one hairline weight. */
.djangocms-plugin-styles .spacer {
  clear: both;
  height: 0;
  margin: 28px 0;
  border-bottom: 1px solid var(--color-divider);
}

/* File and folder plugins: an extension icon beside the file name. Laid out as
   a flex row so a long name wraps against the text, not under the icon. */
.djangocms-plugin-styles .plugin_file { margin-bottom: 0.5em; }
.djangocms-plugin-styles .plugin_file a {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}
.djangocms-plugin-styles .plugin_file a:hover .filetitle { text-decoration: underline; }
/* The icons are 16px .gif sprites; the img rule above would round their corners. */
.djangocms-plugin-styles .plugin_file img {
  flex: none;
  width: 16px;
  height: auto;
  border-radius: 0;
  transform: translateY(2px);
}
.djangocms-plugin-styles .filetitle {
  color: var(--color-accent-700);
  text-underline-offset: 3px;
}
.djangocms-plugin-styles .filesize {
  color: rgba(var(--ink-rgb), 0.5);
  font-size: 0.85em;
}

/* Contact form plugin. The field controls themselves are already covered by the
   input/select/textarea rules above. */
.djangocms-plugin-styles .form-group { margin-bottom: 4px; }
.djangocms-plugin-styles .alert {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 15px;
}
.djangocms-plugin-styles .alert-success {
  background: var(--color-accent-200);
  color: var(--color-accent-800);
}
.djangocms-plugin-styles .alert-danger { background: #f6e2dd; color: #8a3b28; }

/* The old green outline button (main.css: white fill, #92AF1A border and
   label). `.btn` is already a ViZZ component in vizz-tokens.css, so this only
   supplies the colour pair — and it supplies the same one as the submit-button
   rule above, deliberately: the contact form's button carries BOTH classes
   (`btn btn-green`), and the two rules disagreeing meant whichever won by
   specificity decided how the only button on the page looked. They now agree
   on the design's primary button, filled accent. */
.djangocms-plugin-styles .btn-green {
  border-color: transparent;
  background: var(--color-accent);
  color: var(--color-accent-ink);
}
.djangocms-plugin-styles .btn-green:hover {
  background: var(--color-accent-600);
  color: var(--color-accent-ink);
}

/* ── compact variant ──────────────────────────────────────────────── */

/* For narrow columns — the sidebar placeholder. Same rules, one step down.
   Everything above sizes headings in em or clamp(), so only the root and the
   two fixed-size headings need restating. */
.djangocms-plugin-styles--compact {
  font-size: 15px;
  line-height: 1.6;
  --flow: 18px;
  --flow-lg: 22px;
}
.djangocms-plugin-styles--compact h1 { font-size: 24px; }
.djangocms-plugin-styles--compact h2 { font-size: 20px; }
.djangocms-plugin-styles--compact h3 { font-size: 18px; }
.djangocms-plugin-styles--compact h4,
.djangocms-plugin-styles--compact h5 { font-size: 16px; }
.djangocms-plugin-styles--compact table { font-size: 14px; }

/* ── narrow (<900px) ──────────────────────────────────────────────── */

@media (max-width: 899px) {
  .vizz-content { padding-inline: 24px; }
  .vizz-content__grid { grid-template-columns: minmax(0, 1fr); }
  /* Below the content it has nothing to stick to. */
  .vizz-content__side { position: static; }
}

/* ── mobile (<620px) ──────────────────────────────────────────────── */

@media (max-width: 619px) {
  .vizz-content { padding-inline: 16px; }
  .djangocms-plugin-styles { font-size: 16px; }
  /* A float in a 320px column leaves a two-word text gutter beside the image,
     whether the float came from an inline style, a Bootstrap utility or the
     old picture-plugin wrapper. */
  .djangocms-plugin-styles img[style*="float"],
  .djangocms-plugin-styles .float-start,
  .djangocms-plugin-styles .float-end,
  .djangocms-plugin-styles .content_image {
    float: none;
    /* Without the block the image goes back to being inline and the first line
       of the paragraph hangs off its bottom-right corner. */
    display: block;
    margin: 1.2em 0;
  }
  .djangocms-plugin-styles table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .vizz-sidenav__item,
  .vizz-sidenav-alt .vizz-sidenav__item,
  .vizz-sidenav-alt .vizz-sidenav__item::before,
  #right_column_content img,
  .djangocms-plugin-styles a,
  .djangocms-plugin-styles input[type="submit"],
  .djangocms-plugin-styles button[type="submit"] { transition: none; }
}
