/* archivo-colonial.css - Premium Aesthetics */

:root {
  --ac-primary: #8a1d2d;     /* Deep colonial red styling */
  --ac-primary-hover: #b02a3f;
  --ac-surface: #ffffff;
  --ac-surface-secondary: #f4f5f7;
  --ac-border: #e0e4e8;
  --ac-text: #2c3e50;
  --ac-text-muted: #64748b;
  --ac-transition: all 0.25s ease-in-out;
  --ac-shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
  --ac-shadow-md: 0 8px 16px rgba(0,0,0,0.06);
  --ac-shadow-hover: 0 12px 24px rgba(138, 29, 45, 0.12);
  --ac-radius: 12px;
}

body {
  color: var(--ac-text);
}

/* ========================================================
   1. Homepage & General Layouts
======================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.home-intro {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeInDown 0.6s ease-out;
}

.home-intro h1 {
  font-size: 2.8rem;
  letter-spacing: -0.5px;
  color: var(--ac-primary);
  margin-bottom: 1rem;
}

.home-logo {
  max-width: 250px;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: var(--ac-shadow-md);
  border: 4px solid var(--ac-surface);
  transition: var(--ac-transition);
}

.home-logo:hover {
  transform: scale(1.02);
  box-shadow: var(--ac-shadow-hover);
}

.home-manuscrito {
  width: 90%;
  max-width: 450px;
  display: block;
  margin: 1.5rem auto 2.5rem auto;
  border-radius: 8px;
  box-shadow: var(--ac-shadow-md);
  border: 4px solid var(--ac-surface);
  transition: var(--ac-transition);
}

.home-manuscrito:hover {
  transform: scale(1.02);
  box-shadow: var(--ac-shadow-hover);
}

.home-footer-img {
  text-align: center;
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px dashed var(--ac-border);
}

/* Stats Cards */
.home-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out;
}

.stat-box {
  background: var(--ac-surface);
  padding: 2rem;
  border-radius: var(--ac-radius);
  text-align: center;
  min-width: 180px;
  box-shadow: var(--ac-shadow-md);
  border: 1px solid rgba(0,0,0,0.02);
  transition: var(--ac-transition);
}

.stat-box:hover {
  transform: translateY(-5px);
  box-shadow: var(--ac-shadow-hover);
  border-color: rgba(138, 29, 45, 0.2);
}

.stat-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--ac-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ac-text-muted);
}

/* Hero Buttons */
.home-buttons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.home-buttons .btn {
  background: var(--ac-primary);
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--ac-transition);
  box-shadow: 0 4px 6px rgba(138, 29, 45, 0.2);
}

.home-buttons .btn:hover {
  background: var(--ac-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(138, 29, 45, 0.3);
}

/* Zenodo Datasets Section */
.zenodo-datasets {
  background: var(--ac-surface-secondary);
  padding: 3rem;
  border-radius: var(--ac-radius);
  margin-bottom: 4rem;
  text-align: center;
  border: 1px solid var(--ac-border);
  animation: fadeInUp 1s ease-out;
}

.zenodo-datasets h2 {
  color: var(--ac-primary);
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.zenodo-datasets p {
  margin-bottom: 2.5rem;
  color: var(--ac-text-muted);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.doi-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1rem;
  text-align: left;
}

.doi-list li {
  background: var(--ac-surface);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--ac-shadow-sm);
  transition: var(--ac-transition);
  border: 1px solid transparent;
}

.doi-list li:hover {
  transform: translateY(-2px);
  box-shadow: var(--ac-shadow-md);
  border-color: var(--ac-primary);
}

.doi-list li span {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ac-text);
}

.doi-list a img {
  display: block;
  height: 20px;
}

/* ========================================================
   2. Catalog Table & Filters
======================================================== */
.list-header h1 {
  font-size: 2.2rem;
  color: var(--ac-primary);
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--ac-surface-secondary);
  padding-bottom: 0.5rem;
}

.list-container {
  width: 96%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 2rem;
}

.catalog-filters {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  background: var(--ac-surface);
  padding: 1.5rem;
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow-md);
  align-items: flex-end;
  border: 1px solid rgba(0,0,0,0.03);
}

.filter-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ac-text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--ac-border);
  border-radius: 8px;
  background: var(--ac-surface-secondary);
  font-size: 1rem;
  color: var(--ac-text);
  transition: var(--ac-transition);
  outline: none;
  font-family: inherit;
  appearance: none;
}

.filter-group input::placeholder {
  color: #94a3b8;
}

.filter-group select:focus,
.filter-group input:focus {
  border-color: var(--ac-primary);
  background: var(--ac-surface);
  box-shadow: 0 0 0 3px rgba(138, 29, 45, 0.1);
}

