/* -----------------------------------------------------------
   Fuentes Personalizadas
----------------------------------------------------------- */
@font-face {
  font-family: 'StamAshkenazCLM';
  src: url('../fonts/StamAshkenazCLM.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Metatron-Regular';
  src: url('../fonts/Metatron-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* -----------------------------------------------------------
   Variables de color y fuentes
----------------------------------------------------------- */
:root {
  --bg: #1a0028;
  --bg-alt: #30003f;
  --text: #fef5e3;
  --accent: #fe69a5;
  --glow: #fec630;
  --muted: #692a8c;
  --font-main: 'Inter', sans-serif;
  --font-hebrew: 'StamAshkenazCLM', serif;
}

/* -----------------------------------------------------------
   Estilos base
----------------------------------------------------------- */
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

h1 {
  text-align: center;
  color: var(--text);
  margin-top: 1rem;
  font-size: 2.3em;
  font-weight: 700;
  text-shadow: 0 0 6px var(--glow), 0 0 12px var(--glow), 0 1px 2px rgba(0, 0, 0, 0.3);
}

h1 .stam {
  display: inline;
  font-size: 1.2em;
}

/* -----------------------------------------------------------
   Tabla de los 72 Nombres
----------------------------------------------------------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: var(--bg-alt);
  border-radius: 10px;
  overflow: hidden;
}
th {
  background-color: var(--bg-alt);
  color: var(--glow);
  padding: 14px;
  font-weight: 600;
  border-bottom: 1px solid #444;
  text-align: center;
}
td {
  padding: 12px;
  border-bottom: 1px solid #222;
  text-align: center;
  vertical-align: middle;
}
td.btn-cell {
  text-align: center;
}
td.gem {
  color: var(--glow);
  font-weight: bold;
  text-align: center;
}

/* -----------------------------------------------------------
   Nombres Hebreos y Metatrónicos (Tabla)
----------------------------------------------------------- */
.hebrew-box {
  font-family: var(--font-hebrew);
  font-size: 1.6em;
  line-height: 1.2;
  color: var(--text);
  text-shadow: 0 0 5px white;
  text-align: center;
}
.stam {
  font-family: 'StamAshkenazCLM', serif;
  font-size: 1.6em;
  color: white;
  text-shadow: 0 0 6px white;
  direction: rtl;
  display: block;
  margin: 0 auto;
  text-align: center;
}
.meta {
  font-family: 'Metatron-Regular', serif;
  font-size: 1.7em;
  color: white;
  text-shadow: 0 0 6px white;
  display: block;
  margin-top: 2px;
  direction: ltr;
  text-align: center;
}

/* -----------------------------------------------------------
   Caja de Nombre Actual (Current Box)
----------------------------------------------------------- */
#current.cur-box {
  background-color: #22002c;
  border-radius: 12px;
  padding: 0.8rem 1.4rem 1.2rem;
  max-width: 1000px;
  margin: 0.8rem auto 1.2rem;
  color: var(--text);
  box-shadow: 0 0 20px rgba(254, 245, 227, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

#current h2 {
  font-size: 1.3em;
  font-weight: 600;
  color: var(--glow);
  margin: 0;
  text-align: center;
}

.cur-time {
  text-align: center;
}


.cur-name-block {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 3rem;
  margin-top: 0.2rem;
}

.cur-info-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--glow);
  font-weight: bold;
  text-align: center;
  gap: 0.3rem;
}

.cur-time {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.2em;
  line-height: 1;
}

.cur-heading {
  font-size: 1em;
  line-height: 1;
}

/* ---------- Zodiac styles ---------- */
.zodiac,
.zodiac-badge {
  margin-left: 0.25rem;
  color: var(--glow);
  font-weight: 600;
  font-size: 0.95em;
}
.ord .zodiac {
  display: inline-block;
  margin-left: 0.4rem;
  color: var(--glow);
  font-weight: 600;
}


.cur-name-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1.4rem;
  margin: 0 auto;
}

#curStam {
  display: flex;
  direction: rtl;
  font-family: 'StamAshkenazCLM', serif;
  font-size: 9.2em;
  gap: 1.2rem;
  text-shadow: 0 0 22px white;
  color: white;
}

