/* ─────────────────────────────────────────────────────────────────────────────
   Hintlab Components
   All component classes for hintlab.org.
   Uses only --ink, --paper, dither patterns, and spacing multiples of --sp.
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Navigation ──────────────────────────────────────────────────────────────── */

.site-header {
  border-bottom: var(--b4) solid var(--ink);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 200;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: calc(var(--sp) * 2);
  padding: calc(var(--sp) * 1.5) calc(var(--sp) * 4);
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  position: relative; /* anchor for mobile dropdown */
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  /* Logo image is the colourful element — no CSS colour filter applied */
}

.nav-logo img {
  display: block;
  height: 51px;
  width: auto;
  max-width: 180px;
}

.nav-logo:focus {
  outline: var(--b2) solid var(--ink);
  outline-offset: 2px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: calc(var(--sp) * 1.5);
  margin: 0;
  margin-left: auto; /* push links to the right */
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 8px;
  border: var(--b2) solid transparent;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-color: var(--ink);
}

/* Language switcher — sits outside nav-links, always visible in sticky bar */
.nav-lang {
  font-size: .8rem;
  white-space: nowrap;
}

.nav-lang:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Theme toggle — bare icon button, no box */
.nav-theme-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  min-width: 44px;  /* touch target */
  min-height: 44px;
  justify-content: center;
}

.nav-theme-btn svg {
  width: .8rem;
  height: .8rem;
  display: block;
}

/* Mobile menu toggle button — hidden on desktop */
.nav-menu-btn {
  display: none;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 600;
  background: none;
  border: var(--b2) solid var(--ink);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  /* 44px minimum touch target */
  min-height: 44px;
  padding: 0 calc(var(--sp) * 1.5);
  align-items: center;
  justify-content: center;
}

/* ── Mobile nav ──────────────────────────────────────────────────────────────── */

@media (max-width: 700px) {
  .site-nav {
    flex-wrap: nowrap;
    gap: var(--sp);
    padding: calc(var(--sp) * 1) calc(var(--sp) * 2);
  }

  /* Push menu-btn + lang to right */
  .nav-logo {
    margin-right: auto;
  }

  /* Overlay row — absolutely below the sticky header, full width, does not push content */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--sp);
    padding: calc(var(--sp) * 1) calc(var(--sp) * 2);
    background: var(--paper);
    border-bottom: var(--b4) solid var(--ink);
    margin-left: 0;
    z-index: 199;
  }

  .nav-links.is-open {
    display: flex;
  }

  /* Each nav item as a bordered box — same treatment as .nav-menu-btn */
  .nav-links li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 calc(var(--sp) * 1.5);
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    background: none;
    border: var(--b2) solid var(--ink);
    white-space: nowrap;
  }

  .nav-links li a:hover,
  .nav-links li a[aria-current="page"] {
    background: var(--ink);
    color: var(--paper);
  }

  /* Show menu toggle */
  .nav-menu-btn {
    display: inline-flex;
  }

  /* Lang switcher — 44px touch target on mobile */
  .nav-lang {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 600;
  padding: calc(var(--sp) * 1) calc(var(--sp) * 2.5);
  text-decoration: none;
  border: var(--b3) solid var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
}

/* Mail icon inside buttons */
.btn-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
  margin-right: .35em;
  position: relative;
  top: -.1em;
}

/* ── Cards ───────────────────────────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: calc(var(--sp) * 2);
}

/* Hintlabs teaser: 4 col desktop, 2 col mobile */
.card-grid--hl-teaser {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 900px) {
  .card-grid--hl-teaser {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .card-grid--hl-teaser {
    grid-template-columns: 1fr;
  }
}

/* Clickable card: position:relative on card, stretched link on .card-cta */
.card {
  border: var(--b3) solid var(--ink);
  padding: calc(var(--sp) * 2);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  position: relative; /* required for stretched-link */
}

.card--product {
  background: var(--paper);
}

/* Card illustration — optional square image above content */
.card-illustration-wrap {
  position: relative;
  isolation: isolate;
  display: block;
  margin-bottom: calc(var(--sp) * 2);
}

.card-illustration-wrap--overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  mix-blend-mode: screen;
  pointer-events: none;
}

