/* =========================================================
   MEJORAS DE PÁGINAS INTERNAS + AYUDA + BOTÓN CAFÉ
   Archivo independiente y encapsulado.
   ========================================================= */

html, body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  flex: 0 0 auto;
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
}

.pg-footer-v2 {
  flex: 0 0 auto;
}

/* Botón café en navbar */
.nav-coffee {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  margin-left: 4px;
  color: #8e1b2b !important;
  background: rgba(211,161,75,.12);
  border: 1px solid rgba(211,161,75,.48);
}

.nav-coffee:hover {
  color: #fff !important;
  background: #8e1b2b !important;
}

.nav-coffee i {
  color: #d3a14b;
}

/* Cabecera de páginas internas */
.inner-hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 52px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 12%, rgba(211,161,75,.18), transparent 22rem),
    linear-gradient(135deg, #0a343b, #072b31);
  border-bottom: 1px solid rgba(233,204,145,.24);
}

.inner-hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -130px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(233,204,145,.12);
  border-radius: 50%;
}

.inner-hero__content {
  position: relative;
  z-index: 2;
  max-width: 780px;
}

.inner-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f0cf8e;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.inner-hero h1 {
  margin: 10px 0 12px;
  color: #fff7e7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
}

.inner-hero p {
  max-width: 700px;
  margin: 0;
  color: rgba(255,255,255,.77);
  font-size: 1rem;
}

.page-shell {
  padding: 58px 0 72px;
  background:
    radial-gradient(circle at top left, rgba(211,161,75,.08), transparent 24rem),
    #fffdf8;
}

.page-shell--soft {
  background: #fbf6eb;
}

.page-card {
  padding: 30px;
  background: #fff;
  border: 1px solid #dfcfad;
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(19,39,42,.10);
}

.page-card h2,
.page-card h3 {
  color: #072b31;
  font-family: Georgia, "Times New Roman", serif;
}

.page-card p {
  color: #6f716d;
}

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

.page-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.page-empty {
  padding: 52px 28px;
  text-align: center;
  background: linear-gradient(180deg,#fffaf0,#f5ead7);
  border: 1px dashed #d3b87b;
  border-radius: 20px;
}

.page-empty__icon {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: #f2d89d;
  background: #0a343b;
  border: 3px solid #d3a14b;
  border-radius: 50%;
  font-size: 1.35rem;
}

.page-empty h2 {
  margin: 0;
  color: #072b31;
  font-family: Georgia, "Times New Roman", serif;
}

.page-empty p {
  max-width: 560px;
  margin: 10px auto 20px;
  color: #6f716d;
}

/* Ranking */
.ranking-card {
  overflow: hidden;
  padding: 0;
}

.ranking-card .table {
  margin: 0;
}

.ranking-card .table th {
  color: #fff7e7;
  background: #0a343b;
  border-bottom-color: rgba(255,255,255,.12);
}

.ranking-card .table td {
  background: #fff;
}

.ranking-card .table tr:nth-child(even) td {
  background: #fbf6eb;
}

.ranking-number {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: #8e1b2b;
  border-radius: 50%;
  font-weight: 800;
}

/* Autores */
.author-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.author-card__avatar {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  overflow: hidden;
  color: #f3d99c;
  background: #0a343b;
  border: 3px solid #d3a14b;
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
}

.author-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-card .button {
  margin-top: auto;
}

/* Concursos */
.contest-card {
  position: relative;
  overflow: hidden;
}

.contest-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(#d3a14b,#8e1b2b);
}

.contest-card__date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: #8e1b2b;
  font-size: .82rem;
  font-weight: 800;
}

/* Legal / contenido editorial */
.editorial-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.editorial-aside {
  position: sticky;
  top: 128px;
  padding: 22px;
  color: #fff;
  background: #0a343b;
  border: 1px solid rgba(211,161,75,.45);
  border-radius: 18px;
}

.editorial-aside i {
  color: #d3a14b;
  font-size: 1.6rem;
}

.editorial-aside h3 {
  margin: 12px 0 8px;
  color: #f4d899;
}

.editorial-aside p {
  margin: 0;
  color: rgba(255,255,255,.68);
  font-size: .84rem;
}

.editorial-content {
  padding: 36px;
  background: #fff;
  border: 1px solid #dfcfad;
  border-radius: 20px;
  box-shadow: 0 14px 32px rgba(19,39,42,.10);
}

.editorial-content h2 {
  margin-top: 30px;
  color: #8e1b2b;
  font-family: Georgia, "Times New Roman", serif;
}