/* Table Styling */
.table-wrapper {
  background: var(--ac-surface);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow-sm);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
}

.catalog-table {
  width: unset;
  margin: 0 auto;
  border-collapse: collapse;
  text-align: left;
}

.catalog-table th {
  background: var(--ac-surface-secondary);
  color: var(--ac-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  padding: 1.25rem 1rem;
  border-bottom: 2px solid var(--ac-border);
  user-select: none;
}

.catalog-table th.sortable {
  cursor: pointer;
  transition: var(--ac-transition);
}

.catalog-table th.sortable:hover {
  background: #e2e8f0;
  color: var(--ac-text);
}

.catalog-table th.asc::after { content: " ▼"; opacity: 0.5;}
.catalog-table th.desc::after { content: " ▲"; opacity: 0.5;}

.catalog-table td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--ac-border);
  color: var(--ac-text);
  vertical-align: middle;
}

.catalog-table tbody tr {
  transition: var(--ac-transition);
}

.catalog-table tbody tr:hover {
  background-color: #fafbfa;
  transform: scale(1.002);
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
  position: relative;
  z-index: 10;
}

.catalog-table td a {
  color: var(--ac-primary);
  text-decoration: none;
  font-weight: 500;
}

.catalog-table td a:hover {
  text-decoration: underline;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ac-surface-secondary);
  transition: var(--ac-transition);
  font-size: 1.1rem;
}

.catalog-table tr:hover .btn-link {
  background: var(--ac-primary);
  color: #fff;
  transform: translateX(3px);
}

/* ========================================================
   3. Single Obra Page
======================================================== */
.obra-header {
  margin-bottom: 2rem;
}

.obra-header h1 {
  font-size: 1.4rem;
  color: var(--ac-text);
  border-left: 4px solid var(--ac-primary);
  padding-left: 0.75rem;
  line-height: 1.25;
  margin-top: 0;
}

.obra-single {
  width: 96%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 2rem;
}

.obra-content {
  display: grid;
  grid-template-columns: 320px 1fr;
  grid-template-rows: auto 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
  align-items: start;
}

.obra-meta {
  grid-column: 1;
  grid-row: 1;
}

.obra-downloads {
  grid-column: 1;
  grid-row: 2;
}

.obra-viewer {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* Meta Data Sidebar */
.obra-meta, .obra-downloads {
  background: var(--ac-surface);
  padding: 1.5rem;
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow-md);
  border: 1px solid rgba(0,0,0,0.04);
}

.obra-meta h3, .obra-downloads h3 {
  font-size: 1.3rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--ac-primary);
  border-bottom: 2px solid var(--ac-surface-secondary);
  padding-bottom: 0.75rem;
}

.obra-meta dl dt {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--ac-text-muted);
  font-weight: 700;
  margin-top: 1.5rem;
  letter-spacing: 0.5px;
}

.obra-meta dl dd {
  margin: 0.25rem 0 0 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ac-text);
}

/* --- Catalog list thumbnails ------------------------------------------ */
.catalog-thumb-cell {
  width: 80px;
  text-align: center;
  vertical-align: middle;
  padding: 0.5rem;
}

.catalog-thumb {
  display: block;
  width: 60px;
  height: 80px;
  object-fit: cover;
  object-position: top center;
  border-radius: 4px;
  border: 1px solid var(--ac-border);
  box-shadow: var(--ac-shadow-sm);
  transition: var(--ac-transition);
}

.catalog-table tbody tr:hover .catalog-thumb {
  box-shadow: var(--ac-shadow-md);
  border-color: var(--ac-primary);
}

/* --- Single obra page thumbnail --------------------------------------- */
.obra-thumbnail {
  margin: -2rem -2rem 1.5rem -2rem; /* bleed to card edges */
  border-radius: var(--ac-radius) var(--ac-radius) 0 0;
  overflow: hidden;
  line-height: 0;
}

.obra-thumb-img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: top center;
}

/* --- Download button size label --------------------------------------- */
.dl-size {
  font-size: 0.8rem;
  font-weight: 400;
  opacity: 0.7;
  margin-left: 0.35rem;
}

/* Downloads Section */
.obra-downloads {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--ac-border);
}

.download-btn {
  display: flex !important;
  align-items: center;
  padding: 0.4rem;
  margin-bottom: 0.75rem;
  font-size: 0.65em;
  border-radius: 8px;
  background: var(--ac-surface-secondary);
  color: var(--ac-text) !important;
  text-decoration: none;
  font-weight: 600;
  transition: var(--ac-transition);
  border: 1px solid var(--ac-border);
}

