/* References index and portfolio pages (uploaded by tools/import_references.py).
   Colours come ONLY from the site.css :root tokens (--vual-*), which every
   frontend page loads: no teal, forest, sage or cream literals (VUX-04).
   tools/test_qweb_lint.py fails the build on a hex colour in this file.
   Logo marks are shown at their natural size at most, never upscaled (VUX-10).
   Motion (DESIGN.md "Hareket (motion) sistemi"): F1 hover only, through the
   --vual-* tokens; hover movement in (hover: hover) and (pointer: fine) and
   (prefers-reduced-motion: no-preference). This file goes live through the
   data step tools/import_references.py --apply, after the module upgrade that
   defines the tokens; without them a transition or zoom simply does not run,
   and the mark-card ring falls back to the old 1px rule. */
.vual-ref {
  background: var(--vual-paper);
  color: var(--vual-ink);
  overflow: clip;
}

.vual-ref h1,
.vual-ref h2,
.vual-ref h3,
.vual-ref p,
.vual-ref figure { margin: 0; }

.vual-ref h1,
.vual-ref h2,
.vual-ref h3 {
  font-family: var(--vual-display, Georgia, serif);
  font-weight: 400;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.vual-ref__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
  padding: clamp(4.5rem, 9vw, 9rem) clamp(1.5rem, 7vw, 8rem) clamp(3.25rem, 6vw, 6rem);
  background: var(--vual-surface);
}

.vual-ref__intro h1 {
  max-width: 11ch;
  font-size: clamp(3.6rem, 7.5vw, 6rem);
  line-height: .98;
}

.vual-ref__intro h1 em { color: var(--vual-green-ink); }

.vual-ref__intro p,
.vual-ref__detail-copy p {
  max-width: 58ch;
  color: var(--vual-muted);
  font-size: clamp(1rem, 1.16vw, 1.13rem);
  line-height: 1.75;
}

.vual-ref__intro p {
  border-top: 1px solid var(--vual-ink);
  padding-top: 1.4rem;
}

/* Project cards at the bottom of the index (owner, 2026-09-24), under their
   own H2; the card titles are H3. */
.vual-ref__projects { border-top: 1px solid var(--vual-rule-strong); }
.vual-ref__projects-heading { padding: clamp(4rem, 7vw, 7rem) clamp(1.5rem, 7vw, 8rem) 0; }

.vual-ref__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1rem, 2.3vw, 2.5rem);
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 7vw, 8rem) clamp(5rem, 8vw, 8rem);
}

.vual-ref__card {
  display: block;
  padding: 0 0 clamp(2.25rem, 4vw, 4rem);
  color: var(--vual-ink);
  text-decoration: none;
}

.vual-ref__card:hover { text-decoration: none; }  /* core a:hover would underline the whole card */
.vual-ref__card:focus-visible { outline-offset: 8px; }

/* S23 cards (F1): photo cards get a ring and a 1.03 zoom on hover; a logo
   mark keeps its pixels (no zoom) and sits on a shadow ring instead of a grey
   border (same geometry: the border stays, transparent, and shows as the
   edge in a Windows contrast theme). */
.vual-ref__card figure {
  display: grid;
  place-items: center;
  height: clamp(220px, 28vw, 380px);
  overflow: hidden;
  background: var(--vual-surface);
  transition: box-shadow var(--vual-duration-swap) var(--vual-ease-out);
}

.vual-ref__card--mark figure {
  background: var(--vual-paper);
  border: 1px solid transparent;
  box-shadow: var(--vual-shadow-border, 0 0 0 1px var(--vual-rule));
}

.vual-ref__card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale var(--vual-duration-swap) var(--vual-ease-out);
}

/* Photographs: a 1px neutral outline inside the edge (static). */
.vual-ref__card--visual img,
.vual-ref__gallery-grid img { outline: 1px solid var(--vual-image-outline); outline-offset: -1px; }

/* A logo mark keeps its own pixels: at most its natural size, centred. */
.vual-ref__card--mark img {
  width: auto;
  height: auto;
  max-width: 74%;
  max-height: 70%;
  object-fit: contain;
}

/* The meta rule draws a 2px green bar over itself on hover (R-RULE). */
.vual-ref__card-meta {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding-top: 1.3rem;
  border-top: 1px solid var(--vual-rule-strong);
  margin-top: 1rem;
}

