/* Components. Each block maps to a core block, a pattern or the named custom block in
   mockup/README.md. */

/* Buttons (core/buttons, block styles) ---------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0 var(--sp-6);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-16);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-ui) ease, color var(--dur-ui) ease;
}

.button--small {
  min-height: 2.75rem;
  padding: 0 var(--sp-4);
}

.button--primary {
  background: var(--c-red);
  color: var(--c-white);
}

.button--primary:hover {
  background: var(--c-red-deep);
  color: var(--c-white);
}

.button--secondary {
  border-color: var(--c-red);
  color: var(--c-red);
}

.button--secondary:hover {
  background: var(--c-veil);
  color: var(--c-red-deep);
}

.button--on-dark {
  background: var(--c-white);
  color: var(--c-red-deep);
}

.button--on-dark:hover {
  background: var(--c-on-deep);
}

.text-link {
  font-weight: 600;
}

/* Placeholder: missing content, never styled like real content ---------------------- */

.placeholder {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 1.5px dashed var(--c-field);
  border-radius: var(--radius-field);
  color: var(--c-muted);
  font-size: var(--fs-16);
  line-height: 1.45;
}

span.placeholder {
  display: inline-block;
  padding-block: var(--sp-1);
}

.placeholder--image {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-width: 24rem;
  margin-top: var(--sp-4);
  padding: var(--sp-6);
  text-align: center;
  background: var(--c-white);
}

.band--red .placeholder,
.site-footer .placeholder {
  border-color: var(--c-on-deep);
  color: var(--c-on-deep);
}

/* Header navigation (core/navigation) ----------------------------------------------- */

/* Logo lockup: the disc logo and the veterinary mark, as in the customer's
   "logo module.png". */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.brand img {
  width: 68px;
  height: 64px;
}

.brand .brand__mark img {
  width: auto;
  height: 64px;
}

/* Home page on the narrow layout: the hero disc already shows the logo, so the header
   keeps only the veterinary mark. The link keeps its aria-label name; Aderisci and Menu
   do not move because the brand link pushes them right with margin-right: auto. */
@media (width < 60em) {
  .is-home .brand__logo {
    display: none;
  }
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-4);
  margin: 0;
  padding: 0 0 var(--sp-2);
  list-style: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--c-ink);
  font-size: var(--fs-16);
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--c-red);
  text-decoration: underline;
}

.nav-ready .site-nav__list {
  flex-direction: column;
  padding-bottom: var(--sp-4);
}

.nav-ready .site-nav__list a {
  width: 100%;
  font-size: var(--fs-18);
  border-bottom: 1px solid var(--c-rule);
}

@media (min-width: 60em) {
  .site-nav__list,
  .nav-ready .site-nav__list {
    flex-direction: row;
    gap: var(--sp-6);
    padding: 0;
  }

  .nav-ready .site-nav__list a {
    width: auto;
    font-size: var(--fs-16);
    border-bottom: 0;
  }
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 2.75rem;
  padding: 0 var(--sp-3);
  border: 2px solid var(--c-field);
  border-radius: var(--radius-pill);
  background: var(--c-white);
  font-size: var(--fs-16);
  font-weight: 500;
  cursor: pointer;
}

.nav-toggle[hidden] {
  display: none;
}

@media (min-width: 60em) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  display: block;
  width: 1.125rem;
  height: 2px;
  background: currentColor;
  transition: transform var(--dur-ui) ease;
}

.nav-toggle__icon {
  position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle__icon::before {
  top: -6px;
}

.nav-toggle__icon::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__icon::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* Hero (patterns/hero.php) ----------------------------------------------------------- */

.hero__title {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
  max-width: 14ch;
}

.hero__lead {
  font-size: var(--fs-21);
  line-height: 1.5;
  max-width: 36ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.hero__note {
  color: var(--c-muted);
  font-size: var(--fs-14);
}

/* "La fetta": the logo's disc with its wedge cut out, drawn with an SVG mask in token
   colour. The complete disc and wordmark are the default; the load animation below is an
   enhancement on top of it. */
.fetta {
  position: relative;
  aspect-ratio: 1;
  isolation: isolate;
}

.fetta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--c-red);
  mask-image: url("../img/fetta-disc.svg");
  mask-position: center;
  mask-repeat: no-repeat;
  mask-size: contain;
}

