@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400;1,600&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #f8f8f0;
  --text: #111111;
  --text-muted: #555555;
  --red: #cc0000;
  --border: #d0ccc4;
  --max-width: 680px;
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html { font-size: 18px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  line-height: 1.75;
  padding: 0 1rem;
}

/* ── Layout ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 0 6rem;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.25rem; }
h3 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }

p { margin-bottom: 1.25rem; text-align: justify; hyphens: auto; }

:lang(es) { quotes: "«" "»" "‹" "›"; }

/* ── Links — subrayado rojo ── */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 2px;
  text-decoration-thickness: 3.5px;
  transition: color 0.15s;
}
a:hover { color: var(--red); }

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem auto;
}

figcaption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: -1.5rem;
  margin-bottom: 2rem;
  font-style: italic;
}

/* ── Pull quote ── */
blockquote {
  float: left;
  clear: left;
  width: 220px;
  margin: 0.5rem 2rem 1.5rem -260px;
  padding: 0;
  border: none;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 600;
  line-height: 1.4;
  color: var(--red);
  border-top: 2px solid var(--red);
  padding-top: 0.6rem;
  text-align: left !important;
}

blockquote p { margin: 0; text-align: left !important; hyphens: none; }

@media (max-width: 980px) {
  blockquote {
    float: none;
    width: auto;
    margin: 1.5rem 0;
    margin-right: 0;
    border-left: 3px solid var(--red);
    border-top: none;
    padding: 0.25rem 0 0.25rem 1rem;
    font-size: 1rem;
    color: var(--red);
  }
}

/* ── Code ── */
code {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: #eeebe3;
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

pre {
  background: #1a1a1a;
  color: #f0ebe0;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.82rem;
}

pre code { background: none; padding: 0; color: inherit; }

/* ── Header ── */
.site-header {
  border-bottom: 2px dashed var(--border);
  padding: 1.5rem 0 1rem;
  margin-bottom: 3rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  gap: 0.25em;
}
.site-title-main {
  display: flex;
  align-items: center;
}
.site-title-jp {
  font-family: var(--font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: var(--red);
  text-transform: none;
  font-weight: 400;
}
.site-title:hover { color: var(--red); text-decoration: none; }
.site-title .dot {
  display: inline-block;
  width: 0.18em;
  height: 0.18em;
  background: var(--red);
  vertical-align: baseline;
  position: relative;
  top: 5px;
  margin-left: 0.06em;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
}
.site-nav a:hover { color: var(--red); }
.site-nav a.active { color: var(--text); font-weight: 600; }

/* ── Post header ── */
.post-meta {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
}

.post-tag {
  color: var(--red);
  text-decoration: none;
  font-size: 0.75rem;
}
.post-tag::before { content: '#'; }
.post-tag:hover { text-decoration: underline; text-decoration-color: var(--red); }
.post-tag-issue::before { content: '' !important; }

.issue-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1.5px solid var(--text);
  padding: 1px 6px;
  color: var(--text);
  text-decoration: none;
}

/* ── Post list ── */
.post-list { list-style: none; }
.post-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.post-list li:first-child { border-top: 1px solid var(--border); }

.post-list-title {
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}
.post-list-title:hover { color: var(--red); }

.post-list-meta {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ── Issue / Descarga ── */
.issue-card {
  border: 2px solid var(--text);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.issue-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.issue-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.issue-count { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); }

.btn-download {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--text);
  color: var(--bg);
  padding: 0.5rem 1rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;
}
.btn-download:hover { background: var(--red); color: #fff; }

/* ── Cómo imprimir ── */
.how-to-print {
  margin-top: 3.5rem;
  border-top: 3px solid var(--text);
  padding-top: 1.5rem;
}

.how-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.how-steps {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.how-diagram {
  width: 100%;
  max-width: 110px;
  color: var(--text);
}

.how-diagram svg {
  width: 100%;
  height: auto;
  display: block;
}

.how-desc {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.6;
  text-align: center;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

.how-desc strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.2rem;
}

.how-arrow {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--text-muted);
  align-self: center;
  padding-bottom: 2rem;
}

@media (max-width: 600px) {
  .how-steps { gap: 1rem; }
  .how-arrow { display: none; }
  .how-step { flex-direction: row; gap: 1rem; align-items: center; min-width: 100%; }
  .how-diagram { max-width: 70px; flex-shrink: 0; }
  .how-desc { text-align: left; margin-top: 0; }
}

/* ── Newsletter ── */
.newsletter-block {
  border-top: 2px solid var(--text);
  margin-top: 5rem;
  padding-top: 2rem;
}
.newsletter-block h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.newsletter-block p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1rem; }

.newsletter-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.newsletter-form input[type="email"] {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  border: 1.5px solid var(--text);
  background: var(--bg);
  padding: 0.5rem 0.75rem;
  flex: 1;
  min-width: 200px;
  outline: none;
}
.newsletter-form input[type="email"]:focus { border-color: var(--red); }
.newsletter-form button {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.newsletter-form button:hover { background: var(--red); }

/* ── Footer ── */
.site-footer {
  border-top: 2px dashed var(--border);
  margin-top: 2rem;
  padding: 2rem 0;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Lang selector ── */
.lang-selector {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  display: flex;
  gap: 0.5rem;
}
.lang-selector a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 1px 4px;
}
.lang-selector a.active {
  color: var(--text);
  border-bottom: 1.5px solid var(--red);
}

/* ── Settings panel ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

#settings-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
  z-index: 100;
}
#settings-toggle:hover,
#settings-toggle.active { color: var(--red); }
#settings-toggle.spinning { animation: spin 0.4s ease-out; }

#settings-panel {
  position: fixed;
  bottom: 4.2rem;
  right: 1.5rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  padding: 1rem 1.25rem;
  width: 200px;
  z-index: 100;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.settings-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-size: 0.65rem;
  margin-bottom: 0.5rem;
  text-align: left;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

#toggle-dark, #toggle-gameboy {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 2px 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}
#toggle-dark:hover, #toggle-gameboy:hover { border-color: var(--red); }

.font-size-btn {
  font-family: var(--font-serif);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  padding: 2px 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex: 1;
}
.font-size-btn:hover,
.font-size-btn.active { border-color: var(--red); color: var(--text); }

/* ── Font sizes ── */
:root[data-size="small"]  { font-size: 15px; }
:root[data-size="normal"] { font-size: 18px; }
:root[data-size="large"]  { font-size: 21px; }

/* ── Dark mode ── */
:root.dark {
  --bg: #1a1917;
  --text: #e8e4dc;
  --text-muted: #888580;
  --border: #333128;
}
:root.dark code { background: #2a2925; }
:root.dark pre  { background: #111; }

/* ── Responsive ── */
@media (max-width: 640px) {
  html { font-size: 16px; }
  h1 { font-size: 1.7rem; }
  .site-header { flex-direction: column; gap: 0.75rem; }
  .issue-card { flex-direction: column; }
}

/* ── Game Boy Camera filter ── */
.gameboy img {
  filter: grayscale(100%) contrast(200%) brightness(110%);
  image-rendering: pixelated;
}
