/* ==========================================================================
   base.css · Osteria del Lago
   Reset, typography classes, scroll reveal, image placeholder system.
   ========================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--color-canvas);
  color: var(--color-ink);
  font-family: var(--font-sans);
  line-height: var(--lh-body);
  /* clip (not hidden) prevents horizontal scroll without creating a scroll
     container, so position: sticky descendants keep working */
  overflow-x: clip;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
}

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

/* --- Typography classes --- */
.t-hero {
  font-family: var(--font-serif);
  font-size: var(--t-hero);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: 400;
}

.t-display {
  font-family: var(--font-serif);
  font-size: var(--t-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-tight);
  font-weight: 400;
}

.t-h2 {
  font-family: var(--font-serif);
  font-size: var(--t-h2);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-tight);
  font-weight: 400;
}

.t-h3 {
  font-family: var(--font-serif);
  font-size: var(--t-h3);
  line-height: 1.2;
  font-weight: 400;
}

.t-large {
  font-size: var(--t-large);
  line-height: 1.55;
}

.t-body {
  font-size: var(--t-body);
  line-height: var(--lh-body);
}

.t-small {
  font-size: var(--t-small);
  line-height: 1.55;
}

.t-label {
  font-size: var(--t-label);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--color-ink-muted);
}

.t-italic {
  font-style: italic;
  font-family: var(--font-serif);
}

.t-mono {
  font-family: var(--font-mono);
}

.t-muted {
  color: var(--color-ink-muted);
}

.t-crimson {
  color: var(--color-crimson);
}

.t-forest {
  color: var(--color-forest);
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

/* --- Scroll reveal system --- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(4px);
  transition:
    opacity var(--dur-reveal) var(--ease-out-expo),
    transform var(--dur-reveal) var(--ease-out-expo),
    filter var(--dur-reveal) var(--ease-out-expo);
  will-change: opacity, transform, filter;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-stagger > * {
  --i: 0;
  transition-delay: calc(var(--i) * 80ms);
}

.reveal-stagger > *:nth-child(1) { --i: 0; }
.reveal-stagger > *:nth-child(2) { --i: 1; }
.reveal-stagger > *:nth-child(3) { --i: 2; }
.reveal-stagger > *:nth-child(4) { --i: 3; }
.reveal-stagger > *:nth-child(5) { --i: 4; }
.reveal-stagger > *:nth-child(6) { --i: 5; }
.reveal-stagger > *:nth-child(7) { --i: 6; }
.reveal-stagger > *:nth-child(8) { --i: 7; }

/* --- Image placeholder system --- */
.img-placeholder {
  background: #E8EAE5;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.img-placeholder::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, calc(-50% - 1.25rem));
  opacity: 0.25;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239A9A95' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z'/%3E%3Ccircle cx='12' cy='13' r='4'/%3E%3C/svg%3E");
}

.img-placeholder::after {
  content: attr(data-label);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  line-height: 1.4;
  color: #9A9A95;
  text-align: center;
  padding: 1rem;
  max-width: 80%;
  margin-top: 2.5rem;
}

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

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only.focus\:not-sr-only:focus,
.focus\:not-sr-only:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 300;
  width: auto;
  height: auto;
  padding: 0.75rem 1.25rem;
  margin: 0;
  clip: auto;
  overflow: visible;
  white-space: normal;
  background: var(--color-forest);
  color: #fff;
  border-radius: 3px;
  font-size: 0.9375rem;
}

.no-scroll {
  overflow: hidden;
}
