/*
Theme Name: StefanMader 2026
Author URI: https://staiger.it
Author: Philipp Staiger (Karussell-Umbau 2026)
Version: 2.4
*/

/**************************************************** RESET ****************************************************/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: baseline;
  box-sizing: border-box;
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
  overscroll-behavior-y: none;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/**************************************************** VARIABLE ****************************************************/

@font-face {
  font-family: "ArialNarrowBold";
  src:  url("fonts/ArialNarrowBold.otf") format("opentype");
  src:  url("fonts/ArialNarrowBold.woff2") format("woff2"),
        url("fonts/ArialNarrowBold.woff") format("woff"),
        url("fonts/ArialNarrowBold.otf") format("opentype"),
        url("fonts/ArialNarrowBold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

/**************************************************** BASIC ****************************************************/

div,
span,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a {
  font-family: "ArialNarrowBold", Helvetica, Arial, sans-serif;
  line-height: 17px;
  font-size: 15px;
  font-weight: bold;
  font-style: normal;
  text-align: justify;
  -moz-osx-font-smoothing: grayscale;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  -webkit-box-shadow: none;
  -webkit-backface-visibility: hidden;
  -webkit-transform: translate3d(0, 0, 0);
  touch-action: manipulation;
  letter-spacing: unset;
  -webkit-backface-visibility: hidden;
  text-decoration: unset;
}

/**************************************************** TYPE ****************************************************/

.case-upper {
  text-transform: uppercase;
}

.align-right {
  text-align: right;
}

.align-center {
  text-align: center;
}

.case-mixed,
.case-mixed * {
  text-transform: none;
}

p,
ol,
ul {
  margin-bottom: 17px;
}

p:last-child {
  margin-bottom: 0px;
}

.columns {
  column-count: 2;
  padding-left: 0px;
  padding-right: 0px;
}

a {
  color: inherit;
}

img,
video {
  width: 100%;
  display: block;
}

.snapping {
  -webkit-scroll-snap-type: y mandatory;
  -moz-scroll-snap-type: y mandatory;
  scroll-snap-type: y mandatory;
	scroll-behavior: smooth;
}

/**************************************************** HEADER ****************************************************/

header {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  z-index: 500;
}

header .header,
header .project a,
header ul {
  margin-bottom: 3px;
  display: flex;
  height: 39px;
  padding: 11px 20px;
  background-color: rgba(217, 217, 217, 0.85);
  border-radius: 0px;
}

header .cell,
header li {
  flex: 1 1 0px;
  display: inline-block;
  text-align: center;
  text-overflow: ellipsis;
  overflow: hidden; 
  white-space: nowrap;
}
header .cell:last-child,
header li:last-child {
  text-align: right;
}
header .cell:first-child,
header li:first-child {
  text-align: left;
}

.projects-menu-button {
  cursor: pointer;
}

header .projects-menu {
  display: none;
  /* reicht bis knapp über die Fußzeile; längere Listen scrollen innerhalb des Menüs */
  max-height: calc(var(--vh, 1vh) * 100 - 104px);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 0px;
}
header .projects-menu.open {
  display: block;
  height: auto;
}

.portfolio-navigation {
  width: 100%;
}

header .projects-navigation .project.reference a {
  color: white;
  background-color: rgba(70, 70, 70, 0.85);
}

#projects-menu-overlay {
  position: fixed;
  z-index: 450;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}
body.overlay-open #projects-menu-overlay {
  display: flex;
}

/**************************************************** FOOTER ****************************************************/

footer {
  position: fixed;
  bottom: 10px;
  left: 10px;
  right: 10px;
  z-index: 500;
  padding: 11px 20px;
  max-height: 39px;
  overflow: hidden;
  background-color: rgba(217, 217, 217, 0.85);
  border-radius: 0px;
}
footer.open {
  max-height: unset;
  background-color: rgba(70, 70, 70, 0.85);
  color: white;
}
footer.open .footer-navigation {
  display: none;
}

footer nav ul {
  margin: unset;
  display: flex;
  justify-content: space-between;
}

footer nav ul li {
  display: inline-block;
}

footer nav ul li.current-menu-item {
  color: white;
}

