/* ==========================================
   Custom CSS for "To Serve Man" Cookbook
   Elements that cannot use Tailwind utilities
   ========================================== */

/* Navigation animated underline */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: #c1121f;
  transition: width 0.2s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* Ingredient list bullets */
.ingredients-list ul {
  list-style: none;
  padding: 0;
}

.ingredients-list li {
  margin-bottom: 1rem;
  padding-left: 2rem;
  position: relative;
}

.ingredients-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: #1a1816;
}

/* Instruction list numbering */
.instructions-list ol {
  list-style: none;
  counter-reset: step-counter;
  padding: 0;
}

.instructions-list li {
  counter-increment: step-counter;
  margin-bottom: 2rem;
  padding-left: 4rem;
  position: relative;
}

.instructions-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  font-family: 'EB Garamond', 'Palatino', 'Georgia', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1816;
}

/* Section headers in instructions */
.instructions-list h3 {
  font-family: 'EB Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-left: 0;
}

/* Ingredient/cookware/timer highlighting in instructions */
.ingredient {
  font-weight: 400;
}

.timer {
  font-weight: 400;
}

.cookware {
  font-style: italic;
}

/* Meta item bullets (recipe detail) */
.meta-item::after {
  content: '•';
  margin-left: 2rem;
}

.meta-item:last-child::after {
  content: '';
}

/* About page styling */
article a {
  color: #1a1816;
  border-bottom: 1px solid #e8e4df;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

article a:hover {
  border-color: #c1121f;
}

article h1 {
  font-family: 'EB Garamond', serif;
  font-size: 3rem;
  margin-bottom: 4rem;
  text-align: center;
}

article h2 {
  font-family: 'EB Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 4rem;
  margin-bottom: 2rem;
}

article p {
  margin-bottom: 2rem;
  line-height: 1.6;
}

article ul {
  list-style-type: disc;
  padding-left: 2rem;
  margin-bottom: 2rem;
}

article ul li {
  margin-bottom: 0.5rem;
}

article strong {
  font-weight: 500;
}

article em {
  font-style: italic;
}

/* ==========================================
   Recipe Search Styles
   ========================================== */

.search-container {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 1rem 1.5rem;
  font-family: 'EB Garamond', 'Palatino', 'Georgia', serif;
  font-size: 1.25rem;
  color: #1a1816;
  background-color: #fdfcfb;
  border: 2px solid #e8e4df;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: #c1121f;
  box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.1);
}

.search-input::placeholder {
  color: #6b6560;
  opacity: 0.6;
}

/* Search results container */
.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  z-index: 50;
  background-color: #fdfcfb;
  border: 2px solid #e8e4df;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  max-height: 500px;
  overflow-y: auto;
}

.search-results[hidden] {
  display: none;
}

/* Result count */
.search-result-count {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  color: #6b6560;
  border-bottom: 1px solid #e8e4df;
}

/* Results list */
.search-results-list {
  display: flex;
  flex-direction: column;
}

/* Individual result item */
.search-result-item {
  display: block;
  padding: 1rem 1.5rem;
  text-decoration: none;
  border: none;
  border-bottom: 1px solid #e8e4df;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
  background-color: rgba(139, 111, 71, 0.05);
}

.search-result-item:hover .search-result-title,
.search-result-item.selected .search-result-title {
  color: #c1121f;
}

/* Result title */
.search-result-title {
  font-family: 'EB Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1816;
  margin-bottom: 0.25rem;
  transition: color 0.15s ease;
}

/* Result meta */
.search-result-meta {
  font-size: 0.875rem;
  color: #6b6560;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-result-tags {
  display: inline;
  font-style: italic;
}

/* No results message */
.search-no-results {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #6b6560;
}

.search-no-results p {
  margin-bottom: 0.5rem;
}

.search-no-results p:first-child {
  font-size: 1.125rem;
  color: #1a1816;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .search-input {
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
  }

  .search-result-title {
    font-size: 1.125rem;
  }

  .search-results {
    max-height: 400px;
  }
}

/* Smooth scrolling for keyboard navigation */
.search-results {
  scroll-behavior: smooth;
}

/* ==========================================
   Print Styles
   ========================================== */

@media print {
  @page {
    margin: 2cm;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  .no-print {
    display: none !important;
  }

  .recipe-title {
    font-size: 24pt;
    margin-bottom: 12pt;
  }

  .recipe-content {
    display: block !important;
    grid-template-columns: 1fr !important;
  }

  .recipe-ingredients,
  .recipe-instructions {
    margin-bottom: 24pt;
  }

  .recipe-ingredients h2,
  .recipe-instructions h2 {
    font-size: 14pt;
    margin-bottom: 12pt;
  }

  a {
    color: #1a1816;
    text-decoration: none;
    border: none;
  }

  .recipe-attribution a::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
  }
}
