/* WordPress header: 8% side inset; about 100px tall at 1280px and 167px at 2000px. */
@media (min-width: 1001px) {
  .site-header {
    height: clamp(100px, calc(7.78vw + 11.4px), 167px);
  }

  .header-inner {
    width: 84%;
    max-width: none;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 16px;
  }

  .brand,
  .brand img {
    width: clamp(138px, calc(13.05vw - 29px), 232px);
  }

  .main-nav {
    gap: 20px;
  }

  .main-nav > a,
  .nav-menu > .nav-trigger {
    font-size: 14px;
  }
}

/* Expandable navigation items open their submenu on click. */
.main-nav .nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: inherit;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  white-space: nowrap;
}

.main-nav .nav-trigger::after {
  content: '⌄';
  font-size: 17px;
  line-height: 1;
}

.main-nav .nav-trigger.active {
  border-bottom-color: var(--mint);
}

.main-nav .nav-trigger:hover,
.main-nav .nav-trigger[aria-expanded="true"] {
  color: var(--mint);
}

.main-nav .nav-trigger:focus-visible,
.mobile-nav .mobile-trigger:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}

.main-nav .nav-menu:hover .dropdown,
.main-nav .nav-menu:focus-within .dropdown {
  display: none;
}

.main-nav .nav-menu.is-open .dropdown {
  display: grid;
}

@media (min-width: 1001px) and (max-width: 1100px) {
  .main-nav .nav-trigger {
    font-size: 12px;
  }
}

@media (max-width: 1000px) {
  .mobile-nav {
    position: absolute;
    left: 0;
    right: 0;
    background: inherit;
    color: inherit;
    box-shadow: 0 12px 20px #0003;
    padding: 12px 18px 22px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
  }

  .mobile-nav.open {
    display: grid;
  }

  .mobile-nav a,
  .mobile-nav .mobile-trigger {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-decoration: none;
    font-weight: 600;
  }

  .mobile-nav .mobile-trigger {
    appearance: none;
    background: none;
    border: 0;
    color: inherit;
    text-align: left;
  }

  .mobile-nav .mobile-trigger::after {
    content: '⌄';
    float: right;
  }

  .mobile-nav .mobile-trigger[aria-expanded="true"]::after {
    transform: rotate(180deg);
  }

  .mobile-nav .mobile-submenu {
    display: none;
  }

  .mobile-nav .mobile-menu.is-open .mobile-submenu {
    display: grid;
  }

  .mobile-nav .mobile-submenu a {
    padding-left: 34px;
    font-size: 14px;
    opacity: .85;
  }
}

/* The desktop navigation does not fit comfortably at tablet widths. */
@media (min-width: 761px) and (max-width: 1000px) {
  .site-header {
    height: 84px;
  }

  .header-inner {
    display: flex;
    justify-content: space-between;
  }

  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .mobile-nav {
    top: 84px;
  }
}

/* Text pages use a quieter, narrower editorial layout. */
@media (min-width: 761px) {
  .content-page .narrow {
    width: min(calc(100% - 48px), 1075px);
  }

  .content-page .content-intro {
    padding-top: 76px;
    padding-bottom: 0;
  }

  .content-page .content-intro h1 {
    margin-bottom: 52px;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
  }

  .content-page .content-intro .lead {
    max-width: 700px;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 300;
    line-height: 1.6;
  }

  .content-page .content-intro:not(:has(.lead)) {
    padding-top: 96px;
  }

  .content-page .content-intro:not(:has(.lead)) h1 {
    margin-bottom: 30px;
  }

  .content-page:has(#faq) .content-intro {
    padding-top: 96px;
  }

  /* Keep every page in the Projekt menu on the same heading baseline. */
  :is(.page-team, .page-forschung) .content-page .content-intro,
  .page-sponsoren .content-page:has(#faq) .content-intro {
    padding-top: 76px;
  }

  .content-page .content-body {
    font-size: 18px;
    line-height: 1.6;
  }

  .content-page .content-body h2 {
    font-size: 28px;
    font-weight: 300;
    line-height: 1.2;
  }

  .content-page .content-body h3 {
    font-weight: 300;
  }
}

/* Team: the first two portraits are spread across two wide columns. */
@media (min-width: 1001px) {
  .content-page:has(.people) .content-body section:first-child .people {
    grid-template-columns: repeat(2, 400px);
    column-gap: 120px;
  }
}

@media (min-width: 761px) and (max-width: 1000px) {
  .content-page:has(.people) .content-body section:first-child .people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.content-page:has(.people) .content-body section:first-child h2 {
  font-size: 24px;
  font-weight: 300;
}

.content-page:has(.people) .person h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.25;
}

