/* Articles, biographies and info pages (src/pages/), the top-bar icon buttons
   and menu dividers. Loaded last. */

/* ---- top bar ----------------------------------------------------------- */
a.logo { text-decoration: none; color: inherit; }
.top-ico { display: grid; place-items: center; }
.top-ico .ui-ico, .ui-ico { width: 20px; height: 20px; }
.btn-icon.top-ico { color: var(--text); }
.btn-icon.top-ico:hover { color: var(--yellow); }
@media (max-width: 380px) { .top-actions { gap: 3px; } .btn-icon { width: 32px; } }
.menu-div { height: 1px; margin: 5px 8px; background: rgba(212, 246, 255, 0.14); }

/* ---- pages ---------------------------------------------------------------- */
body.on-page .share-fab, body.on-page .poster-fab { display: none; }
body.on-page #app { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.page { padding: 10px 12px 8px; }
.pg-back, .pg-crumb {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  background: var(--surface2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(212, 246, 255, 0.14); margin: 2px 6px 6px 0;
}
.pg-back:hover, .pg-crumb:hover { color: var(--yellow); box-shadow: inset 0 0 0 1.5px rgba(255, 230, 0, 0.5); }
.pg-crumb { background: transparent; }
.pg-h1 { margin: 12px 2px 6px; font-size: 26px; line-height: 1.15; font-weight: 700; }
.pg-h2 { margin: 22px 2px 8px; font-size: 19px; font-weight: 700; color: var(--yellow); }
.pg-lede { margin: 0 2px 12px; font-size: 16px; color: var(--accent); }
.pg-note { margin: 0 2px 12px; font-size: 13px; color: var(--muted); }
.pg-p { margin: 0 2px 14px; font-size: 16px; line-height: 1.6; color: var(--text); }
.pg-email a { color: var(--yellow); font-weight: 700; font-size: 18px; text-decoration: none; }
.pg-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.pg-card {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px;
  background: var(--surface); color: var(--text); text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.18s;
}
.pg-card:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1.5px rgba(255, 230, 0, 0.45); }
.pg-thumb { flex: none; width: 96px; height: 96px; border-radius: 12px; overflow: hidden; background: var(--surface2); }
.pg-thumb > * { width: 100%; height: 100%; }
.pg-card-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pg-card-txt b { font-size: 16px; line-height: 1.25; }
.pg-card-txt small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.pg-deco {
  display: grid; place-items: center; border-radius: 12px;
  background: radial-gradient(circle at 30% 25%, hsla(var(--hue), 90%, 65%, 0.55), hsla(calc(var(--hue) + 40), 80%, 35%, 0.35) 60%, rgba(13, 13, 15, 0.9));
}
.pg-deco span { font-family: var(--emoji-font); font-size: 46px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45)); }
.pg-deco.wide { aspect-ratio: 16 / 9; }
.pg-deco.wide span { font-size: 72px; }
.pg-excerpt { min-height: 60px; border-radius: 12px; overflow: hidden; background: var(--surface2); }
.pg-excerpt canvas { display: block; width: 100%; height: auto; }
.pg-excerpt.sq canvas { height: 100%; object-fit: cover; }
.pg-fig { margin: 4px 0 18px; }
.pg-fig figcaption { margin-top: 6px; font-size: 12.5px; color: var(--muted); text-align: center; }
.page .mock-slot { margin: 14px auto 18px; }
@media (min-width: 760px) {
  .pg-thumb { width: 120px; height: 120px; }
  .pg-h1 { font-size: 32px; }
  .pg-p { font-size: 17px; }
}

/* ---- the × on sheets and panels, undo / redo in the event browser -------- */
.sheet-head { position: relative; }
.x-close {
  position: absolute; top: 6px; right: 8px; z-index: 2; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 22px; line-height: 1; color: var(--muted);
  background: var(--surface2); box-shadow: inset 0 0 0 1px rgba(212, 246, 255, 0.14);
}
.x-close:hover { color: var(--text); box-shadow: inset 0 0 0 1.5px rgba(255, 230, 0, 0.5); }
.sheet-head .sheet-title { padding-right: 40px; }
.pre-head { display: flex; align-items: center; gap: 8px; }
.pre-head .search { flex: 1; }
.pre-head .x-close { position: static; flex: none; }
.hist { display: inline-flex; gap: 4px; margin-right: 6px; }
.hist-btn {
  width: 30px; height: 30px; border-radius: 10px; font-size: 18px; line-height: 1; font-weight: 700;
  background: var(--surface3); color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(255, 230, 0, 0.35);
}
.hist-btn:disabled { color: var(--faint); box-shadow: none; opacity: 0.6; }

/* ---- profile extras: each block as tall as its content, two columns on wide screens ---- */
@media (min-width: 760px) {
  .xblocks { display: block; columns: 2; column-gap: 6px; }
  .xblocks .xblock { break-inside: avoid; margin-bottom: 6px; }
}

/* ---- picture blocks (ui/imageblocks.js): above a year, or above a pair of months */
.iblock {
  position: relative; width: 100%; overflow: hidden; container-type: inline-size;
  border-radius: 12px; background-color: #0b0b0e; box-shadow: inset 0 0 0 1px rgba(212, 246, 255, 0.12);
  user-select: none; -webkit-user-select: none;
}
/* the edit area: the middle 80%, marked by camera-style corners; the outer
   band belongs to the page (phones scroll there) and darkens when touched */
