/* work-table.css: project table under the carousel on "Mitt arbete" (Nora, 9 Nov).
   Structure inspired by a file-directory list: small column headings over a dashed line,
   then big rows separated by thin lines. Blinker only. The background follows the carousel colour. */
.wt { background: var(--s1-bg, var(--cream)); color: var(--black); transition: background-color .7s ease, color .4s ease;
  padding: var(--space-7) var(--space-6) var(--space-8); }
.wt.is-dark { color: var(--white); }
.wt-table { max-width: 1344px; margin: 0 auto; }
.wt-row { display: grid; grid-template-columns: 46fr 13fr 22fr 19fr; gap: var(--space-4); align-items: baseline;
  color: inherit; text-decoration: none; border-bottom: 1px solid currentColor; border-bottom-color: color-mix(in srgb, currentColor 30%, transparent);
  padding: clamp(14px, 1.6vw, 22px) 0; font: 600 clamp(20px, 2.4vw, 34px)/1.15 var(--font-heading); }
.wt-head { font: 700 14px/1 var(--font-heading); letter-spacing: .04em; text-transform: uppercase; padding: 0 0 10px;
  border-bottom: 1px dashed currentColor; }
.wt-name { font-weight: 700; }
#wt-body .wt-row { opacity: .55; transition: opacity .4s ease; }
#wt-body .wt-row.is-current { opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) {
  .wt { padding: var(--space-6) var(--space-3) var(--space-7) calc(var(--rail) + var(--space-3)); }
  .wt-row { grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 18px; }
  .wt-row > :nth-child(3), .wt-row > :nth-child(4) { grid-column: 1 / -1; font-size: 14px; font-weight: 400; }
  .wt-head > :nth-child(3), .wt-head > :nth-child(4) { display: none; }
}

/* Same column widths in every row (so the columns line up), sized so the longest words fit (Nora, 9 Nov) */
.wt-row { grid-template-columns: minmax(0, 36fr) minmax(0, 9fr) minmax(0, 29fr) minmax(0, 26fr); font-size: clamp(18px, 2vw, 30px); overflow-wrap: break-word; hyphens: auto; }
.wt-head { font-size: 14px; }
@media (max-width: 760px) { .wt-row { grid-template-columns: minmax(0, 1fr) auto; font-size: 18px; } .wt-head { font-size: 14px; } }
/* Words are never split inside the table (e.g. "Användarundersökningar" stays whole); the role column
   is always wide enough for that word (Nora, 9 Nov). */
.wt-row { grid-template-columns: minmax(0, 36fr) minmax(0, 9fr) minmax(12.5em, 29fr) minmax(0, 26fr); hyphens: manual; overflow-wrap: normal; word-break: keep-all; }
@media (max-width: 760px) { .wt-row { grid-template-columns: minmax(0, 1fr) auto; } }
/* "Användarundersökningar" may break as "Användar-/undersökningar" when space is short (soft hyphen in project.json) */
.wt-row { grid-template-columns: minmax(0, 36fr) minmax(0, 9fr) minmax(0, 29fr) minmax(0, 26fr); }
@media (max-width: 760px) { .wt-row { grid-template-columns: minmax(0, 1fr) auto; } }

/* v2 (Nora, 9 Nov): the table is its own full screen, the same height as the carousel. */
.wt { min-height: 100svh; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center;
  padding-top: calc(68px + var(--space-5)); transition: background-color 1.2s var(--ease-slow, ease), color 1.2s var(--ease-slow, ease); }
.wt-table { width: 100%; }
.site-header.wt-over { color: var(--black); }
.site-header.wt-over a { color: var(--black); }
.site-header.wt-dark { color: var(--white) !important; }
.site-header.wt-dark a { color: var(--white) !important; }
.site-header.wt-dark::after { background: var(--white) !important; }

/* Row hover: the row comes forward, an arrow slides in and the project name glitches (RGB split,
   the brand's motion effect). */
