/* ==========================================================================
   Variables
   ========================================================================== */
:root {
  /* Colors - Italian-inspired palette */
  --color-background: #fdfcf9;
  --color-surface: #ffffff;
  --color-surface-muted: #f5f4f0;
  --color-text: #1f1b16;
  --color-text-muted: #6b665d;

  --color-primary: #d62828; /* rich appetizing red */
  --color-primary-soft: #fbe3e3;
  --color-success: #2f7c31; /* fresh green */
  --color-success-soft: #e1f3e2;
  --color-warning: #e9a000;
  --color-warning-soft: #fff4d9;
  --color-danger: #c1121f;
  --color-danger-soft: #fde2e5;

  --color-accent-green: #2b9348;
  --color-accent-cream: #fff3e0;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Playfair Display", "Georgia", serif;
  --font-display: "Playfair Display", "Georgia", serif;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.8;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-pill: 999px;

  /* Shadows - soft, appetizing depth */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 15px 35px rgba(15, 23, 42, 0.12);

  /* Transitions */
  --transition-fast: 150ms ease-out;
  --transition-normal: 220ms ease-out;
  --transition-slow: 320ms ease-out;
}

/* ==========================================================================
   Reset / Normalize
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

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

body {
  min-height: 100vh;
}

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

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

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

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

textarea {
  resize: vertical;
}

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

:focus {
  outline: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

/* Headings - modern, slightly gourmet feel */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

h1 {
  font-size: var(--font-size-4xl);
}

h2 {
  font-size: var(--font-size-3xl);
}

h3 {
  font-size: var(--font-size-2xl);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-md);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text);
}

p + p {
  margin-top: var(--space-2);
}

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

strong {
  font-weight: 600;
}

/* Links - clean with subtle, appetizing hover */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal);
}

a:hover {
  color: #a81818;
}

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

/* Lists */
ul,
ol {
  padding-left: 1.25rem;
  margin: 0 0 var(--space-3);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

/* Layout */
.container {
  width: 100%;
  max-width: 72rem; /* 1152px - wide for menu imagery */
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-6);
  }
}

.section {
  padding-block: var(--space-10);
}

.section--muted {
  background-color: var(--color-surface-muted);
}

/* Flex helpers */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

/* Grid helpers */
.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

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

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }

.py-4 {
  padding-block: var(--space-4);
}

.py-6 {
  padding-block: var(--space-6);
}

.p-4 {
  padding: var(--space-4);
}

/* Screen reader only */
.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;
}

/* ==========================================================================
   Components
   ========================================================================== */

/* Buttons - primary call to action (order, reservations) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-fast),
    transform var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #f2542d);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b01f21, #e04927);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary-soft);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text);
}

.btn-ghost:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.btn[disabled],
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

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

/* Inputs / Form elements */
.input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-300);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft);
}

input[disabled],
select[disabled],
textarea[disabled] {
  background-color: var(--gray-100);
  cursor: not-allowed;
}

label {
  display: inline-block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-sm);
  font-weight: 500;
}

/* Cards - for pizzas, testimonials, offers */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}

.card--elevated {
  box-shadow: var(--shadow-md);
}

.card-header {
  margin-bottom: var(--space-3);
}

.card-media {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: var(--space-3);
}

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

.card-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  background-color: var(--color-success-soft);
  color: var(--color-success);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ==========================================================================
   Accessibility / Focus States
   ========================================================================== */

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

/* Improve focus contrast on dark backgrounds */
[data-dark-bg] :focus-visible {
  outline-color: #ffffff;
}

/* ==========================================================================
   Media helpers
   ========================================================================== */

.responsive-media {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
}

.responsive-media > iframe,
.responsive-media > video,
.responsive-media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