.content-page:has(.people) .person p {
  font-size: 14px;
  line-height: 1.25;
}

/* Personal university addresses beneath the project leaders. */
.page-team .content-body > section:first-child .person p {
  margin-bottom: 0;
}

.page-team .content-body > section:first-child .person .person-email {
  margin-top: 8px;
  overflow-wrap: anywhere;
}

.page-team .person-email a {
  color: var(--ink);
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}

/* Keep the contact address directly in the introductory sentence. */
.page-kontakt .content-intro a {
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}

/* Editor: contain the heading's top margin inside the green hero. */
.editor-hero {
  display: flow-root;
}

@media (min-width: 1001px) {
  .editor-hero {
    height: 585px;
    background-size: 865px auto;
    background-position: calc(50% + 33px) top;
  }

  .editor-hero h1 {
    margin-top: 92px;
    margin-bottom: 16px;
    font-size: 96px;
    line-height: 1;
  }

  .editor-hero p {
    font-size: 28px;
    line-height: 1;
  }
}

/* Spielekatalog: title and image rhythm from the original layout. */
.catalog-page .game-card :is(h2, h3) {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: 32px;
  line-height: 1;
}

@media (min-width: 1001px) {
  .catalog-page {
    padding-top: 66px;
  }

  .catalog-page .wrap {
    width: min(calc(100% - 50px), var(--max));
  }

  .catalog-page h1 {
    font-size: 96px;
    line-height: 1;
  }

  .catalog-page .filters {
    margin-top: 15px;
    margin-bottom: 122px;
  }

}

@media (max-width: 760px) {
  /* The same site-wide Elementor header is used on home and inner pages. */
  .site-header {
    --mobile-header-height: clamp(223px, calc(7.7vw + 193px), 233px);
    height: var(--mobile-header-height);
  }

  .header-inner {
    position: relative;
    display: block;
    width: 100%;
  }

  .brand {
    position: absolute;
    top: 14px;
    left: 50%;
    width: min(79vw, 414px);
    height: clamp(142px, calc(6vw + 119px), 150px);
    transform: translateX(-50%);
  }

  .brand img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: none;
  }

  .menu-toggle {
    position: absolute;
    top: 166px;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 53px;
    font-size: 0;
  }

  .menu-toggle::before {
    content: "☰";
    display: grid;
    place-items: center;
    width: 33px;
    height: 34px;
    border-radius: 2px;
    background: #f5f5f5;
    color: #343c42;
    font-size: 21px;
  }

  .mobile-nav {
    top: var(--mobile-header-height);
  }

  .content-page .content-intro {
    padding-bottom: 0;
  }

  .content-page .content-intro h1 {
    margin-bottom: 28px;
    font-weight: 300;
    line-height: 1.2;
  }

  .content-page .content-intro .lead {
    font-size: 21px;
    line-height: 1.45;
  }

  .content-page .content-body h2,
  .content-page .content-body h3 {
    font-weight: 300;
  }

  .editor-hero {
    background-size: auto 530px;
    background-position: center top;
  }

  .catalog-page .game-card :is(h2, h3) {
    font-size: 25px;
  }
}

/* The editor illustration follows the actual words, including their responsive layout. */
.editor-hero {
  position: relative;
  isolation: isolate;
  display: block;
  height: clamp(524px, 47.55vw, 700px);
  overflow: hidden;
  background: #39605c;
}

.editor-hero .wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: none;
  height: 100%;
  padding: clamp(120px, 10.9vw, 145px) 20px 0;
  transform: translateX(-4vw);
}

.editor-hero h1 {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  margin: 0;
  color: var(--mint);
  line-height: 1;
  white-space: nowrap;
}

.editor-hero-first,
.editor-hero-second {
  position: relative;
  display: block;
  width: max-content;
  line-height: 1;
}

.editor-hero-first {
  font-size: clamp(78px, 8.17vw, 96px);
}

.editor-hero-second {
  font-size: clamp(46px, 5vw, 60px);
}

.editor-hero-first::before,
.editor-hero-first::after,
.editor-hero-brush,
.editor-hero-second::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  background-image: url('editor-decor.png');
  background-repeat: no-repeat;
  background-size: 762px auto;
}

/* Confetti above the first word. */
.editor-hero-first::before {
  width: 44px;
  height: 42px;
  top: -79px;
  left: calc(50% - 22px);
  background-position: -242px 0;
}

/* The pen and its dotted stroke touch the end of the first word. */
.editor-hero-first::after {
  width: 135px;
  height: 52px;
  top: -44px;
  right: -79px;
  background-position: -394px -36px;
}