.card-illustration {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: var(--b2) solid var(--ink);
  display: block;
  background: var(--d25); /* fallback if img fails to load */
}

.card-illustration-wrap--overlay .card-illustration {
  filter: grayscale(1);
}

[data-theme="dark"] .card-illustration-wrap--overlay .card-illustration {
  filter: grayscale(1);
}

[data-theme="dark"] .card-illustration-wrap--overlay::after {
  background: var(--paper);
}

/* Placeholder div for illustration when no real image available */
.card-illustration-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--d25);
  border: var(--b2) solid var(--ink);
  margin-bottom: calc(var(--sp) * 2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-illustration-placeholder span {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  /* Contrasting outline for d25 background legibility */
  text-shadow:
    1px  1px 0 var(--paper),
   -1px -1px 0 var(--paper),
    1px -1px 0 var(--paper),
   -1px  1px 0 var(--paper);
}

.card-tag {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: var(--b1) solid var(--ink);
  padding: 1px 6px;
  display: inline-block;
  margin-bottom: calc(var(--sp) * .75);
  align-self: flex-start;
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: calc(var(--sp) * .75);
  margin-top: 0;
}

.card-tagline {
  font-size: .875rem;
  line-height: 1.5;
  flex: 1;
  margin-bottom: var(--sp);
}

.card-footer {
  font-family: var(--font-mono);
  font-size: .75rem;
  border-top: var(--b1) solid var(--ink);
  padding-top: var(--sp);
  margin-top: var(--sp);
  display: flex;
  flex-direction: column;
  gap: calc(var(--sp) * 1.5);
}

.card-meta {
  font-family: var(--font-mono);
  font-size: .75rem;
}

.card-cta {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: var(--b2) solid var(--ink);
  padding: 5px 10px;
  text-align: center;
  display: block;
}

.card-cta:hover {
  background: var(--ink);
  color: var(--paper);
}

/* Reset <button> when used as card-cta (dialog trigger) */
button.card-cta {
  appearance: none;
  background: none;
  cursor: pointer;
}

/* Stretched link — makes entire card clickable via the .card-cta element */
.card-cta::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* Ensure card hover shadow fires when hovering anywhere on the card */
.card:has(.card-cta:hover) {
  box-shadow: var(--shadow);
}

/* ── Horizontal card layout (studio offerings) ───────────────────────────────── */

/* 2-column grid for horizontal cards */
.card-grid--studio {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 700px) {
  .card-grid--studio {
    grid-template-columns: 1fr;
  }
}

/* Card becomes a row; columns stretch to equal height (default align-items: stretch) */
.card--horizontal {
  flex-direction: row;
}

/* Left column: title → image → tag → meta (36%) */
.card-col-left {
  width: 36%;
  flex-shrink: 0;
}

/* Tag sits below the image in left col — needs top margin */
.card-col-left .card-tag {
  margin-top: var(--sp);
  margin-bottom: calc(var(--sp) * .5);
}

/* Tighten gap between image and title in the left col */
.card--horizontal .card-illustration-wrap,
.card--horizontal .card-illustration-placeholder {
  margin-bottom: var(--sp);
}

.card--horizontal .card-title {
  margin-top: 0;
  margin-bottom: calc(var(--sp) * .75);
}

/* Meta sits below the image in the left column */
.card-col-left .card-meta {
  display: block;
  margin-top: var(--sp);
  font-family: var(--font-mono);
  font-size: .75rem;
}

/* Right column: all content (64%) */
.card-col-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding-left: calc(var(--sp) * 2);
  min-width: 0; /* prevent flex overflow */
}

/* Prevent global flex:1 on tagline from pushing suits+CTA to the bottom */
.card-col-right .card-tagline {
  flex: none;
}

/* CTA: separate from suits text, full column width */
.card-col-right .card-cta {
  margin-top: calc(var(--sp) * 2);
  align-self: stretch;
}

/* On mobile: revert to vertical stacking */
@media (max-width: 700px) {
  .card--horizontal {
    flex-direction: column;
  }

  .card-col-left {
    width: 100%;
  }

  .card-col-right {
    padding-left: 0;
    padding-top: calc(var(--sp) * 1.5);
    width: 100%;
  }
}