/************************************************ FOOTER CONTENT ************************************************/

.footer-page-content {
  max-height: calc(var(--vh, 1vh) * 100 - 10px - 39px - 90px - 11px);
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
}
.footer-page-content.open {
  display: block;
}

.footer-page-content .title {
  width: 100%;
  padding: 6px 0 12px 0;
}

.footer-page-content li {
  padding: 1px 0;
}

/**************************************************** Page ****************************************************/

.snappy {
  -webkit-scroll-snap-align: start;
  -moz-scroll-snap-align: start;
  scroll-snap-align: start;
}

.row img,
.row video {
  width: 100%;
  object-fit: contain;
}
.row.cover img,
.row.cover video {
  height: calc(var(--vh, 1vh) * 100);
  object-fit: cover;
}

/**************************************************** EXPLANATION ****************************************************/
#explanation-overlay {
  position: fixed;
  z-index: 450;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(var(--vh, 1vh) * 100);
  background-color: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
}

#explanation-overlay .box {
  border-radius: 0px;
  max-width: calc(100% - 20px);
  padding: 20px;
  margin: calc(var(--vh, 1vh) * 50 - 142px) auto;
  width: 372px;
  height: 283px;
  background-color: rgba(255,255,255,0.75);
  justify-content: center;
}

#explanation-overlay .row {
  width: 100%;
  text-align: center;
}

#explanation-overlay .row.center {
  margin: calc(283px / 2 - 8.5px - 20px) 0 calc(283px / 2 - 8.5px - 20px - 17px) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 15px;
}

#explanation-overlay .row .text {
  width: 100%;
  text-align: center;
}



/**************************************************** SLIDER ****************************************************/

body.invert,
body.invert .slider {
	background-color: black;
}

/* Formate und maximale Breite – hier lassen sich die Bildverhältnisse zentral ändern */
:root {
  --format-portrait: 0.75;    /* Hochformat 3:4 (Instagram) */
  --format-landscape: 1.5;    /* Querformat 3:2 (4:3 = 1.3333, 16:9 = 1.7778) */
  --slide-max-width: 100vw;   /* maximale Breite eines einzelnen Bildes */
  --slide-gap: 0px;           /* Abstand zwischen den Bildern */
}

.slider,
.slide {
  height: calc(var(--vh, 1vh) * 100);
}
  
.slider {
  width: 100%;
  position: relative;
  background: white;
}

/* Bilder in voller Höhe nebeneinander; jedes Bild schließt direkt an das vorige an */
.slider .slide {
  width: auto;
  margin-right: var(--slide-gap);
  display: flex;
  align-items: center;
  transition: opacity var(--animationspeed) ease-in-out;
  z-index: -1;
}

.slider .slide .media {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--format-landscape);
  height: min(calc(var(--vh, 1vh) * 100), calc(var(--slide-max-width) / var(--format-landscape)));
}
.slider .slide.format-portrait .media {
  aspect-ratio: var(--format-portrait);
  height: min(calc(var(--vh, 1vh) * 100), calc(var(--slide-max-width) / var(--format-portrait)));
}

/* Einstellung „Cover“ in der Mediathek: Bild füllt den ganzen Bildschirm (wird je nach Bildschirm zugeschnitten) */
.slider .slide.format-fill .media {
  aspect-ratio: auto;
  width: 100vw;
  height: calc(var(--vh, 1vh) * 100);
}

/* Bilder, die nicht genau im Format sind, werden mittig zugeschnitten */
.slider .slide .media img,
.slider .slide .media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-front-page .slider .slide {
  width: auto;
}
.page-front-page .slider .slide.cover img,
.page-front-page .slider .slide.cover video {
  width: auto;
  object-fit: contain;
}

.flickity-enabled {
  position: relative;
}

.flickity-enabled:focus,
.flickity-enabled:focus-visible {
  outline: none;
}

.lazy {
  filter: blur(10px);
  transition: var(--animationspeed) filter ease-in-out;
}

.flickity-lazyloaded {
  filter: blur(0px);
}

.flickity-viewport {
  position: relative;
  height: 100%;
  overflow: hidden;
}

