/* === System Dark Mode Support === */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #111827;
    color: #f9fafb;
  }
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: clip;
}

section[id], h1[id], h2[id], h3[id] {
  scroll-margin-top: 6rem;
}

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

body {
  max-width: 100%;
  overflow-x: clip;
}

img, svg {
  max-width: 100%;
}

/* === NAVBAR MOBILE FIX === */
@media (max-width: 768px) {
  #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 {
  box-sizing: border-box;
  max-width: 80rem;
  padding-left: 1rem;
  padding-right: 1rem;
  width: 100%;
}

@media (min-width: 640px) {
  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(54, 89, 184, 0.3);
}

/* === Recipe Link Styling === */
.fake-link {
  color: #3659b8;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.2s ease;
}

.fake-link:hover {
  color: #203873;
}

/* === Fix link flow inside recipe previews === */
#recipeGrid a {
  color: #3659b8;
  text-decoration: underline;
  font-weight: 500;
}

#recipeGrid a:hover {
  color: #203873;
}

/* 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;
}

/* === PAGE-SPECIFIC SUPPORTING PALETTES === */
.eagle-theme .text-indigo-600 {
  color: #3f6b4f !important;
}

.eagle-theme .bg-indigo-600 {
  background-color: #3f6b4f !important;
}

.eagle-theme .hover\:bg-indigo-700:hover {
  background-color: #31543e !important;
}

.eagle-theme .hover\:text-indigo-800:hover {
  color: #31543e !important;
}

.eagle-theme .bg-indigo-50,
.eagle-theme .bg-green-50 {
  background-color: #e8f0e9 !important;
}

.eagle-theme .border-indigo-600 {
  border-color: #3f6b4f !important;
}

.eagle-theme main .bg-white {
  border: 1px solid #e1ddd2;
}

.eagle-theme main img {
  border-radius: 0.75rem;
}

.recipe-theme .bg-indigo-600 {
  background-color: #b4533c !important;
}

.recipe-theme .hover\:bg-indigo-700:hover {
  background-color: #913f2f !important;
}

.recipe-theme .text-indigo-600,
.recipe-theme .text-indigo-700 {
  color: #a34734 !important;
}

.recipe-theme .text-indigo-800,
.recipe-theme .hover\:text-indigo-800:hover {
  color: #7f3428 !important;
}

.recipe-theme .border-indigo-600 {
  border-color: #b4533c !important;
}

.recipe-theme .bg-indigo-50,
.recipe-theme .bg-indigo-100 {
  background-color: #f8e8df !important;
}

.recipe-theme .focus\:ring-indigo-500:focus {
  --tw-ring-color: #b4533c !important;
}

@media (prefers-color-scheme: dark) {
  .eagle-theme .dark\:text-indigo-400 {
    color: #9bc4a8 !important;
  }

  .recipe-theme .dark\:text-indigo-400 {
    color: #f0ad91 !important;
  }
}
