/* The site's own layer on top of the vendored frontend stylesheets, which are never
   edited (burza_dev/static/frontend, scripts/vendor_frontend.py). Loaded after them. */

/* Without scripting the menu toggle cannot open the menu, so the header shows it. */
@media (max-width: 860px) and (scripting: none) {
  .site-header { position: relative; flex-wrap: wrap; background: var(--bg); }
  .menu-toggle { display: none; }
  .site-header:not([data-menu-open]) .site-menu,
  .site-menu { display: flex; position: static; flex: 1 0 100%; max-height: none; overflow: visible; padding: 0 0 var(--space-4); }
}


/* A per-visitor form slot keeps the form's room while it loads (no layout shift). */
.contact-form-slot { min-height: 62rem; }
/* The form's measured height per layout (site.css): one column up to 860px, two below
   1101px, the selects sharing a row above; the same in both languages. */
@media (min-width: 521px) { .contact-form-slot { min-height: 59.5rem; } }
@media (min-width: 861px) { .contact-form-slot { min-height: 60.5rem; } }
@media (min-width: 1101px) { .contact-form-slot { min-height: 54rem; } }
.contact-form-slot:not(:empty) { min-height: 0; }
.comment-form-slot { min-height: 50.5rem; }
/* A visitor's comment form, measured: name, email, comment and the security check. */
@media (min-width: 1101px) { .comment-form-slot { min-height: 49rem; } }
.comment-form-slot:not(:empty) { min-height: 0; }