/* The one animated moment of the page: the hero disc draws itself counterclockwise. A
   conic mask, intersected with the disc mask (so the wedge stays transparent in every
   frame), opens from the wedge's 14deg edge and sweeps 296deg counterclockwise to its
   78deg edge; the wordmark then fades in.

   --sweep must interpolate as an angle, or the disc would jump from empty to full. The
   inline script at the top of the home page's <head> registers --sweep with
   CSS.registerProperty (same definition as below) and adds html.fetta-sweep before first
   paint only where that succeeds, mask-composite works and motion is allowed. Everywhere
   else - no script, older browsers, reduced motion - nothing below applies and the
   complete disc shows at once. The resting value 360deg makes the conic layer fully
   opaque, so the end state is the static disc. */
@property --sweep {
  syntax: "<angle>";
  inherits: false;
  initial-value: 360deg;
}

@media (prefers-reduced-motion: no-preference) {
  .fetta-sweep .hero .fetta::before {
    mask-image: url("../img/fetta-disc.svg"),
      conic-gradient(from 14deg, transparent 0 calc(360deg - var(--sweep)), #000 0);
    mask-composite: intersect;
    animation: fetta-sweep var(--dur-sweep) var(--ease-out) var(--delay-sweep) backwards;
  }

  .fetta-sweep .hero .fetta__wordmark {
    animation: fetta-reveal var(--dur-reveal) ease-out
      calc(var(--delay-sweep) + var(--dur-sweep)) backwards;
  }
}

@keyframes fetta-sweep {
  from {
    --sweep: 0deg;
  }

  to {
    --sweep: 296deg;
  }
}

@keyframes fetta-reveal {
  from {
    opacity: 0;
  }
}

/* The wordmark sits above the disc. Letters are white on the red;
   a red outline under the fill (invisible on the disc) draws them where they cross into
   the white wedge cut, as the logo does. */
.fetta__wordmark {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fetta__word,
.fetta__buyers {
  font-family: "Sivet Wordmark", Georgia, serif;
  font-weight: 900;
  fill: var(--c-white);
}

.fetta__word {
  stroke: var(--c-red);
  stroke-width: 0.9;
  stroke-linejoin: round;
  paint-order: stroke;
}

.fetta__stripe-green {
  fill: var(--c-olive);
}

.fetta__stripe-white {
  fill: var(--c-white);
}

.fetta__stripe-red {
  fill: var(--c-red-bright);
}

/* Steps (come funziona) -------------------------------------------------------------- */

.step {
  counter-increment: step;
  display: grid;
  align-content: start;
  gap: var(--sp-3);
}

.step::before {
  content: counter(step) / "";
  color: var(--c-olive);
  font-family: var(--font-serif);
  font-size: var(--fs-72);
  font-weight: 800;
  line-height: 1;
}

.step__title {
  font-size: var(--fs-24);
  line-height: 1.25;
}

.facts__item {
  display: grid;
  align-content: start;
  gap: var(--sp-4);
}

.facts__title {
  font-size: var(--fs-24);
  line-height: 1.25;
}

/* Conditions sheet (vantaggi) -------------------------------------------------------- */

.sheet {
  border-bottom: 1px solid var(--c-rule);
}

.sheet__row {
  display: grid;
  gap: var(--sp-2);
  padding-block: var(--sp-6);
  border-top: 1px solid var(--c-rule);
}

.sheet__term {
  font-family: var(--font-serif);
  font-size: var(--fs-21);
  font-weight: 700;
  line-height: var(--lh-snug);
  color: var(--c-red);
}

.sheet__value {
  display: grid;
  gap: var(--sp-3);
}

.sheet__list {
  display: grid;
  gap: var(--sp-2);
  padding-left: 1.25em;
}

.sheet__list li::marker {
  color: var(--c-red);
}

.sheet__validity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  color: var(--c-olive);
  font-size: var(--fs-16);
  font-weight: 600;
}

@media (min-width: 37.5em) {
  .sheet__row {
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: var(--sp-6);
  }
}

/* Video card (patterns/video-in-evidenza.php) ---------------------------------------- */

.video-card__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-poster);
  background: var(--c-white);
}

.video-card__frame img {
  width: 100%;
}

.video-card__duration {
  position: absolute;
  right: var(--sp-4);
  bottom: var(--sp-4);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--c-ink);
  color: var(--c-white);
  font-size: var(--fs-14);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.video-card__caption {
  margin-top: var(--sp-4);
  color: var(--c-muted);
  font-size: var(--fs-16);
  max-width: 52ch;
}

.video-text {
  display: grid;
  gap: var(--sp-6);
  justify-items: start;
}

