/* carretes.llepo.photos: parrilla justificada a todo el ancho, agrupada por
   carretes, y visor a pantalla completa. Oscuro, como llepo.photos. */
:root {
    color-scheme: dark;
    --bg: #1c1b1e;
    --surface: #25242a;
    --fg: #e9e6ea;
    --muted: #9a95a0;
    --line: #34323a;
    --stamp: #ff9a3c;
    --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --f-body: "Barlow", system-ui, sans-serif;
    --f-stamp: "Share Tech Mono", ui-monospace, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 var(--f-body); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1800px; margin: 0 auto; padding-inline: clamp(16px, 3vw, 40px); padding-block: 28px 40px; }

header.site { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 28px; }
.logo { font-family: Candara, "Segoe UI", var(--f-body); font-style: italic; font-size: 26px; text-decoration: none; }
.logo span { color: var(--muted); }
header.site nav { font-family: var(--f-display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; }
header.site nav a { color: var(--muted); text-decoration: none; }
header.site nav a:hover { color: var(--fg); }

.roll { margin-bottom: 48px; }
.roll-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; font-family: var(--f-display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em; font-size: 13px; color: var(--muted); }
.roll-head h2 { margin: 0; font-weight: 600; font-size: 13px; letter-spacing: 0.14em; color: var(--fg); }
.roll-title { color: var(--muted); font-weight: 500; }
.roll-head .rule { flex: 1; min-width: 20px; height: 1px; background: repeating-linear-gradient(90deg, var(--line) 0 10px, transparent 10px 16px); }
.stamp { font-family: var(--f-stamp); color: var(--stamp); letter-spacing: 0.06em; font-size: 15px; text-transform: none; text-shadow: 0 0 6px rgba(255, 154, 60, 0.45); }

/* Sin JavaScript: aproximación con flex; el script ajusta cada fila al píxel. */
.grid { display: flex; flex-wrap: wrap; gap: 6px; }
.ph { position: relative; display: block; flex: calc(var(--r) * 100) 1 calc(var(--r) * 240px); aspect-ratio: var(--r); max-width: 100%; background: var(--surface); overflow: hidden; cursor: zoom-in; }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph .n { position: absolute; right: 8px; bottom: 6px; font-family: var(--f-stamp); font-size: 13px; color: var(--stamp); opacity: 0; transition: opacity 0.25s; text-shadow: 0 0 4px rgba(0, 0, 0, 0.8); }
.ph:hover .n, .ph:focus-visible .n { opacity: 1; }

.empty { color: var(--muted); padding: 2rem 0; }
.site-foot { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 16px; }

.lb { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; background: #141316;
      padding: calc(env(safe-area-inset-top, 0px) + 48px) 16px calc(env(safe-area-inset-bottom, 0px) + 56px); }
.lb img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.lb button { background: none; border: 0; color: var(--fg); font: inherit; cursor: pointer; padding: 10px 14px; }
.lb .x { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 6px); right: 8px; font-size: 28px; line-height: 1; }
.lb .prev, .lb .next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 34px; color: var(--muted); }
.lb .prev { left: 4px; }
.lb .next { right: 4px; }
.lb .prev:hover, .lb .next:hover { color: var(--fg); }
.lb .bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px;
           padding: 12px 20px calc(env(safe-area-inset-bottom, 0px) + 14px); font-family: var(--f-display); text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; color: var(--muted); }
.lb .bar .stamp { font-size: 16px; }
@media (max-width: 640px) { .lb .prev, .lb .next { display: none; } }
@media (prefers-reduced-motion: reduce) { .ph .n { transition: none; } }
