/* --- BASE & LAYOUT --- */
.gallery-page { padding-bottom: 5rem; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; min-height: 100vh; background: #fdfbf7; color: #2d241e; font-size: 20px !important; }

.gallery-page .gh-canvas {
  display: block !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

.gallery-shell { width: 100%; }

/* --- GHOST-PROOF HERO (REWARDS STYLE) --- */
.gallery-page .gh-article-header.gallery-hero {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 5rem !important;
    padding: 4rem 0 !important;
    margin: 0 auto 4rem auto !important;
    max-width: 1200px !important;
    width: 100% !important;
    text-align: left !important;
    min-height: 420px;
}

.gallery-hero-content {
    flex: 0 0 40% !important;
    max-width: 400px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding-top: 0 !important;
}

.gallery-hero-content h1.gh-article-title {
    font-size: 4.5rem !important;
    font-weight: 900 !important;
    margin: 0 0 1.5rem 0 !important;
    line-height: 1 !important;
    color: #2d241e !important;
}

.gallery-hero-content p.gh-article-excerpt {
    font-size: 1.35rem !important;
    line-height: 1.6 !important;
    color: #5d4037 !important;
    margin: 0 !important;
}

.gallery-hero-image {
    flex: 0 0 55% !important;
    max-width: 650px !important;
    width: 100% !important;
    aspect-ratio: 16 / 9;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(74, 55, 40, 0.12);
    background: #f1ece6;
}

.gallery-hero-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* --- WARNING BANNER --- */
.gallery-warning-banner {
    display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem 2rem;
    background: #fff8e1; border: 1px solid #ffe082; border-radius: 24px;
    margin-bottom: 2rem; animation: slideDown 0.4s ease-out;  min-height: 110px;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.warning-icon { font-size: 2rem; }
.warning-title { margin: 0 0 0.25rem; font-weight: 800; color: #795548; }
.warning-text { margin: 0; font-size: 0.9rem; color: #8d6e63; line-height: 1.4; }

/* --- TOOLBAR --- */
.gallery-toolbar {
  margin-bottom: 2rem;
  padding: 2rem;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid #d7ccc8;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(74, 55, 40, 0.08);
  min-height: 360px;
}


.gallery-toolbar-top { display: grid; grid-template-columns: 1fr 1.5fr 1.5fr 1.2fr; gap: 2.5rem; align-items: start; }
.gallery-filter-block { display: flex; flex-direction: column; gap: 1rem; }
.gallery-filter-label { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #8d6e63; }

/* --- FILTERS (CHIPS) --- */
.gallery-chip-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gallery-chip { position: relative; cursor: pointer; }
.gallery-chip input { position: absolute; opacity: 0; }
.gallery-chip span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 1.2rem;
  border-radius: 12px; border: 1px solid #d7ccc8; background: #efebe9; color: #4e342e;
  font-size: 0.95rem; font-weight: 700; transition: 0.2s ease;
}
.gallery-chip span strong { margin-left: 6px; opacity: 0.5; font-weight: 600; font-size: 0.85rem; }
.gallery-chip:hover span { background: #e0e0e0; border-color: #8d6e63; }
.gallery-chip input:checked + span { background: #ff5722; color: #fff; border-color: #ff5722; box-shadow: 0 8px 20px rgba(255, 87, 34, 0.25); }

.character-grid-scroll {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  max-height: 220px;
  min-height: 220px;
  overflow-y: auto;
  padding-right: 10px;
  gap: 0.6rem;
  width: 100% !important;
  max-width: 320px !important;
}

.character-grid-scroll .gallery-chip { width: 100% !important; }
.character-grid-scroll .gallery-chip span { width: 100% !important; justify-content: center !important; text-align: center !important; padding: 0 0.5rem !important; }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  max-height: 200px;
  min-height: 200px;
  overflow-y: auto;
  padding-right: 10px;
}

.tag-cloud .gallery-chip span { min-height: 30px; padding: 0 0.8rem; font-size: 0.75rem; border-radius: 8px; }
.tags-paywall-msg {
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-status {
  font-size: 1.1rem;
  font-weight: 300;
  color: #8d6e63;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid #efebe9;
  padding-bottom: 0.5rem;
  min-height: 2.2rem;
}

.gallery-active-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d7ccc8;
  min-height: 64px;
}

.gallery-active-pill { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 100px; background: #4e342e; color: #fff; font-size: 0.75rem; font-weight: 700; border: none; cursor: pointer; transition: 0.2s; }
.gallery-active-pill:hover { background: #ff5722; transform: scale(1.05); }

/* --- SEARCH & SORT --- */
.gallery-search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: 0.8rem;
  min-height: 48px;
}
.gallery-search-icon { 
position: absolute;
left: 1rem;
top: 50%;
transform:
translateY(-50%);
width: 18px;
height: 18px;
fill: #8d6e63;
pointer-events: none;
display: block;
}

.gallery-search-input { width: 100%; height: 48px; box-sizing: border-box; padding: 0 1rem 0 3rem; border-radius: 16px; border: 1px solid #d7ccc8; background: #fff; color: #2d241e; font-size: 0.95rem; transition: 0.3s; }
.gallery-search-input:focus { outline: none; border-color: #ff5722; box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1); }
.gallery-sort-select { width: 100%; height: 48px; padding: 0 1rem; border-radius: 16px; border: 1px solid #d7ccc8; background: #fff; color: #2d241e; font-weight: 700; font-size: 0.85rem; cursor: pointer; }

/* --- GRID & CARDS --- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.gallery-card { display: flex; flex-direction: column; border-radius: 28px; overflow: hidden; background: #fff; border: 1px solid #d7ccc8; transition: 0.3s cubic-bezier(0.23, 1, 0.32, 1); box-shadow: 0 4px 12px rgba(74, 55, 40, 0.04); }
.gallery-card:hover { transform: translateY(-6px); border-color: #8d6e63; box-shadow: 0 12px 24px rgba(74, 55, 40, 0.1); }
.gallery-card-media { position: relative; aspect-ratio: 4/5; overflow: hidden; display: block; cursor: zoom-in; }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: 0.6s ease; }
.gallery-card-meta { padding: 1.25rem; }
.gallery-card-title { margin: 0 0 0.8rem; font-size: 1.35rem; font-weight: 800; line-height: 1.2; color: #2d241e; }
.gallery-date-pill { display: inline-flex; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; color: #8d6e63; margin-bottom: 0.5rem; letter-spacing: 0.05em; }
.gallery-card-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.gallery-tag { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; padding: 5px 12px; border-radius: 8px; background: #f5f5f5; color: #5d4037; }

/* --- INTERACTIVE RATING (STAR SYSTEM) --- */
.gallery-card-rating { display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #f5f5f5; }
.stars-container { display: flex; flex-direction: row-reverse; gap: 4px; }
.star-btn { background: none; border: none; padding: 0; margin: 0; cursor: pointer; font-size: 1.4rem; color: #d7ccc8; transition: 0.2s ease; }
.star-btn.active { color: #ffb74d; }

/* Efecto hover: apaga las activas y enciende las del ratón */
.stars-container:hover .star-btn { color: #ffe0b2 !important; }
.stars-container .star-btn:hover, 
.stars-container .star-btn:hover ~ .star-btn { color: #ff5722 !important; transform: scale(1.15); }

.rating-info { font-size: 0.75rem; font-weight: 800; color: #8d6e63; }

/* --- LIGHTBOX & MISC --- */
.gslide-image img { border-radius: 24px; }
.gcontainer .gslide-description { border-radius: 0 0 24px 24px; background: #fff !important; border-top: 1px solid #f5f5f5; }
.lightbox-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 10px; border-top: 1px solid #efebe9; }
.lightbox-download-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: #ff5722; color: #fff; border: none; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3); }
.lightbox-download-btn:hover { transform: scale(1.1); background: #e64a19; }
.lightbox-download-btn svg { width: 20px; height: 20px; fill: currentColor; }

.gallery-paywall-banner { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4rem 2rem; background: #fff; border: 2px dashed #d7ccc8; border-radius: 32px; margin-top: 1rem; }
.paywall-icon { font-size: 3rem; margin-bottom: 1.5rem; }
.paywall-title { font-size: 1.5rem; font-weight: 900; color: #2d241e; margin-bottom: 1rem; }
.paywall-text { color: #8d6e63; max-width: 400px; margin-bottom: 2rem; line-height: 1.6; }
.paywall-btn { display: inline-flex; align-items: center; padding: 14px 32px; background: #ff5722; color: #fff; font-weight: 800; text-transform: uppercase; border-radius: 100px; text-decoration: none; transition: 0.2s; box-shadow: 0 8px 20px rgba(255, 87, 34, 0.3); }

@media (max-width: 1000px) { .gallery-toolbar-top { grid-template-columns: 1fr; gap: 1.5rem; } .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1000px) {
  .gallery-toolbar {
    min-height: 520px;
  }
}

@media (max-width: 1000px) {
  .gallery-page .gh-article-header.gallery-hero {
    min-height: unset;
  }
}
@media (max-width: 600px) { .gallery-grid { grid-template-columns: 1fr; } }