/* ==========================================================================
   HMB · METAL  (v1)
   Capa final del template: se carga la ULTIMA, despues de todo el resto.
   1) Legibilidad: tokens de texto con contraste >= 4.5 sobre negro.
   2) Formularios y registro.
   3) Estetica metalera: sangre, fuego, acero.
   ========================================================================== */

:root {
  /* Texto legible sobre fondos oscuros (relacion de contraste sobre #0a0a0a) */
  --tx-faint:  #8f8f8f;   /* 6,1:1  etiquetas y notas */
  --tx-dim:    #a3a3a3;   /* 7,8:1  texto secundario */
  --gold-text: #c9a45c;   /* 8,4:1  dorado apagado */
  --fire-text: #ff4d2e;   /* 6,0:1  rojo para TEXTO (el --fire de siempre queda para fondos y bordes) */

  --metal-edge: linear-gradient(90deg, transparent, #5c0000 12%, #cc2200 50%, #5c0000 88%, transparent);
  --blood-glow: 0 0 22px rgba(204, 34, 0, .45);
  --steel-grad: linear-gradient(180deg, #1c1c1c, #0d0d0d);
}

/* ---------- 1 · Base: selección, foco, barra de desplazamiento ---------- */
html { scrollbar-color: #8b0000 #0a0a0a; scrollbar-width: thin; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: #0a0a0a; border-left: 1px solid #1a1a1a; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #cc2200, #5c0000); border: 2px solid #0a0a0a; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ff4d2e, #8b0000); }
::selection { background: #cc2200; color: #fff; text-shadow: none; }
:focus-visible { outline: 2px solid #daa520; outline-offset: 2px; }

body.hmb-body {
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -8%, rgba(139, 0, 0, .30), transparent 70%),
    radial-gradient(ellipse 70% 35% at 50% 112%, rgba(139, 0, 0, .22), transparent 70%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* ---------- 2 · Formularios (también el registro y el login) ---------- */
input::placeholder, textarea::placeholder, select::placeholder {
  color: var(--tx-faint) !important; opacity: 1 !important; font-style: normal !important;
}
.hmb-component input:not([type=checkbox]):not([type=radio]):not([type=range]),
.hmb-component select, .hmb-component textarea {
  background-color: #0e0e0e; color: #efefef; border: 1px solid #333; border-radius: 0;
  transition: border-color .2s, box-shadow .2s;
}
.hmb-component input:focus, .hmb-component select:focus, .hmb-component textarea:focus {
  border-color: #cc2200 !important; box-shadow: 0 0 0 3px rgba(204, 34, 0, .22), var(--blood-glow); outline: none;
}
.hmb-component label, .hmb-component legend { color: var(--tx-dim); }
input[type=checkbox], input[type=radio] { accent-color: #cc2200; }

/* Registro / login (com_hmb y módulos): todo lo que era gris oscuro pasa a legible */
.hmb-cw .hmb-lb, .hmb-cw .hmb-ft, .hmb-cw .hmb-ctx, .hmb-cw .hmb-hint, .hmb-cw .hmb-bl,
.hmb-header-user-hello, .hmb-colab-title, .hmb-login-footer { color: var(--tx-dim) !important; }
.hmb-cw .hmb-sw, .hmb-cw .hmb-lk a, .hmb-login-footer a { color: var(--fire-text) !important; }
.hmb-cw .hmb-sw:hover, .hmb-cw .hmb-lk a:hover, .hmb-login-footer a:hover { color: #daa520 !important; }
.hmb-cw .hmb-tt, .hmb-cw .hmb-sb { opacity: 1 !important; }
.hmb-cw .hmb-tt { color: #fff !important; text-shadow: 0 0 22px rgba(204, 34, 0, .55); }
.hmb-cw .hmb-sb { color: var(--gold-text) !important; }
.hmb-cw .hmb-in { color: #efefef !important; background: #0e0e0e !important; border-color: #333 !important; }
.hmb-cw .hmb-in:focus { border-color: #cc2200 !important; box-shadow: 0 0 0 3px rgba(204, 34, 0, .22); }
/* texto oscuro sobre rojo = ilegible: botones principales siempre en blanco */
.hmb-cw .hmb-bt, .hmb-cw .hmb-bt .hmb-bts, .hmb-btn-submit, .hmb-btn-submit .hmb-btn-text,
.hmb-btn-primary, .btn-primary, input[type=submit] { color: #fff !important; }

/* ---------- 3 · Estética metalera ---------- */

/* Panel de contenido: acero oscuro con filo rojo */
.hmb-component-inner {
  position: relative;
  border: 1px solid #1d1d1d;
  box-shadow: inset 0 0 70px rgba(0, 0, 0, .65), 0 0 0 1px rgba(139, 0, 0, .18), 0 18px 50px rgba(0, 0, 0, .7);
}
.hmb-component-inner::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--metal-edge);
  box-shadow: 0 0 12px rgba(204, 34, 0, .55); pointer-events: none;
}

/* Titulares: fuego debajo */
.hmb-component-inner h1 {
  font-family: var(--font-display, 'Metal Mania', cursive); font-weight: 400; letter-spacing: .05em;
  color: #fff; text-shadow: 0 2px 18px rgba(204, 34, 0, .5);
}
.hmb-component-inner h1::after {
  content: ''; display: block; height: 3px; margin: .55rem 0 1rem; background: var(--metal-edge); box-shadow: 0 0 14px rgba(204, 34, 0, .6);
}
.hmb-component-inner h2 { font-family: var(--font-title, Oswald, sans-serif); letter-spacing: .08em; text-transform: uppercase; }
.hmb-component-inner h2::before { content: '\25C6'; color: #cc2200; font-size: .6em; margin-right: .55rem; vertical-align: middle; }
.hmb-cw h1::after, .hmb-cw h2::before, .cc2 h1::after, .cc2 h2::before, .hb h1::after, .hb h2::before { content: none !important; display: none !important; }

/* Enlaces del texto: brasa */
.hmb-component-inner a:not([class]) { color: var(--fire-text); border-bottom: 1px solid rgba(255, 77, 46, .35); transition: color .2s, border-color .2s, text-shadow .2s; }
.hmb-component-inner a:not([class]):hover { color: #daa520; border-color: #daa520; text-shadow: 0 0 10px rgba(218, 165, 32, .5); }

/* Citas, listas, separadores, tablas */
blockquote {
  border-left: 4px solid #cc2200; background: linear-gradient(90deg, rgba(139, 0, 0, .22), transparent 80%);
  padding: 1rem 1.4rem; margin: 1.4rem 0; color: #e2d6c4; font-family: var(--font-accent, 'Cinzel', serif);
}
.hmb-component-inner ul:not([class]) { list-style: none; padding-left: 1.2rem; }
.hmb-component-inner ul:not([class]) > li { position: relative; padding-left: .3rem; }
.hmb-component-inner ul:not([class]) > li::before { content: '\25B8'; position: absolute; left: -1rem; color: #cc2200; }
.hmb-component-inner hr { border: 0; height: 2px; margin: 1.8rem 0; background: var(--metal-edge); }
.hmb-component-inner table { border-collapse: collapse; width: 100%; }
.hmb-component-inner th { background: #1a0000; color: var(--gold-text); text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-title, Oswald, sans-serif); }
.hmb-component-inner th, .hmb-component-inner td { border: 1px solid #262626; padding: .5rem .7rem; }
.hmb-component-inner tbody tr:nth-child(even) { background: rgba(255, 255, 255, .02); }
.hmb-component-inner tbody tr:hover { background: rgba(204, 34, 0, .08); }

/* Módulos (cajas laterales y de portada): filo de acero y brillo al pasar */
.hmb-module { border-top: 2px solid #5c0000; transition: border-color .25s, box-shadow .25s; }
.hmb-module:hover { border-top-color: #cc2200; box-shadow: 0 -2px 18px rgba(204, 34, 0, .25); }
.hmb-module-title { text-shadow: 0 0 12px rgba(204, 34, 0, .35); }

/* Pie de página: llamas */
.hmb-footer { position: relative; border-top: 0; box-shadow: 0 -14px 46px rgba(139, 0, 0, .3); }
.hmb-footer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--metal-edge); box-shadow: 0 0 16px rgba(204, 34, 0, .7); }

/* Botones de Joomla (btn-primary) en estilo cuchilla */
.btn-primary, input[type=submit], button[type=submit].btn {
  background: linear-gradient(160deg, #cc2200, #8b0000) !important; border: 1px solid rgba(204, 34, 0, .6) !important; border-radius: 0 !important;
  letter-spacing: .1em; text-transform: uppercase; font-family: var(--font-title, Oswald, sans-serif); transition: filter .2s, box-shadow .2s, transform .2s;
}
.btn-primary:hover, input[type=submit]:hover, button[type=submit].btn:hover { filter: brightness(1.15); box-shadow: var(--blood-glow); transform: translateY(-1px); }

/* Mensajes del sistema (errores, avisos) legibles y en tono */
#system-message-container .alert, .alert {
  background: #170000; color: #f3d3cb; border: 1px solid #5c0000; border-left: 4px solid #cc2200; border-radius: 0;
}
#system-message-container .alert-success, .alert-success { background: #04150a; color: #cdeed8; border-color: #124d28; border-left-color: #2e9d57; }
#system-message-container .alert-warning, .alert-warning { background: #1a1200; color: #f2e2b8; border-color: #5c4500; border-left-color: #daa520; }
#system-message-container .alert a, .alert a { color: #ff7a5f; }

/* ---------- 4 · Ajustes de contraste en extensiones con variables propias ---------- */
.metalmap-wrapper { --mm-text-muted: #a3a3a3 !important; }
.mm-btn-filter { background: #c4161f !important; color: #fff !important; }
.hmbq-rank { color: var(--fire-text) !important; }
.hmbq-ps { background: #b3121d !important; color: #fff !important; }
.hmbq-board-tab.is-active { background: #c4161f !important; color: #fff !important; }
.hmb-ct-btn { color: #fff !important; }
.cc2-prov { color: var(--tx-dim) !important; }
.hmb-card-band { color: var(--fire-text) !important; }
.cc2-eyebrow, .cc2 .cc2-month__h { color: var(--fire-text) !important; }

/* ---------- 5 · Capa metalera v2: cabecera, menú, tarjetas, fuego ---------- */

/* Textura sutil de metal cepillado sobre toda la página (sin imagen: gradientes) */
body.hmb-body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .16;
  background: url('../images/metal/acero.webp') center top / cover no-repeat;
}

/* Menú principal: raya de fuego bajo el enlace activo y brillo al pasar */
.hmb-header-nav a { position: relative; transition: color .2s, text-shadow .2s; }
.hmb-header-nav a:hover { color: #fff; text-shadow: 0 0 12px rgba(255, 77, 46, .75); }
.hmb-header-nav .hmb-ml-ul > li > a::after {
  content: ''; position: absolute; left: 12%; right: 12%; bottom: -2px; height: 2px;
  background: linear-gradient(90deg, transparent, #ff4d2e, transparent);
  transform: scaleX(0); transition: transform .25s ease;
}
.hmb-header-nav .hmb-ml-ul > li > a:hover::after { transform: scaleX(1); }

/* Tarjetas de noticias y vídeos: borde de acero que arde al pasar el ratón */
.hmb-card { position: relative; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.hmb-card:hover {
  transform: translateY(-4px); border-color: #cc2200 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .7), 0 0 22px rgba(204, 34, 0, .35);
}
.hmb-card img { transition: transform .5s ease, filter .35s ease; }
.hmb-card:hover img { transform: scale(1.04); filter: contrast(1.08) saturate(1.1); }

/* Títulos de sección de módulo con filo de espada */
.hmb-module-title { position: relative; padding-bottom: .5rem; }
.hmb-module-title::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 64px; height: 2px;
  background: linear-gradient(90deg, #cc2200, transparent); box-shadow: 0 0 10px rgba(204, 34, 0, .7);
}

/* Imágenes de contenido: marco oscuro con esquina de remache */
.hmb-component-inner img:not([class]) { border: 1px solid #262626; box-shadow: 0 6px 22px rgba(0, 0, 0, .65); }

/* Botón flotante de acceso con pulso de brasa */
.hmb-float-tab { animation: hmb-brasa 3.2s ease-in-out infinite; }
@keyframes hmb-brasa { 0%, 100% { box-shadow: 0 0 8px rgba(204, 34, 0, .4); } 50% { box-shadow: 0 0 22px rgba(255, 77, 46, .75); } }

/* Colaboradores del pie: el efecto gris + 55% de opacidad los hacía casi invisibles sobre negro */
.hmb-colab-item { background: radial-gradient(circle at 50% 40%, #2a2a2a, #121212) !important; border-color: #5c0000 !important; }
.hmb-colab-gris img { filter: brightness(1.15) !important; opacity: 1 !important; }
.hmb-colab-gris .hmb-colab-item:hover img { filter: none !important; opacity: 1 !important; }
.hmb-colab-item:hover { box-shadow: 0 0 18px rgba(204, 34, 0, .45); }
.hmb-colab-nombre { color: var(--tx-dim) !important; }

/* El perfil de usuario usa la clase .hmb-hero, que hmb-base.css define como portada de 60vh: dejaba la ficha medio vacia */
.hmb-pf .hmb-hero { min-height: 0 !important; overflow: visible !important; background-color: transparent; }
/* El desplegable de la foto sale del encabezado: tiene que dibujarse por encima de las filas de datos y de las acciones */
.hmb-pf .hmb-hero { z-index: 20 !important; }
.hmb-pf .hmb-av-drop { z-index: 30; }
.hmb-pf .hmb-av-drop { left: 0 !important; transform: none !important; max-width: min(260px, calc(100vw - 80px)); }

/* ==========================================================================
   6 · METAL v3 — acero remachado, fuego y emblema (assets en ../images/metal/)
   ========================================================================== */

/* Emblema de alas y espadas como marca de agua fija, detrás de todo */
body.hmb-body::after {
  content: ''; position: fixed; left: 50%; top: 56%; width: min(78vw, 760px); aspect-ratio: 1;
  transform: translate(-50%, -50%); z-index: -1; pointer-events: none; opacity: .055;
  background: url('../images/metal/emblema.webp') center / contain no-repeat;
}

/* Barra de menú: placa de acero con filo de fuego */
.hmb-header-nav {
  background-image: linear-gradient(180deg, rgba(0,0,0,.62), rgba(0,0,0,.86)), url('../images/metal/acero.webp');
  background-size: auto, cover; background-position: center, center 30%; background-repeat: no-repeat; background-color: #0d0d0d;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 6px 26px rgba(0,0,0,.75), 0 2px 0 #5c0000, 0 3px 16px rgba(204,34,0,.35);
}

/* Cabecera: banda de remaches y luz de brasa arriba */
.hmb-header-banner { box-shadow: 0 0 0 1px #2a0000, 0 0 34px rgba(204,34,0,.28), inset 0 0 40px rgba(0,0,0,.6); }

/* Tarjetas: placa de acero oscuro bajo el contenido */
.hmb-card, .hmb-module, .hmb-component-inner {
  background-image: linear-gradient(180deg, rgba(22,22,22,.9), rgba(8,8,8,.95));
}

/* Botones principales: acero con filo rojo y brillo al pasar */
.hmb-readmore, .hmb-ct-btn, .btn-primary, .hmb-btn-p, .hmb-bt {
  position: relative; overflow: hidden; text-shadow: 0 1px 0 rgba(0,0,0,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 3px 12px rgba(0,0,0,.6);
}
.hmb-ct-btn:hover, .hmb-btn-p:hover, .hmb-bt:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 0 24px rgba(255,77,46,.55); }

/* Pie de página: muro de fuego + emblema + brasas que suben */
.hmb-footer {
  background-color: #070707;
  background-image: linear-gradient(180deg, rgba(0,0,0,.55), rgba(8,0,0,.9) 55%, rgba(5,0,0,.96)), url('../images/metal/acero.webp');
  background-size: auto, cover; background-position: center, center bottom; background-repeat: no-repeat;
  margin-top: 220px; isolation: isolate;
}
.hmb-footer::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: calc(100% - 110px); height: 440px; z-index: -1; pointer-events: none;
  background:
    url('../images/metal/fuego2.webp') 0 100% / 1100px auto repeat-x,
    url('../images/metal/fuego.webp') 0 100% / 1300px auto repeat-x;
  -webkit-mask-image: linear-gradient(0deg, transparent 0, #000 26%, #000 48%, transparent 100%); mask-image: linear-gradient(0deg, transparent 0, #000 26%, #000 48%, transparent 100%);
  transform-origin: 50% 100%;
  animation: hmb-llama-x 50s linear infinite, hmb-llama-y 3.4s ease-in-out infinite alternate, hmb-llama-luz 2.1s ease-in-out infinite alternate;
}
/* Las capas se desplazan una anchura exacta de tesela: el bucle no tiene salto */
@keyframes hmb-llama-x { from { background-position: 0 100%, 0 100%; } to { background-position: 1100px 100%, -1300px 100%; } }
@keyframes hmb-llama-y { from { transform: scaleY(1); } to { transform: scaleY(1.12); } }
@keyframes hmb-llama-luz { from { filter: brightness(.85) saturate(1.05); } to { filter: brightness(1.25) saturate(1.2); } }

/* Brasas: puntos de luz que suben desde el pie */
.hmb-footer::before { display: none; } /* la linea roja cruzaba las llamas */
.hmb-footer .hmb-container::before, .hmb-footer .container::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 260px; pointer-events: none; z-index: -1;
  background:
    radial-gradient(2px 2px at 8% 90%, #ff7a3c, transparent 60%), radial-gradient(2px 2px at 21% 70%, #ffb347, transparent 60%),
    radial-gradient(1.5px 1.5px at 33% 85%, #ff5a2a, transparent 60%), radial-gradient(2px 2px at 47% 60%, #ffa040, transparent 60%),
    radial-gradient(1.5px 1.5px at 58% 92%, #ff7a3c, transparent 60%), radial-gradient(2px 2px at 69% 74%, #ffc060, transparent 60%),
    radial-gradient(1.5px 1.5px at 81% 88%, #ff5a2a, transparent 60%), radial-gradient(2px 2px at 92% 66%, #ffa040, transparent 60%);
  animation: hmb-brasas 7s linear infinite;
}
@keyframes hmb-brasas { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-90px); opacity: 0; } }
.hmb-footer .hmb-container, .hmb-footer .container { position: relative; }

/* Títulos de bloque con remate de cuchilla */
.hmb-module-title, .hmb-component-inner h2 { letter-spacing: .1em; }
.hmb-component-inner h1 { text-transform: uppercase; }

/* Separador de secciones de portada: línea de brasa */
.hmb-row-noticias, .hmb-row-videos, .hmb-row-conciertos, .hmb-row-slider, .hmb-row-ef-frases { position: relative; }
.hmb-row-noticias::before, .hmb-row-videos::before, .hmb-row-conciertos::before, .hmb-row-ef-frases::before {
  content: ''; position: absolute; left: 8%; right: 8%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, #7a0000 20%, #ff4d2e 50%, #7a0000 80%, transparent);
  box-shadow: 0 0 10px rgba(255, 77, 46, .45);
}

@media (prefers-reduced-motion: reduce) {
  .hmb-footer::after, .hmb-footer .hmb-container::before, .hmb-footer .container::before { animation: none !important; }
}

/* Movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- 5 · Banner (carrusel) también en móvil ----------
   La cabecera completa se ocultaba en móvil y con ella el banner. Ahora solo se ve el banner, a todo el ancho,
   y la barra de menú es la única pegajosa (el banner se va con el scroll). */
@media (max-width: 768px) {
  .hmb-sticky-wrap { display: contents; }
  .hmb-header { position: static; }
  .hmb-header-nav { position: sticky; top: 0; z-index: 1000; background: var(--wine-black, #0a0000); }
  .hmb-header-top { display: block !important; border: 0 !important; padding: 0 !important; }
  .hmb-header-top-inner { display: block !important; max-width: none !important; padding: 0 !important; min-height: 0 !important; }
  .hmb-header-top .hmb-logo, .hmb-header-top .hmb-header-user { display: none !important; }
  .hmb-header-banner { display: block !important; width: 100% !important; padding: 0 !important; min-height: 0 !important; }
}

/* ===== MODULOS: objetivos tactiles >=32px y foco visible (rama modulos) ===== */
.hmb-share__btn, .hmb-share button { min-width: 34px; min-height: 34px; }
.hmb-latestnews .hmb-readmore, .hmb-readmore { min-height: 32px; }
.hmb-mod-ftag, .hmb-mod-viewall, .nc-btn { min-height: 36px; display: inline-flex; align-items: center; box-sizing: border-box; }
.hmb-tc a { min-height: 32px; }
.hmb-colab-item:focus-visible, .hmb-mod-ftag:focus-visible, .hmb-mod-viewall:focus-visible,
.hmb-tc a:focus-visible, .hmb-social__item:focus-visible, .hmb-share button:focus-visible { outline: 2px solid var(--fire-text, #ff4d2e); outline-offset: 2px; }
.hmb-login-footer a { display: inline-block; padding: 8px 4px; }
.hmb-skull { color: #ff4d2e; }
@media (prefers-reduced-motion: reduce) {
	.hmb-colab-item, .hmb-tc a, .hmb-social__item { transition: none !important; transform: none !important; }
}
@media (max-width: 600px) { .hmb-col-ef { padding: 1rem .6rem; } .hmb-subcol-temas { padding: 0; } }
