/* Loaded only by the Gylsere customer package. */
/* Small secondary text must also meet contrast requirements on the warm surfaces. */
.text-neutral-500 {
  color: var(--color-neutral-600);
}

header img[src="/brand/gjk-logo-header.png"] {
  width: clamp(12.5rem, 23vw, 19rem);
  max-width: 100%;
  height: auto;
  flex-shrink: 1;
}

/* Hero category links: one predictable row per category, regardless of language. */
@media (max-width: 1023px) {
  #main-content .container > div:has(> a[href*="/leistungen/#"]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  #main-content .container > div > a[href*="/leistungen/#"] {
    display: flex;
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    gap: 1rem;
  }

  #main-content .container > div > a[href*="/leistungen/#"] svg {
    flex-shrink: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --gjk-content-gutter: 2rem;
    --gjk-media-gutter: 1rem;
    --gjk-feature-gutter: 1rem;
    --gjk-media-outset: calc(var(--gjk-content-gutter) - var(--gjk-media-gutter));
    --gjk-feature-outset: calc(var(--gjk-content-gutter) - var(--gjk-feature-gutter));
    --gjk-space-text: 1rem;
    --gjk-space-block: 1.5rem;
    --gjk-space-group: 2rem;
    --gjk-space-section: 3rem;
    --gjk-header-space: 8.75rem;
    --gjk-title-size: clamp(2rem, 8.8vw, 2.5rem);
    --gjk-heading-size: clamp(1.875rem, 8vw, 2.25rem);
  }

  /* One content grid: remove the Background and container inset layers. */
  #main-content > div:has(.container) {
    margin: 0;
  }

  #main-content :where(section, article):has(> .container),
  body > footer {
    padding-inline: var(--gjk-content-gutter);
    padding-block: var(--gjk-space-section);
  }

  #main-content .container,
  body > footer > .container,
  body > astro-island > header > .container:first-child {
    width: 100%;
    max-width: none;
    padding-inline: 0;
  }

  /* Navigation uses the featured grid; page openings clear it once. */
  body > astro-island > header {
    padding-inline: var(--gjk-feature-gutter);
  }

  body > astro-island > header > .flex {
    padding-inline: 0;
  }

  #agency-mobile-navigation {
    padding-inline: var(--gjk-space-text);
  }

  body.has-language-selector #main-content {
    padding-top: 0;
  }

  #main-content :where(section, article):has(> .container h1),
  #main-content > .container:has(h1) {
    padding-top: calc(var(--gjk-header-space) + var(--gjk-space-group));
  }

  #main-content > .container:has(h1) {
    padding-inline: var(--gjk-content-gutter);
  }

  /* Shared type scale and natural wrapping, without manual line breaks. */
  :is(h1, h2, h3, h4, h5, h6) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    hyphens: auto;
  }

  #main-content h1 {
    font-size: var(--gjk-title-size);
    line-height: 1.08;
    text-wrap: balance;
  }

  #main-content h2:not(.text-sm, .text-xs, #legal-provider, [id^="legal-"]),
  body > footer h2 {
    font-size: var(--gjk-heading-size);
    line-height: 1.12;
    max-width: none;
    text-wrap: balance;
  }

  #main-content > article:has(#legal-provider) h1 {
    font-size: clamp(1.8rem, 7.2vw, 2.25rem);
  }

  #main-content p,
  body > footer p {
    text-align: left;
    text-wrap: pretty;
  }

  #main-content :is(h1, h2, h3) + p {
    margin-top: var(--gjk-space-text);
  }

  #main-content :is(a, button, input, textarea, select, summary) {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  #main-content :is(a, button) svg {
    flex-shrink: 0;
  }

  #main-content nav .font-mono {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Published editorial photographs share one generous media rail. */
  #main-content figure:has(> img[src^="/images/"]) {
    width: calc(100% + 2 * var(--gjk-media-outset));
    max-width: none;
    margin-inline: calc(-1 * var(--gjk-media-outset));
  }

  #main-content figure > img[src^="/images/"] {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  /* Featured CTAs share media edges; their text returns to the content rail. */
  #erstgespraech > .container > .factory-image,
  #main-content [data-service-presentation] > .container > section:last-child {
    width: calc(100% + 2 * var(--gjk-feature-outset));
    margin-inline: calc(-1 * var(--gjk-feature-outset));
    padding: var(--gjk-space-group) var(--gjk-feature-outset);
  }

  #main-content #erstgespraech {
    padding-top: 0;
  }

  #main-content [data-service-spectrum] {
    padding-bottom: 0;
  }

  /* Openings and recurring sections share the same spacing rhythm. */
  #main-content .container > .grid,
  #main-content [data-opening-media],
  #main-content [data-service-presentation] > .container > header {
    gap: var(--gjk-space-group);
  }

  #main-content [data-opening-media],
  #main-content [data-service-presentation] > .container > header,
  #main-content [data-service-spectrum] > .container > div:first-child {
    padding-bottom: var(--gjk-space-group);
  }

  #main-content .signature-positioning > .container > div:first-child {
    padding-block: 0;
  }

  #main-content .signature-process,
  #main-content .signature-media,
  #main-content [data-service-presentation] > .container > header {
    margin-top: var(--gjk-space-group);
  }

  #main-content [data-service-presentation] > .container > div.grid,
  #main-content .signature-contact > .container > div.grid {
    padding-block: var(--gjk-space-section);
  }

  #main-content [data-service-presentation] [data-service-section] + [data-service-section] {
    margin-top: var(--gjk-space-section);
  }

  #main-content [data-service-presentation] [data-service-section="insight"] > section {
    padding-block: 0;
  }

  /* Normal panels keep content-width edges and one consistent inner inset. */
  #main-content .signature-process,
  #main-content .signature-contact aside,
  #main-content [data-service-presentation] [data-service-section="feature-list"],
  #main-content [data-service-presentation="expressive"] [data-service-section="insight"] > section,
  #main-content .signature-index .divide-y > section:nth-child(2) {
    padding: var(--gjk-space-block) var(--gjk-space-text);
  }

  #main-content .signature-index > .container > nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gjk-space-text);
  }

  #main-content .signature-index > .container > nav a {
    width: 100%;
    min-width: 0;
    padding: var(--gjk-space-text);
  }

  #main-content .signature-index .divide-y > section {
    margin-top: 0;
    padding-block: var(--gjk-space-section);
    gap: var(--gjk-space-block);
  }

  #main-content [data-service-spectrum] > .container > .grid:not(:first-child) {
    gap: var(--gjk-space-block);
    padding-top: var(--gjk-space-group);
  }

  #main-content [data-service-spectrum] article {
    padding-block: var(--gjk-space-block);
  }

  @media (min-width: 640px) {
    :root {
      --gjk-header-space: 6rem;
    }
  }
}
