/* ============================================================
   PAGES.CSS — Hijos del Yermo · Interior Page Styles
   Requires styles.css loaded first
   ============================================================ */

/* ===== PAGE HERO ===== */
.page-hero {
  position: relative;
  padding: 56px 0 48px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 320px at 50% 0%, rgba(227, 194, 126, 0.1), transparent 70%),
    radial-gradient(600px 400px at 50% 100%, rgba(11, 13, 16, .8), transparent 60%);
  pointer-events: none;
}

.page-hero .eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
  margin: 0 0 10px;
}

.page-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(36px, 5vw, 62px);
  font-weight: 700;
  line-height: 1.07;
  margin: 0 0 14px;
  max-width: 1000px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .3);
}

.page-hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 680px;
  margin: 0;
  line-height: 1.7;
}

/* ===== SECTIONS ===== */
.page-section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.page-section:first-of-type {
  border-top: none;
}

.page-section figcaption a {
  color: var(--gold);
}

/* ===== INNER CARD ===== */
.inner-card {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: border-color .25s var(--ease);
}

.inner-card:hover {
  border-color: rgba(227, 194, 126, .14);
}

.inner-card h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin: 0 0 10px;
}

.inner-card p {
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.72;
  margin: 0;
}

.inner-card p+p {
  margin-top: 8px;
}

/* ===== DIVIDER ===== */
.divider-gold {
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent);
  opacity: 0.5;
  border: none;
  margin: 20px 0;
}

/* ===== TWO COLUMN ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 740px) {
  .two-col {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(227, 194, 126, .28);
  background: rgba(227, 194, 126, .07);
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition: transform .3s var(--ease-bounce), box-shadow .3s var(--ease), border-color .3s var(--ease);
  cursor: pointer;
}

.gallery-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 20px 48px rgba(0, 0, 0, .55);
  border-color: rgba(227, 194, 126, .2);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .8);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 2rem;
  color: rgba(255, 255, 255, .6);
  cursor: pointer;
  line-height: 1;
  transition: color .2s, transform .2s var(--ease-bounce);
}

.lightbox-close:hover {
  color: #fff;
  transform: scale(1.15) rotate(5deg);
}

/* ===== ASSETS ===== */
.autor-avatar {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  transition: box-shadow .3s var(--ease);
}

.autor-avatar:hover {
  box-shadow: 0 28px 72px rgba(0, 0, 0, .55);
}

.libro-cover {
  width: 100%;
  max-width: 300px;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .55), -8px 8px 28px rgba(0, 0, 0, .35);
  display: block;
  transition: transform .3s var(--ease-bounce), box-shadow .3s var(--ease);
}

.libro-cover:hover {
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .65), -10px 10px 32px rgba(0, 0, 0, .4);
}

/* ===== TIMELINE (upcoming) ===== */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), transparent);
  opacity: 0.28;
}

.timeline-item {
  position: relative;
  padding: 0 0 28px 20px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.55;
  box-shadow: 0 0 12px rgba(227, 194, 126, .45);
}

.timeline-item h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  color: var(--text);
  margin: 0 0 4px;
}

.timeline-item .tl-meta {
  font-size: 0.78rem;
  color: var(--gold);
  opacity: 0.7;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.timeline-item p {
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.65;
  margin: 0;
}

/* ===== FORMS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(227, 194, 126, 0.65);
}

.form-group input,
.form-group textarea,
.form-group select {
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  width: 100%;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: rgba(227, 194, 126, .42);
  background: rgba(255, 255, 255, .06);
  box-shadow: 0 0 0 3px rgba(227, 194, 126, .08);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(236, 233, 226, 0.28);
}

.form-group select {
  background-color: rgba(18, 20, 26, 0.95);
  color: var(--gold);
  padding-right: 38px;
}

.form-group select option {
  background-color: #141414;
  color: #e3c27e;
}

.form-group select:focus {
  background-color: rgba(24, 27, 34, 0.98);
}

.form-success {
  display: none;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(155, 225, 93, .28);
  background: rgba(155, 225, 93, .06);
  color: #9be15d;
  font-size: 0.95rem;
  margin-top: 10px;
}

.form-success.visible {
  display: block;
}

/* ===== CONTACT SOCIALS ===== */
.contact-socials {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.contact-socials a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 130px;
  max-width: 320px;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}

.contact-socials a:hover {
  transform: translateX(4px);
  border-color: var(--border-gold);
  background: rgba(227, 194, 126, .08);
  color: var(--gold);
}

.contact-socials a i {
  width: 22px;
  text-align: center;
  font-size: 1.1rem;
}

.contact-socials-pro a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .03);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all .25s var(--ease);
  width: 100%;
  max-width: 320px;
}

