/* ==========================================================================
   Viali Products – main stylesheet
   No framework. Mobile-first. Progressive enhancement (popover,
   scroll-driven animation) with sensible fallbacks.
   ========================================================================== */

/* Fonts (self-hosted, SIL Open Font License – see /assets/fonts/LICENSE-*.txt) */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/roboto-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/roboto-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Oxygen";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/oxygen-latin-700-normal.woff2") format("woff2");
}

/* Design tokens */
:root {
  --red: #da1f3d;            /* Viali red – fills, nav, large text */
  --red-dark: #b5162f;
  --red-text: #c01835;       /* red for text links on light grey (AA) */
  --red-on-dark: #ff8a9a;    /* red for links on brown (AA) */
  --brown: #3c3533;
  --ink: #404040;
  --grey-panel: #efefef;
  --grey-band: #e0e0e0;
  --paper: #f1f1f1;
  --black: #000;

  --font-body: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-head: "Oxygen", "Roboto", "Segoe UI", system-ui, sans-serif;

  --header-h: 4.5rem;
  --container: 73.125rem;    /* 1170px, as the original layout */
  --gutter: clamp(1rem, 4vw, 2rem);
  --gap: clamp(1rem, 2.5vw, 1.5rem);
}

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 0.5rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  padding-top: var(--header-h);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image: url("../img/paper.png");
  background-image: image-set(url("../img/paper.webp") type("image/webp"), url("../img/paper.png") type("image/png"));
  -webkit-font-smoothing: antialiased;
}

img,
picture {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p,
ul,
address {
  margin: 0;
}

address {
  font-style: normal;
}

ul[role="list"] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff;
}

main:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--brown);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

/* Links & buttons */
.text-link {
  color: var(--red-text);
  font-weight: 700;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.text-link:hover {
  color: var(--brown);
}

.link-light {
  color: var(--red-on-dark);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

.link-light:hover {
  color: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.875rem;
  padding: 0.6rem 1.4rem;
  border: 0;
  font-family: var(--font-head);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.2s ease;
}

.btn--red {
  background: var(--red);
  color: #fff;
}
.btn--red:hover {
  background: var(--red-dark);
}

.btn--dark {
  background: var(--brown);
  color: #fff;
}
.btn--dark:hover {
  background: #221d1c;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Header */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  background: #fff;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100% - 2 * var(--gutter), var(--container));
  height: 100%;
  margin-inline: auto;
}

.site-header__brand {
  display: block;
  width: 9rem;
  flex: none;
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  color: var(--brown);
  background: none;
  cursor: pointer;
}

.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  display: block;
  width: 1.6rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.menu-toggle__bars {
  position: relative;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle__bars::before {
  top: -0.5rem;
}

.menu-toggle__bars::after {
  top: 0.5rem;
}

/* Navigation: native popover on small screens, inline list on large */
.site-nav {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: calc(var(--header-h) + 1rem) var(--gutter) 2rem;
  border: 0;
  color: #fff;
  background: var(--brown);
  overflow-y: auto;
}

.site-nav:popover-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-nav__close {
  position: absolute;
  top: 0.875rem;
  right: var(--gutter);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
}

.site-nav__list {
  display: grid;
  gap: 0.5rem;
  text-align: center;
}

.site-nav__list a {
  display: inline-block;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 7vw, 2.25rem);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav__list a:hover,
.site-nav__list a[aria-current="true"] {
  color: var(--red-on-dark);
}

:root:has(.site-nav:popover-open) {
  overflow: hidden;
}

@media (min-width: 56em) {
  .menu-toggle,
  .site-nav__close {
    display: none;
  }

  .site-nav,
  .site-nav:popover-open {
    position: static;
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    color: var(--ink);
    background: none;
  }

  .site-nav__list {
    display: flex;
    gap: clamp(1rem, 2.5vw, 2rem);
  }

  .site-nav__list a {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
  }

  .site-nav__list a:hover,
  .site-nav__list a[aria-current="true"] {
    color: var(--red);
  }
}

@media (min-width: 56em) and (pointer: coarse) {
  .site-nav__list a {
    padding-block: 0.8rem;
  }
}

/* Kitchen banner with product markers */
.banner {
  padding-block: 0;
}

.banner__frame {
  position: relative;
  width: min(100%, 84.3125rem); /* 1349px, as the original */
  margin-inline: auto;
}

.banner__image {
  width: 100%;
}

.hotspot {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  text-decoration: none;
  transform: translate(-50%, -50%);
}

/* the visible marker: red disc with a white "play" triangle */
.hotspot::before {
  content: "";
  width: clamp(1.25rem, 2.6vw, 2.25rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgb(255 255 255 / 0.85), 0 2px 8px rgb(0 0 0 / 0.35);
}

.hotspot::after {
  content: "";
  position: absolute;
  left: 52%;
  top: 50%;
  border-block: clamp(0.25rem, 0.5vw, 0.45rem) solid transparent;
  border-inline-start: clamp(0.4rem, 0.8vw, 0.7rem) solid #fff;
  transform: translate(-40%, -50%);
}

.hotspot--rangehoods { left: 38.5%; top: 11.5%; }
.hotspot--cooktops { left: 39.5%; top: 44%; }
.hotspot--cookware { left: 19.5%; top: 57%; }
.hotspot--dishwashers { left: 83%; top: 79%; }

.hotspot__label {
  position: absolute;
  left: calc(50% + 1.5rem);
  top: 50%;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: #fff;
  color: var(--brown);
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.25);
  opacity: 0;
  transform: translate(-0.25rem, -50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.hotspot--dishwashers .hotspot__label {
  left: auto;
  right: calc(50% + 1.5rem);
}

.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label {
  opacity: 1;
  transform: translate(0, -50%);
}

@media (prefers-reduced-motion: no-preference) {
  .hotspot::before {
    animation: pulse 2.4s ease-in-out infinite;
  }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgb(255 255 255 / 0.85), 0 2px 8px rgb(0 0 0 / 0.35); }
  50% { box-shadow: 0 0 0 7px rgb(255 255 255 / 0.55), 0 2px 8px rgb(0 0 0 / 0.35); }
}

/* Products intro (video + tagline) */
.intro {
  display: grid;
  margin-bottom: var(--gap);
}

.video,
.video-frame {
  position: relative;
  display: block;
  aspect-ratio: 688 / 368;
  background: var(--brown);
}

.video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.intro__tagline {
  display: flex;
  align-items: flex-start;
  padding: 1.25rem 1.5rem 1.5rem;
  background: var(--brown);
  color: #fff;
  transition: background-color 0.3s ease;
}

.intro__title {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 0.8rem + 1.2vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
}

@media (hover: hover) {
  .intro:hover .intro__tagline {
    background: var(--red);
  }
}

/* Product rows – image and copy alternate sides on larger screens */
.product-row {
  display: grid;
  margin-bottom: var(--gap);
  background: var(--grey-panel);
}

.product-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-row__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem 1.75rem;
  color: var(--brown);
}

.product-row__title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.product-row .text-link {
  display: inline-block;
  padding-block: 0.4rem;
}

@media (min-width: 48em) {
  .intro,
  .product-row {
    grid-template-columns: 2fr 1fr;
  }

  .product-row--reverse {
    grid-template-columns: 1fr 2fr;
  }

  .product-row--reverse .product-row__media {
    order: 2;
  }
}

/* Where to buy */
.buy {
  display: grid;
  background: var(--grey-panel);
}

.panel-heading {
  padding: 0.6rem 1.5rem;
  background: var(--brown);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.buy__text {
  display: grid;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem 1.75rem;
}

.buy__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (min-width: 48em) {
  .buy {
    grid-template-columns: 1fr 1fr;
  }
}

/* Contact */
.contact {
  display: grid;
  gap: 1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem);
  background: var(--brown);
  color: #fff;
}

.contact p {
  max-width: 34rem;
}

.contact__title,
.about__title,
.manuals__title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* About */
.section--about {
  background: var(--grey-band);
}

.about {
  display: grid;
  gap: 1.5rem 3rem;
}

.about__body {
  display: grid;
  gap: 0.75rem;
  max-width: 40rem;
}

.about__links ul {
  display: grid;
  gap: 0.25rem;
}

.about__links a {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--brown);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
}

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

@media (min-width: 48em) {
  .about {
    grid-template-columns: 2fr 1fr;
    align-items: start;
  }

  .about__links {
    padding-top: 2.5rem;
  }
}

/* Manuals */
.manuals__intro {
  margin: 0.5rem 0 1.5rem;
}

.manual-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: var(--gap);
}

.manual-group {
  padding: 1.25rem 1.5rem 1.5rem;
  background: #fff;
  border-top: 4px solid var(--red);
}

.manual-group__title {
  margin-bottom: 0.75rem;
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--brown);
}