.editorial-content h2:first-child {
  margin-top: 0;
}

.editorial-content p,
.editorial-content li {
  color: #505657;
  line-height: 1.8;
}

/* Formularios */
.auth-layout,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .8fr);
  gap: 30px;
  align-items: stretch;
}

.auth-info,
.contact-info {
  padding: 34px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(211,161,75,.15), transparent 20rem),
    #0a343b;
  border-radius: 22px;
}

.auth-info h2,
.contact-info h2 {
  color: #fff7e7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.auth-info p,
.contact-info p {
  color: rgba(255,255,255,.72);
}

.info-list {
  display: grid;
  gap: 13px;
  margin-top: 24px;
}

.info-list div {
  display: flex;
  gap: 11px;
  align-items: flex-start;
}

.info-list i {
  margin-top: 4px;
  color: #d3a14b;
}

.enhanced-form {
  margin: 0;
  max-width: none;
  height: 100%;
}

.enhanced-form h1 {
  margin-top: 0;
}

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

/* Donaciones */
.donation-hero-card {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  gap: 30px;
  align-items: center;
}

.donation-cup {
  width: 170px;
  height: 170px;
  display: grid;
  place-items: center;
  margin-left: auto;
  color: #f2d89d;
  background: #0a343b;
  border: 6px solid #d3a14b;
  border-radius: 50%;
  box-shadow: 0 18px 35px rgba(0,0,0,.16);
  font-size: 4rem;
}

.donation-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

.donation-option {
  padding: 24px;
  background: #fff;
  border: 1px solid #dfcfad;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(19,39,42,.08);
}

.donation-option i {
  color: #8e1b2b;
  font-size: 1.7rem;
}

.donation-option h3 {
  margin: 12px 0 8px;
}

/* Relatos */
.story-filter {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 28px;
}

.story-filter label {
  margin-top: 0;
}

.story-filter button {
  min-height: 46px;
}

.story-reader {
  position: relative;
  overflow: hidden;
}

.story-reader::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(#d3a14b,#8e1b2b);
}

/* Ayuda flotante */
.help-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 220;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 11px 16px;
  color: #fff;
  background: linear-gradient(135deg,#9d1d2d,#741322);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  box-shadow: 0 16px 34px rgba(0,0,0,.25);
  cursor: pointer;
  font-weight: 800;
}

.help-fab i {
  color: #f2d89d;
}

.help-panel {
  position: fixed;
  right: 22px;
  bottom: 82px;
  z-index: 230;
  width: min(360px, calc(100vw - 32px));
  padding: 26px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(211,161,75,.15), transparent 15rem),
    #0a343b;
  border: 1px solid rgba(233,204,145,.35);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,.34);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.98);
  transition: .22s ease;
}

.help-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.help-panel__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  cursor: pointer;
}

.help-panel__icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #f4da9d;
  background: #8e1b2b;
  border: 2px solid #d3a14b;
  border-radius: 50%;
}

.help-panel__eyebrow {
  display: block;
  margin-top: 16px;
  color: #e8ca8f;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.help-panel h3 {
  margin: 6px 0 8px;
  color: #fff7e7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
}

.help-panel p {
  color: rgba(255,255,255,.72);
  font-size: .88rem;
}

.help-panel__primary,
.help-panel__secondary {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 800;
}

.help-panel__primary {
  color: #fff;
  background: #8e1b2b;
}

.help-panel__secondary {
  color: #f3d99c;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(233,204,145,.20);
}

.help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(3,20,23,.38);
  opacity: 0;
  visibility: hidden;
  transition: .2s ease;
}

.help-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1000px) {
  .nav-coffee {
    margin-left: 0;
  }

  .page-grid,
  .page-grid--2,
  .donation-options {
    grid-template-columns: 1fr 1fr;
  }

  .auth-layout,
  .contact-layout,
  .donation-hero-card {
    grid-template-columns: 1fr;
  }

  .donation-cup {
    margin: 0 auto;
  }
}

@media (max-width: 750px) {
  .inner-hero {
    padding: 48px 0 40px;
  }

  .page-grid,
  .page-grid--2,
  .donation-options,
  .auth-layout,
  .contact-layout,
  .editorial-layout {
    grid-template-columns: 1fr;
  }

  .editorial-aside {
    position: static;
  }

  .form-row,
  .story-filter {
    grid-template-columns: 1fr;
  }

  .help-fab span {
    display: none;
  }

  .help-fab {
    width: 52px;
    height: 52px;
    justify-content: center;
    padding: 0;
  }
}
