/* storefront/base.css — Reset, document defaults, typography and the page container.
   Part 2 of 9; files are linked in this order in views/storefront.html (cascade order matters). */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  color-scheme: light;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.7;
  background-color: var(--bg-page);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5 {
  color: var(--ink);
  line-height: 1.2;
  font-weight: 600;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h4,
h5 {
  font-family: var(--font-sans);
  font-weight: 700;
}

p {
  max-width: 68ch;
  text-wrap: pretty;
}

b,
strong {
  color: var(--ink);
  font-weight: 700;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 3px;
}

/* On photos the ring is white so it stays visible */
.home-hero :focus-visible,
.page-hero.has-photo :focus-visible,
.gallery-tile:focus-visible {
  outline-color: #fff;
}

.gallery-tile:focus-visible {
  outline-offset: -4px;
}

main:focus {
  outline: none;
}

/* Visually hidden, still read by screen readers */
.sr-only {
  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: off-screen until focused with the keyboard */
.skip-link {
  position: fixed;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 10000;
  padding: 10px 18px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: #fff;
  font-size: var(--fs-small);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline-color: var(--brand-primary);
}

::selection {
  background: var(--brand-soft);
  color: var(--ink);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Small uppercase label in the accent colour (section eyebrows, card kickers) */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--brand-ink);
  line-height: 1.4;
}

/* Scroll reveal (js/storefront/ui.js adds .reveal / .in-view; never applied with reduced motion).
   An animation, not a transition, so the cards' own hover transitions keep working. */
.reveal-ready .reveal:not(.in-view) {
  opacity: 0;
}

.reveal-ready .reveal.in-view {
  animation: mk-reveal 0.75s var(--ease) backwards;
}

@keyframes mk-reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

/* Cards in a row arrive one after another */
.reveal-ready .reveal.in-view:nth-child(2) {
  animation-delay: 70ms;
}
.reveal-ready .reveal.in-view:nth-child(3) {
  animation-delay: 140ms;
}
.reveal-ready .reveal.in-view:nth-child(4) {
  animation-delay: 210ms;
}

/* Photos fade in over their placeholder tint once loaded (boxes keep their ratio: no layout shift) */
.img-fade main img {
  transition:
    opacity 0.6s ease,
    transform 1.2s var(--ease);
}

.img-fade main img:not(.is-loaded) {
  opacity: 0;
}

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

@media print {
  .reveal-ready .reveal:not(.in-view),
  .img-fade main img:not(.is-loaded) {
    opacity: 1;
  }
}