.vual-ref__card-meta::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: -1px;
  height: 2px;
  background: var(--vual-green);
  pointer-events: none;
  scale: 0 1;
  transform-origin: 100% 50%;
  transition: scale var(--vual-duration-swap) var(--vual-ease-out);
}

.vual-ref__card:focus-visible .vual-ref__card-meta::before { scale: 1 1; transition-duration: 0s; }
.vual-ref__card:focus-visible figure { box-shadow: var(--vual-shadow-border-hover); transition-duration: 0s; }

.vual-ref__card h3 {
  font-size: clamp(1.85rem, 2.45vw, 2.75rem);
  line-height: 1.13;
  transition: color var(--vual-duration-ui) var(--vual-ease-out);
}

.vual-ref__card-meta > span {
  color: var(--vual-muted);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.vual-ref__card:hover h3,
.vual-ref__back:hover { color: var(--vual-green-ink); }

.vual-ref__logos {
  padding: clamp(4rem, 7vw, 7rem) clamp(1.5rem, 7vw, 8rem);
  background: var(--vual-surface);
  border-top: 1px solid var(--vual-rule-strong);
}
.vual-ref__logos-heading {
  margin-bottom: clamp(3rem, 5vw, 5rem);
}
.vual-ref__logos-heading h2,
.vual-ref__projects-heading h2 { font-size: clamp(2.7rem, 5vw, 4.8rem); line-height: 1.02; }
.vual-ref__logo-group + .vual-ref__logo-group { margin-top: clamp(2.8rem, 5vw, 4.6rem); }
.vual-ref__logo-group h3 {
  margin-bottom: 1.15rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--vual-rule-strong);
  font-size: clamp(1.45rem, 2vw, 2rem);
}
.vual-ref__logo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-auto-flow: row dense; gap: .8rem; }
.vual-ref__logo-card {
  display: flex;
  min-width: 0;
  min-height: 166px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem .9rem 1rem;
  background: var(--vual-paper);
  border: 1px solid var(--vual-rule);
}
.vual-ref__logo-card--dark { background: var(--vual-ink); border-color: var(--vual-ink); }
/* Wordmarks 6:1 or wider (import_references.is_wide_logo) take two cells;
   in one cell they rendered 9-11 px tall at 375 px. The grid has 5, 3 or 2
   columns, so a span of 2 always fits. */
.vual-ref__logo-card--wide { grid-column: span 2; }
.vual-ref__logo-card.vual-ref__logo-card--wide img { max-height: 2rem; }
.vual-ref__logo-card img {
  display: block;
  width: auto;
  height: auto;
  max-width: 82%;
  max-height: 85px;
  object-fit: contain;
}
.vual-ref__logo-card figcaption {
  color: var(--vual-muted);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
}
.vual-ref__logo-card--dark figcaption { color: color-mix(in srgb, var(--vual-paper) 82%, var(--vual-ink)); }

.vual-ref__detail {
  display: grid;
  grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  min-height: 590px;
  background: var(--vual-surface);
}

.vual-ref__detail-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(3.2rem, 7vw, 7rem) clamp(1.5rem, 7vw, 8rem);
}

/* R-DRAW: a 1px rest line and a 2px green bar that draws from the start
   edge on hover and retracts toward the end; ::before widens the hit area. */
.vual-ref__back {
  position: relative;
  display: inline-block;
  margin-bottom: clamp(2.75rem, 6vw, 6rem);
  padding-bottom: .1em;
  color: var(--vual-ink);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor), linear-gradient(var(--vual-green), var(--vual-green));
  background-repeat: no-repeat;
  background-position: 0 100%, 100% 100%;
  background-size: 100% 1px, 0% 2px;
  transition: background-size var(--vual-duration-swap) var(--vual-ease-out), color var(--vual-duration-ui) var(--vual-ease-out);
}

.vual-ref__back::before { content: ""; position: absolute; inset: -.45em -.25em; }
.vual-ref__back:hover { text-decoration: none; }
.vual-ref__back:focus-visible { background-position: 0 100%, 0 100%; background-size: 100% 1px, 100% 2px; transition-duration: 0s; }

.vual-ref__detail-copy .vual-ref__type {
  margin-bottom: 1rem;
  color: var(--vual-muted);
  font-size: .82rem;
  font-weight: 700;
}

.vual-ref__detail-copy h1 {
  max-width: 12ch;
  margin-bottom: 1.8rem;
  font-size: clamp(3.4rem, 5.7vw, 5.7rem);
  line-height: 1.0;
}

