/* Mindience: rules that the design mock (styles.css, kept byte for byte) did not need.
   styles.css is never edited; anything new goes here. */

/* Page changes cross-fade where the browser supports it (Chrome, Edge, Safari); elsewhere they are plain page loads. */
@view-transition { navigation: auto; }

/* Rich text from the panel can hold a preformatted block; it scrolls inside the column instead of widening the page. */
.prose pre { max-width: 100%; overflow-x: auto; }

/* ---------- contact form: the parts the mock's form did not have (partials/contact-form.html.twig) ---------- */

/* The consent box, in the fields' language: their border, ground and focus ring at checkbox size; plum when ticked.
   `.field .consent` outranks styles.css's `.field input` rules (size, padding, and the `background` shorthands on hover and
   focus that would wipe the tick); :checked comes last so the tick stays while hovered or focused. */
.consent { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start; }
.field .consent input {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; min-height: 0; margin: 0; padding: 0;
  background: rgba(255, 255, 255, .7) center / 14px 14px no-repeat; border: 1px solid var(--field); border-radius: 6px;
  cursor: pointer; transition: border-color .2s, background-color .2s;
}
.field .consent input:hover { background-color: var(--white); }
.field .consent input:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; border-color: var(--plum); background-color: var(--white); border-radius: 6px; }
.field .consent input[aria-invalid="true"] { border-color: var(--error); }
.field .consent input:checked {
  background-color: var(--plum); border-color: var(--plum);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.4l3 3 6-6.8' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.field .consent label { font-weight: 400; line-height: 1.55; cursor: pointer; }

/* "Could not be sent", above the form: the colour and type of .error, in a box like the fields'.
   The script focuses it after a failed send, as it does the thank-you (styles.css: .form-done:focus). */
.form-alert {
  max-width: 36rem; margin-bottom: 24px; padding: 14px 18px;
  font-family: var(--sans); font-size: .875rem; line-height: 1.55; color: var(--error);
  background: rgba(255, 255, 255, .7); border: 1px solid var(--error); border-radius: 12px;
}
.form-alert a { color: inherit; }
.form-alert:focus { outline: none; }

/* Send waits while the message is on its way. */
.form-actions .btn:disabled { opacity: .72; cursor: progress; }

/* The honeypot: the Form plugin's inline style hides it (plugins/form.yaml, inline_css); this keeps it hidden without that. */
.form-honeybear { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); visibility: hidden; }

/* ---------- blog: the list and the page numbers (templates/blog.html.twig); a post page is a plain .prose page ---------- */

/* The list keeps the practical page's rhythm: a hairline above and between the entries, titles at the size of a term's heading,
   the text no wider than a column of prose. The date is the .eyebrow line; "Read more" is the .link-thread. */
.posts { max-width: 35rem; margin-top: clamp(20px, 3vw, 40px); border-top: 1px solid var(--hairline); }
.post { display: grid; gap: 8px; justify-items: start; padding-block: clamp(30px, 3.6vw, 48px) clamp(14px, 2vw, 22px); border-bottom: 1px solid var(--hairline); }
.post-title { font-weight: 400; font-size: clamp(1.5rem, 1.3rem + .8vw, 1.875rem); line-height: 1.2; letter-spacing: -.005em; }
.post-summary { margin-top: 4px; }

/* Page numbers, when there are more posts than fit on a page: plum numbers in round 44px targets, the current page on mist. */
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin-top: clamp(24px, 3vw, 36px); }
.pager a {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding-inline: 10px; border-radius: 999px;
  font-family: var(--sans); font-weight: 500; font-size: .9375rem; line-height: 1; color: var(--plum); text-decoration: none;
  transition: background-color .2s, color .2s;
}
.pager a:hover, .pager a[aria-current="page"] { background: var(--mist); color: var(--ink); }

/* ---------- every picture keeps the shape of its file ---------- */
/* A picture is offered in several sizes (srcset), and a smaller copy's height is rounded to whole pixels, so its own
   proportions are off from the file's by a hair: enough to move what follows by a pixel, depending on which copy a
   browser took. Every <img> carries the size of its file as --iw and --ih (templates/partials/picture.html.twig), and
   this keeps its box in exactly that shape. :where() gives the rule no weight: where styles.css sets a shape of its
   own (the 4:3 illustration on a phone, the arched portraits, the band) that still decides. */
:where(img[style*="--iw"]) { aspect-ratio: var(--iw) / var(--ih); }

/* ---------- page illustrations: their edges fade into the page ---------- */
/* Home, Practical Details and Contact pictures are files of their pages (the owner can change them), so the fade is here,
   not in the file (tools/illustrations.mjs writes the defaults without one). The curve is the one
   mock/tools/prepare-assets.mjs baked in: smoothstep over a share of the picture's width (left, right) and height (top,
   bottom), starting 3 px (left, top) and 4 px (right, bottom) in from the edge; the two directions multiply
   (mask-composite: intersect). --iw and --ih are the size of the picture's file (see above). */
