:root {
  --blue: #2175bc;
  --blue-dark: #1a5e9a;
  --blue-hover: #2586d7;
  --maroon: #EC5439;
  --maroon-dark: #B83A24;
  --text: #222;
  --muted: #555;
  --bg-text: #fff;
  --panel: #ffffff;
  --panel-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  --radius: 14px;
  --container: 1100px;
  --gap: 1.25rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.55;
  color: var(--text);
  background: var(--blue);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--maroon); }
a:hover, a:focus { color: var(--maroon-dark); }

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

/* ---------- Layout ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

main { padding-block: 1.5rem; }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--blue);
  padding: 0.5rem 0;
}

.header-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  background: var(--blue);
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
}

.logo img {
  height: clamp(48px, 6vw, 85px);
  width: auto;
  display: block;
}

.site-nav {
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-width: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--blue-dark);
  color: #fff;
  border: none;
  font-family: Verdana, sans-serif;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  min-height: 44px;
}

.nav-toggle::before { content: "\2630"; font-size: 1.2rem; line-height: 1; }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.nav-list li { display: flex; }

.nav-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Verdana, sans-serif;
  font-size: clamp(11px, 1vw, 13px);
  color: #fff;
  text-decoration: none;
  padding: 0 clamp(0.4rem, 0.8vw, 0.9rem);
  background: var(--blue);
  transition: background-color 0.18s ease;
  white-space: nowrap;
  text-align: center;
}

.nav-list a:hover,
.nav-list a:focus {
  background: var(--blue-hover);
}

.nav-list a[aria-current="page"] {
  background: var(--blue-dark);
}

/* ---------- Panel (white card) ---------- */
.panel {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
  padding: clamp(1rem, 3vw, 2rem);
  margin-block: 1rem;
}

.panel h1,
.panel h2 {
  color: var(--maroon);
  font-family: Verdana, sans-serif;
  text-align: center;
  margin: 0 0 1rem;
}

.panel h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
.panel h2 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

.panel p { margin: 0 0 1rem; }

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  color: #fff;
  padding: 1.5rem 1rem;
  font-size: 0.85rem;
}

.site-footer a { color: #fff; text-decoration: underline; }
.site-footer a:hover { color: #ffd; }

/* ---------- Specific page blocks ---------- */
.book-cover {
  max-width: 245px;
  margin: 0 auto 1rem;
}

.book-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 768px) {
  .book-grid { grid-template-columns: 245px 1fr; }
}

.book-index {
  margin: 1rem 0 1rem 1.5rem;
  padding: 0;
  list-style: none;
}

.book-index li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.book-index li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  background: url("../img/BOLPETAL.GIF") no-repeat center / contain;
}

.author-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 768px) {
  .author-grid { grid-template-columns: 1fr 250px; }
}

.author-grid img {
  width: 100%;
  max-width: 250px;
  margin: 0 auto;
}

/* ---------- Opiniones ---------- */
.quote-block {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.5rem 1rem;
  margin: 1.25rem 0;
  align-items: start;
}

.quote-block img {
  width: 50px;
  height: auto;
  justify-self: end;
}

.quote-block .quote-text {
  font-style: italic;
  text-align: justify;
  margin: 0 0 0.25rem;
}

.quote-block .quote-author {
  text-align: right;
  color: var(--maroon);
  font-style: italic;
  margin: 0;
}

.photo-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
  text-align: center;
}

@media (min-width: 600px) {
  .photo-grid { grid-template-columns: 1fr 1fr; }
}

.photo-grid img {
  max-width: 100%;
  margin: 0 auto;
  border-radius: 8px;
}

.jump-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 0.75rem;
  padding: 0.5rem;
  margin: 1rem 0;
  text-align: center;
}

.jump-nav a {
  text-decoration: none;
}

.section-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0.5rem;
}

.section-title h2 { margin: 0; }

/* ---------- Form ---------- */
form.opinion-form {
  max-width: 700px;
  margin: 0 auto;
}

form.opinion-form p { margin: 0.75rem 0; }

form.opinion-form label {
  display: inline-block;
  min-width: 6rem;
  font-weight: bold;
}

form.opinion-form input[type="text"],
form.opinion-form textarea {
  width: 100%;
  max-width: 600px;
  padding: 0.5rem;
  font-family: Verdana, sans-serif;
  font-size: 0.9rem;
  border: 1px solid #aaa;
  border-radius: 4px;
}

form.opinion-form input[type="text"]:focus,
form.opinion-form textarea:focus {
  border-color: var(--blue);
}

form.opinion-form input[type="submit"],
form.opinion-form input[type="reset"] {
  font-family: Verdana, sans-serif;
  color: #000080;
  background: #e8f2ff;
  border: 3px outset var(--blue-hover);
  padding: 0.4rem 1rem;
  margin: 0.25rem;
  cursor: pointer;
  border-radius: 4px;
}