#curMeta {
  display: flex;
  direction: rtl;
  font-family: 'Metatron-Regular', serif;
  font-size: 9.6em;
  gap: 1.2rem;
  text-shadow: 0 0 32px white;
  color: white;
}

.cur-info-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: -0.5rem;
  flex-wrap: nowrap;
  flex-direction: row;
}



.cur-gematria {
  text-align: center;
  margin-top: 0.2rem;
  font-size: 1.1em;
  color: var(--glow);
  font-weight: bold;
}


.cur-letters {
  font-size: 1.3em;
  font-family: var(--font-main);
  color: var(--text);
  white-space: nowrap;
}

.cur-desc {
  font-size: 1em;
  font-family: var(--font-main);
  color: var(--text);
  max-width: 320px;
  text-align: left;
}

.cur-action {
  text-align: center;
}
.cur-action button {
  background-color: var(--accent);
  color: var(--text);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1em;
  margin: 0.3em auto;
  transition: all 0.2s ease;
}
.cur-action button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px var(--accent);
}

/* Hora + duración en celdas de tiempo */
td.hora {
  line-height: 1.1;
}
.hora .slot-dur {
  display: block;
  font-size: 0.85em;
  color: #cdb9da;
  margin-top: 2px;
}

/* 12h mode tiny controls */
.twelve-mode-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
}
.twelve-toggle {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.twelve-label {
  font-size: 0.85em;
  color: var(--glow);
  cursor: pointer;
}
.twelve-icon {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--muted);
  color: var(--text);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.85em;
  line-height: 1;
  cursor: pointer;
}

/* Anchor-at-sunrise toggle */
.anchor-mode-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
}
.anchor-toggle {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.anchor-label {
  font-size: 0.9em;
  color: var(--glow);
  cursor: pointer;
}

/* Solar adjust (hourglass) */
.solar-mode-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.5rem;
}
.solar-toggle {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}
.solar-label {
  font-size: 0.9em;
  color: var(--glow);
  cursor: pointer;
}

/* -----------------------------------------------------------
   Fonética por letra (debajo del nombre hebreo)
----------------------------------------------------------- */
.cur-fonetic-row {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  font-size: 1em;
  font-family: var(--font-main);
  color: var(--text);
  margin-top: -1.2rem; /* 👈 bien pegado a las letras hebreas */
}

/* -----------------------------------------------------------
   Selector de Zona Horaria
----------------------------------------------------------- */
#timezone-box {
  margin-left: auto;
  margin-right: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2rem auto;
  flex-wrap: wrap;
  font-size: 1em;
  text-align: center;
}
#timezone-box label {
  font-weight: bold;
  color: var(--glow);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
#timezone-box .label-long {
  display: inline;
}
#timezone-box .label-short {
  display: none;
  font-weight: 600;
  letter-spacing: 0.05em;
}
#timezone-box select,
#timezone-box input[type="time"] {
  background-color: #22002c;
  border: 1px solid var(--muted);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 1em;
}
#timezone-box .gps-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(254, 105, 165, 0.16);
  color: var(--text);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}
#timezone-box .gps-btn:hover,
#timezone-box .gps-btn:focus-visible {
  background: var(--accent);
  color: #200018;
  transform: translateY(-1px);
}
#timezone-box .gps-btn:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 2px;
}
#timezone-box .gps-btn__icon svg {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}
#timezone-box .gps-btn__text {
  white-space: nowrap;
}
@media (max-width: 640px) {
  #timezone-box .gps-btn {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  #timezone-box .gps-btn__text {
    display: none;
  }
  #timezone-box .gps-btn__icon svg {
    width: 1.35rem;
    height: 1.35rem;
  }
}

/* -----------------------------------------------------------
   Encabezado con Logo y Título
----------------------------------------------------------- */
#header-bar {
  display: grid;
  grid-template-columns: auto 1fr auto; /* logo | title | lang */
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  gap: 1rem;
  padding: 0.6rem 0.8rem;
}
#header-bar img {
  display: flex;
  align-items: left;
  height: 60px;
  width: auto;
  max-width: 100%;
  filter: drop-shadow(0 0 5px var(--glow));
  opacity: 0.92;
}

