:root {
  --bg: #f2f3f5;
  --paper: #ffffff;
  --ink: #1c2330;
  --muted: #5d6675;
  --accent: #1f4e8c;
  --shadow: rgba(20, 30, 50, .18);
  --shadow-hover: rgba(20, 30, 50, .35);
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --line: rgba(125,125,125,.2);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131a;
    --paper: #1a2029;
    --ink: #e8ebf0;
    --muted: #98a1b0;
    --accent: #7fb0f0;
    --shadow: rgba(0,0,0,.5);
    --shadow-hover: rgba(0,0,0,.75);
    --line: rgba(255,255,255,.1);
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(31,78,140,.06), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============ BOTÓN HAMBURGUESA ============ */
.hamburger {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 60;
  width: 46px;
  height: 46px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--shadow);
  transition: transform .2s ease, border-color .2s ease, opacity .2s ease;
}
.hamburger:hover { transform: scale(1.06); border-color: var(--accent); }
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .3s ease, opacity .2s ease;
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* El hamburger se oculta mientras el drawer está abierto */
body.drawer-open .hamburger {
  opacity: 0;
  pointer-events: none;
}

/* ============ OVERLAY ============ */
.overlay-bg {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, .55);
  z-index: 65;
  opacity: 0;
  transition: opacity .25s ease;
}
.overlay-bg.show { opacity: 1; }

/* ============ DRAWER (PANEL LATERAL) ============ */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(340px, 88vw);
  background: var(--paper);
  border-left: 1px solid var(--line);
  z-index: 70;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2,.7,.3,1);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,.2);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.drawer-title {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

/* X simple, sin borde ni fondo */
.close-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  transition: color .15s ease, transform .15s ease;
}
.close-btn:hover,
.close-btn:focus-visible {
  color: var(--accent);
  transform: scale(1.15);
  outline: none;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px 32px;
}
.drawer-body h4 {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 10px;
}
.drawer-body h4:first-child { margin-top: 0; }

.drawer-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.drawer-list li { margin: 0; }
.drawer-list a {
  display: block;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: .9rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease, padding-left .2s ease;
}
.drawer-list a:hover,
.drawer-list a:focus-visible {
  background: var(--accent);
  color: #fff;
  outline: none;
  padding-left: 18px;
}

.drawer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}
.drawer-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: .9rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.drawer-links a:hover,
.drawer-links a:focus-visible {
  background: var(--accent);
  color: #fff;
  outline: none;
}
.drawer-links svg { flex-shrink: 0; }

/* ============ HEADER ============ */
header {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 96px 20px 8px;
  text-align: center;
}
h1 {
  margin: 0;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: 1;
}
h1::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 20px auto 0;
  border-radius: 2px;
}
.tagline {
  margin: 20px 0 0;
  font-family: var(--sans);
  font-size: .95rem;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ============ ÚLTIMA EDICIÓN CENTRADA ============ */
main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 72px;
}
.ultima-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
.ultima-item {
  display: block;
  width: 100%;
  max-width: 380px;
  text-align: center;
  color: inherit;
  text-decoration: none;
}
.ultima-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 8px;
  border-radius: 6px;
}
.ultima-item .cover {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--paper);
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 18px 42px var(--shadow-hover);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s ease;
}
.ultima-item .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
  position: relative;
  z-index: 1;
}
.ultima-item:hover .cover {
  transform: translateY(-8px);
  box-shadow: 0 26px 54px var(--shadow-hover);
}
.ultima-item:hover .cover img { transform: scale(1.04); }

.num {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.15rem;
  color: #fff;
  background: rgba(0,0,0,.55);
  padding: 4px 11px;
  border-radius: 3px;
  backdrop-filter: blur(4px);
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20,30,50,.5);
  color: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.ultima-item:hover .overlay,
.ultima-item:focus-visible .overlay { opacity: 1; }
.cover.no-img { background: linear-gradient(135deg, #2b3a55, #1f4e8c); }
.cover .fallback {
  position: relative;
  z-index: 1;
  padding: 16px;
  text-align: center;
  color: #fff;
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
}

.ultima-item .title {
  margin-top: 22px;
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
}
.ultima-item .sub {
  color: var(--muted);
  font-family: var(--sans);
  font-size: .95rem;
  margin-top: 6px;
}

/* ============ FOOTER ============ */
footer {
  border-top: 1px solid var(--line);
  padding: 48px 20px 32px;
  background: rgba(0,0,0,.02);
}
@media (prefers-color-scheme: dark) {
  footer { background: rgba(255,255,255,.02); }
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.footer-col h3 {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.footer-col p {
  font-family: var(--sans);
  font-size: .88rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.contacto {
  list-style: none;
  padding: 0;
  margin: 0;
  font-family: var(--sans);
  font-size: .88rem;
  line-height: 1.8;
}
.contacto a,
footer a {
  color: var(--ink);
  text-decoration: none;
  transition: color .2s ease;
}
.contacto a:hover,
footer a:hover { color: var(--accent); text-decoration: underline; }

.ig-footer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: .88rem;
  text-decoration: none;
  transition: color .2s ease;
}
.ig-footer:hover { color: var(--accent); }

.copy {
  max-width: 1100px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-family: var(--sans);
  font-size: .78rem;
  color: var(--muted);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 520px) {
  header { padding-top: 88px; }
  main { padding: 32px 16px 56px; }
  .hamburger { top: 14px; right: 14px; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer, .overlay-bg, .hamburger span,
  .ultima-item .cover, .ultima-item .cover img,
  .overlay { transition: none; }
  .ultima-item:hover .cover { transform: none; }
  .ultima-item:hover .cover img { transform: none; }
}