:root{
  --navy:#07163d;
  --navy2:#0D1B3E;
  --gold:#C9A84C;
  --bg:#f7f4ee;
  --text:#111827;
  --muted:#6b7280;
  --white:#ffffff;
  --border:#e5e7eb;
  --shadow:0 10px 30px rgba(0,0,0,.10);
}

*{
  box-sizing:border-box;
}

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  font-family:Inter, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{
  color:inherit;
  text-decoration:none;
}

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

/* Barra superior */
.topbar{
  background:#061025;
  color:#ffffff;
  padding:8px 7%;
  font-size:13px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
}

/* Navegación */
.nav{
  background:#ffffff;
  min-height:76px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:10px 7%;
  box-shadow:0 2px 16px rgba(0,0,0,.08);
  position:sticky;
  top:0;
  z-index:50;
}

.brand{
  display:flex;
  align-items:center;
  justify-content:center;
  height:62px;
  max-width:210px;
  overflow:hidden;
}

.brand img{
  display:block;
  width:auto !important;
  height:58px !important;
  max-width:200px !important;
  object-fit:contain;
  position:static !important;
}

.menu{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:22px;
  flex-wrap:wrap;
}

.menu a{
  font-size:14px;
  font-weight:700;
  color:var(--navy);
}

.menu a:hover{
  color:var(--gold);
}

/* Hero */
.hero{
  min-height:460px;
  background:
    linear-gradient(rgba(7,22,61,.78),rgba(7,22,61,.88)),
    url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?auto=format&fit=crop&w=1800&q=80');
  background-size:cover;
  background-position:center;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:#ffffff;
  padding:40px 20px;
  position:relative;
  overflow:hidden;
}

.hero-content{
  width:100%;
  max-width:850px;
  margin:0 auto;
  position:relative;
  z-index:2;
}

/* Logo del hero controlado */
.hero-logo{
  width:190px !important;
  max-width:190px !important;
  height:auto !important;
  margin:0 auto 48px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  position:static !important;
  overflow:hidden !important;
}

.hero-logo img{
  display:block !important;
  width:190px !important;
  max-width:190px !important;
  height:auto !important;
  object-fit:contain !important;
  position:static !important;
  filter:drop-shadow(0 8px 20px rgba(0,0,0,.35));
}

.hero h1{
  font-family:Georgia, 'Times New Roman', serif;
  font-size:64px;
  line-height:1;
  margin:0 0 14px;
  letter-spacing:.5px;
}

.hero h2{
  color:var(--gold);
  font-size:27px;
  margin:0 0 18px;
  font-weight:700;
}

.hero p{
  max-width:720px;
  margin:0 auto 28px;
  font-size:17px;
  line-height:1.6;
}

/* Botones */
.btn{
  display:inline-block;
  padding:14px 24px;
  border-radius:10px;
  font-weight:900;
  margin:6px;
  border:1px solid rgba(255,255,255,.55);
  transition:.2s ease;
}

.btn:hover{
  transform:translateY(-2px);
}

.btn.gold{
  background:var(--gold);
  color:#1f2937;
  border:0;
}

.btn.outline{
  color:#ffffff;
  background:transparent;
}

/* Buscador */
.search-section{
  max-width:1100px;
  margin:90px auto 30px;
  background:transparent;
  text-align:center;
  padding:0 20px;
  position:relative;
  z-index:5;
}

.search-section h2{
  font-family:Georgia, 'Times New Roman', serif;
  font-size:38px;
  color:var(--navy);
  margin:0 0 18px;
}

.search-box{
  max-width:720px;
  margin:auto;
  display:flex;
  background:#ffffff;
  border-radius:12px;
  overflow:hidden;
  box-shadow:var(--shadow);
  border:1px solid var(--border);
}

.search-box input{
  flex:1;
  padding:18px;
  border:0;
  outline:0;
  font-size:15px;
  background:#ffffff;
}