.hero-ill, .practical-art, .contact-strip {
  --fade-l: 4%; --fade-r: 4%; --fade-t: 4%; --fade-b: 4%;
  --in-l: calc(300% / var(--iw, 1000)); --in-r: calc(400% / var(--iw, 1000));
  --in-t: calc(300% / var(--ih, 1000)); --in-b: calc(400% / var(--ih, 1000));
  mask-image:
    linear-gradient(to right,
      transparent var(--in-l),
      rgb(0 0 0 / .028) calc(var(--in-l) + var(--fade-l) * .1),
      rgb(0 0 0 / .104) calc(var(--in-l) + var(--fade-l) * .2),
      rgb(0 0 0 / .216) calc(var(--in-l) + var(--fade-l) * .3),
      rgb(0 0 0 / .352) calc(var(--in-l) + var(--fade-l) * .4),
      rgb(0 0 0 / .5) calc(var(--in-l) + var(--fade-l) * .5),
      rgb(0 0 0 / .648) calc(var(--in-l) + var(--fade-l) * .6),
      rgb(0 0 0 / .784) calc(var(--in-l) + var(--fade-l) * .7),
      rgb(0 0 0 / .896) calc(var(--in-l) + var(--fade-l) * .8),
      rgb(0 0 0 / .972) calc(var(--in-l) + var(--fade-l) * .9),
      #000 calc(var(--in-l) + var(--fade-l)),
      #000 calc(100% - var(--in-r) - var(--fade-r)),
      rgb(0 0 0 / .972) calc(100% - var(--in-r) - var(--fade-r) * .9),
      rgb(0 0 0 / .896) calc(100% - var(--in-r) - var(--fade-r) * .8),
      rgb(0 0 0 / .784) calc(100% - var(--in-r) - var(--fade-r) * .7),
      rgb(0 0 0 / .648) calc(100% - var(--in-r) - var(--fade-r) * .6),
      rgb(0 0 0 / .5) calc(100% - var(--in-r) - var(--fade-r) * .5),
      rgb(0 0 0 / .352) calc(100% - var(--in-r) - var(--fade-r) * .4),
      rgb(0 0 0 / .216) calc(100% - var(--in-r) - var(--fade-r) * .3),
      rgb(0 0 0 / .104) calc(100% - var(--in-r) - var(--fade-r) * .2),
      rgb(0 0 0 / .028) calc(100% - var(--in-r) - var(--fade-r) * .1),
      transparent calc(100% - var(--in-r))),
    linear-gradient(to bottom,
      transparent var(--in-t),
      rgb(0 0 0 / .028) calc(var(--in-t) + var(--fade-t) * .1),
      rgb(0 0 0 / .104) calc(var(--in-t) + var(--fade-t) * .2),
      rgb(0 0 0 / .216) calc(var(--in-t) + var(--fade-t) * .3),
      rgb(0 0 0 / .352) calc(var(--in-t) + var(--fade-t) * .4),
      rgb(0 0 0 / .5) calc(var(--in-t) + var(--fade-t) * .5),
      rgb(0 0 0 / .648) calc(var(--in-t) + var(--fade-t) * .6),
      rgb(0 0 0 / .784) calc(var(--in-t) + var(--fade-t) * .7),
      rgb(0 0 0 / .896) calc(var(--in-t) + var(--fade-t) * .8),
      rgb(0 0 0 / .972) calc(var(--in-t) + var(--fade-t) * .9),
      #000 calc(var(--in-t) + var(--fade-t)),
      #000 calc(100% - var(--in-b) - var(--fade-b)),
      rgb(0 0 0 / .972) calc(100% - var(--in-b) - var(--fade-b) * .9),
      rgb(0 0 0 / .896) calc(100% - var(--in-b) - var(--fade-b) * .8),
      rgb(0 0 0 / .784) calc(100% - var(--in-b) - var(--fade-b) * .7),
      rgb(0 0 0 / .648) calc(100% - var(--in-b) - var(--fade-b) * .6),
      rgb(0 0 0 / .5) calc(100% - var(--in-b) - var(--fade-b) * .5),
      rgb(0 0 0 / .352) calc(100% - var(--in-b) - var(--fade-b) * .4),
      rgb(0 0 0 / .216) calc(100% - var(--in-b) - var(--fade-b) * .3),
      rgb(0 0 0 / .104) calc(100% - var(--in-b) - var(--fade-b) * .2),
      rgb(0 0 0 / .028) calc(100% - var(--in-b) - var(--fade-b) * .1),
      transparent calc(100% - var(--in-b)));
  mask-composite: intersect;
  mask-repeat: no-repeat;
}
.hero-ill { --fade-l: 14%; --fade-r: 6%; --fade-t: 5%; --fade-b: 7%; }
.contact-strip { --fade-l: 8%; --fade-r: 8%; --fade-t: 8%; --fade-b: 8%; }

/* styles.css crops the home illustration to 4:3 on narrower screens (object-fit: cover; object-position: 52% 50%).
   The mask takes the size and place of the whole picture, so the fade follows the picture's own edges. */
@media (max-width: 960px) {
  .hero-ill {
    mask-size: max(100%, calc(100% * var(--iw) / var(--ih) * 3 / 4)) max(100%, calc(100% * var(--ih) / var(--iw) * 4 / 3));
    mask-position: 52% 50%;
  }
}

/* ---------- the brand as text (partials/header, menu, footer) ---------- */
/* When no logo file is chosen or the file is gone, the brand's name shows as text: in the serif, about as tall as the wordmark;
   the footer is the dark ground, so it takes the paper colour. */
.brand-text { font-family: var(--serif); font-size: 1.375rem; line-height: 1; color: var(--ink); }
.site-footer .brand-text { color: var(--paper); }