/* "Where to look next" paragraph with links to the collection pages. The
   links are underlined: green-ink and muted text alone differ too little. */
.vual-ref__detail-copy .vual-ref__guide { margin-top: 1.1rem; }
.vual-ref__guide a {
  color: var(--vual-green-ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  transition: color var(--vual-duration-ui) var(--vual-ease-out);
}
.vual-ref__guide a:hover { color: var(--vual-ink); }

.vual-ref__detail-art {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 570px;
  padding: clamp(1.5rem, 3.5vw, 4rem);
  background: var(--vual-paper);
}

.vual-ref__detail-art img { display: block; width: 100%; height: 100%; max-height: 660px; object-fit: contain; }
.vual-ref__detail-art--mark { border-left: 1px solid var(--vual-rule); }
.vual-ref__detail-art--mark img { width: auto; height: auto; max-width: 68%; max-height: 48%; }

.vual-ref__gallery {
  padding: clamp(4rem, 7vw, 7rem) clamp(1.5rem, 7vw, 8rem);
}

.vual-ref__gallery h2 {
  margin-bottom: 2rem;
  font-size: clamp(2.6rem, 4.6vw, 4.4rem);
  line-height: 1.05;
}

.vual-ref__gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.8rem, 1.8vw, 1.5rem);
}

.vual-ref__gallery-grid figure { background: var(--vual-surface); }
.vual-ref__gallery-grid img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.vual-ref__next {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: clamp(3rem, 5vw, 5rem) clamp(1.5rem, 7vw, 8rem);
  background: var(--vual-ink);
  color: var(--vual-paper);
}

.vual-ref__next h2 { max-width: 18ch; color: var(--vual-paper); font-size: clamp(2.6rem, 4.4vw, 4.5rem); line-height: 1.08; }
.vual-ref__next .vual-button { flex: none; }

@media (max-width: 950px) {
  .vual-ref__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vual-ref__card figure { height: clamp(220px, 37vw, 360px); }
  .vual-ref__detail { grid-template-columns: 1fr 1fr; }
  .vual-ref__logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .vual-ref__intro,
  .vual-ref__detail { grid-template-columns: 1fr; }
  .vual-ref__intro p { max-width: 65ch; }
  .vual-ref__grid { grid-template-columns: 1fr; }
  .vual-ref__card figure { height: min(78vw, 410px); }
  .vual-ref__card h3 { font-size: 2.4rem; }
  .vual-ref__logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vual-ref__logo-card { min-height: 150px; }
  .vual-ref__detail-copy { padding-top: 3rem; padding-bottom: 3rem; }
  .vual-ref__back { margin-bottom: 3rem; }
  .vual-ref__detail-art { min-height: 370px; height: min(100vw, 520px); }
  .vual-ref__detail-art--mark { border-left: 0; border-top: 1px solid var(--vual-rule); }
  .vual-ref__gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vual-ref__next { display: block; }
  .vual-ref__next .vual-button { margin-top: 1.5rem; }
}

@media (max-width: 440px) {
  .vual-ref__gallery-grid { grid-template-columns: 1fr; }
  .vual-ref__gallery-grid img { aspect-ratio: 4 / 3; }
}

/* Motion (F1). Hover colour, ring and bar on pointer devices only. */
@media (hover: hover) and (pointer: fine) {
  .vual-ref__card:hover figure { box-shadow: var(--vual-shadow-border-hover); }
  .vual-ref__card:hover .vual-ref__card-meta::before { scale: 1 1; transform-origin: 0 50%; }
  .vual-ref__back:hover { background-position: 0 100%, 0 100%; background-size: 100% 1px, 100% 2px; }
}

/* The zoom moves, so it also waits for no-preference; a logo keeps its pixels. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .vual-ref__card:not(.vual-ref__card--mark):hover img { scale: var(--vual-zoom); }
}

@media (prefers-reduced-motion: no-preference) {
  .vual-ref__card:not(.vual-ref__card--mark):focus-visible img { scale: var(--vual-zoom); transition-duration: 0s; }
}

/* Windows contrast themes drop gradients and shadows: underline instead. */
@media (forced-colors: active) {
  .vual-ref__back,
  .vual-ref__back:hover { text-decoration: underline 1px; }
  .vual-ref__card-meta::before { display: none; }
  .vual-ref__card:is(:hover, :focus-visible) h3 { text-decoration: underline; }
}

@media print {
  .vual-ref__back { text-decoration: underline 1px; background-image: none; }
}