/* Compact language switch, inline in header */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.lang-switch label.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.lang-switch select {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}
#header-bar h1 {
  margin: 0;
  font-size: 2em;
  font-weight: 600;
  color: var(--text);
  text-shadow: none;
}

/* Make the title link look like plain heading (no blue/underline) */
#header-bar h1 a {
  color: inherit;
  text-decoration: none;
}
#header-bar h1 a:visited {
  color: inherit;
}
#header-bar h1 a:hover {
  text-decoration: none;
}
#header-bar h1 a:focus-visible {
  outline: 2px dashed var(--glow);
  outline-offset: 2px;
}

/* Hamburger menu */
#options-bar {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 0.5rem;
}
.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--muted);
  color: var(--text);
  cursor: pointer;
}
.menu-btn:hover { background: rgba(255,255,255,0.12); }
.options-panel {
  position: relative;
  display: none;
  max-width: 1000px;
  margin: 0.5rem auto 0;
  padding: 0.8rem;
  border: 1px solid var(--muted);
  border-radius: 10px;
  background: #22002c;
}
.options-panel.open { display: block; }
.options-panel .options-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  justify-content: center;
}
.options-panel .toggles { margin-top: 0.4rem; }

/* Compact latitude control */
.latdeg-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
}
.latdeg-label {
  font-size: 0.95em;
  color: var(--glow);
}
.latdeg-input {
  width: 6ch;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--muted);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.85em;
}

/* -----------------------------------------------------------
   Utilidades
----------------------------------------------------------- */
.no-show {
  visibility: hidden;
}

tr.highlight {
  background-color: var(--accent) !important;
  color: black;
  transition: background-color 0.5s ease;
}

.next-meditation-link {
  color: var(--glow);
  cursor: pointer;
  text-align: center;
  font-weight: 500;
  font-size: 1em;
  margin-top: 0.3rem;
  transition: opacity 0.3s ease;
}

.next-meditation-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* Para desplazamiento suave por toda la página */
html {
  scroll-behavior: smooth !important;
}

/* Estilo del botón “Back to Top” */
.back-to-top {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  display: none;            /* Oculto por defecto */
  width: 40px;
  height: 40px;
  background: #30003f;       /* Ajusta este color a tu paleta */
  color: #fef5e3;            /* Color de la flecha */
  text-align: center;
  line-height: 40px;
  font-size: 24px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: opacity 0.2s ease;
}
.back-to-top:hover {
  background: #fec630;       /* Hover opcional */
  color: #30003f;
}

@media (max-width: 768px) {
  /* Header más pequeño en móvil */
  #header-bar { padding: 0.5rem 0.6rem; gap: 0.6rem; }
  #header-bar h1 {
    font-size: clamp(0.95rem, 4vw, 1.2rem);
    text-align: center;
  }
  #header-bar img { height: 36px; }
  .lang-switch { display: inline-flex; }
  .lang-switch select { font-size: 0.8em; padding: 2px 4px; }
  /* Shorten title on mobile */
  .h1-suffix { display: none; }

  /* Mantener controles en una sola fila */
  #timezone-box {
    flex-wrap: nowrap;
    gap: 0.5rem;
    font-size: 0.95em;
  }
  #timezone-box label {
    font-size: 0.78em;
    gap: 0.25rem;
    position: relative;
  }
  #timezone-box label .label-long {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
  }
  #timezone-box label .label-short {
    display: inline-flex;
    align-items: center;
    font-size: 0.95em;
    letter-spacing: 0.08em;
  }
  #timezone-box .sunrise-label .label-short {
    font-size: 1.1em;
  }
  #timezone-box select,
  #timezone-box input[type="time"] {
    padding: 4px 8px;
    font-size: 0.85em;
  }
  #timezone-box input[type="time"] {
    width: 5.4ch;
  }
  #timezone-box select {
    min-width: 0;
    flex: 1 1 48vw;
    max-width: 52vw;
  }
  #timezone-box input[type="time"],
  #timezone-box button {
    min-width: 0;
    max-width: 28vw;
  }

  /* Espaciado más apretado para la fila del nombre actual */
  .cur-name-row {
    gap: 1rem;
  }

  /* Tamaños moderados de letras en móvil */
  #curStam {
    font-size: clamp(4.5rem, 22vw, 14rem);
  }
  #curMeta {
    font-size: clamp(4.5rem, 22vw, 14rem);
  }

  /* Caja actual a ancho completo en móvil */
  #current.cur-box {
    max-width: 100%;
    padding: 1.2rem;
    margin: 1rem auto;
  }

  /* Descripción más ancha en móvil */
  .cur-desc {
    max-width: 92vw;
  }
}

