/* === System Dark Mode Support === */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #111827;
    color: #f9fafb;
  }
}

html {
  scroll-behavior: smooth;
}

/* === NAVBAR MOBILE FIX === */
@media (max-width: 768px) {
  #navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  #navbar .text-2xl {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  #mobile-menu-btn {
    margin-left: auto;
  }

  #mobile-menu {
    width: 100%;
    text-align: left;
  }

  #navbar .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Prevent text wrapping in logo */
  #navbar a.text-2xl {
    white-space: nowrap;
  }
}

/* === MOBILE DROPDOWN CLAMSHELL === */
#mobile-menu {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
  #mobile-menu {
    background-color: rgba(17, 24, 39, 0.85); /* dark translucent */
  }
}

/* === PAGE PADDING (HOME + GENERAL) === */
main.container {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 1024px) {
  main.container {
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

/* === TYPOGRAPHY AND BASE === */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.2;
}

a.block:hover {
  transform: translateY(-5px);
  transition: transform 0.3s ease;
  text-decoration: none;
}

#recipeGrid a {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* === RECIPE PAGE STYLES === */
.recipe-image {
  height: 24rem;
}

.recipe-card {
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ingredient-item {
  transition: all 0.2s ease;
}

.instruction-step {
  counter-increment: step-counter;
}

.instruction-step::before {
  content: counter(step-counter) ".";
  font-weight: bold;
  margin-right: 0.5rem;
}

/* === ADMIN FORM STYLES === */
#recipeForm textarea {
  min-height: 100px;
}

#recipeForm button[type="submit"] {
  transition: background-color 0.3s ease;
}

input[type="text"] {
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* === Recipe Link Styling === */
.fake-link {
  color: #4f46e5; /* Tailwind Indigo-600 */
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.fake-link:hover {
  color: #3730a3; /* Tailwind Indigo-800 */
}

/* === Fix link flow inside recipe previews === */
#recipeGrid a {
  color: #4f46e5;
  text-decoration: underline;
  font-weight: 500;
}

#recipeGrid a:hover {
  color: #3730a3;
}

/* Keep short inline links aligned naturally in text */
#recipeGrid p a {
  display: inline;
  white-space: normal;
  word-break: break-word;
  text-decoration-thickness: 1.5px;
}