/* ── Category blocks — Studio overview ───────────────────────────────────────── */

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: calc(var(--sp) * 2);
  margin-bottom: calc(var(--sp) * 4);
}

.cat-block {
  border: var(--b4) solid var(--ink);
  padding: calc(var(--sp) * 2.5);
}

.cat-block.bg-d25   { background: var(--d25); }
.cat-block.bg-d50   { background: var(--d50); }
.cat-block.bg-d-dots { background: var(--d-dots); }

/* ── Teaser row — Open Calls and Shop teasers on homepage ────────────────────── */

.teaser-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: calc(var(--sp) * 2);
}

.teaser-card {
  border: var(--b3) solid var(--ink);
  padding: calc(var(--sp) * 2);
  background: var(--d25);
  display: flex;
  flex-direction: column;
}

.teaser-card h3 {
  margin-top: 0;
}

/* ── Status badges — Open Call cards ─────────────────────────────────────────── */

.status {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: var(--b2) solid var(--ink);
  display: inline-block;
  margin-bottom: var(--sp);
}

.status--idea      { background: var(--d25); }
.status--open      { background: var(--ink); color: var(--paper); }
.status--ongoing   { background: var(--d50); }
.status--closing   { background: var(--d75); color: var(--paper); }
.status--financing { background: var(--d-diag); }

/* ── Hero ────────────────────────────────────────────────────────────────────── */

.hero {
  background: var(--d50);
  border: var(--b4) solid var(--ink);
  padding: calc(var(--sp) * 7) calc(var(--sp) * 5);
  margin-bottom: calc(var(--sp) * 6);
}

.hero-eye {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  display: inline-block;
  padding: 3px 10px;
  margin-bottom: calc(var(--sp) * 3);
}

.hero h1 {
  background: var(--paper);
  display: inline-block;
  padding: calc(var(--sp) * 1.5) calc(var(--sp) * 2);
  border: var(--b2) solid var(--ink);
  margin-bottom: calc(var(--sp) * 3);
}

.hero-tagline {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.55;
  max-width: 620px;
  background: var(--paper);
  border: var(--b2) solid var(--ink);
  padding: calc(var(--sp) * 1.5) calc(var(--sp) * 2);
  margin-bottom: calc(var(--sp) * 3);
}

.hero-ctas {
  display: flex;
  gap: calc(var(--sp) * 1.5);
  flex-wrap: wrap;
}

/* ── Section header — used above each homepage section ───────────────────────── */

.section-header {
  display: flex;
  align-items: baseline;
  gap: calc(var(--sp) * 2);
  flex-wrap: wrap;
  margin-bottom: calc(var(--sp) * 3);
}

.section-header h2 {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
  flex: 1;
  min-width: 0;
}

.section-link {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border: var(--b2) solid var(--ink);
  padding: 5px 10px;
  display: inline-block;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Section heading as a link (e.g. "Studio offerings") */
.section-header h2 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: var(--b2) solid transparent;
}

.section-header h2 a:hover {
  border-bottom-color: var(--ink);
}

.section-link:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ── About strip ─────────────────────────────────────────────────────────────── */

.about-strip {
  border: var(--b4) solid var(--ink);
  background: var(--d-diag);
  padding: calc(var(--sp) * 4);
  display: flex;
  gap: calc(var(--sp) * 4);
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: calc(var(--sp) * 6);
}

.about-strip-text {
  flex: 1;
  min-width: 280px;
}

.about-strip-text h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: calc(var(--sp) * 2);
  text-shadow:
    2px  0   0 var(--paper),
   -2px  0   0 var(--paper),
    0    2px 0 var(--paper),
    0   -2px 0 var(--paper),
    2px  2px 0 var(--paper),
   -2px -2px 0 var(--paper),
    2px -2px 0 var(--paper),
   -2px  2px 0 var(--paper);
}

.about-strip-text p {
  background: var(--paper);
  border: var(--b2) solid var(--ink);
  padding: calc(var(--sp) * 1.5) calc(var(--sp) * 2);
}

/* ── Portrait (about strip) ──────────────────────────────────────────────────── */
.portrait-wrapper {
  position: relative;
  width: 200px;
  flex-shrink: 0;
  align-self: flex-start;
}