/* Ajustes solo para móvil en vertical (portrait) */
@media (max-width: 768px) and (orientation: portrait) {
  /* Evita overflow lateral en portrait */
  html, body { max-width: 100vw; overflow-x: hidden; }

  /* Mantener controles en una sola línea y compactos */
  #timezone-box { flex-wrap: nowrap; gap: 0.3rem; justify-content: center; }
  #timezone-box label { white-space: nowrap; font-size: 0.72em; gap: 0.2rem; position: relative; }
  #timezone-box label .label-short { font-size: 0.95em; letter-spacing: 0.1em; }
  #timezone-box .sunrise-label .label-short { font-size: 1.05em; }
  #timezone-box select { min-width: 0; max-width: 56vw; flex: 1 1 56vw; }
  #timezone-box input[type="time"] { width: 5.4ch; min-width: 0; }
  #timezone-box button { white-space: nowrap; padding: 4px 6px; font-size: 0.8em; flex: 0 0 auto; }
  #timezone-box .gps-btn {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0;
  }
  #timezone-box .gps-btn__text {
    display: none;
  }
  #timezone-box .gps-btn__icon svg {
    width: 1.3rem;
    height: 1.3rem;
  }

  /* Letras grandes y centradas en portrait */
  .cur-name-row { gap: 0.35rem; }
  #current.cur-box { padding-top: 0.3rem; gap: 0.5rem; margin: 0.5rem auto; }
  #current > .cur-name-row { gap: 0.4rem; }
  .cur-name-center { margin-top: 0; }
  #current h2 { font-size: 0.85em; margin: 0; line-height: 1; }
  .cur-time { font-size: 0.9em; }
  .cur-heading { font-size: 0.85em; }
  #curStam,
  #curMeta {
    font-size: 26vw;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
  }

  /* Acción: botón + siguiente en una fila, más compacto */
  .cur-action { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
  .cur-action button { font-size: 0.9em; padding: 6px 10px; }
  .next-meditation-link { font-size: 0.85em; white-space: nowrap; }
  /* On mobile show only the checkbox for the 12h mode */
  .twelve-icon { display: none; }
  .twelve-label { font-size: 0.9em; }

  /* Botón subir un poco más grande en portrait */
  .back-to-top {
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 26px;
  }

  /* Tabla: encajar sin scroll horizontal (solo portrait móvil) */
  #shemotTable {
    display: table;
    width: 100%;
    table-layout: fixed;
    overflow-x: visible;
  }
  #shemotTable th,
  #shemotTable td {
    font-size: 0.75em;
    padding: 6px 4px;
    white-space: normal; /* permitir saltos para que quepa */
    word-break: break-word;
  }
  /* Distribución de columnas para que quepan al 100% */
  #shemotTable th:nth-child(1), #shemotTable td:nth-child(1) { width: 8%;  }
  #shemotTable th:nth-child(2), #shemotTable td:nth-child(2) { width: 15%; }
  #shemotTable th:nth-child(3), #shemotTable td:nth-child(3) { width: 10%; }
  #shemotTable th:nth-child(4), #shemotTable td:nth-child(4) { width: 20%; }
  #shemotTable th:nth-child(5), #shemotTable td:nth-child(5) { width: 18%; }
  #shemotTable th:nth-child(6), #shemotTable td:nth-child(6) { width: 10%; }
  #shemotTable th:nth-child(7), #shemotTable td:nth-child(7) { width: 19%; }
  /* Ajustes internos: hebreo y fonética más contenidos dentro de la tabla */
  #shemotTable .hebrew-box .stam,
  #shemotTable .hebrew-box .meta { font-size: 1.05em; text-shadow: none; }
  #shemotTable .phonetic { font-size: 0.9em; white-space: normal; }
  #shemotTable td.gem { font-size: 0.9em; }
  #shemotTable .btn-cell .med-btn { padding: 4px 6px; font-size: 0.9em; }
}