.contact-socials-pro a:hover {
  transform: translateX(4px);
  border-color: var(--border-gold);
  background: rgba(227, 194, 126, .08);
  color: var(--gold);
}

.contact-socials-pro i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.contact-socials-pro a[href*="amazon"] {
  border-color: rgba(255, 176, 32, 0.22);
}

.contact-socials-pro a[href*="amazon"]:hover {
  background: rgba(255, 176, 32, 0.11);
  color: #ffb020;
}

.contact-socials-pro a[href^="mailto"] {
  border-color: rgba(227, 194, 126, .22);
}

.contact-socials-pro a[href^="mailto"]:hover {
  background: rgba(227, 194, 126, .11);
}

/* ===== REVIEW CARDS ===== */
.review-card {
  cursor: pointer;
  transition: transform .25s var(--ease-bounce), box-shadow .25s var(--ease), border-color .25s var(--ease);
}

.review-card:hover {
  transform: translateY(-4px);
  border-color: rgba(227, 194, 126, .28);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}

/* ===== GEOGRAFÍA ===== */
.geografia-page {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.geo-block {
  display: grid;
  grid-template-columns: minmax(260px, 400px) 1fr;
  gap: 28px;
  align-items: stretch;
}

.geo-block.reverse {
  grid-template-columns: 1fr minmax(260px, 400px);
}

.geo-block.reverse .geo-image {
  order: 2;
}

.geo-block.reverse .geo-text {
  order: 1;
}

.geo-image {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.geo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease);
}

.geo-image:hover img {
  transform: scale(1.04);
}

.geo-text {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.geo-text h2 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin: 0 0 10px;
}

.geo-text p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.72;
  margin: 0 0 10px;
}

@media (max-width: 768px) {

  .geo-block,
  .geo-block.reverse {
    grid-template-columns: 1fr;
  }

  .geo-block.reverse .geo-image {
    order: unset;
  }

  .geo-block.reverse .geo-text {
    order: unset;
  }

  .geo-image {
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    min-height: 200px;
  }

  .geo-image img {
    max-height: 240px;
  }

  .geo-text {
    border-radius: 0 0 16px 16px !important;
    padding: 20px 18px;
  }
}

/* ===== SOCIEDAD ===== */
.society-intro {
  margin-bottom: 36px;
}

.society-hierarchy {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-left: 34px;
}

.society-hierarchy::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold), transparent);
  opacity: 0.28;
}

.society-rank {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
}

.society-rank::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.68;
  box-shadow: 0 0 16px rgba(227, 194, 126, .3);
}

.rank-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.4;
  padding-top: 20px;
  text-align: right;
}

.rank-card {
  margin: 0;
}

.society-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 36px;
}

@media (max-width: 768px) {
  .society-hierarchy {
    padding-left: 24px;
  }

  .society-rank {
    grid-template-columns: 40px 1fr;
    gap: 10px;
  }

  .rank-number {
    font-size: 1.2rem;
    padding-top: 20px;
  }

  .society-extra {
    grid-template-columns: 1fr;
  }
}

