/* ─────────────────────────────────────────────────────────────
   Recipe Search — CSS
   Brand: Bodoni Moda (headings) / Dosis (body)
   ───────────────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,wght@0,400;0,600;1,400&family=Dosis:wght@400;500;600&display=swap');

:root {
  --rs-primary:      #7B876D;
  --rs-secondary:    #D49B7E;
  --rs-accent:       #C67F43;
  --rs-dark-orange:  #893F04;
  --rs-light-green:  #989E8B;
  --rs-text:         #2E1503;
  --rs-cream:        #FEFBEA;
  --rs-white:        #ffffff;
  --rs-overlay-bg:   rgba(46, 21, 3, 0.45);
  --rs-panel-radius: 20px 20px 0 0;
  --rs-font-heading: 'Bodoni Moda', Georgia, serif;
  --rs-font-body:    'Dosis', sans-serif;
  --rs-transition:   0.38s cubic-bezier(0.32, 0, 0.15, 1);
  --rs-panel-max:    900px;
}

/* ── Overlay ─────────────────────────────────────────────────── */

.rs-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--rs-overlay-bg);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--rs-transition), visibility var(--rs-transition);
}

.rs-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── Panel ───────────────────────────────────────────────────── */

.rs-panel {
  width: 100%;
  max-width: var(--rs-panel-max);
  background: var(--rs-cream);
  border-radius: var(--rs-panel-radius);
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  transform: translateY(100%);
  transition: transform var(--rs-transition);
  box-shadow: 0 -8px 40px rgba(46, 21, 3, 0.18);
  overflow: hidden;
}

.rs-overlay.is-open .rs-panel {
  transform: translateY(0);
}

/* ── Header ──────────────────────────────────────────────────── */

.rs-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(123, 135, 109, 0.2);
  flex-shrink: 0;
}

.rs-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--rs-white);
  border: 1.5px solid rgba(123, 135, 109, 0.35);
  border-radius: 50px;
  padding: 10px 18px;
  transition: border-color 0.2s;
}

.rs-search-wrap:focus-within {
  border-color: var(--rs-accent);
}

.rs-icon-search {
  width: 18px;
  height: 18px;
  color: var(--rs-light-green);
  flex-shrink: 0;
}

.rs-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--rs-font-body);
  font-size: 16px;
  color: var(--rs-text);
  letter-spacing: 0.01em;
}

.rs-input::placeholder {
  color: var(--rs-light-green);
}

.rs-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rs-text);
  transition: background 0.18s, color 0.18s;
  flex-shrink: 0;
}

.rs-close:hover {
  background: rgba(137, 63, 4, 0.1);
  color: var(--rs-dark-orange);
}

.rs-close svg {
  width: 20px;
  height: 20px;
}

/* ── Body ────────────────────────────────────────────────────── */

.rs-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--rs-light-green) transparent;
}

.rs-section-label {
  font-family: var(--rs-font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rs-primary);
  margin: 0 0 16px;
}

/* ── Results grid ────────────────────────────────────────────── */

.rs-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .rs-results {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* ── Result card ─────────────────────────────────────────────── */

.rs-card {
  display: block;
  text-decoration: none;
  color: var(--rs-text);
  transition: transform 0.2s;
}

.rs-card:hover {
  transform: translateY(-3px);
}

.rs-card__img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  background: var(--rs-light-green);
  margin-bottom: 8px;
}

.rs-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.rs-card:hover .rs-card__img-wrap img {
  transform: scale(1.04);
}

.rs-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--rs-primary) 0%, var(--rs-light-green) 100%);
}

.rs-card__placeholder svg {
  width: 36px;
  height: 36px;
  color: var(--rs-cream);
  opacity: 0.6;
}

.rs-card__title {
  font-family: var(--rs-font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--rs-text);
  letter-spacing: 0.01em;
}

/* ── Empty state ─────────────────────────────────────────────── */

.rs-empty {
  padding: 32px 0;
  text-align: center;
}

.rs-empty p {
  font-family: var(--rs-font-body);
  font-size: 15px;
  color: var(--rs-light-green);
  line-height: 1.6;
  margin: 0;
}

/* ── Skeleton loading ────────────────────────────────────────── */

.rs-skeleton {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rs-skeleton__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(123,135,109,0.15) 25%, rgba(123,135,109,0.28) 50%, rgba(123,135,109,0.15) 75%);
  background-size: 200% 100%;
  animation: rs-shimmer 1.4s infinite;
}

.rs-skeleton__text {
  height: 13px;
  width: 80%;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(123,135,109,0.15) 25%, rgba(123,135,109,0.28) 50%, rgba(123,135,109,0.15) 75%);
  background-size: 200% 100%;
  animation: rs-shimmer 1.4s infinite;
}

@keyframes rs-shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Footer CTA ──────────────────────────────────────────────── */

.rs-panel__footer {
  padding: 16px 24px 20px;
  border-top: 1px solid rgba(123, 135, 109, 0.2);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

.rs-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--rs-font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rs-accent);
  text-decoration: none;
  transition: color 0.18s, gap 0.18s;
}

.rs-cta:hover {
  color: var(--rs-dark-orange);
  gap: 10px;
}

.rs-cta svg {
  width: 15px;
  height: 15px;
}

/* ── Trigger: bar ────────────────────────────────────────────── */

.rs-trigger-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--rs-white);
  border: 1.5px solid rgba(123, 135, 109, 0.35);
  border-radius: 50px;
  padding: 11px 22px;
  font-family: var(--rs-font-body);
  font-size: 15px;
  color: var(--rs-light-green);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 480px;
  text-align: left;
}

.rs-trigger-bar:hover {
  border-color: var(--rs-accent);
  box-shadow: 0 2px 12px rgba(198, 127, 67, 0.15);
}

.rs-trigger-bar svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.rs-trigger-bar span {
  flex: 1;
}

/* ── Trigger: icon ───────────────────────────────────────────── */

.rs-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--rs-text);
  transition: color 0.18s;
}

.rs-trigger-icon:hover {
  color: var(--rs-accent);
}

.rs-trigger-icon svg {
  width: 22px;
  height: 22px;
}

/* ── Reduced motion ──────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .rs-overlay,
  .rs-panel,
  .rs-card,
  .rs-card__img-wrap img,
  .rs-cta {
    transition: none;
  }
  .rs-skeleton__img,
  .rs-skeleton__text {
    animation: none;
  }
}
