/* ============================================================
   notas.css — the notebook page only.
   ============================================================ */

.notas-wrap { position: relative; max-width: 60rem; margin: 0 auto; padding: 0 var(--space-3) var(--space-5); }

/* ---------- timeline ---------- */
.timeline {
  position: fixed;
  left: max(var(--space-2), calc(50vw - 38rem));
  top: 9rem;                                   /* anchored at the top: opening a year only pushes the years below it */
  max-height: calc(100vh - 11rem); overflow-y: auto; scrollbar-width: none;
  z-index: 40;
  display: flex; flex-direction: column;
  padding-right: 1rem;
}
.timeline::-webkit-scrollbar { display: none; }
.tl-year {
  display: flex; align-items: baseline; gap: 0.5rem;
  background: none; border: 0; padding: 0.45rem 0; cursor: pointer; text-align: left;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em;
  color: var(--ink-faint); transition: color 0.3s ease;
}
.tl-year:hover, .tl-group.is-current .tl-year { color: var(--ink-dim); }
.tl-count { font-size: 0.56rem; letter-spacing: 0.04em; opacity: 0.55; transition: opacity 0.3s ease; }
.tl-group.is-current .tl-count, .tl-group.is-peek .tl-count, .tl-group:focus-within .tl-count { opacity: 0; }
/* the months fold away: open for the year being read, a year under the mouse, or keyboard focus */
.tl-months { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.tl-months > div { overflow: hidden; display: flex; flex-direction: column; }
.tl-group.is-current .tl-months, .tl-group.is-peek .tl-months, .tl-group:focus-within .tl-months { grid-template-rows: 1fr; }
.tl-mark {
  display: flex; align-items: center; gap: 0.55rem;
  background: none; border: 0; padding: 0.28rem 0; cursor: pointer;
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.05em;
  color: var(--ink-faint); text-align: left;
  transition: color 0.3s ease;
}
.tl-mark:last-child { margin-bottom: 0.3rem; }
.tl-mark::before {
  content: ""; width: 14px; height: 1px; background: var(--ink-faint);
  transition: width 0.3s ease, background 0.3s ease;
}
.tl-mark:hover { color: var(--ink-dim); }
.tl-mark.on { color: var(--ink); }
.tl-mark.on::before { width: 26px; background: var(--verdigris); }

/* a photo the page can't find: its file name, instead of an empty frame */
.shot.is-missing { background: var(--bg-panel); outline: 1px dashed var(--line); }
.shot.is-missing img { visibility: hidden; }
.shot.is-missing::after {
  content: attr(data-missing); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 0.5rem;
  font-family: var(--mono); font-size: 0.66rem; color: var(--ink-faint);
}
/* Android browsers flash a blue box over whatever is tapped; on the full-screen
   index panel that meant the whole screen. Off for everything tappable here. */
.tl-pill, .tl-sheet, .tl-sheet *, .shot, .lb, .lb *, .tl-mark, .tl-year {
  -webkit-tap-highlight-color: transparent;
}

/* ---------- phones and tablets: date pill + list of notes ---------- */
.tl-pill, .tl-sheet { display: none; }
@media (max-width: 1180px) {
  .timeline { display: none; }

  .tl-pill {
    position: fixed; z-index: 120; left: 50%;   /* above tapped photos (99) */
    bottom: calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.7rem 1rem 0.7rem 1.15rem;
    background: rgba(32, 34, 24, 0.97);
    border: 1px solid rgba(140, 106, 79, 0.6); border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    color: var(--ink); cursor: pointer;
    font-family: var(--mono); font-size: 0.76rem; letter-spacing: 0.04em; white-space: nowrap;
    transform: translate(-50%, 160%); opacity: 0;
    transition: transform 0.35s ease, opacity 0.3s ease, border-color 0.2s ease;
  }
  .tl-pill.show { transform: translate(-50%, 0); opacity: 1; }
  body.nav-open .tl-pill { opacity: 0; pointer-events: none; }
  .tl-pill:active { border-color: var(--oak); }
  .tl-pill-count { color: var(--ink-faint); font-size: 0.68rem; padding-left: 0.6rem; border-left: 1px solid var(--line); }
  .tl-pill svg { width: 0.8rem; height: 0.8rem; color: var(--oak); }

  .tl-sheet {
    display: block; position: fixed; inset: 0; z-index: 300;
    background: rgba(8, 10, 7, 0); pointer-events: none;
    cursor: pointer;   /* iPhone only sends taps to elements that look clickable */
    visibility: hidden;   /* really gone when closed, not just pushed off screen */
    transition: background 0.3s ease, visibility 0s linear 0.36s;
  }
  .tl-sheet.open { background: rgba(8, 10, 7, 0.6); pointer-events: auto; visibility: visible; transition-delay: 0s; }
  .tl-sheet-panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    max-height: 72svh; display: flex; flex-direction: column;
    background: var(--bg-panel); border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    padding: 0.6rem var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: auto; touch-action: pan-y;
  }
  .tl-sheet.open .tl-sheet-panel { transform: translateY(0); }
  .tl-sheet-head { display: flex; flex-direction: column; cursor: pointer; margin: -0.6rem calc(-1 * var(--space-3)) 0; padding: 0.7rem var(--space-3) 0.2rem; }   /* the whole top strip: tap or pull down to close */
  .tl-sheet-grip { align-self: center; width: 2.6rem; height: 5px; border-radius: 3px; background: var(--ink-faint); opacity: 0.6; margin-bottom: 1rem; }
  .tl-sheet-title { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.08em; color: var(--ink-faint); margin: 0 0 0.4rem; }
  .tl-sheet-list { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 0.5rem; }
  .tl-sheet-list h3 {
    font-family: var(--mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.12em;
    color: var(--oak); margin: 1.1rem 0 0.3rem;
  }
  .tl-sheet-list button {
    display: grid; grid-template-columns: 3rem minmax(0, 1fr); align-items: baseline; gap: 0.6rem;
    width: 100%; padding: 0.7rem 0 0.7rem 0.8rem; margin: 0;
    background: none; border: 0; border-left: 2px solid transparent; border-radius: 0;
    text-align: left; cursor: pointer; color: var(--ink-dim);
  }
  .tl-sheet-month { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-faint); }
  .tl-sheet-name { font-family: var(--display); font-style: italic; font-size: 1.2rem; line-height: 1.2; }
  .tl-sheet-list button.on { border-left-color: var(--verdigris); color: var(--ink); background: rgba(110, 143, 130, 0.08); }
  .tl-sheet-list button.on .tl-sheet-month { color: var(--verdigris); }
}