.search-box button{
  width:70px;
  border:0;
  background:var(--navy);
  color:#ffffff;
  font-size:20px;
  cursor:pointer;
}

.chips{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:12px;
  margin-top:20px;
}

.chips span{
  background:#ffffff;
  border:1px solid #dddddd;
  padding:9px 16px;
  border-radius:9px;
  font-weight:800;
  font-size:13px;
  box-shadow:0 4px 12px rgba(0,0,0,.04);
}

/* Estructura */
main{
  width:100%;
}

.wrap{
  max-width:1200px;
  margin:0 auto;
  padding:38px 20px;
}

.section-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:20px;
  margin-bottom:18px;
}

.section-head p{
  margin:0;
  color:var(--muted);
}

.section-head a{
  font-weight:800;
  color:var(--navy);
}

.section-title{
  font-family:Georgia, 'Times New Roman', serif;
  font-size:34px;
  color:var(--navy);
  margin:0 0 6px;
}

.grid{
  display:grid;
  gap:22px;
}

/* Obras */
.books-grid{
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
}

.book-card{
  background:#ffffff;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 8px 22px rgba(0,0,0,.08);
  transition:.2s ease;
  border:1px solid rgba(0,0,0,.05);
}

.book-card:hover{
  transform:translateY(-4px);
}

.book-cover{
    width:100%;
    height:320px;
    background:#f4f4f4;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    padding:12px;
}

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

.no-cover{
  color:#777777;
  font-weight:700;
}

.book-body{
  padding:14px;
  text-align:center;
}

.book-body h3{
  font-size:15px;
  margin:0 0 6px;
  color:var(--text);
}

.book-body p{
  color:var(--muted);
  font-size:13px;
  margin:0 0 8px;
}

.book-body small{
  display:block;
  color:var(--gold);
  font-weight:800;
  margin-bottom:12px;
}

.mini-btn{
  border:1px solid #dddddd;
  padding:8px 14px;
  display:inline-block;
  border-radius:7px;
  font-weight:800;
  font-size:13px;
  color:var(--navy);
  background:#ffffff;
}

.mini-btn:hover{
  background:var(--navy);
  color:#ffffff;
}

/* Autores */
.authors-grid{
  grid-template-columns:repeat(auto-fit,minmax(170px,1fr));
}

.author-card{
  background:#ffffff;
  border-radius:12px;
  padding:24px;
  text-align:center;
  box-shadow:0 8px 22px rgba(0,0,0,.08);
  border:1px solid rgba(0,0,0,.05);
}

.avatar{
  width:86px;
  height:86px;
  background:var(--navy);
  color:#ffffff;
  border-radius:50%;
  margin:0 auto 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:34px;
  font-weight:900;
  overflow:hidden;
}

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

.author-card h3{
  margin:0 0 6px;
  color:var(--navy);
  font-size:17px;
}

.author-card p{
  margin:0;
  color:var(--muted);
}

.author-card small{
  display:block;
  color:var(--gold);
  margin-top:6px;
  font-weight:800;
}

/* Biblioteca */
.library-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:18px;
}

.library-grid div{
  background:#ffffff;
  padding:24px;
  border-radius:12px;
  text-align:center;
  box-shadow:0 8px 22px rgba(0,0,0,.07);
  border:1px solid rgba(0,0,0,.05);
  font-size:28px;
}

.library-grid strong{
  display:block;
  margin:10px 0 5px;
  color:var(--navy);
  font-size:18px;
}

.library-grid span{
  color:var(--muted);
  font-size:13px;
}

/* Novedades */
.news-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:20px;
}

.news-grid article{
  background:#ffffff;
  padding:24px;
  border-radius:12px;
  box-shadow:0 8px 22px rgba(0,0,0,.07);
  border:1px solid rgba(0,0,0,.05);
}

.news-grid h3{
  color:var(--navy);
  margin-top:0;
}