.portrait-base {
  display: block;
  width: 100%;
  height: auto;
}

/* Dithered overlay: shown by default, fades out on hover */
.portrait-dither-overlay {
  position: absolute;
  inset: 0;
  isolation: isolate;
}

.portrait-dither-overlay img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Screen-blend ink tint: turns black pixels in the dithered PNG to --ink colour */
.portrait-dither-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  mix-blend-mode: screen;
  pointer-events: none;
}

[data-theme="dark"] .portrait-dither-overlay::after {
  background: var(--paper);
}

@media (prefers-reduced-motion: no-preference) {
  .portrait-dither-overlay {
    transition: opacity .25s;
  }
}

.portrait-wrapper:hover .portrait-dither-overlay {
  opacity: 0;
}

/* ── Card "suits you" blurb ──────────────────────────────────────────────────── */
.card-suits-label {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: calc(var(--sp) * 1.5);
  margin-bottom: calc(var(--sp) * .75);
}

.card-suits {
  font-family: var(--font-mono);
  font-size: .75rem;
  border-left: var(--b2) solid var(--ink);
  padding-left: calc(var(--sp) * 1.5);
  margin-top: calc(var(--sp) * 1.5);
  color: var(--ink);
}

/* ── Newsletter ──────────────────────────────────────────────────────────────── */

.newsletter {
  border: var(--b4) solid var(--ink);
  padding: calc(var(--sp) * 4);
  margin-bottom: calc(var(--sp) * 6);
}

.newsletter h2 {
  margin-bottom: calc(var(--sp) * 2);
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */

footer {
  border-top: var(--b4) solid var(--ink);
  background: var(--d25);
  padding: calc(var(--sp) * 4);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: calc(var(--sp) * 3);
}

.footer-col h3 {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: calc(var(--sp) * 1.5);
  border-bottom: var(--b1) solid var(--ink);
  padding-bottom: calc(var(--sp) * .75);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: calc(var(--sp) * .75);
}

.footer-col a {
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--ink);
  text-decoration: underline;
}

.footer-col p {
  font-family: var(--font-mono);
  font-size: .9rem;
  margin-bottom: calc(var(--sp) * .75);
}

/* ── Details / expandable content ───────────────────────────────────────────── */
/* Always native <details>/<summary> — never JS accordion. */

details {
  border: var(--b2) solid var(--ink);
  padding: calc(var(--sp) * 1.5);
  margin-bottom: calc(var(--sp) * 1.5);
}

summary {
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  margin-bottom: var(--sp);
}

/* ── Package detail <details> — summary styled like h2 ───────────────────────── */
/* .pkg-details wraps the <details> elements on studio offering pages. */

.pkg-details {
  border: none;
  padding: 0;
  margin-bottom: calc(var(--sp) * 4);
}

.pkg-details > summary {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  border-bottom: var(--b4) solid var(--ink);
  padding-bottom: var(--sp);
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: calc(var(--sp) * 2);
}

/* Arrow affordance — mobile only */
.pkg-details > summary::after {
  content: '▼';
  font-size: .75rem;
  flex-shrink: 0;
  transition: transform .15s;
}

.pkg-details[open] > summary::after {
  transform: rotate(180deg);
}

.pkg-details[open] > summary {
  margin-bottom: calc(var(--sp) * 2);
}

/* Desktop: details always open, summary not interactive */
@media (min-width: 901px) {
  .pkg-details > summary {
    pointer-events: none;
    cursor: default;
    list-style: none;
  }
  .pkg-details > summary::after {
    display: none;
  }
  .pkg-details > summary::-webkit-details-marker {
    display: none;
  }
}

.pkg-details .pkg-details-content {
  padding-top: calc(var(--sp) * 1);
}

@media (prefers-reduced-motion: no-preference) {
  .pkg-details > summary::after {
    transition: transform .15s ease;
  }
}

/* ── CTA booking block ───────────────────────────────────────────────────────── */

.cta-block {
  border: var(--b4) solid var(--ink);
  padding: calc(var(--sp) * 4);
  margin-top: calc(var(--sp) * 6);
  margin-bottom: calc(var(--sp) * 6);
}

