/* ============================================================
   gigaSPG prototype, styles for the three project pages:
   track-record.html, cppa.html and fit.html.
   Loaded after site.css. The pages share one layout: title and text with the
   figures beside them; the map (site.css, the front page's) with the plant
   photographs beside it; the table; the invitation.
   ============================================================ */

giga-project-table,giga-project-photos{ display:block; }

/* ================= the head: title and text on the left, the figures beside them ================= */
.pj-head-grid{ display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); gap:var(--s6) var(--s7); align-items:start; }
.pj-intro .sec-title{ margin:0 0 var(--s4); }
.pj-intro .sec-lead{ margin:0; font-size:18.5px; line-height:1.95; color:var(--ink-soft); max-width:none; }
/* the figures as a ledger: one line per figure, the number and the words the client used for it */
.pj-ledger{
  margin:0; padding:var(--s2) var(--s5); border-top:3px solid var(--navy);
  display:grid; grid-template-columns:max-content minmax(0,1fr); grid-auto-flow:row dense;
}
.pj-ledger > div{ display:contents; }
.pj-ledger dt,.pj-ledger dd{ margin:0; padding-block:var(--s4); border-top:1px solid var(--rule); display:flex; align-items:center; }
.pj-ledger > div:first-child > *{ border-top:0; }
.pj-ledger dd{ grid-column:1; padding-right:var(--s5); font-family:var(--font-serif); font-size:clamp(30px,3.2vw,38px); font-weight:600; color:var(--navy); line-height:1.2; letter-spacing:.01em; white-space:nowrap; }
.pj-ledger dd .plus{ color:var(--orange-edge); }
.pj-ledger dd .u{ font-size:.5em; margin-left:.2em; color:var(--ink-soft); }
.pj-ledger dt{ grid-column:2; font-family:var(--font-sans); font-size:16px; color:var(--ink-mute); line-height:1.7; }

/* ================= the map, the photographs beside it ================= */
/* the map keeps one size, a square; the photographs beside it fill a box exactly as tall, so the
   table under both stays at one distance whatever the number of photographs or their captions */
