/* Outfit (variable), self-hosted. Subconjuntos latin y latin-ext. */
@font-face {
  font-family: "Outfit Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts/outfit-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Outfit Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("/fonts/outfit-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --bg: #241B17;
  --surface: #322620;
  --text: #FCF0E9;
  --muted: #CDAC9C;
  --accent: #D9AEB1;
  --peach: #4A3830;
  --line: #46362E;
  --lavender-soft: #3B2D40;
  --shell: rgb(252 240 233 / .05);
  --shell-ring: rgb(252 240 233 / .07);
  --shadow: 0 1px 2px rgb(0 0 0 / .2), 0 6px 18px rgb(0 0 0 / .25);
  --focus: #EECFC3;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Outfit Variable", system-ui, sans-serif; -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
svg { display: block; }
[hidden] { display: none !important; }

/* Textos con una versión por idioma (interfaz: data-u, contenido: data-c): solo se ve la del idioma activo */
html[data-lang] [data-u], html[data-lang] [data-c] { display: none; }
html[data-lang="es"] [data-u="es"], html[data-lang="es"] [data-c="es"],
html[data-lang="en"] [data-u="en"], html[data-lang="en"] [data-c="en"],
html[data-lang="pt"] [data-u="pt"], html[data-lang="pt"] [data-c="pt"],
html[data-lang="de"] [data-u="de"], html[data-lang="de"] [data-c="de"] { display: inline; }

/* Keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 12px;
}

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 20; padding: 10px 14px; border-radius: 10px;
  background: var(--surface); box-shadow: var(--shadow); font-weight: 500;
}
.skip:focus { top: 12px; }

main { position: relative; max-width: 460px; margin: 0 auto; padding: 20px 16px 40px; }

/* Selector de idioma: un botón con el idioma actual que abre la lista */
.lang { position: absolute; top: 16px; right: 16px; z-index: 30; font-size: 13px; font-weight: 500; }
.lang-btn {
  display: flex; align-items: center; gap: 4px; min-height: 32px; padding: 6px 8px 6px 10px; border: 0; border-radius: 8px;
  background: var(--peach); color: var(--text); font: inherit; cursor: pointer;
}
.lang-btn svg { transition: transform .2s var(--ease); }
.lang-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.lang-list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 156px; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.lang-list li {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 8px 10px; border-radius: 8px;
  color: var(--muted); cursor: pointer;
}
.lang-list li b { min-width: 22px; font-weight: 600; color: var(--text); }
.lang-list li:hover, .lang-list li:focus-visible { background: rgb(252 240 233 / .08); color: var(--text); }
.lang-list li[aria-selected="true"] { background: var(--peach); color: var(--text); }
.lang-list li:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

header { text-align: center; padding-top: 28px; }
.avatar {
  width: 104px; height: 104px; border-radius: 999px; object-fit: cover; margin: 0 auto;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line);
}
.avatar:not(img) { display: block; background: var(--peach); }
h1 { font-size: 26px; font-weight: 600; margin-top: 16px; letter-spacing: -0.01em; }
header p { color: var(--muted); font-size: 15.5px; margin-top: 4px; }
.socials { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin-top: 14px; }
.socials a {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  color: var(--text); transition: background .2s ease;
}
.socials a:hover { background: var(--peach); }

section { margin-top: 28px; }
h2 { font-size: 15px; font-weight: 500; color: var(--accent); margin: 0 4px 10px; }

/* Search */
.search {
  position: sticky; top: 0; z-index: 10; margin: 18px -16px 0; padding: 10px 16px; background: var(--bg);
}
.search + section { margin-top: 12px; }
.search label {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 6px 0 14px;
  background: var(--surface); border-radius: 14px; box-shadow: 0 0 0 1px var(--line);
  transition: box-shadow .2s var(--ease);
}
.search label:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.search .glass { color: var(--muted); flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text);
  font: 400 16px/1 "Outfit Variable", system-ui, sans-serif;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear {
  width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--peach); color: var(--text);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.empty { text-align: center; color: var(--muted); padding: 28px 8px 8px; font-size: 15px; }
.empty a { color: var(--text); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* Rows */
.row {
  display: flex; align-items: center; gap: 12px; padding: 8px; padding-right: 16px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  transition: transform .2s var(--ease);
}
.res > :not(h2) + * { margin-top: 10px; }
#search-list { display: grid; gap: 10px; }
.row:hover { transform: translateY(-2px); }
.row:active { transform: scale(.98); }
.row .thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
.row .ico { width: 52px; height: 52px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--peach); }
.row .txt { flex: 1; min-width: 0; }
.row .title, .row .sub { display: block; }
.row .title { font-weight: 500; font-size: 16px; line-height: 1.25; }
.row .sub { color: var(--muted); font-size: 13px; margin-top: 1px; overflow-wrap: anywhere; }
.row .go { color: var(--muted); flex: none; }

/* Highlights carousel */
.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: 40%; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
  margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.hl {
  display: block; scroll-snap-align: start; padding: 5px; border-radius: 22px;
  background: var(--shell); box-shadow: 0 0 0 1px var(--shell-ring); transition: transform .2s var(--ease);
}
.hl:hover { transform: translateY(-2px); }
.hl:active { transform: scale(.98); }
.hl .core { background: var(--surface); border-radius: 17px; overflow: hidden; box-shadow: var(--shadow); height: 100%; }
.hl img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; object-position: 50% 15%; }
.hl .cap { padding: 9px 10px 11px; }
.hl .title { display: block; font-weight: 600; font-size: 14px; line-height: 1.25; }
.hl .sub { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Members banner */
.banner {
  display: grid; grid-template-columns: 1fr 116px; align-items: center;
  background: var(--lavender-soft); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s var(--ease);
}
.banner:active { transform: scale(.98); }
.banner .txt { padding: 16px; }
.banner .title { display: block; font-weight: 600; font-size: 18px; line-height: 1.2; }
.banner .sub { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.35; margin-top: 6px; }
.banner img { width: 116px; height: 116px; object-fit: cover; }

/* Free downloads grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { display: block; transition: transform .2s var(--ease); }
.tile:active { transform: scale(.98); }
.tile img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 16px; box-shadow: var(--shadow); }
.tile .title { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.25; margin-top: 8px; }
.tile .sub { display: block; color: var(--muted); font-size: 13px; }

footer { text-align: center; color: var(--muted); font-size: 13px; margin-top: 40px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .carousel { scroll-behavior: auto; }
}

/* Links sin imagen */
.banner.noimg { grid-template-columns: 1fr; }
.ph { display: grid; place-items: center; background: var(--peach); color: var(--muted); }
.hl .ph { width: 100%; aspect-ratio: 1 / 1; }
.tile.noimg { display: flex; flex-direction: column; justify-content: center; aspect-ratio: 1 / 1; padding: 16px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.tile .ph { width: 100%; aspect-ratio: 1 / 1; border-radius: 16px; box-shadow: var(--shadow); }
.tile.noimg .ph { display: none; }
.tile.noimg .title { margin-top: 0; }

/* Preview del panel: link que se está editando */
[data-hl] { outline: 2px solid var(--accent); outline-offset: 3px; }
