/* ==========================================================================
   SistemoCasa's own look, over OS's stylesheet, for the pages of the method.
   Its classes are the site's (`sc-`); OS's components are themed from
   site.php's theme, and nothing here repaints one of them.
   ========================================================================== */

/* ── The home's opening: the drawing, then a real house ───────────────────
   The house drawn from its plan (public/disegni/casa.svg) turns every 18s:
   drawn by about 7s, lived in to 11.5s, gone under the photograph from 12s,
   drawn again from 18s (bin/disegni/tavole.py, CASA_GIRO). On the same
   turn, one of Reniero's houses fades in over it from 11s to 12s, stays to
   16.5s and is gone by 17.5s, so the empty sheet shows a moment before the
   lines come back (the owner, 9 November 2026: "appare una foto reale al
   suo posto per qualche secondo prima di ricomporsi"). Both open 12.5s into
   the turn, the photograph held, so a reader meets the real house first and
   then the drawing composing (the owner, the same day: "inizi dalla foto
   vera, poi composizione"; tavole.py's CASA_PRIMA). A drawing that loads
   late starts late by as much, which the photograph's second of fading
   covers. */
.sc-svela {
  position: relative;
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.sc-svela img {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.sc-svela__foto {
  position: absolute;
  inset: 0;
  border-radius: var(--ds-radius-3);
  opacity: 0;
  animation: sc-svela 18s ease-in-out -12.5s infinite;
}

@keyframes sc-svela {
  0%, 61.1% { opacity: 0; }
  66.7%, 91.7% { opacity: 1; }
  97.2%, 100% { opacity: 0; }
}

/* A reader who asked for less motion has the drawing finished and still,
   as every drawing on the site does, and no photograph coming and going. */
@media (prefers-reduced-motion: reduce) {
  .sc-svela__foto {
    display: none;
  }
}

/* ── Pictures wider than the words ────────────────────────────────────────
   On a wide screen a set of photographs takes the window, up to 100rem and
   inside the page's gutter, while the words over and under it keep the
   column the site is boxed to (the owner, 9 November 2026: "la parte
   multimediale occupasse tutto lo schermo entro un massimo ragionevole,
   mentre i testi restassero nell'attuale colonna", for more movement down
   the page). The section is OS's band container, so 100cqi is the window
   without its scrollbar; never narrower than the column, so on a phone,
   where the column already runs gutter to gutter, nothing moves. */
.sc-largo {
  --sc-largo-max: 100rem;
  --sc-largo: max(100%, min(var(--sc-largo-max), 100cqi - 2 * var(--ds-site-gutter)));
  inline-size: var(--sc-largo);
  margin-inline: calc((100% - var(--sc-largo)) / 2);
}

/* A page that opens on a photograph: the hero itself is placed as wide as
   the galleries (`sc-largo` on it), its words keep the measure the page set,
   and its picture takes the whole of it through OS's hook for the stacked
   picture's width. Only photographs: an opening drawing keeps its size (the
   owner, 9 November 2026: "i drawings no"). */
.sc-apertura-foto {
  --ds-hero-shot: 100%;
}