.video-text__subtitle {
  font-size: var(--fs-21);
  line-height: var(--lh-snug);
}

.chapters {
  display: grid;
  gap: var(--sp-2);
  margin-top: calc(-1 * var(--sp-3));
  padding: 0;
  list-style: none;
}

.chapters li {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
}

.chapters li::before {
  content: "";
  flex: none;
  width: 0.75em;
  height: 0.75em;
  background: var(--c-red);
  mask: url("../img/fetta-disc.svg") center / contain no-repeat;
}

/* FAQ (core/details) ------------------------------------------------------------------ */

.faq {
  border-bottom: 1px solid var(--c-rule);
}

.faq__item {
  border-top: 1px solid var(--c-rule);
}

.faq__question {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-4);
  padding-block: var(--sp-6);
  font-family: var(--font-serif);
  font-size: var(--fs-21);
  font-weight: 700;
  line-height: var(--lh-snug);
  list-style: none;
  cursor: pointer;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "";
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.2em;
  background: var(--c-red);
  mask: url("../img/fetta-disc.svg") center / contain no-repeat;
  transition: transform var(--dur-ui) var(--ease-out);
}

.faq__item[open] > .faq__question::after {
  transform: rotate(180deg);
}

.faq__question:hover {
  color: var(--c-red);
}

.faq__answer {
  display: grid;
  gap: var(--sp-4);
  padding-bottom: var(--sp-6);
}

/* Newsletter (custom block sivet/newsletter-signup) ---------------------------------- */

.newsletter__intro {
  display: grid;
  gap: var(--sp-6);
  align-content: start;
}

.newsletter__signup {
  display: grid;
  gap: var(--sp-3);
  align-content: start;
}

.newsletter__preview {
  color: var(--c-on-deep);
  font-size: var(--fs-16);
  font-weight: 600;
}

.field__label {
  font-weight: 600;
}

.newsletter__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.field__input {
  flex: 1 1 16rem;
  min-height: 3rem;
  padding: 0 var(--sp-4);
  border: 2px solid var(--c-field);
  border-radius: var(--radius-field);
  background: var(--c-white);
  color: var(--c-ink);
}

.newsletter__status {
  min-height: 1.6em;
  color: var(--c-white);
  font-weight: 600;
}

.newsletter__status:empty {
  display: none;
}

/* Contacts (patterns/contatti.php) --------------------------------------------------- */

.contacts__list {
  border-bottom: 1px solid var(--c-rule);
}

.contacts__row {
  display: grid;
  gap: var(--sp-1);
  padding-block: var(--sp-4);
  border-top: 1px solid var(--c-rule);
}

.contacts__row dt {
  color: var(--c-muted);
  font-size: var(--fs-16);
  font-weight: 600;
}

.contacts__note {
  color: var(--c-muted);
  font-size: var(--fs-16);
}

@media (min-width: 37.5em) {
  .contacts__row {
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: var(--sp-6);
    align-items: baseline;
  }
}

/* Footer (parts/footer.html) ---------------------------------------------------------- */

.site-footer a {
  color: var(--c-white);
}

.site-footer a:hover {
  color: var(--c-on-deep);
}

.site-footer__brand {
  display: grid;
  gap: var(--sp-4);
  justify-items: start;
}

.site-footer__tagline {
  font-family: var(--font-serif);
  font-size: var(--fs-21);
  font-weight: 700;
  line-height: var(--lh-snug);
  max-width: 22ch;
}

.site-footer__nav ul {
  display: grid;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 500;
}

.site-footer__legal {
  display: grid;
  gap: var(--sp-3);
  align-content: start;
}

.site-footer__copyright {
  color: var(--c-on-deep);
  font-size: var(--fs-14);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Current page in the navigation (aria-current="page", or "true" for the section a
   child page belongs to) ------------------------------------------------------------- */

.site-nav a[aria-current] {
  color: var(--c-red);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.35em;
}

.site-footer__nav a[aria-current] {
  font-weight: 600;
  text-decoration-thickness: 2px;
}

/* Section links to the full page ------------------------------------------------------ */

.section-more {
  margin-top: var(--sp-8);
}

.section-more--ruled {
  margin-top: var(--sp-12);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--c-rule);
}

.band--red .text-link {
  color: var(--c-white);
}