/* Brush sits beside the lower heading line. */
.editor-hero-brush {
  width: 66px;
  height: 43px;
  top: 46px;
  left: calc(50% - 288px);
  background-position: 25px -118px;
}

/* The dashed circle and scissors deliberately cross the final letters. */
.editor-hero-second::after {
  width: 265px;
  height: 285px;
  top: -20px;
  left: calc(50% + min(20.6vw, 330px));
  background-position: -497px -183px;
}

.editor-hero p {
  max-width: 850px;
  margin: 39px 0 0;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.25;
}

.editor-hero-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
}

.editor-hero-actions .btn {
  min-height: 52px;
  padding: 10px 26px;
  font-size: 16px;
}

@media (max-width: 760px) {
  .editor-hero {
    height: auto;
    min-height: 610px;
  }

  .editor-hero .wrap {
    min-height: 610px;
    padding: 130px 24px 70px;
    transform: none;
  }

  .editor-hero h1 {
    white-space: normal;
  }

  .editor-hero-first {
    font-size: clamp(54px, 12vw, 78px);
  }

  .editor-hero-second {
    width: min(100%, 560px);
    font-size: clamp(37px, 8vw, 53px);
    line-height: .98;
  }

  .editor-hero-first::before {
    width: 29px;
    height: 27px;
    top: -51px;
    left: calc(50% - 14px);
    background-size: 500px auto;
    background-position: -159px 0;
  }

  .editor-hero-first::after {
    width: 89px;
    height: 36px;
    top: -25px;
    right: -52px;
    background-size: 500px auto;
    background-position: -259px -23px;
  }

  .editor-hero-brush,
  .editor-hero-second::after {
    display: none;
  }

  .editor-hero p {
    margin-top: 26px;
    font-size: 20px;
    line-height: 1.3;
  }

  .editor-hero-actions {
    flex-direction: column;
    width: min(100%, 280px);
    gap: 12px;
    margin-top: 30px;
  }

  .editor-hero-actions .btn {
    width: 100%;
  }
}

/* Editor tutorials form one continuous green section below the hero. */
.editor-page {
  background: var(--pale);
}

.editor-page .tutorials {
  margin: 0;
  padding: clamp(64px, 4vw, 82px) 0 clamp(90px, 6vw, 120px);
  background: #39605c;
  color: #fff;
}

.editor-page .tutorials > h2 {
  width: min(84%, 1500px);
  margin: 0 auto 62px;
  color: #fff;
  font-size: clamp(26px, 2vw, 34px);
  font-weight: 300;
  line-height: 1.3;
  text-align: center;
}

.editor-page .tutorial-grid {
  display: grid;
  width: min(84%, 1500px);
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: clamp(28px, 2.5vw, 46px);
  row-gap: 70px;
}

.editor-page .tutorial {
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #fff;
}

.editor-page .tutorial-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 14px;
  background: var(--dark);
}

.editor-page .tutorial-preview {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.editor-page .tutorial-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-page .tutorial-preview:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: -3px;
}

.editor-page .tutorial-player video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--dark);
}

.editor-page .tutorial-player :is(video, .tutorial-preview)[hidden] {
  display: none;
}

.editor-page .tutorial h3 {
  margin: 26px 0 16px;
  padding: 0;
  color: #fff;
  font-size: clamp(21px, 1.55vw, 27px);
  font-weight: 300;
  line-height: 1.35;
}

.editor-page .tutorial p {
  margin: 0;
  padding: 0;
  color: #fff;
  font-size: clamp(16px, 1.05vw, 19px);
  line-height: 1.6;
}

/* Editor advantages keep the current wording in three open columns. */
.editor-benefit-section {
  padding: clamp(105px, 10.5vw, 190px) 0 clamp(95px, 8vw, 150px);
  background: var(--pale);
}

.editor-benefit-inner {
  width: min(76%, 1300px);
  margin: 0 auto;
}

.editor-benefit-inner > h2 {
  margin: 0 0 66px;
  color: var(--ink);
  font-size: clamp(27px, 1.75vw, 32px);
  font-weight: 300;
  line-height: 1.3;
  text-align: center;
}

.editor-benefit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 3.6vw, 66px);
}

.editor-benefit {
  min-width: 0;
}

.editor-benefit h3 {
  margin: 0 0 24px;
  color: var(--mint);
  font-size: clamp(30px, 2.4vw, 42px);
  line-height: .92;
}

.editor-benefit p {
  margin: 0;
  color: var(--ink);
}

