/*
 Theme Name: GeneratePress Child
 Theme URI: https://openlibro.com
 Description: Tema hijo para OpenLibro — estilo neo-brutalista
 Author: OpenLibro
 Author URI: https://openlibro.com
 Template: generatepress
 Version: 2.0
*/

/* ═══════════════════════════════════════════
   VARIABLES
═══════════════════════════════════════════ */
:root {
  --bg:        #f5f0e8;
  --paper:     #fffdf7;
  --ink:       #1a1208;
  --accent:    #c8430a;
  --green:     #2d6a4f;
  --hi:        #fff3b0;
  --muted:     #8a7c6a;
  --rule:      #d4c8b0;
  --shadow:    4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --border:    2px solid var(--ink);
}

/* ═══════════════════════════════════════════
   BASE
═══════════════════════════════════════════ */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Mono', monospace;
  padding: 6px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: background 0.12s;
}
a:hover {
  background: var(--hi);
  outline: 2px solid var(--ink);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Mono', monospace;
  color: var(--ink);
  line-height: 1.15;
}

/* ═══════════════════════════════════════════
   MARCO EDITORIAL
═══════════════════════════════════════════ */
body > * {
  outline: 2px solid var(--ink);
}

@media (min-width: 768px) {
  body {
    padding: 14px;
  }
  body > * {
    outline: 2px solid var(--ink);
    margin-left: 4px;
    margin-right: 4px;
  }
  .site-content,
  .content-area,
  .site-main {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ═══════════════════════════════════════════
   CONTENEDOR
═══════════════════════════════════════════ */
.ol-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ═══════════════════════════════════════════
   BUSCADOR
═══════════════════════════════════════════ */
.ol-search {
  padding: 2.5rem 0;
  text-align: center;
}

.ol-search input[type="search"] {
  width: 100%;
  max-width: 600px;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-family: 'Space Mono', monospace;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow);
  border-radius: 0;
  outline: none;
  transition: box-shadow 0.12s;
}

.ol-search input[type="search"]:focus {
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--hi);
}

/* ═══════════════════════════════════════════
   SECCIONES
═══════════════════════════════════════════ */
.ol-section      { padding: 3rem 0; }
.ol-section-soft { background: var(--paper); border-top: var(--border); border-bottom: var(--border); }

.ol-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--ink);
  display: inline-block;
}

/* ═══════════════════════════════════════════
   GRID DE LIBROS
═══════════════════════════════════════════ */
.ol-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.ol-book-card {
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.1s, box-shadow 0.1s;
  border-radius: 0;
}

.ol-book-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  background: var(--hi);
}

.ol-book-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: var(--border);
  filter: sepia(8%);
}

.ol-book-title {
  font-size: 0.88rem;
  font-family: 'Space Mono', monospace;
  padding: 0.65rem 0.75rem;
  line-height: 1.35;
  color: var(--ink);
}

/* ═══════════════════════════════════════════
   BOTÓN PRINCIPAL
═══════════════════════════════════════════ */
.ol-more { margin-top: 2rem; text-align: center; }

.ol-button {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 0;
  background: var(--accent);
  color: var(--paper);
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  border: var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
}

.ol-button:hover {
  background: var(--ink);
  color: var(--hi);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--accent);
  outline: none;
}

.ol-button:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.ol-button-secondary          { background: var(--green); }
.ol-button-secondary:hover    { background: var(--ink); box-shadow: 6px 6px 0 var(--green); }

/* ═══════════════════════════════════════════
   GRID DE CATEGORÍAS
═══════════════════════════════════════════ */
.ol-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.ol-category-card {
  padding: 1.1rem 1.25rem;
  background: var(--paper);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
  border-radius: 0;
}

.ol-category-card:hover {
  background: var(--hi);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
  outline: none;
}

.ol-category-card strong {
  display: block;
  font-size: 0.95rem;
  font-family: 'Space Mono', monospace;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.ol-category-card span {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════════
   INTRO
═══════════════════════════════════════════ */
.ol-home-intro {
  max-width: 720px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  border-left: 4px solid var(--accent);
  padding-left: 1.25rem;
}

/* ═══════════════════════════════════════════
   BADGES
═══════════════════════════════════════════ */
.ol-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1.5px solid var(--ink);
  background: var(--hi);
  color: var(--ink);
}
.ol-badge-cc  { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.ol-badge-new { background: var(--green);  color: var(--paper); border-color: var(--green); }

/* ═══════════════════════════════════════════
   ANUNCIOS
═══════════════════════════════════════════ */
.ol-ad-container { margin: 2rem 0; text-align: center; }

.ol-ad-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.ol-ad-box {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--rule);
  background: var(--paper);
}

/* ═══════════════════════════════════════════
   MOBILE FIRST
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .ol-books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .ol-book-thumb img {
    aspect-ratio: 2 / 3;
    object-fit: cover;
  }
  .ol-book-title    { font-size: 0.85rem; padding: 0.5rem; }
  .ol-categories-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .ol-category-card { padding: 0.75rem; font-size: 0.9rem; }

  h1 {
    font-size: 1.4rem !important;
    line-height: 1.25 !important;
  }

  body, p, li {
    font-size: 0.92rem;
    line-height: 1.65;
  }
}
/* ═══════════════════════════════════════════
   ESCRITORIO AMPLIO
═══════════════════════════════════════════ */
@media (min-width: 1024px) {
  .ol-books-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ═══════════════════════════════════════════
   PADDING GLOBAL
═══════════════════════════════════════════ */
.site-main,
.ol-container {
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 1024px) {
  .site-main,
  .ol-container {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ═══════════════════════════════════════════
   OVERRIDES GENERATEPRESS — al final para ganar
═══════════════════════════════════════════ */

/* Forzar --accent — GP lo sobreescribe con azul */
:root { --accent: #c8430a !important; }

/* Botones generales — naranja */
button,
html input[type="button"],
input[type="reset"],
input[type="submit"],
a.button:not(.ol-download),
a.wp-block-button__link:not(.has-background):not(.ol-download),
.wp-block-button .wp-block-button__link:not(.ol-download) {
  background-color: #c8430a !important;
  color: #ffffff !important;
  border-radius: 0 !important;
  border: 2px solid #1a1208 !important;
  box-shadow: 3px 3px 0 #1a1208;
  font-family: 'Space Mono', monospace !important;
}
button:hover,
input[type="submit"]:hover,
a.button:not(.ol-download):hover,
.wp-block-button__link:not(.ol-download):hover {
  background-color: #1a1208 !important;
  color: #fff3b0 !important;
}

/* Botón de descarga — verde */
a.button.ol-download,
.ol-download,
a.ol-download,
.entry-content .ol-download,
.site-content .ol-download {
  background-color: #2d6a4f !important;
  color: #ffffff !important;
  border: 2px solid #1a1208 !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0 #1a1208;
}
a.button.ol-download:hover,
.ol-download:hover,
a.ol-download:hover,
.entry-content .ol-download:hover {
  background-color: #1a1208 !important;
  color: #fff3b0 !important;
}

/* Subtítulos H2 y H3 — naranja */
.entry-content h2,
.entry-content h3 {
  color: #c8430a !important;
}

/* Menú — texto oscuro, activo y hover en verde */
.main-navigation a { color: #1a1208 !important; text-decoration: none; }
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_item > a,
.main-navigation .current_page_ancestor > a {
  color: #2d6a4f !important;
  background: transparent !important;
}

.ol-book-title {
    display: none;
}