/* ---------- entries ---------- */
.entry { padding: var(--space-4) 0 var(--space-3); border-top: 1px solid var(--line); }
.entry:first-of-type { border-top: 0; }
.entry-date { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--oak); }
.entry h2 {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0.3rem 0 var(--space-2);
}
.entry p.entry-body { color: var(--ink-dim); max-width: 38rem; margin: 0 0 var(--space-3); }
.entry p.entry-body:last-child { margin-bottom: 0; }   /* a text-only entry */

/* ---------- photos: prints scattered on a table ---------- */
/* Positions are worked out in notas.html (scatterLayout) and written as
   inline percentages, so the photos genuinely overlap instead of sitting
   in a grid. Each one stays at least ~70% visible.
   The pile sits exactly inside the text column: it never runs past the
   edges, so nothing is cut off on a phone. */
.shots {
  position: relative;
  margin: var(--space-2) 0 0;
}
.shot {
  position: absolute; margin: 0; cursor: zoom-in;
  border-radius: 2px; overflow: hidden;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: rotate(var(--rot, 0deg)) translateY(18px);
  transition: opacity 0.7s ease, transform 0.55s cubic-bezier(0.2, 0, 0.2, 1), box-shadow 0.4s ease;
}
.shot.in { opacity: 1; transform: rotate(var(--rot, 0deg)); }
.shot img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  /* house look, applied to every photo in the pile automatically:
     a little less colour, a touch more contrast, slightly warm.
     The full-size view below has no filter, so it shows the photo as taken. */
  filter: saturate(0.86) contrast(1.06) brightness(0.98) sepia(0.06);
}
/* pull it out of the pile */
.shot.in:hover, .shot.in:focus-visible, .shot.in.lifted {
  transform: rotate(0deg) scale(1.06);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 3px 10px rgba(0, 0, 0, 0.5);
  z-index: 99 !important;
}
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1.6rem 0.8rem 0.6rem;
  font-family: var(--mono); font-size: 0.66rem; color: var(--ink);
  background: linear-gradient(to top, rgba(10, 13, 8, 0.85), rgba(10, 13, 8, 0));
  opacity: 0; transition: opacity 0.35s ease;
}
.shot.in:hover figcaption, .shot.in:focus-visible figcaption, .shot.in.lifted figcaption { opacity: 1; }
@media (max-width: 760px) {
  .shot { box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45); }
  .shot.in:hover, .shot.in:focus-visible, .shot.in.lifted { transform: rotate(0deg) scale(1.03); }
  .shot figcaption { font-size: 0.6rem; }
}

