/* ============================================================
   SAPORI — Base Styles & Modern Reset
   Premium Italian Recipe PWA
   ============================================================ */

/* ============================================================
   MODERN CSS RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition:
    color var(--transition-normal),
    background-color var(--transition-slow);
}

/* Remove default styling from elements */
ul,
ol {
  list-style: none;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

fieldset {
  border: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color var(--transition-normal);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
}

h4 {
  font-size: clamp(1.1rem, 2.5vw, 1.375rem);
  font-weight: 600;
}

h5 {
  font-size: 1.1rem;
  font-weight: 600;
}

h6 {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  color: var(--text-secondary);
  line-height: 1.7;
  transition: color var(--transition-normal);
}

small {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

strong {
  font-weight: 600;
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

/* ============================================================
   SELECTION STYLING
   ============================================================ */
::selection {
  background-color: var(--primary);
  color: var(--on-primary);
}

::-moz-selection {
  background-color: var(--primary);
  color: var(--on-primary);
}

/* ============================================================
   FOCUS STYLES
   ============================================================ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Hidden */
.hidden {
  display: none !important;
}

/* ============================================================
   LINK STYLES
   ============================================================ */
a:not([class]) {
  color: var(--primary-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--primary-light);
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:not([class]):hover {
  color: var(--primary-ink);
  text-decoration-color: var(--primary-ink);
}

/* ============================================================
   HORIZONTAL RULE
   ============================================================ */
hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: var(--space-lg) 0;
}