.cta-block p {
  max-width: 600px;
  margin-bottom: calc(var(--sp) * 2);
}

/* ── Dither background text legibility ───────────────────────────────────────── */
/* Text directly on d25 (light speckled) or d75 (dark speckled) backgrounds
   gets a bold weight and contrasting halo to ensure legibility. */

/* d25 backgrounds: ink text with paper halo */
.on-d25,
.on-d25 h2,
.on-d25 h3,
.on-d25 p,
.on-d25 li,
.on-d25 a,
footer h3,
footer p,
footer li,
footer a {
  font-weight: 700;
  text-shadow:
    1px  1px 0 var(--paper),
   -1px -1px 0 var(--paper),
    1px -1px 0 var(--paper),
   -1px  1px 0 var(--paper);
}

/* "link • description" rows in footer Also column */
.footer-also-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-also-list li {
  display: flex;
  align-items: baseline;
  gap: calc(var(--sp) * .5);
  margin-bottom: calc(var(--sp) * .5);
}

.footer-also-sep {
  font-family: var(--font-mono);
  font-size: .8rem;
  flex-shrink: 0;
}

.footer-also-desc {
  font-family: var(--font-mono);
  font-size: .8rem;
}

/* Footer text size and stronger halo for legibility on d25 background */
footer h3,
footer p,
footer li,
footer a {
  font-size: .9rem;
  font-weight: 700;
  text-shadow:
    2px  0   0 var(--paper),
   -2px  0   0 var(--paper),
    0    2px 0 var(--paper),
    0   -2px 0 var(--paper),
    2px  2px 0 var(--paper),
   -2px -2px 0 var(--paper),
    2px -2px 0 var(--paper),
   -2px  2px 0 var(--paper);
}

/* d75 backgrounds: paper text with ink halo */
.on-d75,
.on-d75 h2,
.on-d75 h3,
.on-d75 p,
.on-d75 li,
.on-d75 a {
  color: var(--paper);
  font-weight: 700;
  text-shadow:
    1px  1px 0 var(--ink),
   -1px -1px 0 var(--ink),
    1px -1px 0 var(--ink),
   -1px  1px 0 var(--ink);
}

/* ── Package detail page — 2-column grid layout ──────────────────────────────── */

.pkg-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: calc(var(--sp) * 6);
  row-gap: calc(var(--sp) * 6);
  align-items: start;
}

.pkg-layout-full {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .pkg-layout {
    grid-template-columns: 1fr;
  }
}

/* pkg-format: mono label below h1 */
.pkg-format {
  font-family: var(--font-mono);
  font-size: .85rem;
  margin-top: calc(var(--sp) * 3);
  margin-bottom: 0;
}

/* pkg-col-intro: right column of row 1 — tagline centred vertically */
.pkg-col-intro {
  align-self: stretch;
  display: flex;
  align-items: center;
}

/* Reset margins that were designed for single-column flow */
.pkg-layout .pkg-suits-you,
.pkg-layout .pkg-tagline,
.pkg-layout .pkg-price {
  margin-bottom: 0;
}

/* CTA buttons row (email + phone) */
.cta-btns {
  display: flex;
  gap: var(--sp);
  flex-wrap: wrap;
  margin-bottom: calc(var(--sp) * 3);
}

/* Contact form section */
.cta-contact-form-wrap {
  border-top: var(--b2) solid var(--ink);
  padding-top: calc(var(--sp) * 3);
}

.cta-contact-form-wrap h3 {
  margin-top: 0;
  margin-bottom: calc(var(--sp) * 2);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: calc(var(--sp) * .5);
  margin-bottom: calc(var(--sp) * 2);
}

.form-field label {
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 600;
}

.form-field input[type="email"],
.form-field textarea {
  border: var(--b2) solid var(--ink);
  background: var(--paper);
  padding: calc(var(--sp) * 1) calc(var(--sp) * 1.5);
  font-family: var(--font-sans);
  font-size: .9rem;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
}

.contact-status {
  margin-top: var(--sp);
  font-family: var(--font-mono);
  font-size: .85rem;
}

.pkg-header {
  margin-bottom: calc(var(--sp) * 4);
}


