@import url('../../vendor/fonts/ola-slug-fonts.css');
@import url('ola-nav-arrows.css');

:root {
    --audio-blue: #6F98EC;
    --audio-blue-dark: #4a74cc;
    --audio-blue-pale: #eaf1fc;
    --wave-gray: #E9EDF5;
    --ink: #0d0d0d;
    --paper: #ffffff;
    --card-shadow: rgba(15, 20, 40, 0.15);
    --ola-nav-h: 72px;
    --ola-banner-h: 41px;
}

* {
    box-sizing: border-box;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.site-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}
.site-nav-logo-img {
  height: 38px;
  width: auto;
  display: block;
}
.site-nav-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink);
  white-space: nowrap;
  transition: color 0.25s ease;
}
.site-nav-logo:hover .site-nav-title {
  color: var(--audio-blue);
}
.site-nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  align-items: center;
}
.site-nav-links a {
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: color 0.2s;
}
.site-nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--audio-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.site-nav-links a:hover,
.site-nav-links a.active {
  color: var(--audio-blue);
}
.site-nav-links a:hover::after,
.site-nav-links a.active::after {
  transform: scaleX(1);
}

.site-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.site-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: all 0.3s ease;
}
.site-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-hamburger.open span:nth-child(2) { opacity: 0; }
.site-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}
.site-mobile-menu.open { display: flex; }
.site-mobile-menu a {
  font-family: "Inter", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}
.site-mobile-menu a:hover { color: var(--audio-blue); }

@media (max-width: 900px) {
  .site-nav-links { display: none; }
  .site-hamburger { display: flex; }
}

body {
    margin: 0;
    background-color: var(--audio-blue-pale);
    font-family: 'Poppins', sans-serif;
    color: var(--ink);
    padding-top: calc(var(--ola-nav-h) + var(--ola-banner-h));
    padding-bottom: var(--ola-banner-h);
}

/* ---------- HEADER ---------- */

.titulos-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2.5rem 3rem;
    background-color: var(--wave-gray);
    border-bottom: 6px solid var(--audio-blue-dark);
    position: relative;
    overflow: hidden;
}

.wave-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

.wave-layer-back {
    fill: #AFC6F2;
    opacity: 0.35;
}

.wave-layer-mid {
    fill: #7FA3ED;
    opacity: 0.55;
}

.wave-layer-front {
    fill: var(--audio-blue);
    opacity: 0.9;
}

.header-logo-link {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.header-text {
    position: relative;
    z-index: 1;
}

.header-logo {
    height: 64px;
    width: auto;
}

..header-kicker {
    margin: 0;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: #000000;
    font-weight: 600;
}

.header-title {
    margin: 0.25rem 0;
    font-family: 'Playfair Display', serif;
    font-size: 2.75rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.header-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #ffffff;
    opacity: 0.85;
    text-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* ---------- ERA DESCRIPTION ---------- */

.era-description {
    max-width: 700px;
    margin: 2rem auto 0;
    padding: 0 2rem;
    text-align: center;
}

.era-description p {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
    font-style: italic;
}

/* ---------- TAPESTRY GRID ---------- */

#tapestry {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    padding: 3rem;
    overflow: hidden;
}

#tapestry::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../../Images/logo-wallpaper-blue-quad.png');
    background-repeat: repeat;
    background-position: top left;
    background-size: 640px auto;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}

#tapestry .book {
    z-index: 1;
}

.book {
    width: 260px;
    background-color: var(--paper);
    border: 2px solid var(--audio-blue);
    border-radius: 6px;
    box-shadow: 0 6px 14px var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.book-placeholder {
    width: 100%;
    height: 360px;
    background-color: var(--audio-blue-pale);
    border-bottom: 3px solid var(--audio-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    color: var(--audio-blue-dark);
    font-size: 0.85rem;
    font-style: italic;
    overflow: hidden;
    cursor: pointer;
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.listen-btn {
    display: block;
    background-color: var(--audio-blue);
    color: #ffffff;
    text-align: center;
    padding: 0.65rem 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.listen-btn:hover {
    background-color: var(--audio-blue-dark);
}

.book-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem 1rem;
    background-color: var(--audio-blue-pale);
}

.book-info h3 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--ink);
    /* Reserve room for 2 lines so 1-line and 2-line titles take up the
       same height — keeps the ESCUCHAR AHORA button aligned to the same
       row across every card, regardless of title length. */
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rating {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    background-color: #000000;
    border: 1px solid var(--audio-blue);
}

.rating-feather {
    height: 26px;
    width: auto;
    display: block;
}

/* Hover tooltip: "Pluma de quetzal" appears above the feather icon */
.feather-tip {
    position: relative;
    display: inline-block;
    line-height: 0;
}
.feather-tip::after {
    content: "Pluma de quetzal";
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: #000000;
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 50;
}
.feather-tip:hover::after {
    opacity: 1;
}

.rating.green {
    color: #ffffff;
    border-color: #1e9e5a;
}

.rating.orange {
    color: #ffffff;
    border-color: #d98c1f;
}

.rating.red {
    color: #ffffff;
    border-color: #d9422f;
}

.review {
    background-color: var(--audio-blue-dark);
    color: #ffffff;
    padding: 1.5rem;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transform: translateY(101%);
    transition: transform 0.4s ease-in, opacity 0.4s ease-in;
}

.review h3 {
    margin-top: 0;
    font-family: 'Playfair Display', serif;
}

.book.is-open .review {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* ---------- FOOTER ---------- */

.titulos-footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--audio-blue);
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-link:hover {
    text-decoration: underline;
}

.footer-links {
    margin-top: 1rem;
}

/* ---------- MAYA BANNER (Audiolibros blue) ----------
   Top strip is fixed in the gap between .site-nav and .titulos-header
   (the wave section) — NOT pinned to the very top of the viewport like
   the rest of the site. .site-nav itself is untouched/unmoved; instead
   .titulos-header (and everything after it) is pushed down to make
   room, via the body padding-top above. Bottom strip is fixed under
   everything, below the footer, same as the rest of the site. */
.ola-banner {
    position: fixed;
    left: 0;
    width: 100%;
    height: var(--ola-banner-h);
    z-index: 90;
    overflow: hidden;
    background: #000;
}

.ola-banner-top {
    top: var(--ola-nav-h);
}

.ola-banner-bottom {
    bottom: 0;
    z-index: 200;
}

.ola-banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    :root {
        --ola-banner-h: 27px;
    }
}