#wt-body .wt-row { position: relative; transition: opacity .4s ease, padding-left .35s var(--ease-soft, ease); }
#wt-body .wt-row:hover, #wt-body .wt-row:focus-visible { opacity: 1; padding-left: 12px; }
.wt-last { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.wt-arrow { opacity: 0; transform: translateX(-12px); transition: opacity .3s ease, transform .35s var(--ease-soft, ease); }
#wt-body .wt-row:hover .wt-arrow, #wt-body .wt-row:focus-visible .wt-arrow { opacity: 1; transform: none; }
/* Header over the table: same background as the table, so its colour changes with the projects too */
.site-header.wt-over { background: color-mix(in srgb, var(--s1-bg) 92%, transparent) !important; transition: background-color 1.2s var(--ease-slow, ease), color .6s ease; }
.site-header.wt-dark .site-nav a:hover, .site-header.wt-dark .site-nav a[aria-current="page"] { border-bottom-color: var(--white) !important; }

/* Hover v3 (Nora, 9 Nov): the rows you are not pointing at fade back, and a teaser picture of the
   project floats under the text, following the mouse. */
.wt { position: relative; overflow: hidden; }
.wt-table { position: relative; z-index: 2; }
@media (hover: hover) and (pointer: fine) {
  #wt-body:hover .wt-row:not(:hover) { opacity: .22; }
}
.wt-teaser { position: absolute; left: 0; top: 0; z-index: 1; width: clamp(260px, 26vw, 420px); aspect-ratio: 16 / 10;
  pointer-events: none; opacity: 0; transition: opacity .35s ease; will-change: transform, opacity; }
.wt-teaser.is-on { opacity: .9; }
.wt-teaser img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 6px; }
/* the text over the picture stays readable */
#wt-body .wt-row:hover { mix-blend-mode: normal; }
@media (prefers-reduced-motion: reduce) { .wt-teaser { transition: none; } }
/* The text behind the teaser picture stays readable, like in Nora's reference: all rows sit on top
   of the picture, the picture is a little see-through, and the faded rows keep enough contrast. */
.wt-teaser.is-on { opacity: .72; }
#wt-body .wt-row { position: relative; z-index: 2; }
@media (hover: hover) and (pointer: fine) { #wt-body:hover .wt-row:not(:hover) { opacity: .35; } }

/* Scroll hints on "Mitt arbete" (Nora, 10 Nov): "Scrolla ↓" at the bottom of the carousel,
   "↑ Scrolla" at the top of the table. Small, bold, with a gentle bounce. Desktop and mobile. */
.scroll-hint { display: inline-flex !important; align-items: center; gap: 6px; position: absolute; left: 50%; transform: translateX(-50%);
  font: 700 12px/1 var(--font-heading); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; color: inherit; z-index: 25;
  padding: 10px 12px; }
.scroll-down { bottom: 12px; top: auto; }
.wt > .scroll-up { top: calc(68px + 12px); bottom: auto; }
.sh-arrow { font-size: 15px; display: inline-block; }
@keyframes sh-down { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes sh-up { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
/* no animation on the scroll hint (Nora, 10 Nov: never add animations unless asked) */
@media (max-width: 760px) {
  .scroll-down { bottom: 10px; }
  .wt > .scroll-up { top: calc(var(--mtop, 64px) + 8px); }
}
@media (prefers-reduced-motion: reduce) { .sh-arrow { animation: none !important; } }

/* Mobile v2 (Nora, 10 Nov): the whole table is visible on the phone – all four columns
   (Projekt · År · Min roll · Definition) with their headings, on the 20 px grid, in a smaller size. */
@media (max-width: 760px) {
  .wt-row { grid-template-columns: minmax(0, 33fr) minmax(0, 12fr) minmax(0, 29fr) minmax(0, 26fr) !important;
    gap: 8px !important; align-items: start; padding: 14px 0 !important;
    font: 600 13px/1.3 var(--font-heading) !important; }
  .wt-row > :nth-child(3), .wt-row > :nth-child(4) { grid-column: auto !important; font-size: 13px !important; font-weight: 600 !important; }
  .wt-head { font-size: 10px !important; letter-spacing: .08em; padding: 0 0 8px !important; }
  .wt-head > :nth-child(3), .wt-head > :nth-child(4) { display: block !important; }
  .wt-name { font-size: 14px; line-height: 1.25; }
  .wt-arrow { display: none; }
  #wt-body .wt-row:hover, #wt-body .wt-row:focus-visible { padding-left: 0 !important; }
}
@media (max-width: 760px) {
  .wt-row { grid-template-columns: minmax(0, 31fr) minmax(0, 11fr) minmax(0, 30fr) minmax(0, 28fr) !important; font-size: 12.5px !important; }
  .wt-row > :nth-child(3), .wt-row > :nth-child(4) { font-size: 12.5px !important; }
  .wt-head > * { font-size: 10px !important; font-weight: 700 !important; }
  .wt-name { font-size: 13.5px !important; }
}
@media (max-width: 760px) { .wt-row.wt-head > * { font-size: 10px !important; } }
@media (max-width: 380px) {
  .wt-row { gap: 6px !important; font-size: 11.5px !important; }
  .wt-row > :nth-child(3), .wt-row > :nth-child(4) { font-size: 11.5px !important; }
  .wt-name { font-size: 12.5px !important; }
}