.download-btn:hover {
  background: var(--ac-primary);
  color: #fff !important;
  border-color: var(--ac-primary);
  box-shadow: var(--ac-shadow-sm);
  transform: translateY(-2px);
}

/* Nav */
.obra-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.obra-navigation a {
  padding: 0.75rem 1.5rem;
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 50px;
  color: var(--ac-text);
  font-weight: 600;
  font-size: 1rem !important;
  text-decoration: none;
  transition: var(--ac-transition);
  box-shadow: var(--ac-shadow-sm);
}

.obra-navigation a:hover {
  background: var(--ac-primary);
  color: #fff;
  border-color: var(--ac-primary);
}

.sidebar-nav {
  margin-top: 0;
  margin-bottom: 2rem;
  gap: 0.5rem;
}

.sidebar-nav a {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  flex: 1;
  text-align: center;
}

/* ========================================================
   4. PDF Viewer (Sleek Pills)
======================================================== */
/* Sidebar PDF resolutions */
.pdf-resolution-sidebar {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--ac-border);
}

.pdf-resolution-sidebar h3 {
  border: none;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0;
}

.sidebar-pills {
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  border: none;
  background: transparent;
}

.sidebar-pills .res-pill {
  width: 100%;
}

.sidebar-pills .pill-text {
  display: block;
  text-align: center;
  border: 1px solid var(--ac-border);
  background: var(--ac-surface-secondary);
}

.sidebar-pills input[type="radio"]:checked + .pill-text {
  border-color: var(--ac-primary);
}

.pdf-viewer-container {
  background: var(--ac-surface);
  border-radius: var(--ac-radius);
  box-shadow: var(--ac-shadow-md);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 4rem);
  min-height: 600px;
}

.pdf-resolution-selector {
  background: var(--ac-surface);
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--ac-border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.resolution-label {
  font-weight: 600;
  color: var(--ac-text-muted);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.resolution-pills {
  display: flex;
  gap: 0.5rem;
  padding: 0.25rem;
}

.res-pill {
  cursor: pointer;
  margin: 0;
  position: relative;
}

.res-pill input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pill-text {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ac-text-muted);
  transition: var(--ac-transition);
}

.res-pill:hover .pill-text {
  color: var(--ac-text);
}

.res-pill input[type="radio"]:checked + .pill-text {
  background: var(--ac-primary);
  color: #fff;
  box-shadow: 0 2px 4px rgba(138, 29, 45, 0.2);
}

#pdf-iframe {
  border: none;
  display: block;
  background: #525659; /* PDF.js default dark background */
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
  .obra-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .obra-meta {
    grid-column: 1;
    grid-row: 1;
  }
  .obra-viewer {
    grid-column: 1;
    grid-row: 2;
  }
  .obra-downloads {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none;
  }
  .catalog-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
  }
  .filter-group {
    min-width: 0;
  }
  .filter-search {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
  }
  .sidebar-pills {
    flex-direction: row;
    flex-wrap: nowrap;
  }
  .sidebar-pills .res-pill {
    flex: 1;
  }
  .sidebar-pills .pill-text {
    padding: 0.5rem 0.25rem;
    font-size: 0.8rem;
  }
  .list-container, .obra-single {
    padding: 1rem 0.5rem;
  }
  .obra-meta, .obra-downloads {
    padding: 1.5rem 1rem;
  }
  
  /* Mobile table optimizations */
  .catalog-table th, .catalog-table td {
    padding: 0.85rem 0.5rem;
  }
  .catalog-table tbody tr {
    position: relative;
  }
  .catalog-table tbody td a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
  }
}


.site-tagline {
    font-size: 0.55em;         
    font-weight: normal;       
    font-family: 'Arial', sans-serif; 
    color: #666666;            
    margin-left: 10px;        
    vertical-align: baseline;  
}

.site-tagline::before {
    content: "| ";
    margin-right: 5px;
    color: #ccc; /* Puedes ponerle un color más suave al separador */
}


/* 2. Estilos para móviles */
@media (max-width: 768px) {
    .myname {
        width: 100%;
        text-align: center;  /* <--- Centra todo el contenedor (título incluido) */
    }

    ul.navbar {
        padding-inline-start: 0;
        padding-left: 0; 
        justify-content: center;
        font-size: 0.9em;
    }

    .site-tagline {
        display: block;      
        margin-left: 0;      
        margin-top: 5px;     
    }
    
    /* Oculta el separador en móviles */
    .site-tagline::before {
        content: ""; 
        margin-right: 0;
    }
}


/* ========================================================
   5. Theme Overrides
======================================================== */
/* Hide the default theme search icon since we have a powerful custom one */
li:has(#search-button), #search-button {
  display: none !important;
}
