/* ==========================================================================
   diseno-hora-dorada.css · hora dorada del diseño nuevo (templates/diseno/hora_dorada.php).
   Colores del cielo: los de cada franja de altura del sol, iguales en claro y en
   oscuro (son el cielo, no la interfaz).
   ========================================================================== */
.d2-hd {
  --hd-noche: #18213a; --hd-astro: #23315e; --hd-nautico: #31498a; --hd-azul: #3d6fd0;
  --hd-civil: #d79aa7; --hd-dorada: #f1a93a; --hd-dia: #ffe7a0;
  --hd-dorada-t: #8a4b00; --hd-azul-t: #2453b0;
}
:root[data-theme="dark"] .d2-hd { --hd-dorada-t: #ffc061; --hd-azul-t: #8eb2ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .d2-hd { --hd-dorada-t: #ffc061; --hd-azul-t: #8eb2ff; } }

.hd-s--noche { background: var(--hd-noche); } .hd-s--astro { background: var(--hd-astro); } .hd-s--nautico { background: var(--hd-nautico); }
.hd-s--azul { background: var(--hd-azul); } .hd-s--civil { background: var(--hd-civil); } .hd-s--dorada { background: var(--hd-dorada); } .hd-s--dia { background: var(--hd-dia); }
.hd-pt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; margin-right: 6px; vertical-align: 0; box-shadow: inset 0 0 0 1px rgba(15, 27, 43, .18); }
.hd-pt--dorada { background: var(--hd-dorada); } .hd-pt--azul { background: var(--hd-azul); }

/* Selector de día */
.hd-elige { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e-2) var(--e-4); }
.hd-dias { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; padding: 2px; }
.hd-dias::-webkit-scrollbar { display: none; }
.hd-dia { flex: none; display: grid; justify-items: center; min-width: 48px; padding: 4px 8px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); text-decoration: none; color: var(--ink-2); line-height: 1.15; }
.hd-dia span { font-size: var(--t-1); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hd-dia b { font-size: var(--t-3); }
.hd-dia:hover { border-color: var(--ink); }
.hd-dia[aria-current] { background: var(--senal); border-color: var(--senal); color: var(--on-senal); }
.hd-dia[aria-current] span { color: inherit; opacity: .85; }
.hd-fecha { gap: 6px; }
.hd-fecha .campo { width: auto; color-scheme: light dark; }

/* Primera pantalla */
.hd-hero { display: grid; gap: var(--e-4); position: relative; }
.hd-cuenta { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 4px 10px; border-radius: var(--r-pill); background: var(--senal-suave); color: var(--senal-tinta); font-weight: 600; font-size: var(--t-1); }
.hd-cuenta::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--senal); }
.hd-hero__fr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--e-4); }
.hd-mom { display: grid; gap: var(--e-2); align-content: start; min-width: 0; }
.hd-par { display: grid; gap: 0; }
.hd-par__n { font-size: var(--t-1); font-weight: 600; color: var(--hd-dorada-t); display: flex; align-items: center; }
.hd-par--azul .hd-par__n { color: var(--hd-azul-t); }
.hd-par__h { font-family: var(--f-titular); font-variation-settings: "wdth" 84; font-weight: 700; font-size: var(--t-5); line-height: 1.05; white-space: nowrap; }
.hd-par__h span { color: var(--muted); font-weight: 400; margin: 0 2px; }
.hd-par--azul .hd-par__h { font-size: var(--t-4); }
.hd-mom__sol { font-size: var(--t-1); color: var(--ink-2); border-top: 1px solid var(--line); padding-top: var(--e-2); }
.hd-nota { display: grid; gap: var(--e-2); align-content: start; padding-top: var(--e-4); border-top: 1px solid var(--line); min-width: 0; }
.hd-nota__v { display: flex; align-items: baseline; gap: var(--e-3); }
.hd-nota__v .cifra .hd-de100 { vertical-align: baseline; font-size: var(--t-2); }
.hd-nota__v .cifra small { font: 500 var(--t-1) var(--f-texto); color: var(--muted); margin-left: 4px; }
.hd-nota__cal { font-weight: 600; font-size: var(--t-3); color: var(--c); }
.hd-nota--excelente { --c: var(--ok); } .hd-nota--buena { --c: #2b6fc0; } .hd-nota--regular { --c: var(--av-naranja-t); } .hd-nota--mala { --c: var(--av-rojo-t); }
:root[data-theme="dark"] .hd-nota--buena { --c: #7fb0f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hd-nota--buena { --c: #7fb0f0; } }
.hd-barra { height: 8px; border-radius: var(--r-pill); background: var(--sunk); overflow: hidden; }
.hd-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--hd-azul), var(--hd-dorada)); }
@media (min-width: 900px) {
  .hd-hero { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--e-5); }
  .hd-nota { border-top: 0; padding-top: 0; border-left: 1px solid var(--line); padding-left: var(--e-5); }
  .hd-par__h { font-size: var(--t-6); }
  .hd-par--azul .hd-par__h { font-size: var(--t-5); }
}
@media (max-width: 420px) { .hd-par__h { font-size: var(--t-4); } .hd-par--azul .hd-par__h { font-size: var(--t-3); } }

