/* ==========================================================================
   Phone & tablet layout (< 1100px) for the 1440px page design.
   Active when assets/fit.js puts the class "mzw-fluid" on <html>.
   The pages style elements inline, so rules here use !important and
   match those inline sizes with attribute selectors. Laptops and larger
   screens are not affected at all.
   ========================================================================== */

/* Sideways overflow is clipped on <html> only (set by fit.js) — never on <body>,
   which would stop the sticky header from staying at the top. */
html.mzw-fluid body { overflow-x: visible; }
html.mzw-fluid body { -webkit-text-size-adjust: 100%; }
html.mzw-fluid img, html.mzw-fluid video, html.mzw-fluid svg { max-width: 100%; }

/* --- The 1440px canvas becomes fluid ------------------------------------ */
html.mzw-fluid .sc-host > div[style*="width: 1440px"] {
  width: 100% !important;
  height: auto !important;
  min-height: 100vh;
}
html.mzw-fluid :not(.orb)[style*="width: 1312px"],
html.mzw-fluid :not(.orb)[style*="width: 1184px"],
html.mzw-fluid :not(.orb)[style*="width: 1100px"],
html.mzw-fluid :not(.orb)[style*="width: 1000px"],
html.mzw-fluid :not(.orb)[style*="width: 960px"],
html.mzw-fluid :not(.orb)[style*="width: 880px"],
html.mzw-fluid :not(.orb)[style*="width: 820px"],
html.mzw-fluid :not(.orb)[style*="width: 760px"],
html.mzw-fluid :not(.orb)[style*="width: 720px"],
html.mzw-fluid :not(.orb)[style*="width: 640px"],
html.mzw-fluid :not(.orb)[style*="width: 600px"] { width: 100% !important; max-width: 100% !important; }

/* --- Fixed heights grow with their content ------------------------------ */
html.mzw-fluid section[style*="height:"],
html.mzw-fluid :not(.orb)[style*="height: 380px"],
html.mzw-fluid :not(.orb)[style*="height: 420px"],
html.mzw-fluid :not(.orb)[style*="height: 460px"],
html.mzw-fluid :not(.orb)[style*="height: 480px"],
html.mzw-fluid :not(.orb)[style*="height: 520px"],
html.mzw-fluid :not(.orb)[style*="height: 560px"],
html.mzw-fluid :not(.orb)[style*="height: 600px"],
html.mzw-fluid :not(.orb)[style*="height: 620px"],
html.mzw-fluid :not(.orb)[style*="height: 640px"],
html.mzw-fluid :not(.orb)[style*="height: 660px"],
html.mzw-fluid :not(.orb)[style*="height: 680px"],
html.mzw-fluid :not(.orb)[style*="height: 700px"],
html.mzw-fluid :not(.orb)[style*="height: 720px"],
html.mzw-fluid :not(.orb)[style*="height: 760px"],
html.mzw-fluid :not(.orb)[style*="height: 800px"],
html.mzw-fluid :not(.orb)[style*="height: 860px"],
html.mzw-fluid :not(.orb)[style*="height: 900px"] { height: auto !important; }
html.mzw-fluid :not(.orb)[style*="min-height: 480px"],
html.mzw-fluid :not(.orb)[style*="min-height: 520px"],
html.mzw-fluid :not(.orb)[style*="min-height: 560px"] { min-height: 0 !important; }

