/**
 * assets/css/edd-theme.css
 * Tipografía Google Sans, 7 Temas de Color basados en el nuevo Logo de UDEFE,
 * y componentes interactivos (Ajustes de lectura, Favoritos, Cuentas, Compartir).
 */

/* ── Google Sans @font-face ── */
@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/google-sans/ProductSans-Regular.woff') format('woff');
}
@font-face {
  font-family: 'Google Sans';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/google-sans/ProductSans-Italic.woff') format('woff');
}
@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/google-sans/ProductSans-Medium.woff') format('woff');
}
@font-face {
  font-family: 'Google Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/google-sans/ProductSans-Bold.woff') format('woff');
}

/* ── Tipografía Principal y Variables Globales ── */
:root {
  --font-sans: 'Google Sans', 'Product Sans', 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-scale: 1;
  --font-base: calc(16.5px * var(--font-scale, 1));
  --line-height-scale: 1;

  /* Tema por defecto: Dorado UDEFE */
  --bg: #fcfaf6;
  --card-bg: #ffffff;
  --ink: #1a292b;
  --accent: #d99518;
  --accent-hover: #b87c0e;
  --accent-soft: #fbf1dc;
  --brand: #0b383d;
  --brand-light: #16565d;
  --quote: #1c3e42;
  --muted: #647779;
  --line: #e8e3d8;
  --card-shadow: 0 4px 20px rgba(11, 56, 61, 0.06);
}

/* ── 7 Temas de Color ── */

/* 1. Dorado UDEFE (Oficial Logo) */
[data-theme="udefe"], body:not([data-theme]) {
  --bg: #fcfaf6;
  --card-bg: #ffffff;
  --ink: #1a292b;
  --accent: #d99518;
  --accent-hover: #b87c0e;
  --accent-soft: #fbf1dc;
  --brand: #0b383d;
  --brand-light: #16565d;
  --quote: #1c3e42;
  --muted: #647779;
  --line: #e8e3d8;
  --card-shadow: 0 4px 20px rgba(11, 56, 61, 0.06);
}

/* 2. Azul Petróleo (Océano de Gracia / Teal del libro) */
[data-theme="teal"] {
  --bg: #f2f7f8;
  --card-bg: #ffffff;
  --ink: #0a2125;
  --accent: #0e5e67;
  --accent-hover: #09454c;
  --accent-soft: #dff0f2;
  --brand: #05292e;
  --brand-light: #0d515a;
  --quote: #12434a;
  --muted: #537478;
  --line: #d3e4e7;
  --card-shadow: 0 4px 20px rgba(5, 41, 46, 0.06);
}

/* 3. Verde Litúrgico (Esperanza Cristiana / Tiempo Ordinario) */
[data-theme="liturgico"] {
  --bg: #f3f9f5;
  --card-bg: #ffffff;
  --ink: #112a1c;
  --accent: #246a42;
  --accent-hover: #195031;
  --accent-soft: #e1f5e7;
  --brand: #134226;
  --brand-light: #205c36;
  --quote: #1a4f2e;
  --muted: #567b63;
  --line: #d0e7d7;
  --card-shadow: 0 4px 20px rgba(19, 66, 38, 0.06);
}

/* 4. Cáliz Borgoña (Vino Nuevo / Pasión y Realeza) */
[data-theme="caliz"] {
  --bg: #faf4f5;
  --card-bg: #ffffff;
  --ink: #2b0d11;
  --accent: #861e2b;
  --accent-hover: #65131e;
  --accent-soft: #fce7e9;
  --brand: #4d0e17;
  --brand-light: #731724;
  --quote: #5c1b24;
  --muted: #855b62;
  --line: #ebd5d8;
  --card-shadow: 0 4px 20px rgba(77, 14, 23, 0.06);
}

/* 5. Pergamino Monasterio (Sepia / Serenidad de Lectura) */
[data-theme="pergamino"] {
  --bg: #f5eedb;
  --card-bg: #fdfaf2;
  --ink: #2b1d0f;
  --accent: #825a29;
  --accent-hover: #63431d;
  --accent-soft: #ede0c5;
  --brand: #4a3319;
  --brand-light: #6d4b24;
  --quote: #4f3920;
  --muted: #7d6851;
  --line: #e2d3b9;
  --card-shadow: 0 4px 20px rgba(74, 51, 25, 0.06);
}