.pkg-tagline {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.55;
  max-width: 680px;
  border-left: var(--b4) solid var(--ink);
  padding-left: calc(var(--sp) * 2);
  margin-bottom: calc(var(--sp) * 4);
}

.pkg-suits-you {
  margin-bottom: calc(var(--sp) * 4);
}

.pkg-suits-you ul {
  list-style: none;
  padding: 0;
}

.pkg-suits-you li {
  border-left: var(--b2) solid var(--ink);
  padding-left: calc(var(--sp) * 2);
  margin-bottom: calc(var(--sp) * 1.5);
  font-size: .9375rem;
}

@media (min-width: 901px) {
  .pkg-note {
    max-width: 75%;
  }
}

.pkg-case {
  border: var(--b2) solid var(--ink);
  border-left: var(--b4) solid var(--ink);
  padding: calc(var(--sp) * 2) calc(var(--sp) * 2) calc(var(--sp) * 2) calc(var(--sp) * 3);
  margin-bottom: calc(var(--sp) * 4);
  background: var(--d25);
}

.pkg-case p {
  margin-bottom: 0;
  font-size: .9375rem;
  /* d25 background — contrasting halo */
  font-weight: 700;
  text-shadow:
    1px  1px 0 var(--paper),
   -1px -1px 0 var(--paper),
    1px -1px 0 var(--paper),
   -1px  1px 0 var(--paper);
}

/* Testimonial variant — strip box decoration from wrapper */
.pkg-case:has(.pkg-testimonial) {
  border: none;
  background: none;
  padding: 0;
}

/* Testimonial: single column, left-aligned, capped at ~50% on desktop */
.pkg-testimonial {
  margin: 0;
  padding: 0;
  max-width: 50%;
}

.pkg-case .pkg-testimonial__quote {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: calc(var(--sp) * 2);
  align-items: stretch;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 400;
  font-style: italic;
  text-shadow: none;
}

.pkg-case .pkg-testimonial__quote::before {
  content: '\201C';
  display: flex;
  align-items: flex-start;
  font-size: 5rem;
  line-height: 1;
  font-family: var(--font-sans);
  font-style: normal;
  color: var(--ink);
}

.pkg-testimonial__attr {
  margin: 0;
  margin-top: calc(var(--sp) * 2);
  padding-top: calc(var(--sp) * 2);
  border-top: var(--b2) solid var(--ink);
  font-size: .875rem;
  font-family: var(--font-sans);
  font-weight: 400;
  font-style: normal;
  text-shadow: none;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .pkg-testimonial {
    max-width: 100%;
  }
}

.pkg-price {
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 600;
  border: var(--b1) solid var(--ink);
  padding: calc(var(--sp) * 1) calc(var(--sp) * 1.5);
  display: inline-block;
  margin-top: calc(var(--sp) * 3);
  margin-bottom: calc(var(--sp) * 4);
  max-width: 100%;
}

/* ── Shop page ───────────────────────────────────────────────────────────────── */

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: calc(var(--sp) * 3);
  margin-bottom: calc(var(--sp) * 6);
}

.shop-product {
  border: var(--b3) solid var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  position: relative;
}

.shop-product-images {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--d25);
  border-bottom: var(--b3) solid var(--ink);
  position: relative;
}

.shop-product-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-product-body {
  padding: calc(var(--sp) * 2);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.shop-product-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: calc(var(--sp) * .75);
}

.shop-product-desc {
  font-size: .875rem;
  line-height: 1.5;
  flex: 1;
  margin-bottom: var(--sp);
}

.shop-product-footer {
  font-family: var(--font-mono);
  border-top: var(--b1) solid var(--ink);
  padding-top: var(--sp);
  margin-top: var(--sp);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp);
}

.shop-product-price {
  font-size: .9rem;
  font-weight: 600;
}

/* Product detail page */
.product-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--sp) * 1.5);
  margin-bottom: calc(var(--sp) * 4);
}

.product-gallery-main {
  grid-column: 1 / -1;
  aspect-ratio: 1 / 1;
  background: var(--d25);
  border: var(--b3) solid var(--ink);
  overflow: hidden;
}

.product-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery-thumb {
  aspect-ratio: 1 / 1;
  background: var(--d25);
  border: var(--b2) solid var(--ink);
  overflow: hidden;
  cursor: pointer;
}