form.opinion-form input[type="submit"]:hover,
form.opinion-form input[type="reset"]:hover {
  background: #d0e4ff;
}

.privacy {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin: 1rem auto;
  max-width: 700px;
}

/* ---------- Libro Circulante ---------- */
.book-circulante-img {
  max-width: 344px;
  margin: 1rem auto;
}

/* ---------- Contacto ---------- */
.country-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #eee;
}

@media (min-width: 600px) {
  .country-row { grid-template-columns: 200px 1fr; }
}

.country-row h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--maroon);
  font-weight: bold;
}

.country-row p { margin: 0; }

.book-covers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.book-covers img {
  max-height: 180px;
  width: auto;
}

/* ---------- Responsive Nav (mobile) ---------- */
@media (max-width: 767px) {
  .header-row {
    flex-wrap: wrap;
  }

  .site-nav {
    flex-basis: 100%;
    order: 3;
  }

  .nav-toggle {
    display: flex;
    width: 100%;
  }

  .site-nav.is-open .nav-toggle::before { content: "\2715"; }

  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .site-nav.is-open .nav-list { display: flex; }

  .nav-list a {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    justify-content: center;
    padding: 0.75rem 1rem;
  }

  .logo img { height: 60px; }
}

@media (max-width: 380px) {
  .logo img { height: 48px; }
}

/* ---------- Home (creative) ---------- */
.home-hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  padding: 2rem 1rem;
  background: url("../img/hero-sky.jpg") center/cover no-repeat;
  overflow: hidden;
  isolation: isolate;
}

/* Subtle dark overlay behind text for readability */
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.25) 0%,
    rgba(0, 0, 0, 0.15) 45%,
    rgba(0, 0, 0, 0.45) 100%
  );
  z-index: 0;
  pointer-events: none;
}

/* The 3D book image composited into the scene */
.home-hero::before {
  content: "";
  position: absolute;
  width: clamp(220px, 32vw, 420px);
  aspect-ratio: 500 / 469;
  right: clamp(-40px, -2vw, 40px);
  top: 50%;
  transform: translateY(-50%) rotate(-6deg);
  background: url("../img/librohercolubus.png") center/contain no-repeat;
  filter: drop-shadow(0 24px 38px rgba(0, 0, 0, 0.55));
  z-index: 1;
  pointer-events: none;
}

.home-hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 0.5rem;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
  letter-spacing: 0.5px;
}

.home-hero p.tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin: 0 0 2rem;
  color: #f4f8ff;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-family: Verdana, sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, var(--blue) 0%, var(--maroon) 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 44px;
}

.btn:hover,
.btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  color: #fff;
}

.btn--alt {
  background: linear-gradient(135deg, #fff 0%, #d8eaff 100%);
  color: var(--maroon);
}

.btn--alt:hover,
.btn--alt:focus {
  color: var(--maroon-dark);
}

@media (max-width: 600px) {
  .home-hero::before {
    width: 55vw;
    opacity: 0.85;
    right: -10vw;
  }
}

/* ---------- Carousel ---------- */
.carousel {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
  min-height: 220px;
}

.carousel-track {
  position: relative;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  padding: 1rem;
  text-align: center;
}

.carousel-slide.is-active { opacity: 1; position: relative; }

.carousel-quote {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-style: italic;
  color: var(--text);
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

.carousel-quote::before { content: "\201C"; color: var(--maroon); margin-right: 0.15em; }
.carousel-quote::after  { content: "\201D"; color: var(--maroon); margin-left: 0.15em; }

.carousel-author {
  color: var(--maroon);
  font-style: italic;
  margin: 0 0 0.75rem;
}

.carousel-cta { margin-top: 1rem; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(33, 117, 188, 0.85);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  z-index: 2;
}

.carousel-btn:hover { background: var(--blue-hover); }
.carousel-btn--prev { left: -8px; }
.carousel-btn--next { right: -8px; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: #ccc;
  cursor: pointer;
  padding: 0;
}

.carousel-dots button.is-active { background: var(--maroon); }

/* ---------- Mission strip ---------- */
.mission-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
}

@media (min-width: 768px) {
  .mission-strip { grid-template-columns: repeat(3, 1fr); }
}

.mission-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.mission-card svg {
  width: 56px;
  height: 56px;
  margin-bottom: 0.5rem;
  fill: var(--maroon);
}

.mission-card h3 {
  color: var(--maroon);
  margin: 0.25rem 0 0.5rem;
  font-size: 1.1rem;
}

.mission-card p { font-size: 0.9rem; margin: 0 0 0.75rem; }

/* ---------- Utility ---------- */
.center { text-align: center; }
.muted { color: var(--muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
