/* =========================================================================
   Classic Lady Kitchen — hoja de estilo
   Paleta: porcelana, lino, tinta sepia, rosa palo profundo, salvia, mantequilla
   ========================================================================= */

:root {
  --porcelain: #fffcf4;
  --linen: #f6eedf;
  --ink: #40332b;
  --ink-soft: #7b6858;
  --rosewood: #a8455a;
  --rosewood-dark: #8b3549;
  --sage: #7e9a76;
  --butter: #efcf8e;
  --line: #e2d3bb;
  --shadow: 0 10px 28px rgba(64, 51, 43, .12);
  --shadow-sm: 0 3px 10px rgba(64, 51, 43, .09);

  --display: "Playfair Display", "Hoefler Text", Georgia, serif;
  --body: "Lora", Georgia, "Times New Roman", serif;
  --script: "Parisienne", "Snell Roundhand", cursive;
  --util: "Karla", "Avenir Next", "Segoe UI", system-ui, sans-serif;

  --wrap: 1120px;
  --radius: 4px;
}

/* Mantel de vichy: el fondo de toda la casa */
.gingham {
  background-color: var(--rosewood);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 252, 244, .35) 0 14px, transparent 14px 28px),
    repeating-linear-gradient(0deg, rgba(255, 252, 244, .35) 0 14px, transparent 14px 28px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--porcelain);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(239, 207, 142, .18), transparent 45%),
    radial-gradient(circle at 85% 60%, rgba(126, 154, 118, .12), transparent 40%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; }

a { color: var(--rosewood-dark); text-underline-offset: 3px; }
a:hover { color: var(--rosewood); }

:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

.wrap { width: min(var(--wrap), calc(100% - 2.5rem)); margin-inline: auto; }
.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Cabecera ------------------------------------------------- */