.band--red .text-link:hover {
  color: var(--c-on-deep);
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Page header (patterns/page-header.php) ---------------------------------------------- */

.page-header__title {
  font-size: var(--fs-section);
  line-height: var(--lh-heading);
  max-width: 18ch;
}

.page-header__intro {
  font-size: var(--fs-21);
  line-height: 1.5;
  max-width: 44ch;
}

/* The page-header motif: static, fully visible, never bleeding like the hero disc. */
.fetta.fetta--small {
  order: 0;
  justify-self: end;
  width: clamp(4.5rem, 12vw, 9rem);
  margin: 0;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--c-muted);
  font-size: var(--fs-16);
}

.crumbs li + li::before {
  content: "/";
  margin-right: var(--sp-2);
  color: var(--c-field);
}

.crumbs a {
  color: var(--c-muted);
}

/* In-page links ------------------------------------------------------------------------ */

.toc {
  display: grid;
  gap: var(--sp-2);
  padding-bottom: var(--sp-8);
}

.toc__title {
  color: var(--c-muted);
  font-size: var(--fs-16);
  font-weight: 600;
}

.toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-6);
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc__list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-weight: 500;
}

/* Prose sections and published questions ----------------------------------------------- */

.prose {
  display: grid;
  gap: var(--sp-4);
  align-content: start;
}

.section-lead {
  margin-top: var(--sp-4);
  font-size: var(--fs-21);
  line-height: 1.5;
  max-width: 52ch;
}

.qa {
  display: grid;
  gap: var(--sp-6);
  margin-top: var(--sp-4);
}

.qa__item {
  display: grid;
  gap: var(--sp-2);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--c-rule);
}

.qa__question {
  font-size: var(--fs-21);
  line-height: var(--lh-snug);
}

/* Call to action band ------------------------------------------------------------------ */

.cta__inner {
  display: grid;
  gap: var(--sp-4);
  justify-items: start;
}

.cta__text {
  font-size: var(--fs-21);
}

.cta__actions {
  display: grid;
  gap: var(--sp-3);
  justify-items: start;
  margin-top: var(--sp-2);
}

/* Video archive (templates/archive-video.html) ----------------------------------------- */

.video-grid {
  display: grid;
  gap: var(--sp-8);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 37.5em) {
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 60em) {
  .video-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.video-tile {
  position: relative;
  display: grid;
  gap: var(--sp-4);
  align-content: start;
}

.video-tile__frame {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-poster);
  background: var(--c-white);
}

.video-tile__title {
  font-size: var(--fs-21);
  line-height: var(--lh-snug);
}

.video-tile__link {
  color: var(--c-ink);
  text-decoration: none;
}

/* The title link covers the whole card. */
.video-tile__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-poster);
}

.video-tile__link:hover {
  color: var(--c-red);
  text-decoration: underline;
}

.video-tile__link:focus-visible {
  outline: none;
}

.video-tile__link:focus-visible::after {
  outline: 3px solid var(--c-red);
  outline-offset: 3px;
}

.placeholder--tile {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  text-align: center;
}

/* Single video: click-to-play facade (custom block sivet/video-player) ------------------- */

.video-player {
  display: grid;
  gap: var(--sp-4);
}

.video-facade {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--c-rule);
  border-radius: var(--radius-poster);
  background: var(--c-white);
  cursor: pointer;
}

.video-facade__frame img {
  width: 100%;
}

.video-facade__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--c-red);
  transform: translate(-50%, -50%);
  transition: background-color var(--dur-ui) ease;
}

.video-facade__play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  border-style: solid;
  border-width: 0.75rem 0 0.75rem 1.25rem;
  border-color: transparent transparent transparent var(--c-white);
  transform: translate(-50%, -50%);
}

.video-facade:hover .video-facade__play {
  background: var(--c-red-deep);
}

.video-player__status {
  color: var(--c-ink);
  font-weight: 600;
}

.video-player__status:empty {
  display: none;
}

.video-single__text {
  display: grid;
  gap: var(--sp-4);
  justify-items: start;
}

.video-single__text .video-text__subtitle + .placeholder {
  margin-top: calc(-1 * var(--sp-1));
}

.chapters--timed {
  counter-reset: none;
}

.chapters--timed li::before {
  display: none;
}

.chapters__time {
  flex: none;
  min-width: 2.75rem;
  color: var(--c-olive);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Contacts page, 404 -------------------------------------------------------------------- */

.contacts__list--page {
  max-width: 48rem;
}

.link-list__items {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list__items a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  font-size: var(--fs-21);
}

.faq-page .faq {
  max-width: 52rem;
}
