/* Fósfora — three-column layout (after Cargo template M069).
   Colours and type are set here only. */
:root {
  --bg: #ffffff;
  --ink: #000000;
  --label: rgba(0, 0, 0, .85);
  --muted: rgba(0, 0, 0, .5);
  --rule: rgba(0, 0, 0, .15);
  --serif: "Newsreader", "Iowan Old Style", "Times New Roman", Times, serif;
  --size: 12.5px;
  --line: 1.32;
  --pad: 6px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font-family: var(--serif); font-size: var(--size); line-height: var(--line); font-optical-sizing: auto; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.desc a, .ivalue a, .ptext a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
p { margin: 0 0 1em; }
em { font-style: italic; }
img { display: block; max-width: 100%; height: auto; }

/* Columns */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 100vh; }
.col { display: flex; flex-direction: column; min-width: 0; height: 100vh; border-left: 1px solid var(--rule); }
.col:first-child { border-left: 0; }
.chead { flex: none; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
         padding: 3px var(--pad); border-bottom: 1px solid var(--rule); color: var(--label); background: var(--bg); }
.chead .ctitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chead .close, .chead .lang { color: var(--muted); flex: none; }
.chead .lang .cur { color: var(--label); }
.ibtn { flex: none; background: none; border: 0; padding: 0 2px; font: inherit; font-size: 13px; line-height: 1; color: var(--label); cursor: pointer; }
.cbody { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--pad); }

/* Info column */
.info .logo { display: block; width: 120px; margin: 4px 0 14px; }
.irow { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; padding: 6px 0 4px; border-top: 1px solid var(--rule); }
.irow:first-of-type { border-top: 0; }
.ilabel { color: var(--label); }
.ivalue p:last-child { margin-bottom: 0; }
.foot { color: var(--muted); margin: 24px 0 0; }

/* Feed */
.stitle { font-size: var(--size); font-weight: 400; color: var(--muted); margin: 18px 0 6px; padding-top: 4px; border-top: 1px solid var(--rule); }
.cfeed .stitle:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.item { margin: 0 0 22px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.fimg { display: block; margin: 0 0 6px; }
.fimg img { width: 100%; }
.irow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.desc p:last-child { margin-bottom: 0; }

/* Index view (☰) */
.iname { display: none; }
.cindex { display: none; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cindex a { display: block; }
.cindex img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.cindex span { display: block; color: var(--muted); margin-top: 2px; }
.clist { display: none; margin-top: 12px; }
.show-index .cindex { display: grid; }
.show-index .clist { display: block; }
.show-index .cfeed { display: none; }
.show-index .iname { display: inline; }

/* Project page inside its column */
.ptext { margin-bottom: 18px; }
.pdate { color: var(--muted); }
.ptext h2, .ptext h4 { font-size: var(--size); font-weight: 400; color: var(--muted); margin: 18px 0 6px; padding-top: 4px; border-top: 1px solid var(--rule); }
.ptext h3 { font-size: var(--size); font-weight: 400; font-style: italic; margin: 12px 0 2px; }
.ptext strong { font-weight: 500; }
.ptext .credit-block, .ptext .film-credits { margin-bottom: 8px; }
.ptext details summary { cursor: pointer; color: var(--muted); margin: 4px 0 8px; }
.ptext .credit-group-title { font-style: italic; margin: 10px 0 2px; }
.ptext .credit-role { color: var(--muted); }
.ptext .award-highlight a { text-decoration: none; }
.ptext blockquote { margin: 0 0 10px; }
.ptext .project-credits { margin-bottom: 6px; }
.poster { margin: 18px 0 0; max-width: 60%; }
.poster figcaption { color: var(--muted); margin-top: 3px; }
.gtitle { font-size: var(--size); font-weight: 400; color: var(--label); margin: 14px 0 6px; }
.gcredit { color: var(--muted); margin: -2px 0 6px; }
.grid { columns: 2; column-gap: 6px; }
.grid.one { columns: 1; margin-bottom: 6px; }
.grid a { display: block; margin: 0 0 6px; break-inside: avoid; }
.grid img { width: 100%; }

/* Full-screen image viewer */
.viewer { position: fixed; inset: 0; background: rgba(255, 255, 255, .97); z-index: 10; display: flex; align-items: center; justify-content: center; }
.viewer[hidden] { display: none; }
.viewer img { max-width: 92vw; max-height: 92vh; width: auto; }
.viewer button { position: absolute; background: none; border: 0; color: var(--ink); font-size: 30px; cursor: pointer; padding: 10px 16px; font-family: inherit; }
.v-close { top: 4px; right: 4px; }
.v-prev { left: 0; top: 50%; transform: translateY(-50%); }
.v-next { right: 0; top: 50%; transform: translateY(-50%); }

/* Phones and small screens: one column after another */
@media (max-width: 760px) {
  :root { --size: 15px; --pad: 12px; }
  .cols { display: block; height: auto; }
  .col { height: auto; border-left: 0; border-top: 1px solid var(--ink); }
  .col:first-child { border-top: 0; }
  .chead { position: sticky; top: 0; z-index: 2; padding: 6px var(--pad); }
  .cbody { overflow: visible; }
  .info .logo { width: 110px; }
  .cindex { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .irow2 { grid-template-columns: 1fr; gap: 4px; }
  .irow { grid-template-columns: 1fr 2.2fr; }
}