/* 6. Nocturno Petróleo (Modo Oscuro UDEFE) */
[data-theme="nocturno"] {
  --bg: #091517;
  --card-bg: #112226;
  --ink: #e6f0f2;
  --accent: #f4b41a;
  --accent-hover: #ffd05b;
  --accent-soft: #1a353c;
  --brand: #295760;
  --brand-light: #3b7480;
  --quote: #b8d2d6;
  --muted: #799ca2;
  --line: #1c363d;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* 7. Medianoche Silenciosa (Dark Minimal OLED) */
[data-theme="medianoche"] {
  --bg: #111111;
  --card-bg: #1b1b1b;
  --ink: #f2f2f2;
  --accent: #e5a735;
  --accent-hover: #f7bd55;
  --accent-soft: #282828;
  --brand: #383838;
  --brand-light: #505050;
  --quote: #d0d0d0;
  --muted: #8e8e8e;
  --line: #2b2b2b;
  --card-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

/* ── Aplicación de Tipografía Google Sans para Legibilidad Óptima ── */
body {
  font-family: var(--font-sans) !important;
  font-size: var(--font-base) !important;
  line-height: calc(1.7 * var(--line-height-scale, 1)) !important;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg) !important;
  color: var(--ink) !important;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Encabezados y títulos con Google Sans */
h1, h2, h3, h4, .brand, .cal__title, .g-daytitle, .g-title, .hero__title, .step__latin, .pm-day {
  font-family: var(--font-sans) !important;
  letter-spacing: -0.02em !important;
  font-weight: 700 !important;
}

/* Citas y Frases Bíblicas */
.g-quote, .hero__frase {
  font-family: var(--font-sans) !important;
  font-size: calc(1.3 * var(--font-base)) !important;
  line-height: 1.55 !important;
  font-weight: 500 !important;
  letter-spacing: -0.01em !important;
}

/* Cuerpos de texto del Evangelio */
.reading p, .step__body {
  font-size: var(--font-base) !important;
  line-height: calc(1.72 * var(--line-height-scale, 1)) !important;
  color: var(--ink) !important;
  margin-bottom: 1.15em;
}

/* Logo Oficial en Header */
.site-brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
}
.site-logo {
  max-width: 260px;
  height: auto;
  display: block;
  transition: transform 0.2s ease;
}
.site-logo:hover {
  transform: scale(1.02);
}
@media (max-width: 600px) {
  .site-logo {
    max-width: 210px;
  }
}

/* Barra Superior de Herramientas y Usuario */
.site-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.site-topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Botones Icono y Pastillas */
.edd-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}
.edd-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.edd-btn--primary {
  background: var(--accent);
  color: #ffffff !important;
  border-color: var(--accent);
}
.edd-btn--primary:hover {
  background: var(--accent-hover);
}
.edd-btn--fav.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.edd-btn--fav svg {
  fill: none;
  stroke: currentColor;
  transition: fill 0.2s ease;
}
.edd-btn--fav.active svg {
  fill: var(--accent);
  stroke: var(--accent);
}

/* ── Modales Flotantes (Ajustes, Cuenta, Favoritos, Share) ── */
.edd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 24, 28, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.edd-modal-backdrop.open {
  display: flex;
  animation: eddFadeIn 0.2s ease;
}
.edd-modal {
  background: var(--card-bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  padding: 24px;
  position: relative;
  font-family: var(--font-sans);
}
.edd-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.edd-modal__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--brand);
}
.edd-modal__close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  padding: 4px;
}
.edd-modal__close:hover {
  color: var(--accent);
}

/* Selector de Tamaño de Letra */
.font-scale-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 22px;
}
.font-scale-btn {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.font-scale-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Grilla de Temas de Color */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card-bg);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.theme-option:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.theme-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.theme-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  margin-bottom: 6px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.theme-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

/* Tarjetas de Compartir en Redes */
.share-formats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.share-card-option {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg);
}
.share-card-option:hover {
  border-color: var(--accent);
  background: var(--card-bg);
}
.share-card-icon {
  font-size: 26px;
  margin-bottom: 6px;
  display: block;
}
.share-card-label {
  font-size: 12.5px;
  font-weight: 600;
  display: block;
}
.share-card-dim {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

/* Lista de Favoritos */
.fav-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.fav-item:hover {
  border-color: var(--accent);
}
.fav-item__info {
  flex: 1;
}
.fav-item__date {
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.fav-item__title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 3px 0;
}
.fav-item__sub {
  font-size: 12.5px;
  color: var(--muted);
}
.fav-item__del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.fav-item__del:hover {
  color: #b91c1c;
  background: #fee2e2;
}

@keyframes eddFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

