/* =============================================================
   LA COCINA DE DOÑA LETTY – Recetas CSS
   Paleta: bordo oscuro #3D0000, rojo vivo #C0001A, crema #FAF3E0
   ============================================================= */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --dl-bordo:     #3D0000;
  --dl-red:       #C0001A;
  --dl-red-light: #E8001F;
  --dl-cream:     #FAF3E0;
  --dl-text:      #1A0000;
  --dl-muted:     #7a5a5a;
  --dl-white:     #FFFFFF;

  --dl-radius:    12px;
  --dl-shadow:    0 8px 32px rgba(61,0,0,.18);
  --dl-shadow-lg: 0 20px 60px rgba(61,0,0,.30);
  --dl-transition: 0.35s cubic-bezier(.4,0,.2,1);

  --dl-font-display: 'Playfair Display', Georgia, serif;
  --dl-font-body:    'Lato', sans-serif;
}

/* ── Import Google Fonts ───────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Lato:wght@300;400;700&display=swap');

/* ── Sección contenedora ───────────────────────────────────── */
.dl-recetas-section {
  padding: 48px 24px;
  background: var(--dl-bordo);
  font-family: var(--dl-font-body);
}

/* ── Grilla ────────────────────────────────────────────────── */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .dl-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .dl-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ── Card ──────────────────────────────────────────────────── */
.dl-card {
  background: var(--dl-cream);
  border-radius: var(--dl-radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--dl-shadow);
  transition: transform var(--dl-transition), box-shadow var(--dl-transition);
  outline: none;
}

.dl-card:hover,
.dl-card:focus-visible {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--dl-shadow-lg);
}

/* Image wrap */
.dl-card__img-wrap {
  position: relative;
  width: 100%;
  padding-top: 62%;   /* ratio 16:10 aprox */
  overflow: hidden;
}

.dl-card__img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dl-transition);
}

.dl-card:hover .dl-card__img-wrap img {
  transform: scale(1.06);
}

/* Overlay CTA */
.dl-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, transparent 40%, rgba(61,0,0,.78) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 14px 16px;
  opacity: 0;
  transition: opacity var(--dl-transition);
}

.dl-card:hover .dl-card__overlay,
.dl-card:focus-visible .dl-card__overlay {
  opacity: 1;
}

.dl-card__cta {
  color: var(--dl-white);
  font-family: var(--dl-font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--dl-red);
  padding: 6px 14px;
  border-radius: 50px;
}

/* Card body */
.dl-card__body {
  padding: 18px 20px 22px;
}

.dl-card__title {
  font-family: var(--dl-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dl-bordo);
  margin: 0 0 8px;
  line-height: 1.3;
}

.dl-card__excerpt {
  font-size: .88rem;
  color: var(--dl-muted);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Empty state ───────────────────────────────────────────── */
.dl-empty {
  text-align: center;
  color: var(--dl-cream);
  font-family: var(--dl-font-body);
  padding: 48px;
  opacity: .7;
}

/* ── MODAL ─────────────────────────────────────────────────── */
.dl-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}

.dl-modal.is-open {
  pointer-events: all;
  opacity: 1;
}

/* Backdrop */
.dl-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,0,0,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Container */
.dl-modal__container {
  position: relative;
  z-index: 1;
  background: var(--dl-cream);
  border-radius: 16px;
  width: 90%;
  max-width: 860px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--dl-shadow-lg);
  transform: translateY(24px) scale(.97);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}

.dl-modal.is-open .dl-modal__container {
  transform: translateY(0) scale(1);
}

/* Close button */
.dl-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(61,0,0,.85);
  color: var(--dl-white);
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dl-transition), transform .2s;
}

.dl-modal__close:hover {
  background: var(--dl-red);
  transform: rotate(90deg);
}

/* Inner scroll */
.dl-modal__inner {
  overflow-y: auto;
  flex: 1;
  scroll-behavior: smooth;
}

/* Hero image */
.dl-modal__hero {
  width: 100%;
  max-height: 360px;
  overflow: hidden;
}

.dl-modal__hero img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  display: block;
}

/* Text area */
.dl-modal__text {
  padding: 32px 36px 40px;
}

#dl-modal-title {
  font-family: var(--dl-font-display);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--dl-bordo);
  margin: 0 0 20px;
  line-height: 1.2;
}

/* Rich text content */
.dl-rich-text {
  font-family: var(--dl-font-body);
  font-size: .98rem;
  color: var(--dl-text);
  line-height: 1.75;
}

.dl-rich-text h2,
.dl-rich-text h3,
.dl-rich-text h4 {
  font-family: var(--dl-font-display);
  color: var(--dl-bordo);
  margin-top: 1.5em;
}

.dl-rich-text ul,
.dl-rich-text ol {
  padding-left: 1.5em;
}

.dl-rich-text li { margin-bottom: .4em; }

.dl-rich-text strong { color: var(--dl-bordo); }

.dl-rich-text a {
  color: var(--dl-red);
  text-decoration: underline;
}

.dl-rich-text img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1em 0;
}

/* ── Spinner loading ────────────────────────────────────────── */
.dl-modal__loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 0;
}

.dl-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(192,0,26,.2);
  border-top-color: var(--dl-red);
  border-radius: 50%;
  animation: dl-spin .7s linear infinite;
}

@keyframes dl-spin {
  to { transform: rotate(360deg); }
}

/* ── Mobile modal ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .dl-modal__container {
    width: 100%;
    max-width: 100%;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    align-self: flex-end;
  }

  .dl-modal {
    align-items: flex-end;
  }

  .dl-modal__hero img { height: 220px; }
  .dl-modal__text { padding: 22px 20px 32px; }
  #dl-modal-title { font-size: 1.4rem; }
}
