/*
 * Optimized CSS for Blender Recipe Reviews
 * Focus: Performance, SEO, Responsive Design
 * Removing vendor prefixes, consolidating styles, modern CSS
 */

/* CSS Variables for consistent theming */
:root {
  --primary-color: #ed786a;
  --primary-hover: #da7e18;
  --text-color: #333;
  --text-light: #777;
  --background: #f0f0f0;
  --white: #fff;
  --border-color: #e5e5e5;
  --border-light: #ddd;
  --font-primary: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  --shadow-light: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-medium: 0 4px 8px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary);
  font-weight: 300;
  color: var(--text-color);
  background: var(--background);
  overflow-x: hidden;
}

/* Performance: Reduce repaints */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-light);
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

p {
  margin: 0 0 1.5rem 0;
  line-height: 1.7;
}

/* Links */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover, a:focus {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Layout - Mobile First */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navigation */
.navigation {
  background: var(--white);
  border-bottom: 2px solid var(--border-color);
  box-shadow: var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navigation .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  min-height: 60px;
}

.navigation-title {
  font-weight: 600;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navigation-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
}

.navigation-link {
  font-weight: 400;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.navigation-link:hover {
  border-bottom-color: var(--primary-color);
  text-decoration: none;
}

/* Main Content */
#main {
  flex: 1;
  background: var(--white);
  padding: 2rem 0;
}

article {
  margin-bottom: 3rem;
}

/* Recipe Content */
.recipe-image {
  margin: 2rem 0;
  text-align: center;
}

.recipe-image img {
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
  max-width: 100%;
  height: auto;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

th {
  background: var(--background);
  font-weight: 600;
  color: var(--text-color);
}

/* Lists */
ul, ol {
  margin: 0 0 1.5rem 0;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Buttons */
.button, input[type="submit"], input[type="button"] {
  display: inline-block;
  background: var(--primary-color);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.button:hover, input[type="submit"]:hover, input[type="button"]:hover {
  background: var(--primary-hover);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Forms */
input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-light);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(237, 120, 106, 0.1);
}

/* Footer */
#footer-wrapper {
  background: var(--background);
  border-top: 2px solid var(--border-color);
  padding: 2rem 0;
  margin-top: auto;
}

/* Ads - Responsive */
.ad-container {
  margin: 2rem 0;
  text-align: center;
}

.brr-responsive {
  max-width: 100%;
  height: auto;
}

/* Images - Performance optimized */
.image {
  display: block;
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-light);
}

.image img {
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.image:hover img {
  transform: scale(1.02);
}

/* Responsive Design - Mobile First */

/* Tablet (768px and up) */
@media (min-width: 48rem) {
  .container {
    padding: 0 2rem;
  }

  .navigation .container {
    padding: 1rem 2rem;
  }

  #main {
    padding: 3rem 0;
  }

  .recipe-image {
    max-width: 600px;
    margin: 2rem auto;
  }

  /* Two column layout for larger screens */
  .content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
  }
}

/* Desktop (1024px and up) */
@media (min-width: 64rem) {
  html {
    font-size: 18px;
  }

  .container {
    padding: 0 3rem;
  }

  #main {
    padding: 4rem 0;
  }

  .navigation-list {
    gap: 2rem;
  }
}

/* Large screens (1200px and up) */
@media (min-width: 75rem) {
  .container {
    padding: 0 4rem;
  }
}

/* Performance: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print styles */
@media print {
  .navigation,
  .ad-container,
  #footer-wrapper {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  a {
    color: black;
    text-decoration: underline;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-color: #000;
    --background: #fff;
    --border-color: #000;
  }
}

/* Dark mode support (future-proofing) */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #e0e0e0;
    --text-light: #b0b0b0;
    --background: #1a1a1a;
    --white: #2d2d2d;
    --border-color: #404040;
    --border-light: #505050;
  }
}

/* Focus indicators for accessibility */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Loading state styles */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Skip to main content (accessibility) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}
