/* SpecialCoffee.ru Base Styles
   CSS reset, Google Fonts, element typography, utilities, focus styles, animation.
   Depends on css/variables.css (must be loaded first). */

/* =============================================================================
   Section 1: Google Fonts
   ============================================================================= */

/* Google Fonts — Playfair Display (headings) + Source Sans 3 (body) */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Sans+3:wght@400;600&display=swap');

/* =============================================================================
   Section 2: Modern CSS Reset
   ============================================================================= */

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

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--text-primary);
  background-color: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* =============================================================================
   Section 3: Typography
   ============================================================================= */

/* Headings — Playfair Display for Italian elegance */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

/* Heading scale: 48, 36, 28, 22, 20, 16 px */
/* h1/h2/h4 use raw px — no corresponding token in the system */
h1 { font-size: 48px; }
h2 { font-size: 36px; }
h3 { font-size: var(--font-size-heading); }
h4 { font-size: 22px; }
h5 { font-size: var(--font-size-subheading); }
h6 { font-size: var(--font-size-body); }

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-red);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-chocolate);
}

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

blockquote {
  border-left: 4px solid var(--color-gold);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-style: italic;
}

small {
  font-size: var(--font-size-small);
}

strong {
  font-weight: var(--font-weight-semibold);
}

/* =============================================================================
   Section 4: Utilities
   ============================================================================= */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }
}

.section {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

@media (max-width: 767px) {
  .section {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }
}

/* Hides content visually but keeps it accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* =============================================================================
   Section 5: Keyboard Focus Styles
   ============================================================================= */

/* Visible red ring for keyboard navigation — WCAG AA */
:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 2px;
}

/* Remove mouse-click outline while keeping keyboard outline */
:focus:not(:focus-visible) {
  outline: none;
}

/* =============================================================================
   Section 6: Scroll-Reveal Animation
   ============================================================================= */

/* Initial hidden state — JS adds .is-visible via IntersectionObserver */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.fade-in-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}