/* --- Section spacing: the 64/112/128px desktop gutters shrink ----------- */
html.mzw-fluid .sc-host > div > section,
html.mzw-fluid .sc-host > div > footer {
  padding-left: 20px !important;
  padding-right: 20px !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
html.mzw-fluid .sc-host > div > section[style*="margin: "] { margin-left: 12px !important; margin-right: 12px !important; }
html.mzw-fluid .sc-host > div > section[style*="padding: 160px"],
html.mzw-fluid .sc-host > div > section[style*="margin: 160px"] { padding-top: 72px !important; }
html.mzw-fluid .sc-host > div > section[style*="margin: 160px"] { margin-top: 72px !important; padding-top: 56px !important; }
html.mzw-fluid [style*="padding: 0 112px"], html.mzw-fluid [style*="padding: 0px 112px"],
html.mzw-fluid [style*="padding: 0 88px"], html.mzw-fluid [style*="padding: 0px 88px"],
html.mzw-fluid [style*="padding: 0 64px"], html.mzw-fluid [style*="padding: 0px 64px"] { padding-left: 20px !important; padding-right: 20px !important; }
html.mzw-fluid [style*="padding: 112px 64px"] { padding-top: 56px !important; padding-left: 20px !important; padding-right: 20px !important; }
html.mzw-fluid [style*="padding: 112px 64px;"] { padding-bottom: 56px !important; } /* only where the bottom was 112px too */
html.mzw-fluid [style*="padding: 48px"] { padding: 24px !important; }
html.mzw-fluid [style*="gap: 96px"], html.mzw-fluid [style*="gap: 72px"] { gap: 40px !important; }
html.mzw-fluid [style*="gap: 48px"] { gap: 28px !important; }
html.mzw-fluid [style*="margin-top: 72px"], html.mzw-fluid [style*="margin-top: 64px"] { margin-top: 40px !important; }

/* --- Big headline sizes scale down -------------------------------------- */
html.mzw-fluid [style*="font-size: 104px"],
html.mzw-fluid [style*="font-size: 96px"],
html.mzw-fluid [style*="font-size: 88px"] { font-size: clamp(40px, 9vw, 64px) !important; letter-spacing: -0.035em !important; line-height: 1.05 !important; }
html.mzw-fluid [style*="font-size: 80px"],
html.mzw-fluid [style*="font-size: 72px"] { font-size: clamp(36px, 8vw, 52px) !important; letter-spacing: -0.03em !important; line-height: 1.06 !important; }
html.mzw-fluid [style*="font-size: 64px"],
html.mzw-fluid [style*="font-size: 56px"] { font-size: clamp(32px, 7vw, 46px) !important; letter-spacing: -0.03em !important; line-height: 1.08 !important; }
html.mzw-fluid [style*="font-size: 52px"],
html.mzw-fluid [style*="font-size: 48px"] { font-size: clamp(30px, 6.5vw, 40px) !important; letter-spacing: -0.025em !important; line-height: 1.1 !important; }
html.mzw-fluid [style*="font-size: 44px"],
html.mzw-fluid [style*="font-size: 40px"] { font-size: clamp(28px, 6vw, 36px) !important; }
html.mzw-fluid [style*="font-size: 26px"],
html.mzw-fluid [style*="font-size: 24px"] { font-size: 19px !important; }
html.mzw-fluid [style*="font-size: 21px"] { font-size: 17px !important; }
html.mzw-fluid [style*="max-width: 720px"], html.mzw-fluid [style*="max-width: 760px"],
html.mzw-fluid [style*="max-width: 980px"] { max-width: 100% !important; }

/* --- Grids: 4 → 2 columns on tablets, 1 column on phones ---------------- */
html.mzw-fluid [style*="grid-template-columns: repeat(6"],
html.mzw-fluid [style*="grid-template-columns: repeat(5"],
html.mzw-fluid [style*="grid-template-columns: repeat(4"],
html.mzw-fluid [style*="grid-template-columns: repeat(3"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
html.mzw-fluid [style*="grid-template-columns: minmax(0, 5fr)"],
html.mzw-fluid [style*="grid-template-columns: minmax(0px, 5fr)"],
html.mzw-fluid [style*="grid-template-columns: 1fr 1fr"],
html.mzw-fluid [style*="grid-template-columns: repeat(2"] { grid-template-columns: minmax(0, 1fr) !important; }

/* --- Side-by-side bands stack ------------------------------------------- */
html.mzw-fluid :not(nav)[style*="justify-content: space-between"][style*="align-items: center"][style*="padding: 0"],
html.mzw-fluid :not(nav)[style*="justify-content: space-between"][style*="align-items: flex-end"] {
  flex-direction: column !important;
  align-items: flex-start !important;
}

/* --- Header: glass pill with a menu button ------------------------------ */
html.mzw-fluid .sc-host nav.glass {
  margin: 12px 12px -68px !important;
  height: 56px !important;
  padding: 0 58px 0 14px !important; /* room on the right for the floating menu button */
  top: 12px !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important; /* keep the brand text clear of the language button */
}
html.mzw-fluid .sc-host nav.glass > a:first-child { min-width: 0; flex-shrink: 1; }
html.mzw-fluid .sc-host nav.glass > a:first-child img { height: 34px !important; }
html.mzw-fluid .sc-host nav.glass > a:first-child { font-size: 16px !important; gap: 8px !important; }
html.mzw-fluid .sc-host nav.glass > div:nth-child(2) {
  display: none !important;
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  flex-direction: column !important; align-items: stretch !important; gap: 0 !important;
  padding: 10px !important; border-radius: 22px;
  background: rgba(255,255,255,.97); box-shadow: 0 20px 50px rgba(0,0,0,.16);
  font-size: 17px !important;
}
html.mzw-fluid.mzw-menu-open .sc-host nav.glass > div:nth-child(2) { display: flex !important; }
html.mzw-fluid .sc-host nav.glass > div:nth-child(2) a { padding: 13px 14px !important; border-radius: 12px; transform: none !important; }
html.mzw-fluid .sc-host nav.glass > div:nth-child(2) a:hover { background: rgba(0,0,0,.05); }
html.mzw-fluid .sc-host nav.glass > div:nth-child(3) { gap: 8px !important; }
.mzw-burger { display: none; }
html.mzw-fluid .mzw-burger {
  display: inline-flex; align-items: center; justify-content: center;
  position: fixed; top: 19px; right: 20px; z-index: 60;
  width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.6); cursor: pointer;
}
.mzw-burger span, .mzw-burger span::before, .mzw-burger span::after {
  display: block; width: 18px; height: 2px; background: #1d1d1f; border-radius: 2px; position: relative; transition: .25s;
}
.mzw-burger span::before, .mzw-burger span::after { content: ""; position: absolute; left: 0; }
.mzw-burger span::before { top: -6px; } .mzw-burger span::after { top: 6px; }
html.mzw-menu-open .mzw-burger span { background: transparent; }
html.mzw-menu-open .mzw-burger span::before { top: 0; transform: rotate(45deg); }
html.mzw-menu-open .mzw-burger span::after { top: 0; transform: rotate(-45deg); }
.mzw-burger:focus-visible { outline: 3px solid #dd0000; outline-offset: 2px; }


/* --- Right-to-left (Urdu): mirror the header, menu button on the left --- */
html[dir="rtl"].mzw-fluid .sc-host nav.glass { padding: 0 14px 0 58px !important; }
html[dir="rtl"].mzw-fluid .mzw-burger { right: auto; left: 20px; }

/* --- Urdu & Hindi scripts need taller lines than Latin headlines -------- */
html:lang(ur).mzw-fluid [style*="font-size: 104px"], html:lang(ur).mzw-fluid [style*="font-size: 96px"],
html:lang(ur).mzw-fluid [style*="font-size: 88px"], html:lang(ur).mzw-fluid [style*="font-size: 80px"],
html:lang(ur).mzw-fluid [style*="font-size: 72px"], html:lang(ur).mzw-fluid [style*="font-size: 64px"],
html:lang(ur).mzw-fluid [style*="font-size: 56px"], html:lang(ur).mzw-fluid [style*="font-size: 52px"],
html:lang(ur).mzw-fluid [style*="font-size: 48px"], html:lang(ur).mzw-fluid [style*="font-size: 44px"],
html:lang(ur).mzw-fluid [style*="font-size: 40px"] { line-height: 1.75 !important; letter-spacing: 0 !important; }
html:lang(hi).mzw-fluid [style*="font-size: 104px"], html:lang(hi).mzw-fluid [style*="font-size: 96px"],
html:lang(hi).mzw-fluid [style*="font-size: 88px"], html:lang(hi).mzw-fluid [style*="font-size: 80px"],
html:lang(hi).mzw-fluid [style*="font-size: 72px"], html:lang(hi).mzw-fluid [style*="font-size: 64px"],
html:lang(hi).mzw-fluid [style*="font-size: 56px"], html:lang(hi).mzw-fluid [style*="font-size: 52px"],
html:lang(hi).mzw-fluid [style*="font-size: 48px"], html:lang(hi).mzw-fluid [style*="font-size: 44px"],
html:lang(hi).mzw-fluid [style*="font-size: 40px"] { line-height: 1.3 !important; letter-spacing: 0 !important; }

/* --- Footer ------------------------------------------------------------- */
html.mzw-fluid .sc-host footer { padding-top: 40px !important; padding-bottom: 32px !important; }
html.mzw-fluid .sc-host footer [style*="justify-content: space-between"] { flex-direction: column !important; gap: 8px !important; }

/* --- Phones -------------------------------------------------------------- */
@media (max-width: 640px) {
  html.mzw-fluid [style*="grid-template-columns: repeat("] { grid-template-columns: minmax(0, 1fr) !important; }
  html.mzw-fluid .sc-host footer [style*="grid-template-columns: repeat("] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  html.mzw-fluid .sc-host nav.glass > div:nth-child(3) > a:last-of-type { display: none !important; } /* header CTA: the hero has the same button */
  html.mzw-fluid .sc-host nav.glass > a:first-child { font-size: 15px !important; }
  /* "Log in" becomes a round person icon on phones (the text stays for screen readers) */
  html.mzw-fluid .mzw-login {
    font-size: 0 !important; padding: 0 !important; width: 38px; height: 38px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1d1f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E") center / 20px no-repeat !important;
  }
  html.mzw-fluid .sc-host > div > section,
  html.mzw-fluid .sc-host > div > footer { padding-left: 16px !important; padding-right: 16px !important; }
  html.mzw-fluid [style*="font-size: 19px"] { font-size: 17px !important; }
}

/* ==========================================================================
   Flip cards (Study, Ausbildung, Career, German courses) — all screen sizes.
   iPhone/iPad Safari ignores backface-visibility when a card's content has its
   own layers or scrolls, so the front showed mirrored through the back. The side
   that faces away is now hidden at the halfway point of the turn instead.
   ========================================================================== */
/* Slow, smooth turn: 1.4 s; the hidden side switches at the halfway point (0.7 s) */
/* Stronger 3D depth, so the card is clearly seen turning (not a thin line mid-turn) */
html :is(.flip, .jflip) { perspective: 900px !important; }
@media (prefers-reduced-motion: no-preference) {
  html :is(.flip-inner, .jflip-inner) { transition: transform 1.4s cubic-bezier(.45, .05, .25, 1) !important; }
}
:is(.flip-inner, .jflip-inner) :is(.face, .jface) { transition: visibility 0s linear .7s, opacity 0s linear .7s; }
:is(.flip-inner, .jflip-inner) :is(.face.back, .jback) { visibility: hidden; opacity: 0; }
:is(.flip:hover, .flip:focus-within) .flip-inner .face:not(.back),
:is(.jflip:hover, .jflip:focus-within) .jflip-inner .jfront { visibility: hidden; opacity: 0; }
:is(.flip:hover, .flip:focus-within) .flip-inner .face.back,
:is(.jflip:hover, .jflip:focus-within) .jflip-inner .jback { visibility: visible; opacity: 1; }

/* Touch screens (phones, tablets): a tap flips the card, the next tap flips it back.
   assets/responsive.js sets data-flipped on the tapped card; hover and focus (which
   "stick" after a tap) no longer turn it, so the second tap really turns it back. */
@media (hover: none) {
  html :is(.flip, .jflip) { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  html :is(.flip, .jflip):hover { transform: none !important; }
  html :is(.flip, .jflip) :is(.flip-inner, .jflip-inner) { transform: none !important; }
  html :is(.flip, .jflip)[data-flipped] :is(.flip-inner, .jflip-inner) { transform: rotateY(180deg) !important; }
  html :is(.flip:hover, .flip:focus-within) .flip-inner .face:not(.back),
  html :is(.jflip:hover, .jflip:focus-within) .jflip-inner .jfront { visibility: visible; opacity: 1; }
  html :is(.flip:hover, .flip:focus-within) .flip-inner .face.back,
  html :is(.jflip:hover, .jflip:focus-within) .jflip-inner .jback { visibility: hidden; opacity: 0; }
  html .flip[data-flipped] .flip-inner .face:not(.back),
  html .jflip[data-flipped] .jflip-inner .jfront { visibility: hidden; opacity: 0; }
  html .flip[data-flipped] .flip-inner .face.back,
  html .jflip[data-flipped] .jflip-inner .jback { visibility: visible; opacity: 1; }
  html :is(.flip, .jflip):focus-visible :is(.flip-inner, .jflip-inner) { box-shadow: none; }
}

/* Phones & tablets: frosted, calmer glass — the drifting colours stay soft behind
   the cards instead of shining through the text. */
html.mzw-fluid .jfront,
html.mzw-fluid :is(#universities, #hochschulen) .flip .face:not(.back) {
  background: linear-gradient(135deg, rgba(255,255,255,.9) 0%, rgba(250,250,252,.8) 100%) !important;
  border-color: rgba(255,255,255,.95) !important;
}
html.mzw-fluid .jback,
html.mzw-fluid :is(#universities, #hochschulen) .flip .face.back {
  background: linear-gradient(135deg, rgba(40,40,46,.97) 0%, rgba(22,22,26,.98) 100%) !important;
}

/* Narrow phones: the top bar holds logo, language, log-in icon and menu button —
   the logo stays (never squeezed away) and the brand name gives way to it. */
html.mzw-fluid .sc-host nav.glass > a:first-child img,
html.mzw-fluid .sc-host nav.glass > a:first-child .zk-brand-i { flex-shrink: 0; }
@media (max-width: 430px) {
  html.mzw-fluid .sc-host nav.glass .zk-brand-t { display: none !important; }
}

/* ==========================================================================
   Effects (assets/effects.js)
   ========================================================================== */
/* Lenis smooth scrolling */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Text reveal: headings rise out of a mask; a second line (<span>) follows a moment later */
html.mzw-fx [data-mzw-reveal] {
  transition: clip-path 1.1s cubic-bezier(.2, .8, .2, 1), transform 1.1s cubic-bezier(.2, .8, .2, 1), opacity .9s ease;
}
html.mzw-fx [data-mzw-reveal="wait"] { clip-path: inset(0 0 100% 0); transform: translateY(.5em); opacity: 0; }
html.mzw-fx [data-mzw-reveal="in"] { clip-path: inset(0 0 -.2em 0); transform: none; opacity: 1; }
html.mzw-fx [data-mzw-reveal] > span { display: inline-block; transition: transform 1.2s cubic-bezier(.2, .8, .2, 1) .12s, opacity 1s ease .12s; }
html.mzw-fx [data-mzw-reveal="wait"] > span { transform: translateY(.6em); opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  html.mzw-fx [data-mzw-reveal], html.mzw-fx [data-mzw-reveal] > span { transition: none !important; clip-path: none !important; transform: none !important; opacity: 1 !important; }
}