.iedit { position: absolute; inset: 20%; z-index: 1; border-radius: 12px; cursor: grab; touch-action: none; transition: box-shadow 0.18s; }
.iblock.panning .iedit { cursor: grabbing; }
.icor { position: absolute; width: 14%; max-width: 26px; aspect-ratio: 1; border: 0 solid rgba(255, 255, 255, 0.6); filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.7)); pointer-events: none; }
.icor.tl { top: 0; left: 0; border-width: 2px 0 0 2px; border-top-left-radius: 6px; }
.icor.tr { top: 0; right: 0; border-width: 2px 2px 0 0; border-top-right-radius: 6px; }
.icor.bl { bottom: 0; left: 0; border-width: 0 0 2px 2px; border-bottom-left-radius: 6px; }
.icor.br { bottom: 0; right: 0; border-width: 0 2px 2px 0; border-bottom-right-radius: 6px; }
.iblock.guard .iedit { box-shadow: 0 0 0 100vmax rgba(5, 5, 8, 0.62); }
.ihere {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0;
}
.ihere b { padding: 6px 14px; border-radius: 999px; font-size: 15px; color: #111; background: var(--yellow); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5); white-space: nowrap; }
.ihere-arrow { /* the graph bar's suggestion arrow, larger */
  width: 24px; height: 21px; filter: drop-shadow(0 0 3px rgba(255, 230, 0, 0.55));
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 13'%3E%3Cpath d='M2.2 2.2h10.6L7.5 10.8z' fill='%23ffe600' stroke='%230d0d0f' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cpath d='M2.2 2.2h10.6L7.5 10.8z' fill='%23ffe600' stroke='%23ffe600' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* the vignette: dark from the border toward the middle (draw.js VIGNETTE matches it) */
.ivig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.45) 100%); }
.ihere.show { animation: ihere 1.5s ease-out forwards; }
.ihere.show .ihere-arrow { animation: ihere-bob 0.5s ease-in-out 3 alternate; }
@keyframes ihere { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 60% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ihere-bob { to { transform: translateY(5px); } }
.ipic {
  position: absolute; left: calc(50% + var(--ix, 0) * 100cqw); top: calc(50% + var(--iy, 0) * 100cqw);
  width: calc(var(--iz, 1) * 100cqw); max-width: none; height: auto;
  transform: translate(-50%, -50%) rotate(var(--ia, 0deg)); pointer-events: none;
  border-radius: 10px; /* rounded where the picture is dragged away from the block's edge */
}
.ipair.n2 .ipic { border-radius: 8px; }
.iblock.missing {
  display: grid; place-items: center; padding: 10px 36px; text-align: center;
  border: 2px dashed rgba(255, 230, 0, 0.45);
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.025) 0 10px, transparent 10px 20px), #111115;
}
.iph { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.iph b { font-size: 14px; color: var(--yellow); overflow-wrap: anywhere; }
.iph small { font-size: 12px; color: var(--muted); }
.ix, .iz {
  position: absolute; z-index: 3; display: grid; place-items: center; border-radius: 50%;
  color: #fff; background: rgba(10, 10, 14, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
  opacity: 0.75; transition: opacity 0.15s, background 0.15s;
}
.ix { top: 8px; right: 8px; width: 52px; height: 52px; }
.ix svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }
/* bottom right: turn left / right above zoom out / in */
.izoom { position: absolute; bottom: 8px; right: 8px; z-index: 3; display: grid; grid-template-columns: 44px 44px; gap: 6px; }
.iz { position: static; width: 44px; height: 44px; }
.iz svg { width: 30px; height: 30px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.ix:hover, .iz:hover { opacity: 1; background: rgba(10, 10, 14, 0.8); }
.igrip { position: absolute; left: 0; right: 0; height: 12px; z-index: 2; cursor: ns-resize; touch-action: none; }
.igrip.top { top: 0; }
.igrip.bottom { bottom: 0; }
.igrip::after {
  content: ''; position: absolute; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.55); opacity: 0; transition: opacity 0.15s;
}
.igrip.top::after { top: 4px; }
.igrip.bottom::after { bottom: 4px; }
.iblock:hover .igrip::after, .iblock.resizing .igrip::after { opacity: 1; }
.month-grid > .ipair { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: inherit; align-items: start; }
.month-grid > .ipair.n2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ipair.n2 .iblock { border-radius: 8px; }
/* a picture joined to its block: square corners where they meet, no gap, and
   a triangle from the block pointing up into the picture, 75% from the left */
.iblock.joined { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.year-group > .iblock.joined { margin-bottom: calc(-3px * var(--ky, 1)); }
.month-grid > .ipair.joined { margin-bottom: calc(-3px * var(--ky, 1)); }
.block.joined-top { border-top-left-radius: 0; border-top-right-radius: 0; }
/* the triangle: a square turned 45 degrees, its lower half cut away; the
   rounded corner is the tip, and its two upper edges get a brighter line */
.block.joined-owner::before {
  content: ''; position: absolute; left: 75%; top: 0; width: 26px; height: 26px; z-index: 4; pointer-events: none;
  transform: translate(-50%, -50%) rotate(45deg); border-top-left-radius: 6px;
  background: var(--bg); border: 1.6px solid var(--edge, rgba(255, 255, 255, 0.3)); border-right: 0; border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}
.drop-img { outline: 2px solid var(--yellow); outline-offset: 1px; box-shadow: 0 0 18px rgba(255, 230, 0, 0.35); }