.topbar {
  font-family: var(--util);
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: #fff;
  padding: .55rem 0;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar a { color: #fff; text-decoration: none; }
.topbar a:hover { text-decoration: underline; }

.masthead { text-align: center; padding: 2.4rem 0 1.2rem; }
.masthead .logo {
  font-family: var(--script);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  color: var(--rosewood);
  line-height: .95;
  display: inline-block;
  text-decoration: none;
}
.masthead .tagline {
  font-family: var(--util);
  font-size: .74rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: .7rem 0 0;
}

/* Cinta de rúbrica bajo el logotipo */
.rule-flourish {
  display: flex; align-items: center; justify-content: center; gap: .9rem;
  margin: 1.1rem auto 0; max-width: 460px; color: var(--butter);
}
.rule-flourish::before, .rule-flourish::after {
  content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.rule-flourish span { color: var(--sage); font-size: 1.1rem; }

.mainnav {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 1.4rem;
  background: rgba(255, 255, 255, .5);
}
.mainnav .wrap {
  display: flex; flex-wrap: wrap; gap: .4rem 1.6rem;
  justify-content: center; align-items: center; padding: .7rem 0;
}
.mainnav a {
  font-family: var(--util);
  font-size: .8rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
}
.mainnav a:hover, .mainnav a[aria-current="page"] { border-bottom-color: var(--rosewood); color: var(--rosewood-dark); }

.searchform { display: flex; gap: .4rem; margin-left: auto; }
.searchform input {
  font-family: var(--body); font-size: .9rem; padding: .35rem .7rem;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; min-width: 10rem;
}

/* ---------- Botones -------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--util); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  padding: .7rem 1.4rem; border-radius: 999px; border: 1px solid var(--rosewood);
  background: var(--rosewood); color: #fff; text-decoration: none; cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}
.btn:hover { background: var(--rosewood-dark); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--rosewood-dark); }
.btn--ghost:hover { background: var(--rosewood); color: #fff; }
.btn--sage { background: var(--sage); border-color: var(--sage); }
.btn--sage:hover { background: #6b8664; }
.btn--sm { padding: .45rem 1rem; font-size: .72rem; }

/* ---------- Portada: la receta de la casa ---------------------------- */

.hero { padding: 2.8rem 0 1rem; }
.hero-card {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  position: relative;
}
.hero-card::before {
  content: ""; position: absolute; inset: 10px; border: 1px solid var(--line); pointer-events: none;
}
.hero-photo { position: relative; min-height: 340px; background: var(--linen); overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo .no-photo {
  position: absolute; inset: 0; display: grid; place-content: center; gap: .4rem; text-align: center;
  font-family: var(--script); font-size: 2rem; color: var(--ink-soft);
}
.hero-body { padding: clamp(1.6rem, 4vw, 3rem); display: flex; flex-direction: column; justify-content: center; }
.eyebrow {
  font-family: var(--util); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--sage); margin: 0 0 .8rem;
}
.hero-body h1 { margin-bottom: .6rem; }
.hero-body p { color: var(--ink-soft); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* Ficha de fichero: la firma visual de la casa */
.recipe-meta {
  list-style: none; display: flex; flex-wrap: wrap; gap: 1.4rem;
  margin: 1.2rem 0 0; padding: 1rem 0 0; border-top: 1px dashed var(--line);
  font-family: var(--util); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft);
}
.recipe-meta strong { display: block; font-family: var(--display); font-size: 1.15rem; letter-spacing: 0; text-transform: none; color: var(--ink); }

/* ---------- Rejilla de recetas --------------------------------------- */

.section { padding: 3rem 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.section-head h2 { margin: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.8rem; }

.card {
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-photo { aspect-ratio: 4 / 3; background: var(--linen); overflow: hidden; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-photo .no-photo {
  height: 100%; display: grid; place-content: center; font-family: var(--script);
  font-size: 1.6rem; color: var(--ink-soft);
}
.card-body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: .4rem; }
.card-body h3 a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover { color: var(--rosewood); }
.card-body p { margin: 0 0 1rem; color: var(--ink-soft); font-size: .95rem; }
.card-foot {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .6rem;
  font-family: var(--util); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft);
  border-top: 1px dashed var(--line); padding-top: .8rem;
}

.tag {
  display: inline-block; font-family: var(--util); font-size: .68rem; letter-spacing: .18em;
  text-transform: uppercase; background: var(--linen); color: var(--rosewood-dark);
  padding: .25rem .7rem; border-radius: 999px; text-decoration: none;
}
.tag:hover { background: var(--butter); color: var(--ink); }

/* Tira de categorías */
.cat-strip { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.cat-chip {
  font-family: var(--util); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: .5rem 1.1rem; text-decoration: none; color: var(--ink);
}
.cat-chip:hover, .cat-chip.is-active { background: var(--sage); border-color: var(--sage); color: #fff; }
.cat-chip small { opacity: .7; }

/* ---------- Ficha de receta ------------------------------------------ */

.recipe-head { text-align: center; padding: 2.6rem 0 1.4rem; max-width: 760px; margin-inline: auto; }
.recipe-head .lead { font-size: 1.1rem; color: var(--ink-soft); }

.recipe-cover { border: 1px solid var(--line); box-shadow: var(--shadow); background: #fff; padding: 10px; }
.recipe-cover img { display: block; width: 100%; }

.recipe-grid { display: grid; grid-template-columns: 320px 1fr; gap: 3rem; padding: 2.6rem 0 1rem; align-items: start; }

/* Tarjeta de ingredientes con pauta, como una ficha de cocina */
.ingredients {
  background:
    repeating-linear-gradient(180deg, transparent 0 33px, var(--line) 33px 34px),
    #fffdf6;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  padding: 1.4rem 1.4rem 1.6rem; position: sticky; top: 1.5rem;
}
.ingredients h2 {
  font-size: 1.35rem; margin: 0 0 1rem; padding-bottom: .4rem;
  border-bottom: 2px solid var(--rosewood); display: inline-block;
}
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li {
  line-height: 34px; padding-left: 1.5rem; position: relative; font-size: .97rem;
}
.ingredients li::before {
  content: "✦"; position: absolute; left: 0; color: var(--sage); font-size: .8rem;
}

.recipe-body h2 { border-bottom: 1px solid var(--line); padding-bottom: .4rem; }
.recipe-body p { margin: 0 0 1.15rem; }
.recipe-body img, .recipe-body video {
  display: block; margin: 1.6rem auto; border: 1px solid var(--line); padding: 8px; background: #fff;
  box-shadow: var(--shadow-sm);
}
.recipe-body figure { margin: 1.6rem 0; }
.recipe-body blockquote {
  margin: 1.6rem 0; padding: .2rem 0 .2rem 1.3rem; border-left: 3px solid var(--butter);
  font-style: italic; color: var(--ink-soft);
}
.recipe-body ol, .recipe-body ul { padding-left: 1.3rem; }
.recipe-body li { margin-bottom: .5rem; }

.notes {
  margin-top: 2rem; background: var(--linen); border: 1px dashed var(--rosewood);
  padding: 1.2rem 1.4rem;
}
.notes h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.notes p { margin: 0; font-style: italic; }

/* ---------- Compartir ------------------------------------------------ */

.share { position: relative; display: inline-block; }
.share-panel {
  position: absolute; z-index: 40; right: 0; top: calc(100% + .6rem);
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: .5rem; min-width: 220px; display: none;
}
.share-panel[data-open="true"] { display: block; }
.share-panel a, .share-panel button {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  font-family: var(--util); font-size: .82rem; padding: .55rem .7rem;
  background: none; border: 0; color: var(--ink); text-decoration: none; cursor: pointer;
}
.share-panel a:hover, .share-panel button:hover { background: var(--linen); }
.share-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .8rem;
  margin: 2.4rem 0 0; padding: 1.2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.share-bar .label {
  font-family: var(--util); font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-soft);
}

.toast {
  position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: .8rem 1.4rem; border-radius: 999px;
  font-family: var(--util); font-size: .85rem; box-shadow: var(--shadow); z-index: 200;
}

/* ---------- Avisos --------------------------------------------------- */

.flashes { list-style: none; margin: 1.2rem auto 0; padding: 0; width: min(var(--wrap), calc(100% - 2.5rem)); }
.flashes li {
  font-family: var(--util); font-size: .9rem; padding: .8rem 1.1rem; margin-bottom: .6rem;
  border-left: 4px solid var(--sage); background: #fff; box-shadow: var(--shadow-sm);
}
.flashes li.error { border-left-color: var(--rosewood); }
.flashes li.warn { border-left-color: var(--butter); }

/* ---------- Paginación ----------------------------------------------- */

.pager { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; }
.pager a, .pager span {
  font-family: var(--util); font-size: .85rem; padding: .45rem .85rem;
  border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink);
}
.pager .is-current { background: var(--rosewood); border-color: var(--rosewood); color: #fff; }

/* ---------- Pie ------------------------------------------------------ */

.footer-band { height: 26px; margin-top: 4rem; }
.site-footer { background: var(--linen); border-top: 1px solid var(--line); padding: 2.6rem 0 2rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h4 {
  font-family: var(--util); font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-soft);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer .logo { font-family: var(--script); font-size: 2.1rem; color: var(--rosewood); }
.colophon {
  text-align: center; font-family: var(--util); font-size: .75rem; letter-spacing: .1em;
  color: var(--ink-soft); padding: 1.6rem 0 2rem;
}

.empty {
  text-align: center; padding: 3rem 1rem; border: 1px dashed var(--line); background: #fff;
}
.empty p { color: var(--ink-soft); }

/* ---------- Responsive ----------------------------------------------- */

@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; }
  .recipe-grid { grid-template-columns: 1fr; gap: 2rem; }
  .ingredients { position: static; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .searchform { margin-left: 0; width: 100%; }
  .searchform input { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .topbar, .mainnav, .share, .share-bar, .site-footer, .footer-band, .btn { display: none !important; }
  body { background: #fff; }
}