/* Línea del día */
.hd-linea { display: grid; gap: 4px; padding-bottom: 34px; position: relative; }
.hd-linea__esc { position: relative; height: 16px; font-size: var(--t-1); color: var(--muted); }
.hd-linea__esc span { position: absolute; transform: translateX(-50%); }
.hd-linea__esc span:first-child { transform: none; } .hd-linea__esc span:last-child { transform: translateX(-100%); }
.hd-linea__barra { position: relative; height: 40px; border-radius: var(--r-2); overflow: hidden; background: var(--hd-noche); }
.hd-s { position: absolute; top: 0; bottom: 0; }
.hd-linea__ahora { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--senal); box-shadow: 0 0 0 1px var(--surface); z-index: 2; }
.hd-linea__marcas { position: absolute; left: 0; right: 0; bottom: 0; height: 32px; }
.hd-marca { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; line-height: 1.1; white-space: nowrap; font-size: var(--t-1); }
.hd-marca::before { content: ""; width: 1px; height: 5px; background: var(--ink-2); margin-bottom: 1px; }
.hd-marca small { color: var(--muted); }
@media (max-width: 600px) { .hd-marca--med small { display: none; } }
.hd-ley { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; margin: 0; padding: 0; }
.hd-ley li, .hd-ley span { display: inline-flex; align-items: center; gap: 6px; }
.hd-ley i { width: 14px; height: 10px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(15, 27, 43, .18); }
.hd-ley i.hd-ley__ahora { width: 2px; height: 14px; border-radius: 0; background: var(--senal); box-shadow: none; }
.hd-ley__luz { background: var(--hd-dia); } .hd-ley__dor { background: none; height: 0 !important; border-top: 2.5px solid var(--hd-dorada); box-shadow: none !important; }

/* 7 días */
.hd-semana { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: var(--e-2); }
.hd-sd { display: grid; gap: 4px; height: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); text-decoration: none; color: var(--ink); }
.hd-sd:hover { border-color: var(--ink); }
.hd-sd--sel { border-color: var(--senal); box-shadow: inset 0 0 0 1px var(--senal); }
.hd-sd__d { font-size: var(--t-1); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.hd-sd__d b { color: var(--ink); }
.hd-sd__h { font-weight: 600; display: flex; align-items: center; white-space: nowrap; }
.hd-sd__s { display: flex; align-items: center; gap: 4px; }
.hd-sd__n { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.hd-chip { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: var(--t-1); color: var(--c); }
.hd-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
@media (max-width: 520px) { .hd-semana { grid-template-columns: minmax(0, 1fr); } .hd-sd { grid-template-columns: 1fr auto; } .hd-sd__h { justify-self: end; } }

/* Luna */
.hd-luna { flex: none; }
.hd-luna__sombra { fill: var(--sunk); stroke: var(--line-2); stroke-width: 1; }
.hd-luna__luz { fill: #f3efe0; stroke: #bdb59a; stroke-width: .5; }
:root[data-theme="dark"] .hd-luna__luz { fill: #e9e3cc; }
.hd-luna--s { width: 18px; height: 18px; } .hd-luna--l { width: 64px; height: 64px; }
.hd-lunat { display: flex; gap: var(--e-4); align-items: center; }
.hd-luna__c { display: flex; align-items: center; gap: 6px; font-size: var(--t-1); color: var(--ink-2); }

/* Detalle del día */
.hd-det { display: grid; gap: var(--e-4); }
.hd-det__bajo { display: grid; gap: var(--e-3); }
@media (min-width: 900px) { .hd-det__bajo { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: stretch; } }
.hd-tabla th[scope="row"] { white-space: nowrap; }
.hd-tabla td.num { white-space: nowrap; }
.hd-tabla .hd-pt { vertical-align: -1px; }
.hd-tabla__sol th, .hd-tabla__sol td { border-top: 1px solid var(--line-2); }
.hd-tabla .hd-tabla__d { white-space: normal; min-width: 220px; text-align: left; }
@media (max-width: 700px) { .hd-tabla .hd-tabla__d { display: none; } }
.hd-cifras { grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); }

/* Año */
.g-hd-luz { --c: #f1a93a; }
.g-hd-dorada { --c: #c26a00; }
:root[data-theme="dark"] .g-hd-dorada { --c: #ffb347; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .g-hd-dorada { --c: #ffb347; } }
.hd-graf .g-banda.g-hd-luz { opacity: .28; }
.hd-fila-mes th, .hd-fila-mes td { background: var(--senal-suave); }

/* Abajo */
.hd-busca { max-width: 520px; background: var(--surface); border-color: var(--line-2); }
.hd-busca input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; color: var(--ink); font: inherit; }
.hd-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.hd-chips .chip[aria-current] { background: var(--senal-suave); border-color: var(--senal); color: var(--senal-tinta); }

@media print { .hd-elige, .hd-busca, .hd-cuenta { display: none !important; } }
