/* Accesible — GitHub Pages site styles */

:root {
  --bg: #0f1419;
  --bg-elevated: #161d26;
  --surface: #1c2530;
  --text: #e8ecf1;
  --text-muted: #9aa5b5;
  --accent: #5b8def;
  --accent-soft: rgba(91, 141, 239, 0.15);
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --max: 920px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(91, 141, 239, 0.18), transparent),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(91, 141, 239, 0.06), transparent);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  padding-left: 0.75rem;
  margin-left: 0.25rem;
  border-left: 1px solid var(--border);
}

.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.lang-switch a:hover {
  opacity: 1;
  background: var(--accent-soft);
  text-decoration: none;
}

.lang-switch a[aria-current="page"] {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--accent);
  pointer-events: none;
}

/* Language dropdown (esquina superior derecha) */
.lang-dropdown {
  display: flex;
  align-items: center;
}

.lang-dropdown details {
  position: relative;
}

.lang-dropdown summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  height: 2.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(28, 37, 48, 0.45);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  user-select: none;
}

.lang-dropdown-label {
  white-space: nowrap;
}

.lang-dropdown summary::-webkit-details-marker {
  display: none;
}

.lang-dropdown details[open] summary {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.6rem);
  min-width: 16rem;
  background: rgba(15, 20, 25, 0.98);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  z-index: 30;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.lang-dropdown details[open] .lang-dropdown-menu {
  display: block;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.lang-dropdown-item-label {
  white-space: nowrap;
}

.lang-dropdown-item:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.lang-dropdown-item[aria-current="page"] {
  background: rgba(91, 141, 239, 0.22);
  color: var(--text);
  pointer-events: none;
}

.lang-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.lang-dropdown-flag {
  width: 1.55rem;
  height: 1.1rem;
  object-fit: contain;
  border-radius: 3px;
  display: block;
}

/* Euskara / Galego / Català: iconos SVG (Unicode no incluye estas banderas como emoji) */
.lang-switch a.lang-flag-img {
  width: auto;
  min-width: 2.35rem;
  padding: 0 0.15rem;
}

.lang-switch a.lang-flag-img img {
  display: block;
  width: 1.7rem;
  height: 1.15rem;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Ikurriña (SVG con cruz blanca explícita #FFFFFF) */
.lang-switch a.lang-flag-img img[src$="eu.svg"],
.lang-landing-flag[src$="eu.svg"] {
  width: 1.45rem;
  height: 1.45rem;
  object-fit: contain;
}

/* Texto EU/GL/CA (p. ej. landing) si no se usa imagen */
.lang-switch a.lang-code {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  width: auto;
  min-width: 2.35rem;
  padding: 0 0.4rem;
}

/* Landing language chooser (root index) */
.lang-landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lang-landing .box {
  text-align: center;
  max-width: 28rem;
}

.lang-landing h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.lang-landing p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.lang-landing .choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.lang-landing .choices a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--text);
}

.lang-landing .choices a:hover {
  border-color: rgba(91, 141, 239, 0.45);
  text-decoration: none;
}

.lang-landing .footer-disclaimer {
  margin-top: 2rem;
  padding: 0 0.5rem;
  font-size: 0.72rem;
}

.lang-code-inline {
  display: inline-block;
  min-width: 1.75rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-right: 0.15rem;
  opacity: 0.9;
}

.lang-landing-flag {
  vertical-align: middle;
  margin-right: 0.35rem;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav a:hover {
  color: var(--text);
}

/* Hero */
.hero {
  padding: 4rem 0 3.5rem;
  text-align: center;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hero .tagline {
  margin: 0 auto 2rem;
  max-width: 36rem;
  color: var(--text-muted);
  font-size: 1.15rem;
}

.hero-note {
  margin-top: 1.5rem !important;
  margin-bottom: 0 !important;
  font-size: 0.9rem !important;
}

/* Tarjetas con imagen al pie: alineación vertical consistente */
.card-feature-photo {
  display: flex;
  flex-direction: column;
}

.card-feature-img {
  margin: 1.15rem 0 0;
  margin-top: auto;
  padding-top: 1.15rem;
  line-height: 0;
}

.card-feature-img img {
  display: block;
  width: 100%;
  height: 16.5rem;
  object-fit: cover;
  max-height: none;
  object-position: center 22%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Subtítulos: desplazar encuadre a la derecha (menos cara a la izquierda) */
.card-feature-img img[src$="subtitulos.png"] {
  object-position: 72% 38%;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(135deg, #5b8def, #4a7ad4);
  color: #fff;
  box-shadow: 0 4px 24px rgba(91, 141, 239, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(91, 141, 239, 0.45);
  text-decoration: none;
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text);
}

/* Sections */
section {
  padding: 2.5rem 0;
}

section h2 {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.section-intro {
  color: var(--text-muted);
  margin: -0.45rem 0 0.5rem;
}

.app-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.quick-links-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.app-card p {
  min-height: 4.5rem;
  margin-bottom: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.compare-table th,
.compare-table td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.compare-table th {
  background: rgba(91, 141, 239, 0.14);
  font-weight: 700;
}

.compare-table tr:last-child td {
  border-bottom: 0;
}

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Cuatro funciones en una fila en escritorio (el wrap ~920px admite 4 columnas) */
@media (min-width: 900px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: rgba(91, 141, 239, 0.35);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card .icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1;
}

/* Page content (support, privacy) */
.page-hero {
  padding: 3rem 0 2rem;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.page-hero .meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.prose {
  padding-bottom: 4rem;
}

.prose h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.2rem;
}

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

.prose p,
.prose li {
  color: var(--text-muted);
}

.prose ul {
  padding-left: 1.25rem;
}

.prose strong {
  color: var(--text);
}

.note {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border: 1px solid rgba(91, 141, 239, 0.25);
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer .inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer .links {
  display: flex;
  gap: 1.25rem;
}

.footer-disclaimer {
  margin: 0.75rem auto 0;
  padding: 0 1.5rem 1.25rem;
  max-width: var(--max);
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-muted);
  opacity: 0.9;
  text-align: center;
}

.footer-disclaimer a {
  color: var(--text-muted);
  text-decoration: underline;
}

.footer-disclaimer a:hover {
  color: var(--text);
}

/* Layout helper */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