/* ===== CLANES ===== */
.clanes-page {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.clan-block {
  --clan-color: var(--gold);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.clan-block.reverse {
  direction: rtl;
}

.clan-block.reverse .clan-text {
  direction: ltr;
}

.clan-block.reverse .clan-images {
  direction: ltr;
}

.clan-images {
  display: flex;
  gap: 10px;
  height: 260px;
  overflow: hidden;
  border-radius: 14px;
}

.clan-images img {
  flex: 1;
  min-width: 0;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  background: rgba(255, 255, 255, .04);
  transition: transform .35s var(--ease);
}

.clan-images:hover img {
  transform: scale(1.03);
}

.clan-text {
  position: relative;
  border-color: color-mix(in oklab, var(--clan-color) 28%, var(--border));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.clan-text::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 220px at 0% 0%, color-mix(in oklab, var(--clan-color) 16%, transparent), transparent 70%);
  opacity: .5;
  pointer-events: none;
}

.clan-text h2 {
  position: relative;
  color: var(--clan-color);
  margin-bottom: 6px;
  font-size: 1.6rem;
}

.clan-text p {
  position: relative;
  margin: 4px 0;
}

.clan-lema {
  color: var(--text);
  font-style: italic;
  opacity: 0.8;
  margin-bottom: 10px !important;
}

.clan-sol {
  --clan-color: var(--sol);
}

.clan-hielo {
  --clan-color: var(--hielo);
}

.clan-volcan {
  --clan-color: var(--volcan);
}

.clan-pantano {
  --clan-color: var(--pantano);
}

.clan-mar {
  --clan-color: var(--mar);
}

.clan-sombra {
  --clan-color: var(--sombra);
}

@media (max-width: 768px) {
  .clanes-page {
    gap: 24px;
  }

  .clan-block {
    grid-template-columns: 1fr;
    gap: 16px;
    direction: ltr;
  }

  .clan-block.reverse {
    direction: ltr;
  }

  .clan-images {
    height: 200px;
    gap: 8px;
  }
}

/* ===== CUSTODIOS ===== */
.custodios-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.custodios-intro {
  text-align: center;
}

.custodios-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.custodios-jerarquia ul {
  margin-top: 14px;
  padding-left: 18px;
}

.custodios-lista li {
  margin-bottom: 7px;
  opacity: 0.85;
  line-height: 1.6;
}

.custodios-cierre {
  text-align: center;
  font-style: italic;
  opacity: 0.82;
}

@media (max-width: 768px) {
  .custodios-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== LUMEN ===== */
.lumen-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.lumen-intro {
  position: relative;
  overflow: hidden;
}

.lumen-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(700px 320px at 50% 0%, rgba(227, 194, 126, .1), transparent 70%);
  pointer-events: none;
}

.lumen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.lumen-card {
  min-height: 200px;
}

.lumen-blood {
  border-color: rgba(227, 194, 126, .2);
}

.lumen-warning {
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--gold);
  font-style: italic;
}

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

  .lumen-card {
    min-height: auto;
  }
}

/* ===== PERSONAJES ===== */
.personajes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.personaje-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: transform .3s var(--ease-bounce);
}

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

.personaje-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px 14px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  transition: filter .3s var(--ease);
}

.personaje-card:hover img {
  filter: brightness(1.06);
}

.personaje-info {
  border-radius: 0 0 14px 14px;
  text-align: center;
  border-top: 1px solid rgba(227, 194, 126, .08);
}

.personaje-info h3 {
  margin-bottom: 4px;
}

.rol {
  font-size: 0.83rem;
  opacity: 0.65;
  margin-bottom: 6px;
  color: var(--muted);
}

.rasgos {
  font-size: 0.8rem;
  opacity: 0.55;
  margin-bottom: 10px;
  letter-spacing: .02em;
}

.frase {
  font-style: italic;
  color: var(--gold);
  font-size: 0.9rem;
  opacity: 0.85;
}

@media (max-width: 900px) {
  .personajes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .personajes-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== CRONOLOGÍA / EXPLORA ===== */
.explora-page {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Timeline (cronología) */
.timeline {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
  padding-bottom: 4px;
}

.timeline-item span {
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  opacity: 0.55;
  font-size: 1.05rem;
}

.timeline-item h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.timeline-item p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.65;
}

/* Proverbios */
.proverbios {
  text-align: center;
}

.proverbio {
  margin: 14px 0;
  font-style: italic;
  color: var(--gold);
  font-size: 1.05rem;
  opacity: 0.85;
  transition: opacity .2s;
}

.proverbio:hover {
  opacity: 1;
}

/* ===== MAPAS ===== */
.mapas-section {
  padding: 48px 0;
}

/* ===== MOBILE GLOBAL ===== */
@media (max-width: 768px) {
  .autor-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .two-col {
    gap: 20px !important;
  }

  .contact-socials {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-socials a {
    width: 100%;
    max-width: 100%;
  }

  .inner-card {
    padding: 18px 16px;
  }

  .proximos-imgs {
    flex-direction: column !important;
  }

  .proximos-imgs img {
    width: 100% !important;
  }
}