.product-gallery-thumb:hover {
  border-width: var(--b3);
}

.product-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--sp) * 5);
  margin-bottom: calc(var(--sp) * 6);
}

@media (max-width: 700px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
  }
}

.product-detail-info h1 {
  font-size: 1.8rem;
  margin-bottom: calc(var(--sp) * 2);
}

.product-price-block {
  border: var(--b4) solid var(--ink);
  padding: calc(var(--sp) * 2);
  margin-bottom: calc(var(--sp) * 3);
  display: flex;
  align-items: baseline;
  gap: calc(var(--sp) * 2);
}

.product-price {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 600;
}

.product-price-note {
  font-family: var(--font-mono);
  font-size: .75rem;
  opacity: .8;
}

/* ── Newsletter styled form ──────────────────────────────────────────────────── */
/* Override MailerLite default styles to match design system.
   These may need adjustment depending on MailerLite's generated class names. */

.newsletter {
  border: var(--b4) solid var(--ink);
  padding: calc(var(--sp) * 4);
  margin-bottom: calc(var(--sp) * 6);
}

.newsletter h2 {
  margin-bottom: calc(var(--sp) * 2);
  border-bottom-color: var(--ink);
}

.newsletter-description {
  font-size: .9375rem;
  max-width: 560px;
  margin-bottom: calc(var(--sp) * 3);
}

/* Custom form (replaces MailerLite embed when using native form) */
.newsletter-form {
  display: flex;
  gap: var(--sp);
  flex-wrap: wrap;
  max-width: 480px;
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-mono);
  font-size: .9rem;
  padding: calc(var(--sp) * 1) calc(var(--sp) * 1.5);
  border: var(--b2) solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  outline: none;
}

.newsletter-form input[type="email"]::placeholder {
  color: var(--ink);
  opacity: .5;
}

.newsletter-form input[type="email"]:focus {
  border-width: var(--b3);
}

.newsletter-form button {
  font-family: var(--font-mono);
  font-size: .9rem;
  font-weight: 600;
  padding: calc(var(--sp) * 1) calc(var(--sp) * 2.5);
  background: var(--ink);
  color: var(--paper);
  border: var(--b3) solid var(--ink);
  cursor: pointer;
}

.newsletter-form button:hover {
  box-shadow: var(--shadow);
}

.newsletter-status {
  font-family: var(--font-mono);
  font-size: .875rem;
  margin-top: calc(var(--sp) * 2);
}


/* ── Open call cards ─────────────────────────────────────────────────────── */
.open-calls-grid {
  display: grid;
  gap: calc(var(--sp) * 4);
  margin-top: calc(var(--sp) * 4);
}

.open-call-card {
  border: var(--b2) solid var(--ink);
  padding: calc(var(--sp) * 3);
}

.open-call-card header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: calc(var(--sp) * 2);
  margin-bottom: calc(var(--sp) * 2);
}

.open-call-card h2 {
  margin: 0;
  font-size: 1.1rem;
  border-bottom: none;
}

.open-call-meta {
  font-family: var(--font-mono);
  font-size: .75rem;
  margin: 0;
  width: 100%;
}

/* ── Shop product detail — additional image classes ──────────────────────── */
.product-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp);
}

.product-images img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: var(--b1) solid var(--ink);
  cursor: pointer;
}

.product-images img:first-child {
  outline: var(--b2) solid var(--ink);
  outline-offset: 2px;
}

.product-main-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: var(--b2) solid var(--ink);
}

.product-info {}

.product-info h1 {
  margin-bottom: calc(var(--sp) * 2);
}

/* ── About page ──────────────────────────────────────────────────────────── */

.about-page-intro {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: calc(var(--sp) * 5);
  align-items: start;
  margin-bottom: calc(var(--sp) * 6);
  max-width: 75%;
}

.about-page-intro .portrait-wrapper {
  width: 100%;
}

.about-page-intro-text p {
  font-size: clamp(1rem, 1.8vw, 1.25rem);
  line-height: 1.55;
  border-left: var(--b4) solid var(--ink);
  padding-left: calc(var(--sp) * 2);
}

