@font-face {
  font-family: "mona";
  src: url("fonts/Mona.otf") format("opentype");
}

@font-face {
  font-family: "pixelta";
  src: url("fonts/Pixelta.ttf") format("truetype");
}

@font-face {
  font-family: "glass";
  src: url("fonts/glass.ttf") format("truetype");
}

@font-face {
  font-family: "monocraft";
  src: url("fonts/Monocraft.ttf") format("truetype");
}

@font-face {
  font-family: "anotherhim";
  src: url("fonts/AnotherHim.ttf") format("truetype");
}

@font-face {
  font-family: "pixelitta";
  src: url("fonts/Pixelitta.ttf") format("truetype");
}

@font-face {
  font-family: "star";
  src: url("fonts/Star.otf") format("opentype");
}

@font-face {
  font-family: "ticketing";
  src: url("fonts/Ticketing.otf") format("opentype");
}

@font-face {
  font-family: "vcrjp";
  src: url("fonts/vcrjp.ttf") format("truetype");
}

:root {
  --bg: #f6f1e5;
  --ink: #23211b;
  --muted: #8b8474;
  --border: #23211b;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-family: "mona", Menlo, Monaco, "Lucida Console", "Liberation Mono",
    "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace;
  overflow: hidden;
}

a { color: inherit; }

/* ---------- overall layout: sidebar + main ---------- */

.layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 210px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: bold;
  margin-bottom: 2rem;
  font-family: "pixelta", monospace;
}

.brand img {
  width: 20px;
  height: 20px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-family: "pixelta", monospace;
}

.side-nav a {
  text-decoration: none;
}

.side-nav a:hover {
  color: var(--muted);
  text-decoration: underline;
}

.sidebar-avatar {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: cover;
  margin: -0.5rem 0 0.5rem;
}

.sidebar-bottom .muted {
  color: var(--muted);
  font-size: 0.8rem;
  font-family: "pixelta", monospace;
}

/* ---------- main content grid ---------- */

.content {
  flex: 1;
  display: grid;
  grid-template-columns: 3fr 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "calendar note"
    "calendar about";
  gap: 1.25rem;
  padding: 1.5rem;
  min-width: 0;
  min-height: 0;
}

.zone {
  position: relative;
  border: 1px solid var(--border);
  padding: 1.6rem 1rem 1rem;
  min-height: 0;
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.zone > h2 {
  position: absolute;
  top: -0.65em;
  left: 0.9rem;
  margin: 0;
  padding: 0 0.5em;
  background: var(--bg);
  font-family: "pixelta", monospace;
  font-size: 0.8rem;
  font-weight: normal;
  text-transform: lowercase;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.zone-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.zone-calendar { grid-area: calendar; }
.zone-note     { grid-area: note; }
.zone-about    { grid-area: about; }

.zone-about p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

/* ---------- calendar: month switch (radio hack, no JS) ---------- */

.month-tab-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.month-tabs label {
  cursor: pointer;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "pixelta", monospace;
}

.month-tabs label:hover {
  color: var(--ink);
}

.months .month-block { display: none; }

/* al anadir un mes nuevo, duplica este par de reglas con su fecha */
#tab-2026-08:checked ~ .month-tabs label[for="tab-2026-08"],
#tab-2026-07:checked ~ .month-tabs label[for="tab-2026-07"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

#tab-2026-08:checked ~ .months .month-block[data-month="2026-08"] { display: block; }
#tab-2026-07:checked ~ .months .month-block[data-month="2026-07"] { display: block; }

/* ---------- calendar: grid ---------- */

.week-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: var(--muted);
  font-family: "pixelta", monospace;
  font-size: 0.75rem;
  padding-bottom: 0.4rem;
  flex-shrink: 0;
}

.week-labels span {
  justify-self: center;
  border: 1px solid var(--muted);
  padding: 0 0.35rem;
  line-height: 1.4;
}

.months {
  padding-top: 0.2rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}

.day-cell {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
}

.day-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(15%) contrast(95%);
}