/* CTA */
.cta{
  max-width:1200px;
  margin:40px auto;
  background:
    linear-gradient(90deg,rgba(7,22,61,.95),rgba(7,22,61,.75)),
    url('https://images.unsplash.com/photo-1455390582262-044cdead277a?auto=format&fit=crop&w=1600&q=80');
  background-size:cover;
  background-position:center;
  color:#ffffff;
  border-radius:18px;
  padding:54px;
}

.cta h2{
  font-family:Georgia, 'Times New Roman', serif;
  font-size:36px;
  margin:0 0 10px;
}

.cta p{
  max-width:650px;
  line-height:1.7;
}

/* Sobre */
.about{
  background:#ffffff;
  border-radius:18px;
  padding:38px;
  margin-bottom:40px;
  box-shadow:0 8px 22px rgba(0,0,0,.06);
}

.about h2{
  font-family:Georgia, 'Times New Roman', serif;
  color:var(--navy);
  font-size:32px;
  margin-top:0;
}

.about p{
  line-height:1.8;
}

/* Footer */
.footer{
  background:#061025;
  color:#ffffff;
  padding:42px 7%;
  display:grid;
  grid-template-columns:2fr 1fr 1fr 1.5fr;
  gap:30px;
}

.footer h3,
.footer h4{
  margin-top:0;
  color:#ffffff;
}

.footer p{
  color:#d1d5db;
  line-height:1.7;
}

/* Mensajes vacíos */
.empty{
  background:#ffffff;
  border:1px dashed #cccccc;
  border-radius:14px;
  padding:28px;
  color:var(--muted);
}

/* Seguridad contra logos sueltos */
body > img,
.hero > img,
main > img{
  display:none !important;
}

/* Responsive */
@media(max-width:1000px){
  .nav{
    flex-direction:column;
    height:auto;
    gap:14px;
  }

  .menu{
    justify-content:center;
    gap:14px;
  }
}

@media(max-width:900px){
  .topbar{
    flex-direction:column;
    text-align:center;
  }

  .hero{
    min-height:520px;
    padding:55px 18px;
  }

  .hero h1{
    font-size:42px;
  }

  .hero h2{
    font-size:22px;
  }

  .section-head{
    display:block;
  }

  .footer{
    grid-template-columns:1fr;
  }
}

@media(max-width:600px){
  .hero-logo{
    width:145px !important;
    max-width:145px !important;
  }

  .hero-logo img{
    width:145px !important;
    max-width:145px !important;
  }

  .brand img{
    height:48px !important;
    max-width:160px !important;
  }

  .search-section h2{
    font-size:30px;
  }

  .search-box{
    flex-direction:row;
  }

  .books-grid,
  .authors-grid{
    grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  }

  .cta{
    margin:30px 20px;
    padding:34px 24px;
  }

  .about{
    margin:20px;
    padding:28px;
  }
}
.public-nav-tools{
  max-width:1200px;
  margin:24px auto 0;
  padding:0 20px;
  display:flex;
  gap:12px;
}

.public-nav-tools a,
.public-nav-tools button{
  background:#0D1B3E;
  color:white;
  border:0;
  padding:10px 16px;
  border-radius:9px;
  font-weight:800;
  cursor:pointer;
  font-size:14px;
}

.breadcrumb{
  max-width:1200px;
  margin:14px auto 0;
  padding:0 20px;
  display:flex;
  gap:8px;
  align-items:center;
  color:#6b7280;
  font-size:14px;
}

.breadcrumb a{
  color:#0D1B3E;
  font-weight:800;
}

.breadcrumb strong{
  color:#111827;
}
/* AJUSTES OBRA.PHP */

.obra-hero{
  max-width:1200px;
  margin:30px auto;
  padding:0 20px;
}

.obra-hero-inner{
  background:#fff;
  border-radius:22px;
  padding:34px;
  display:grid;
  grid-template-columns:320px 1fr;
  gap:38px;
  align-items:start;
  box-shadow:0 10px 30px rgba(0,0,0,.10);
}