.flickity-slider {
  position: absolute;
  width: 100%;
  height: 100%; }

/* Draggable */
.flickity-enabled.is-draggable {
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none; }

.flickity-enabled.is-draggable .flickity-viewport {
  cursor: move;
  cursor: -webkit-grab;
  cursor: grab; }

.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down {
  cursor: -webkit-grabbing;
  cursor: grabbing; }

/************************************************ SIDER NAV *************************************************/

#slider-nav {
  position: fixed;
  bottom: 52px;
  left: 10px;
  z-index: 420;
}
#slider-nav a {
  float: left; 
  clear: left; 
  line-height: 17px;
  font-size: 15px;
  text-align: center;
  margin: 3px 0 0 0;
  padding: 11px 12px;
  border-radius: 0px;
  background-color: rgba(217, 217, 217, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  max-height: 39px;
  width: auto;
  transition: all var(--animationspeedbutton) ease-in-out;
}
#slider-nav a.active {
  color: white;
  background-color: rgba(70, 70, 70, 0.85);
}

/************************************************ PROJECT FOOTER *************************************************/

.footer {
  position: fixed;
  bottom: 10px;
  left: 10px;
  right: 10px;
  z-index: 500;
  padding: 11px 20px;
  background-color: rgba(217, 217, 217, 0.85);
  border-radius: 0px;
}
.footer.open {
  color: white;
  background-color: rgba(70, 70, 70, 0.85);
}

.footer .title-bar {
  display: flex;
  cursor: pointer;
}

.footer .title-bar .cell {
  flex: 1 1 0px;
  display: inline-block;
  text-align: center;
  text-overflow: ellipsis;
  overflow: hidden; 
  white-space: nowrap;
}
.footer .title-bar .cell:last-child {
  text-align: right;
}
.footer .title-bar .cell:first-child {
  text-align: left;
}

.footer .title-bar .cell h1 {
  width: calc(100% - 3px);
  text-overflow: ellipsis;
  overflow: hidden; 
  white-space: nowrap;
}

.footer .details {
  margin-top: 22px;
  display: none;
  max-height: calc(var(--vh, 1vh) * 100 - 10px - 39px - 90px - 17px - 22px);
  overflow-y: auto;
  overflow-x: hidden;
}
.footer.open .details {
  display: block;
}


/******************************************** SLIDER AUF DEM HANDY (HOCHKANT) ********************************************/
/* Hochformate füllen genau einen Bildschirm. Querformate in voller Höhe und ungeschnitten; main.js teilt sie
   in gleich große Schritte auf, damit man sie mit mehreren Klicks/Wischern vollständig sieht. */
@media screen and (max-width: 900px) and (orientation: portrait) {
  .project .slider .slide .media {
    height: calc(var(--vh, 1vh) * 100);
  }
  .project .slider .slide.seg .media img {
    right: auto;
    max-width: none;
  }
  /* Videos werden nicht geteilt: volle Bildschirmbreite, Höhe ergibt sich aus dem Format */
  .project .slider .slide.has-video .media {
    width: 100vw;
    height: auto;
  }
  /* Hochformate und „Cover“: füllen genau einen Bildschirm (links/rechts leicht beschnitten) */
  .project .slider .slide.format-portrait .media,
  .project .slider .slide.format-fill .media {
    width: 100vw;
    height: calc(var(--vh, 1vh) * 100);
  }
}

/**************************************************** MOBILE ****************************************************/

@media screen and (max-width: 900px) {

  body,
  html {
    position: fixed;
    height: 100%;
    width: 100%;
    overflow: auto;
  }

  #explanation-overlay .box {
    width: calc(var(--vh, 1vh) * 100);
  }
  
  #slider-nav a {
    line-height: 11px;
    font-size: 10px;
  }

  header .cell.service,
  .footer .title-bar .cell.service {
    display: none;
  }


  #page .title {
    padding: 8px 0 26px 0;
  }

  .desktop-only {
    display: none;
  }
}
video {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

video:focus {
  outline: none !important;
  border: none !important;
}

/* Optional: Noch gezielter NUR für mobile Geräte */
@media (max-width: 900px) {
  video {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }
}