/* Engagement options: four cards in one row on a wide screen, two by two below it. */
.options-grid:has(> :nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) { .options-grid:has(> :nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .options-grid:has(> :nth-child(4)) { grid-template-columns: minmax(0, 1fr); } }
.options-note { max-width: 72ch; margin: var(--space-5) 0 0; color: var(--muted); font-size: .9375rem; }
.contact-aside .options-note { margin-top: var(--space-5); font-size: .875rem; }

/* Staff only: the way into edit mode and the studio, under the header's right edge. */
.staff-bar {
  position: fixed; z-index: 19; top: calc(var(--header-bottom, 72px) + var(--space-2));
  /* Right-aligned with the page's frame, as the header's links are. */
  right: max(var(--gutter), env(safe-area-inset-right), calc((100vw - var(--frame)) / 2));
  display: flex; align-items: center; gap: 2px; padding: 4px;
  border: 1px solid #7fb0e033; border-radius: 999px; background: #08112af2; box-shadow: 0 10px 30px #02050c99;
  font: 500 .8125rem/1 var(--font-text, inherit);
}
.staff-bar a, .staff-bar button {
  display: inline-flex; align-items: center; gap: .45em; padding: .55em .9em; border: 0; border-radius: 999px;
  background: none; color: var(--muted); font: inherit; text-decoration: none; cursor: pointer;
}
.staff-bar a:hover, .staff-bar button:hover { color: var(--ink); background: #93c2f21f; }
.staff-bar .staff-bar-edit { color: #050a17; background: var(--accent); font-weight: 600; }
.staff-bar .staff-bar-edit:hover { color: #050a17; background: var(--accent-strong); }
.staff-bar svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.staff-bar form { margin: 0; }
/* The page's language versions as chips: this one, a written one (✓), one with parts to
   translate, and a missing one to add. */
.staff-chips { display: inline-flex; gap: .25rem; align-items: center; padding: 0 .25rem; border-left: 1px solid #93c2f233; border-right: 1px solid #93c2f233; }
.staff-bar .staff-chip { font: 600 .72rem/1 var(--font-mono, ui-monospace, monospace); letter-spacing: .04em; padding: .32rem .5rem; border-radius: 999px; border: 1px solid #93c2f240; white-space: nowrap; }
.staff-bar .staff-chip.is-current { color: #050a17; background: #cfe0ff; border-color: transparent; }
.staff-bar .staff-chip.is-ready { color: #9fe3b8; border-color: #9fe3b866; display: inline-flex; align-items: center; gap: .35rem; }
/* The check mark of a written version, drawn (no font glyph): a rotated corner. */
.staff-bar .staff-chip.is-ready::after { content: ""; width: .28rem; height: .55rem; margin-top: -.12rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.staff-bar .staff-chip.is-todo { color: #ffd38a; border-color: #ffd38a66; }
.staff-bar .staff-chip.is-add { color: var(--ink-soft, #b8c4dc); border-style: dashed; background: transparent; }
.staff-bar .staff-bar-new { font-weight: 600; }
.staff-bar .staff-bar-todo { color: #ffd38a; }
/* On a phone the bar spans the width and scrolls sideways; every link stays reachable. */
@media (max-width: 860px) {
  .staff-bar { left: max(var(--gutter), env(safe-area-inset-left)); overflow-x: auto; scrollbar-width: none; }
  .staff-bar a, .staff-bar button { white-space: nowrap; }
}

.error-view { padding-top: calc(var(--header-bottom, 72px) + var(--space-7)); text-align: center; }

/* Home */
.service-card { position: relative; }

/* Article list and article */
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--accent-strong); }
.load-more { margin-top: var(--space-6); text-align: center; }
/* The header is fixed, so the article starts below it (the design's #article-view does the same). */
.blog-article { padding-top: calc(var(--header-bottom, 72px) + var(--space-6)); }
.article-body { overflow-wrap: anywhere; }
.article-body > * + * { margin-top: 1.1em; }
.article-body :is(h2, h3, h4) { margin-top: 1.8em; }
.article-body :is(ul, ol) { padding-left: 1.4em; }
.article-body pre { overflow-x: auto; padding: var(--space-4); background: var(--surface-raised); border: 1px solid var(--line); }
.article-body code { font-family: var(--font-mono); font-size: .9em; }
/* A table outside a table element scrolls on its own; one inside scrolls in .table-scroll. */
.article-body :not(.table-scroll) > table { display: block; max-width: 100%; overflow-x: auto; }
.table-of-contents a.toc-sub { grid-template-columns: minmax(0, 1fr); padding-left: calc(var(--space-2) + 1.75rem + var(--space-2)); }

/* Comments */
.comments-section > h2 { margin-bottom: var(--space-5); font-size: var(--step-3); font-weight: 400; }
.comment { display: grid; gap: var(--space-2); margin-bottom: var(--space-5); padding: var(--space-4); background: var(--glass); border: 1px solid var(--glass-edge); }
.comment-reply { margin-left: var(--space-5); }
.comment-context, .comment-pending, .comment-none { color: var(--muted); font-size: .875rem; }
.comment-body { overflow-wrap: anywhere; }
.comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.reaction-form { display: inline-block; margin: 0; }
.status-pending { background: #5c4a14; }
.status-spam { background: #6a2a2a; }
.status-deleted { background: #2f3b4d; }

/* Forms: Django renders the widgets, the vendored .field rule styles them. */
.field label:not(.field-label) { color: var(--ink); font-size: .9375rem; font-weight: 600; }
.field-check { grid-template-columns: auto 1fr; align-items: center; }
.field-check input { width: auto; min-height: 0; }
.field .errorlist, .contact-form .errorlist { margin: 0; padding: 0; list-style: none; color: var(--danger); font-size: .875rem; font-weight: 600; }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.captcha-row .captcha-part:last-child { flex: 1 1 12rem; }
/* A challenge image is 140-170 x 29-37 px, by its letters: a fixed box keeps the form's
   layout while it loads; the image stays its own size, on the image's white. */
.captcha { box-sizing: content-box; width: 180px; height: 40px; object-fit: scale-down; background: #fff; border: 1px solid var(--glass-edge); }
.contact-form .notice { margin: 0; }

/* Nothing of a public page is wider than the viewport. A long word breaks (hyphenated where the browser
   has a dictionary for the page language) instead of widening the hero, and the home headline is sized
   so the longest Polish word of home.title fits at 360 px. The vendored 13.5vw cap below 420 px is not
   enough for it. */
.display, .hero-copy { min-width: 0; overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 520px) { .hero-home .display { font-size: min(var(--step-6), 9vw); } }

/* The compact header: the brand may shrink and the menu toggle never does, so the toggle stays on screen. */
@media (max-width: 860px) {
  .site-header, .brand { min-width: 0; }
  .menu-toggle { flex: none; }
}

/* Below 860 px the vendored stylesheet swaps the tabs of the services workspace for an accordion that the
   demo's services.js builds and this site does not load. The tabs of service-tabs.js stay, in a row. */
@media (max-width: 860px) {
  .service-tabs { position: static; display: flex; flex-flow: row wrap; }
  .service-tabs [role="tab"] { flex: 1 1 14rem; }
  .services-console { display: block; }
}

/* The owner's notice above every page (back office, Settings). */
.site-notice { position: fixed; z-index: 40; left: 50%; bottom: max(1rem, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; width: max-content; max-width: calc(100% - 2rem); padding: 0.55rem 1rem; border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in oklab, var(--surface-raised) 92%, transparent); backdrop-filter: blur(8px); color: var(--ink); font-size: 0.9rem; text-align: center; box-shadow: 0 8px 28px rgb(0 0 0 / 35%); }

/* A language without a version of the page: the switch leads to that language's list. */
.lang-option.lang-missing { opacity: .55; text-decoration: line-through; text-decoration-thickness: 1px; }

/* ===================================================================== the landing page */
/* The landing page leaves the scene room: its cyclone shows beside a narrower, shorter
   hero (one sentence of lead), and the shield behind the text is lighter and ends sooner. */
body[data-view="home"] .reading-shield::before { background: linear-gradient(90deg, #050a17c7 0%, #050a1773 30%, #050a1720 46%, transparent 58%); }
body[data-view="home"] .hero-home .hero-copy { max-width: 38rem; }
body[data-view="home"] .hero-home .display { font-size: clamp(2.75rem, 5.6vw, 5.25rem); line-height: .94; letter-spacing: -.005em; text-wrap: balance; }
body[data-view="home"] .hero-home .hero-lead { max-width: 30rem; margin-top: var(--space-4); font-size: clamp(1.05rem, 1.25vw, 1.2rem); line-height: 1.55; color: #c9d6ea; text-wrap: pretty; }
body[data-view="home"] .hero-home .action-group { margin-top: var(--space-5); }
body[data-view="home"] .hero-home .hero-proof { margin-top: var(--space-5); color: #8fa7c8; }
/* A phone: the first screen opens on the cyclone; the hero sits on its lower part, over a
   shield that darkens only behind the text. */
@media (max-width: 760px) {
  body[data-view="home"] .reading-shield::before { background: linear-gradient(180deg, transparent 0%, transparent 34%, #050a1799 58%, #050a17e0 82%); }
  body[data-view="home"] .hero-home { min-height: 100svh; align-content: end; padding-top: 44svh; padding-bottom: var(--space-6); }
  body[data-view="home"] .hero-home .display { font-size: min(9vw, 2.6rem); }
  body[data-view="home"] .hero-home .hero-lead { font-size: 1rem; }
  body[data-view="home"] .hero-home .action-group { gap: var(--space-2); }
  body[data-view="home"] .hero-home .hero-proof { font-size: .66rem; letter-spacing: .1em; }
}

/* Wide screens keep an article's contents open beside the text (reader-glue.js opens the
   <details>); shown from the first frame, the list does not push the progress below it
   down when the script runs. */
@media (min-width: 1100px) {
  .reader-outline::details-content { content-visibility: visible; }
}

/* A page section that loads as one fragment (content.lazy.section_load) reserves the
   height its kind of content measures at each width (--section-room), from the first
   paint: just under the smaller of the page's Polish and English (or each language's
   own where they differ), so its arrival moves nothing on the screen. Measured with the
   seeded pages; where the layout changes (site.css) the bands are 20 px apart. A text
   much longer than today's makes the content below move once, below the screen. */
.block-slot[class*="slot-section-"] { min-height: var(--section-room); }

/* The call-to-action band has a top margin (site.css) that, once the band fills its
   slot, collapses out through the slot: the empty slot carries it already, so the
   band's arrival opens no gap above it (it moved the footer 48 px at every width). */
.page-surface > .block-slot.slot-cta-band:empty { margin-top: var(--space-7); }

.block-slot.slot-section-service-explorer { --section-room: 116rem; }
.block-slot.slot-section-card-grid-options { --section-room: 133rem; }
.block-slot.slot-section-card-grid-grid { --section-room: 48rem; }

@media (min-width: 431px) {
  .block-slot.slot-section-service-explorer { --section-room: 91rem; }
  .block-slot.slot-section-card-grid-grid { --section-room: 44.5rem; }
}

@media (min-width: 521px) {
  .block-slot.slot-section-service-explorer { --section-room: 78rem; }
  .block-slot.slot-section-card-grid-options { --section-room: 128rem; }
}

@media (min-width: 600px) {
  .block-slot.slot-section-card-grid-grid { --section-room: 40.5rem; }
}

@media (min-width: 861px) {
  .block-slot.slot-section-service-explorer { --section-room: 93.8rem; }
  .block-slot.slot-section-card-grid-grid { --section-room: 42.1rem; }
  html[lang="en"] .block-slot.slot-section-card-grid-grid { --section-room: 40.5rem; }
}

@media (min-width: 901px) {
  .block-slot.slot-section-service-explorer { --section-room: 88.6rem; }
  .block-slot.slot-section-card-grid-options { --section-room: 77.2rem; }
  .block-slot.slot-section-card-grid-grid { --section-room: 32.5rem; }
  html[lang="en"] .block-slot.slot-section-card-grid-grid { --section-room: 29.4rem; }
}

@media (min-width: 921px) {
  .block-slot.slot-section-service-explorer { --section-room: 82rem; }
  .block-slot.slot-section-card-grid-grid { --section-room: 31rem; }
}

@media (min-width: 941px) {
  .block-slot.slot-section-card-grid-grid { --section-room: 29.5rem; }
  html[lang="en"] .block-slot.slot-section-card-grid-grid { --section-room: 29.5rem; }
}

@media (min-width: 961px) {
  .block-slot.slot-section-service-explorer { --section-room: 76.3rem; }
}

@media (min-width: 981px) {
  .block-slot.slot-section-service-explorer { --section-room: 74.8rem; }
}

@media (min-width: 1001px) {
  .block-slot.slot-section-service-explorer { --section-room: 73.2rem; }
}

@media (min-width: 1041px) {
  .block-slot.slot-section-service-explorer { --section-room: 68.5rem; }
  .block-slot.slot-section-card-grid-options { --section-room: 74.1rem; }
}

@media (min-width: 1081px) {
  .block-slot.slot-section-service-explorer { --section-room: 67rem; }
  .block-slot.slot-section-card-grid-grid { --section-room: 28.1rem; }
  html[lang="en"] .block-slot.slot-section-card-grid-grid { --section-room: 28.1rem; }
}

@media (min-width: 1141px) {
  .block-slot.slot-section-service-explorer { --section-room: 65.5rem; }
}

@media (min-width: 1181px) {
  .block-slot.slot-section-card-grid-options { --section-room: 76.2rem; }
}

@media (min-width: 1241px) {
  html[lang="en"] .block-slot.slot-section-card-grid-grid { --section-room: 26.8rem; }
}

@media (min-width: 1281px) {
  .block-slot.slot-section-service-explorer { --section-room: 62.5rem; }
  .block-slot.slot-section-card-grid-options { --section-room: 57.3rem; }
  html[lang="en"] .block-slot.slot-section-card-grid-options { --section-room: 52.9rem; }
  .block-slot.slot-section-card-grid-grid { --section-room: 26.7rem; }
  html[lang="en"] .block-slot.slot-section-card-grid-grid { --section-room: 25.2rem; }
}

@media (min-width: 1321px) {
  .block-slot.slot-section-card-grid-options { --section-room: 55.8rem; }
}

@media (min-width: 1341px) {
  .block-slot.slot-section-service-explorer { --section-room: 60rem; }
  .block-slot.slot-section-card-grid-options { --section-room: 52.8rem; }
}

@media (min-width: 1361px) {
  .block-slot.slot-section-card-grid-grid { --section-room: 25.2rem; }
}

@media (min-width: 1421px) {
  .block-slot.slot-section-card-grid-options { --section-room: 49.7rem; }
  html[lang="en"] .block-slot.slot-section-card-grid-options { --section-room: 51.3rem; }
}