.obra-cover-card{
  width:320px;
  max-width:100%;
  background:#f4f4f4;
  border-radius:18px;
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.obra-cover-card img{
  width:auto !important;
  max-width:100% !important;
  max-height:460px !important;
  object-fit:contain !important;
  display:block;
  border-radius:12px;
}

.obra-main-info h1{
  font-family:Georgia,serif;
  font-size:42px;
  color:#07163d;
  margin:12px 0;
}

.obra-main-info h2{
  color:#6b7280;
  font-size:22px;
  margin:0 0 16px;
}

.obra-badge{
  display:inline-block;
  background:#C9A84C;
  color:#111827;
  padding:8px 14px;
  border-radius:999px;
  font-weight:900;
  font-size:13px;
}

.obra-author a{
  color:#0D1B3E;
  font-weight:900;
}

.obra-lead{
  font-size:17px;
  line-height:1.7;
  color:#374151;
}

.obra-share{
  margin-top:22px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.obra-share span{
  font-weight:900;
  color:#07163d;
}

.obra-share a{
  background:#0D1B3E;
  color:white !important;
  padding:9px 14px;
  border-radius:9px;
  font-weight:800;
  font-size:14px;
}

.obra-section{
  max-width:1200px;
  margin:0 auto;
  padding:20px;
}

.obra-layout{
  display:grid;
  grid-template-columns:1fr 340px;
  gap:28px;
  align-items:start;
}

.obra-panel{
  background:#fff;
  border-radius:18px;
  padding:28px;
  margin-bottom:24px;
  box-shadow:0 8px 24px rgba(0,0,0,.08);
}

.obra-panel h2{
  font-family:Georgia,serif;
  color:#07163d;
  margin-top:0;
}

.obra-panel p{
  line-height:1.8;
}

.obra-data-list div{
  border-bottom:1px solid #e5e7eb;
  padding:12px 0;
}

.obra-data-list strong{
  display:block;
  color:#07163d;
  margin-bottom:4px;
}

.obra-data-list span{
  color:#374151;
}

.obra-buy-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.obra-buy-list a{
  background:#C9A84C;
  color:#111827 !important;
  padding:12px 16px;
  border-radius:10px;
  font-weight:900;
  text-align:center;
}

.author-mini-box{
  display:grid;
  grid-template-columns:100px 1fr;
  gap:18px;
  align-items:start;
}

.public-nav-tools,
.breadcrumb{
  max-width:1200px;
}

@media(max-width:900px){
  .obra-hero-inner{
    grid-template-columns:1fr;
  }

  .obra-cover-card{
    width:100%;
  }

  .obra-cover-card img{
    max-height:380px !important;
  }

  .obra-layout{
    grid-template-columns:1fr;
  }

  .author-mini-box{
    grid-template-columns:1fr;
  }
}
.recurso-card {
    position: relative;
    z-index: 1;
}

.external-btn {
    position: relative;
    z-index: 5;
    pointer-events: auto !important;
    cursor: pointer;
    display: block;
    width: 100%;
    margin-top: auto;
    padding: 13px 16px;
    border-radius: 10px;
    background: #0d1b3e;
    color: #ffffff !important;
    text-align: center;
    font-weight: 800;
    text-decoration: none;
}

.external-btn:hover {
    background: #c9a84c;
    color: #111827 !important;
}

.external-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.recurso-card {
    position: relative;
    z-index: 1;
}

.external-btn {
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
    cursor: pointer;
    display: block;
    width: 100%;
    margin-top: auto;
    padding: 13px 16px;
    border-radius: 10px;
    background: #0d1b3e;
    color: #fff !important;
    text-align: center;
    font-weight: 800;
    text-decoration: none;
}

.external-btn:hover {
    background: #c9a84c;
    color: #111827 !important;
}

.external-disabled {
    opacity: .55;
    cursor: not-allowed;
}