.editor-benefit .editor-benefit-lead {
  margin-bottom: 20px;
  font-size: clamp(19px, 1.48vw, 25px);
  line-height: 1.55;
}

.editor-benefit .editor-benefit-copy {
  font-size: clamp(16px, 1.1vw, 19px);
  line-height: 1.62;
}

.editor-page .editor-after-content {
  padding: 0 0 90px;
  background: var(--pale);
}

.editor-page .editor-after-content > .narrow {
  width: min(calc(100% - 48px), 1120px);
}

.editor-page .editor-after-content .callout {
  display: flex;
  min-height: 400px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 60px 24px;
  border-radius: 0;
  background: var(--mint);
  color: var(--dark);
  text-align: center;
}

.editor-page .editor-after-content .callout h2 {
  margin: 0 0 13px;
  color: var(--dark);
  font-family: Indigo, Arial, sans-serif;
  font-size: clamp(50px, 5vw, 72px);
  font-weight: 400;
  line-height: .96;
  text-transform: uppercase;
}

.editor-page .editor-after-content .callout p {
  max-width: 900px;
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.4;
}

.editor-page .editor-after-content .callout a {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--orange);
  color: var(--dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.editor-page .editor-after-content .callout a:hover {
  background: #ffd29b;
}

.editor-page .editor-after-content .faq {
  padding-top: 100px;
}

/* Editor and contact FAQs follow the original two-column accordion layout. */
.faq-columns .faq-inner {
  display: grid;
  grid-template-columns: 34% minmax(0, 1fr);
  align-items: start;
  width: 100%;
}

.faq-columns .faq-list {
  min-width: 0;
  max-width: none;
  margin: 0;
}

.editor-page .editor-after-content .faq-columns h2,
.page-kontakt .content-body .faq-columns h2 {
  max-width: 250px;
  margin: 0;
  color: var(--ink);
  font-size: 23px;
  font-weight: 300;
  line-height: 1.28;
  text-align: left;
}

.faq-columns .faq-list details {
  padding: 15px 0;
  border-bottom: 1px solid #9e9e9e33;
}

.faq-columns .faq-list summary {
  align-items: center;
  font-size: 18px;
  font-weight: 300;
  line-height: 1.4;
}

.faq-columns .faq-list summary::after {
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 14px;
  line-height: 15px;
}

.faq-columns .faq-list details p {
  margin: 16px 0 5px;
  font-size: 16px;
  line-height: 1.65;
}

.page-kontakt .faq-overview .faq-group + .faq-group {
  margin-top: 44px;
}

.page-kontakt .faq-overview .faq-group h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.35;
}

@media (max-width: 1100px) {
  .editor-page .tutorial-grid,
  .editor-benefit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .editor-benefit-inner {
    width: 84%;
  }
}

@media (max-width: 760px) {
  .editor-page .tutorials {
    padding: 68px 0 80px;
  }

  .editor-page .tutorials > h2 {
    width: 84%;
    margin-bottom: 36px;
    font-size: 26px;
  }

  .editor-page .tutorial-grid,
  .editor-benefit-grid {
    grid-template-columns: 1fr;
  }

  .editor-page .tutorial-grid {
    width: 84%;
    row-gap: 55px;
  }

  .editor-page .tutorial h3 {
    margin-top: 18px;
    font-size: 22px;
  }

  .editor-benefit-section {
    padding: 75px 0 90px;
  }

  .editor-benefit-inner {
    width: 84%;
  }

  .editor-benefit-inner > h2 {
    margin-bottom: 40px;
    font-size: 26px;
  }

  .editor-benefit-grid {
    gap: 52px;
  }

  .editor-benefit h3 {
    font-size: 32px;
  }

  .editor-benefit .editor-benefit-lead {
    font-size: 20px;
  }

  .editor-page .editor-after-content > .narrow {
    width: 84%;
  }

  .editor-page .editor-after-content .callout {
    min-height: 360px;
    padding: 55px 18px;
  }

  .editor-page .editor-after-content .callout h2 {
    font-size: clamp(34px, 9.7vw, 52px);
  }

  .editor-page .editor-after-content .callout p {
    font-size: 17px;
  }

  .editor-page .editor-after-content .faq {
    padding-top: 75px;
  }

  .faq-columns .faq-inner {
    grid-template-columns: 1fr;
  }

  .editor-page .editor-after-content .faq-columns h2,
  .page-kontakt .content-body .faq-columns h2 {
    margin-bottom: 30px;
  }

  .faq-columns .faq-list summary {
    font-size: 17px;
  }
}

@media (max-width: 620px) {
  .content-page:has(.people) .content-body section:first-child .people {
    grid-template-columns: 1fr;
  }
}