.about-section {
  margin-bottom: calc(var(--sp) * 5);
}

/* When standalone (not in pkg-layout), constrain width */
.about-page > .about-section {
  max-width: 720px;
}

@media (max-width: 600px) {
  .about-page-intro {
    grid-template-columns: 1fr;
    gap: calc(var(--sp) * 3);
    max-width: 100%;
  }

  .about-page-intro .portrait-wrapper {
    width: 140px;
    margin-inline: auto;
  }
}

/* ── Lab entry (hintlabs detail pages) ───────────────────────────────────── */
/* ── Page header — H1 left, description right ─────────────────────────────── */
.page-header {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: calc(var(--sp) * 6);
  align-items: start;
  margin-bottom: calc(var(--sp) * 6);
  border-bottom: var(--b1) solid var(--ink);
  padding-bottom: calc(var(--sp) * 5);
}

.page-header h1 {
  margin: 0;
}

.page-intro {
  margin: 0;
  padding-top: .25em; /* optical alignment with cap-height */
}

@media (max-width: 700px) {
  .page-header {
    grid-template-columns: 1fr;
    gap: calc(var(--sp) * 2);
  }
}

.lab-entry {
  max-width: 720px;
}

.lab-entry-header {
  border-bottom: var(--b1) solid var(--ink);
  padding-bottom: calc(var(--sp) * 3);
  margin-bottom: calc(var(--sp) * 4);
}

.lab-entry-meta {
  font-family: var(--font-mono);
  font-size: .8125rem;
  color: var(--ink);
  margin: 0;
}

.lab-entry-body p + p {
  margin-top: calc(var(--sp) * 2);
}

.lab-entry-body strong {
  font-family: var(--font-mono);
  font-size: .8125rem;
}

.lab-entry-image {
  width: 100%;
  height: auto;
  display: block;
  border: var(--b1) solid var(--ink);
  margin-bottom: calc(var(--sp) * 4);
}

/* ── Hintlabs dialogs ──────────────────────────────────────────────────────── */
dialog.hintlab-dialog {
  border: var(--b2) solid var(--ink);
  padding: 0;
  max-width: min(640px, calc(100vw - 32px));
  width: 100%;
  max-height: 90dvh;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}

dialog.hintlab-dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog.hintlab-dialog::backdrop {
  background: var(--ink);
  opacity: .55;
}

.dialog-inner {
  overflow-y: auto;
  padding: calc(var(--sp) * 4);
}

.dialog-close {
  float: right;
  appearance: none;
  background: none;
  border: var(--b2) solid var(--ink);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1;
  padding: 3px 8px;
  cursor: pointer;
  color: var(--ink);
  margin-bottom: calc(var(--sp) * 2);
  margin-left: calc(var(--sp) * 2);
}

.dialog-close:hover {
  background: var(--ink);
  color: var(--paper);
}

.dialog-img {
  width: 100%;
  height: auto;
  display: block;
  border: var(--b1) solid var(--ink);
  margin-top: calc(var(--sp) * 2);
  margin-bottom: calc(var(--sp) * 3);
}

.dialog-body p + p {
  margin-top: calc(var(--sp) * 2);
}

.dialog-body strong {
  font-family: var(--font-mono);
  font-size: .8125rem;
}

.dialog-body a {
  color: var(--ink);
}

/* ── Media carousel (hintlabs dialogs) ────────────────────────────────────── */
.media-carousel {
  margin-top: calc(var(--sp) * 2);
  margin-bottom: calc(var(--sp) * 3);
}

.carousel-item {
  display: none;
  margin: 0;
}

.carousel-item.is-active {
  display: block;
}

.carousel-item img,
.carousel-item video {
  width: 100%;
  height: auto;
  display: block;
  border: var(--b1) solid var(--ink);
}

.carousel-nav {
  display: flex;
  align-items: center;
  gap: var(--sp);
  margin-top: var(--sp);
}

.carousel-btn {
  appearance: none;
  background: none;
  border: var(--b2) solid var(--ink);
  font-family: var(--font-mono);
  font-size: .875rem;
  padding: 3px 10px;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}

.carousel-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.carousel-count {
  font-family: var(--font-mono);
  font-size: .75rem;
  margin-left: auto;
}