.day-cell .day-number {
  position: absolute;
  top: 3px;
  left: 3px;
  font-family: "pixelta", monospace;
  font-size: 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0 3px;
  line-height: 1.3;
}

.day-cell.empty {
  color: var(--muted);
}

.day-cell.empty .day-number {
  border-color: var(--muted);
}

.day-cell.today {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.day-cell.today .day-number {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- collapsible note ---------- */

.note-toggle summary {
  cursor: pointer;
  color: var(--muted);
  font-family: "mona", monospace;
  font-size: 0.9rem;
}

.note-toggle summary::marker {
  color: var(--muted);
}

.note-toggle[open] summary {
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.note-toggle p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.9rem;
  font-family: "mona", monospace;
}

/* ---------- lightbox popup for captures ---------- */

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
}

.lightbox:target {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 33, 27, 0.92);
}

.lightbox-content {
  position: relative;
  margin: 0;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  line-height: 0;
}

.lightbox-content img {
  display: block;
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border: 1px solid var(--bg);
  /* el navegador sigue permitiendo pinch-zoom / ctrl+scroll sobre esta imagen */
}

.lightbox-content figcaption {
  font-family: "mona", monospace;
  color: var(--bg);
  font-size: 0.85rem;
  text-align: center;
  padding-top: 0.5rem;
  line-height: 1;
}

.lightbox-close {
  position: absolute;
  top: -1.6rem;
  right: -0.4rem;
  color: var(--bg);
  text-decoration: none;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-close:hover {
  color: var(--muted);
}

/* ---------- about me (standalone page) ---------- */

.content-page {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.zone-aboutme {
  width: 100%;
  max-width: 480px;
}

.zone-musica {
  width: 100%;
  max-width: 720px;
}

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

.spotify-embed iframe {
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
}

@media (max-width: 600px) {
  .spotify-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- file tree (dotfiles page) ---------- */

.zone-dotfiles {
  max-width: 480px;
}

.zone-tafm {
  max-width: 320px;
  margin-top: 2rem;
  margin-left: 15rem;
}

/* ---------- code block ---------- */

.code-block {
  background: var(--ink);
  color: var(--bg);
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  font-family: "mona", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
  margin: 0.5rem 0;
}

.file-tree {
  font-size: 0.9rem;
  line-height: 1.2;
}

.tree-folder {
  color: var(--muted);
}

.tree-item {
  padding-left: 1rem;
}

.tree-indent1 { padding-left: 1rem; }
.tree-indent2 { padding-left: 2rem; }
.tree-indent3 { padding-left: 3rem; }
.tree-indent4 { padding-left: 4rem; }

.file-tree a {
  text-decoration: none;
  color: var(--ink);
}

.file-tree a:hover {
  color: var(--muted);
  text-decoration: underline;
}

.about-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 1rem;
  padding: 1px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.about-avatar svg {
  width: 38px;
  height: 38px;
  fill: currentColor;
}

.about-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(15%) contrast(95%);
}

.about-name {
  font-family: "mona";
  font-size: 1.15rem;
  margin: 0 0 0rem;
  text-align: center;
}

.about-namer {
  font-family: "AnotherHim";
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.about-bio {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

.about-links {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
}

.about-links a {
  text-decoration: underline;
}

.about-links a:hover {
  color: var(--muted);
}

.about-socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.about-socials a {
  text-decoration: underline;
}

.about-socials a:hover {
  color: var(--ink);
}

/* ---------- small screens: allow scroll, stack everything ---------- */

@media (max-width: 800px) {
  html, body { overflow: auto; }

  .layout { flex-direction: column; height: auto; }

  .sidebar {
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .sidebar-bottom { margin-left: auto; }

  .content {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "calendar"
      "note"
      "about";
    height: auto;
  }

  .zone { overflow: visible; }

  .content-page { padding: 1rem; }
}