.manual-list li {
  padding-block: 0.3rem;
  line-height: 1.45;
}

.manual-list a {
  color: var(--red-text);
  text-underline-offset: 0.2em;
}

.manual-list a:hover {
  color: var(--brown);
}

.manual-model {
  font-weight: 700;
}

.manual-meta {
  white-space: nowrap;
  font-size: 0.85em;
  color: #5c5c5c;
}

/* Footer */
.site-footer {
  padding-block: 1rem;
  background: var(--black);
  color: #fff;
  font-size: 0.875rem;
}

/* Back to top */
.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  background: var(--red);
  color: #fff;
  transition: background-color 0.2s ease;
}

.to-top:hover {
  background: var(--red-dark);
}

.icon-chevron-up {
  width: 0.7rem;
  height: 0.7rem;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateY(2px) rotate(45deg);
}

@supports (animation-timeline: scroll()) {
  .to-top {
    animation: reveal linear both;
    animation-timeline: scroll(root block);
    animation-range: 40vh 70vh;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    visibility: hidden;
  }
  to {
    opacity: 1;
    visibility: visible;
  }
}

/* Error page */
body.no-header {
  padding-top: 0;
}

.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 3rem var(--gutter);
  text-align: center;
}

.error-page__inner {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  max-width: 36rem;
  padding: clamp(2rem, 6vw, 3rem);
  background: #fff;
  border-top: 4px solid var(--red);
}

.error-page__inner img {
  width: 10rem;
}

.error-page h1 {
  font-family: var(--font-head);
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  color: var(--brown);
}

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

  @supports (animation-timeline: scroll()) {
    .to-top {
      animation: reveal linear both !important;
      animation-timeline: scroll(root block) !important;
      animation-range: 40vh 70vh !important;
    }
  }
}

/* Forced colours (Windows High Contrast) */
@media (forced-colors: active) {
  .hotspot::before {
    background: Highlight;
    forced-color-adjust: none;
  }

  .btn {
    border: 2px solid ButtonText;
  }
}

/* Print */
@media print {
  .site-header,
  .to-top,
  .skip-link,
  .hotspots {
    display: none !important;
  }

  body {
    padding-top: 0;
    background: none;
  }

  .contact {
    color: #000;
    background: none;
  }
}