.pj-map-row{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:var(--s5); align-items:stretch; }
.pj-map-row giga-project-overview{ display:block; }
.pj-map-row .ov-map{ aspect-ratio:1 / 1; justify-content:center; padding:var(--s4); }
.pj-map-row .ov-map svg{ flex:1; min-height:0; max-width:none; }
giga-project-photos{ display:block; position:relative; min-height:0; }
.pp-frame{ position:absolute; inset:0; display:flex; flex-direction:column; }
.pp-tile.is-empty{ visibility:hidden; }
/* arrows on the edges of the photographs: the way to the next four, and back */
.pp-arrow{ position:absolute; top:calc(50% - 22px); z-index:1; width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:50%; border:1px solid var(--rule); background:var(--sheet); color:var(--navy); box-shadow:var(--shadow-card); cursor:pointer; }
.pp-arrow.is-next{ right:-14px; }
.pp-arrow.is-prev{ left:-14px; }
.pp-arrow:hover{ background:var(--navy); color:#fff; }
.pp-arrow:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
/* the count sits under the box, in the space before the table, so the photographs end where the map ends */
.pp-count{ position:absolute; top:100%; right:0; margin:var(--s3) 0 0; text-align:right; font-family:var(--font-sans); font-size:15px; line-height:1.4; color:var(--ink-mute); }
/* one photograph fills the box, two stack, three put one over two, four make a square */
.pp-tiles{ flex:1; min-height:0; list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:repeat(2,minmax(0,1fr)); gap:var(--s4); }
.pp-tiles.pp-n1{ grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.pp-tiles.pp-n2{ grid-template-columns:minmax(0,1fr); }
.pp-tiles.pp-n3 > :first-child{ grid-column:1 / -1; }
.pp-tile{ display:flex; flex-direction:column; background:var(--sheet); border:1px solid var(--rule); border-radius:6px; overflow:hidden; box-shadow:var(--shadow-card); }
.pp-media{ position:relative; flex:1; min-height:0; display:block; background:var(--paper-deep); }
.pp-media img{ position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; }
/* always two lines, place over capacity, so every caption is as tall and photographs side by side are as tall */
.pp-cap{ flex:none; display:flex; flex-direction:column; min-height:calc(17px * 1.6 + 15px * 1.6 + 2 * var(--s3)); padding:var(--s3) var(--s4); line-height:1.6; }
.pp-pref{ display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-family:var(--font-serif); font-size:17px; font-weight:600; color:var(--navy); }
.pp-spec{ display:block; font-family:var(--font-sans); font-size:15px; font-weight:600; color:var(--ink); }
/* a photograph still to be supplied: hatched paper */
.pp-tile.is-todo{ box-shadow:none; border-style:dashed; border-color:rgba(31,41,51,.4); }
.pp-tile.is-todo .pp-media{ background:repeating-linear-gradient(-45deg, transparent 0 6px, rgba(31,41,51,.05) 6px 12px), var(--paper-warm); }
.pp-tile .todo{ font-size:14px; }

@media (max-width:899px){
  .pj-head-grid,.pj-map-row{ grid-template-columns:minmax(0,1fr); }
  giga-project-photos{ aspect-ratio:1 / 1; }   /* under the map, as tall as it: a square too */
}
@media (max-width:560px){
  .pj-intro .sec-lead{ font-size:17.5px; line-height:1.9; }
  .pj-ledger{ padding-inline:var(--s4); }
  .pj-ledger dd{ padding-right:var(--s4); }
  .pp-tiles{ gap:var(--s3); }
  .pp-cap{ min-height:calc(15px * 1.6 + 15px * 1.6 + 2 * var(--s2)); padding:var(--s2) var(--s3); }
  .pp-pref{ font-size:15px; }
}


/* ================= the table, under the map ================= */
giga-project-table{ margin-top:var(--s8); }
.pt-head{ display:flex; align-items:baseline; flex-wrap:wrap; gap:var(--s1) var(--s4); }
.pt-title{ font-size:22px; letter-spacing:.02em; }
.pt-count{ font-family:var(--font-sans); font-size:16px; color:var(--ink-mute); font-variant-numeric:tabular-nums; }

.pt-frame{ background:var(--sheet); border:1px solid var(--rule); border-radius:2px; box-shadow:var(--shadow-card); }
.pt{ width:100%; border-collapse:collapse; table-layout:fixed; }
.pt thead .pt-nr{ width:9%; }
.pt thead .pt-pref{ width:17%; }
.pt thead .pt-city{ width:auto; }
.pt thead .pt-num{ width:14%; }
.pt thead .pt-status{ width:20%; }
.pt th,.pt td{ padding:var(--s3) var(--s5); text-align:left; vertical-align:middle; font-weight:400; border-bottom:1px solid var(--rule); }
.pt tbody tr:last-child > *{ border-bottom:0; }
/* about sixty rows: the headings stay in sight under the site header while the list scrolls */
.pt thead th{
  position:sticky; top:79px; z-index:1;
  font-family:var(--font-sans); font-size:15px; font-weight:600; letter-spacing:.06em; line-height:1.7;
  color:var(--navy); background:var(--paper-deep); padding-block:var(--s3); white-space:nowrap;
  box-shadow:inset 0 -1px 0 var(--rule);
}
.pt tbody .pt-nr{ font-family:var(--font-sans); font-size:16px; color:var(--ink-mute); font-variant-numeric:tabular-nums; }
.pt tbody .pt-city{ font-family:var(--font-serif); font-size:18px; font-weight:600; color:var(--navy); letter-spacing:.03em; line-height:1.6; }
.pt tbody .pt-pref{ font-family:var(--font-sans); font-size:16px; color:var(--ink); }
.pt td.pt-num{ font-family:var(--font-serif); font-size:18.5px; color:var(--navy); white-space:nowrap; font-variant-numeric:tabular-nums; }
.pt .pt-num{ text-align:right; }
.pt-status{ font-family:var(--font-sans); font-size:16px; color:var(--ink-soft); }
.pt tbody tr:hover > *{ background:var(--paper-warm); }
.pt-label{ display:none; }
.pt-none{ color:var(--ink-mute); }
.pt .todo{ white-space:normal; }
/* the totals: one rule above, the sums in the capacities' own type */
.pt tfoot th,.pt tfoot td{ border-top:2px solid var(--navy); border-bottom:0; background:var(--paper-deep); }
.pt tfoot .pt-sum{ font-family:var(--font-sans); font-size:16px; font-weight:600; color:var(--navy); }
.pt tfoot td.pt-num{ font-weight:600; }

/* on a phone a row is two lines: number, city, MW AC and MW DC, then prefecture and status */
@media (max-width:600px){
  giga-project-table{ margin-top:var(--s7); }
  .pt,.pt tbody{ display:block; }
  /* the headings stay for a screen reader; every box is 1px so nothing reaches past the screen edge */
  .pt thead{ position:absolute; clip-path:inset(50%); }
  .pt thead,.pt thead tr,.pt thead th{ display:block; width:1px; height:1px; padding:0; border:0; overflow:hidden; position:static; }
  .pt tfoot{ display:block; }
  /* four tracks: the number, the place, and the two capacities, each under its own label */
  .pt tbody tr,.pt tfoot tr{
    display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; gap:0 var(--s3); align-items:baseline;
    padding:10px var(--s4); border-bottom:1px solid var(--rule); line-height:1.55;
  }
  .pt tbody tr:last-child{ border-bottom:0; }
  .pt tbody th,.pt tbody td,.pt tfoot th,.pt tfoot td{ display:block; min-width:0; padding:0; border:0; line-height:inherit; background:none; }
  .pt tfoot tr{ border-top:2px solid var(--navy); border-bottom:0; background:var(--paper-deep); }
  .pt tbody tr:hover > *{ background:none; }
  .pt .pt-nr{ grid-column:1; grid-row:1; font-size:15px; }
  .pt tbody .pt-city{ grid-column:2; grid-row:1; font-size:17px; }
  .pt td.pt-ac{ grid-column:3; grid-row:1 / 3; font-size:17px; }
  .pt td.pt-dc{ grid-column:4; grid-row:1 / 3; font-size:17px; }
  .pt tbody .pt-pref{ grid-column:2; grid-row:2; font-size:15px; color:var(--ink-soft); }
  .pt tbody .pt-status{ grid-column:2 / 5; grid-row:3; font-size:15px; }
  .pt tbody .pt-status:empty,.pt tfoot .pt-status{ display:none; }
  .pt tfoot .pt-sum{ grid-column:1 / 3; grid-row:1 / 3; font-size:15px; }
  .pt td.pt-num{ display:flex; flex-direction:column; align-items:flex-end; }
  .pt .todo{ font-size:15px; white-space:normal; }
  .pt-label{ display:block; font-family:var(--font-sans); font-size:15px; color:var(--ink-mute); line-height:1.5; }
}

/* ---------- the table's first five rows; "see more" opens the rest ---------- */
.pt:not(.is-open) .pt-row-more{ display:none; }
.pt-more{ margin:var(--s4) 0 0; }
.pt-toggle-less{ display:none; }
.pt-toggle[aria-expanded="true"] .pt-toggle-more{ display:none; }
.pt-toggle[aria-expanded="true"] .pt-toggle-less{ display:inline; }