/* ---------- lightbox: a gallery view ---------- */
/* The photo lies on a softly lit table, with its details in a column beside
   it and the rest of the entry as thumbnails along the bottom.
   On phones the details go underneath. */
.lb { position: fixed; inset: 0; z-index: 400; display: none; background: rgba(8, 10, 7, 0.985); }
.lb.open { display: flex; align-items: center; justify-content: center; padding: var(--space-3); }
.lb-frame {
  display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: var(--space-3);
  width: min(82rem, 100%); height: min(86svh, 56rem);
}
.lb-table {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  padding: var(--space-3) var(--space-3) var(--space-2);
  border: 1px solid var(--line); border-radius: 14px;
  background: radial-gradient(ellipse 70% 60% at 50% 42%, #232a1d 0%, #1a1f16 55%, #151912 100%);
}
.lb-stage { position: relative; flex: 1; min-height: 0; }
.lb-stage img {
  position: absolute; inset: 0; margin: auto;
  max-width: 100%; max-height: 100%;
  filter: none;   /* the full view shows the photo as taken */
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55), 0 3px 10px rgba(0, 0, 0, 0.45);
  border-radius: 2px;
  opacity: 0; transition: opacity 0.42s ease;
}
.lb-stage img:not([src]), .lb-stage img[src=""] { display: none; }
.lb-stage img.on { opacity: 1; }
.lb-strip {
  display: flex; gap: 0.5rem; justify-content: safe center;
  padding-top: var(--space-2); overflow-x: auto; scrollbar-width: none;
}
.lb-strip::-webkit-scrollbar { display: none; }
.lb-thumb {
  flex-shrink: 0; width: 3.6rem; height: 2.6rem; padding: 0;
  border: 1px solid transparent; border-radius: 3px; overflow: hidden;
  background: none; cursor: pointer; opacity: 0.45;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.lb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lb-thumb:hover { opacity: 0.8; }
.lb-thumb.on { opacity: 1; border-color: var(--verdigris); }

.lb-info { display: flex; flex-direction: column; min-height: 0; padding: var(--space-4) 0 var(--space-2); }
.lb-date { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--oak); margin: 0 0 0.4rem; }
.lb-title {
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: 1.9rem; line-height: 1.05; margin: 0 0 var(--space-2);
}
.lb-cap {
  color: var(--ink-dim); font-size: 0.98rem; line-height: 1.55; margin: 0;
  padding-top: var(--space-2); border-top: 1px solid var(--line);
}
.lb-nav { margin-top: auto; display: flex; align-items: center; gap: 0.9rem; }
.lb-count { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-faint); min-width: 4.5rem; text-align: center; }
.lb-btn {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  font-family: var(--mono); font-size: 0.95rem; cursor: pointer;
  transition: border-color 0.2s ease;
}
.lb-close {
  position: absolute; z-index: 2;
  top: max(var(--space-2), env(safe-area-inset-top)); right: var(--space-2);
  height: 36px; padding: 0 0.9rem; border-radius: 999px;
  background: rgba(17, 21, 15, 0.8); border: 1px solid var(--line); color: var(--ink-dim);
  font-family: var(--mono); font-size: 0.72rem; cursor: pointer;
}
.lb-close:hover, .lb-btn:hover { border-color: var(--verdigris); color: var(--ink); }
.lb-btn:focus-visible, .lb-close:focus-visible, .lb-thumb:focus-visible { outline: 2px solid var(--verdigris); outline-offset: 2px; }

@media (max-width: 900px) {
  .lb.open { padding: 0; }
  .lb-frame {
    grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 0;
    width: 100%; height: 100%;
  }
  .lb-table {
    border: 0; border-radius: 0;
    padding: calc(var(--space-2) + 44px + env(safe-area-inset-top, 0px)) var(--space-3) var(--space-1);
  }
  .lb-strip { margin: 0 calc(-1 * var(--space-2)); justify-content: flex-start; }
  .lb-info {
    padding: var(--space-2) var(--space-3) calc(var(--space-2) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--bg);
  }
  .lb-title { font-size: 1.45rem; margin-bottom: 0.6rem; }
  .lb-cap { padding-top: 0; border-top: 0; font-size: 0.92rem; }
  .lb-nav { margin-top: var(--space-2); justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  .shot { opacity: 1; transform: rotate(var(--rot, 0deg)); transition: none; }
  .lb-stage img {
  filter: none; transition: none; }
}
