/*
Theme Name: Fred Heussner
Theme URI: https://fred-heussner.de
Author: Lukas Böhm
Author URI: https://lukasboehm.de
Description: Ich bastle eine Homepage für den guten Fred.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Text Domain: fred-heussner
*/

@font-face {
  font-family: "Now Alt";
  src:
    url("./assets/fonts/NowAlt/NowAlt-Thin.woff2") format("woff2"),
    url("./assets/fonts/NowAlt/NowAlt-Thin.otf") format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Now Alt";
  src:
    url("./assets/fonts/NowAlt/NowAlt-Light.woff2") format("woff2"),
    url("./assets/fonts/NowAlt/NowAlt-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Now Alt";
  src:
    url("./assets/fonts/NowAlt/NowAlt-Regular.woff2") format("woff2"),
    url("./assets/fonts/NowAlt/NowAlt-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Now Alt";
  src:
    url("./assets/fonts/NowAlt/NowAlt-Medium.woff2") format("woff2"),
    url("./assets/fonts/NowAlt/NowAlt-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Now Alt";
  src:
    url("./assets/fonts/NowAlt/NowAlt-Bold.woff2") format("woff2"),
    url("./assets/fonts/NowAlt/NowAlt-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Now Alt";
  src:
    url("./assets/fonts/NowAlt/NowAlt-Black.woff2") format("woff2"),
    url("./assets/fonts/NowAlt/NowAlt-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #000000;
  --surface: #1f1f1f;
  --text: #ffffff;
  --muted: #5d6673;
  --line: #e06e02;
  --accent: #e06e02;

  /* Responsive multiplier (mobile -> desktop) */
  --fluid-step: 0.62;

  /* Spacing scale (Tailwind-ish, px-based) */
  --s-0: 0px;
  --s-px: 1px;
  --s-0_5: calc(2px * var(--fluid-step)); /* 0.5 */
  --s-1: calc(4px * var(--fluid-step)); /* 1 */
  --s-1_5: calc(6px * var(--fluid-step)); /* 1.5 */
  --s-2: calc(8px * var(--fluid-step)); /* 2 */
  --s-2_5: calc(10px * var(--fluid-step)); /* 2.5 */
  --s-3: calc(12px * var(--fluid-step)); /* 3 */
  --s-3_5: calc(14px * var(--fluid-step)); /* 3.5 */
  --s-4: calc(16px * var(--fluid-step)); /* 4 */
  --s-5: calc(20px * var(--fluid-step)); /* 5 */
  --s-6: calc(24px * var(--fluid-step)); /* 6 */
  --s-8: calc(32px * var(--fluid-step)); /* 8 */
  --s-10: calc(40px * var(--fluid-step)); /* 10 */
  --s-12: calc(48px * var(--fluid-step)); /* 12 */
  --s-16: calc(64px * var(--fluid-step)); /* 16 */
  --s-20: calc(80px * var(--fluid-step)); /* 20 */
  --s-24: calc(96px * var(--fluid-step)); /* 24 */
  --s-32: calc(128px * var(--fluid-step)); /* 32 */

  --text-xs: clamp(12px, 11px + 0.2vw, 13px);
  --text-sm: clamp(14px, 13px + 0.2vw, 15px);
  --text-base: clamp(16px, 15px + 0.2vw, 18px);
  --text-lg: clamp(18px, 17px + 0.3vw, 20px);
  --text-xl: clamp(20px, 18px + 0.5vw, 24px);
  --text-2xl: clamp(24px, 21px + 0.8vw, 32px);
  --text-3xl: clamp(30px, 25px + 1.1vw, 42px);
  --text-huge: 3rem;
  --text-semi-huge: 2.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Now Alt", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.site-wrap {
  position: relative;
  margin: 0;
}

.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  /* margin-bottom: var(--s-32); */

  div {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: var(--s-16) var(--s-16) var(--s-12) 0;
    img {
      width: 70%;
      max-width: 450px;
      /* transform: translateX(-100%); */
      position: absolute;
      bottom: 10%;
      right: 40%;
    }
    @media (max-width: 768px) {
      padding: var(--s-12) var(--s-12);
    }
  }

  h1,
  p {
    text-align: right;
    @media (max-width: 768px) {
      text-align: left;
    }
  }
  h1 {
    font-size: var(--text-huge);
    margin: 0;
    display: inline-block;
  }
  p {
    font-size: var(--text-xl);
    margin: 0 var(--s-16) 0 auto;
    padding-left: var(--s-12);
    font-weight: 200;
    max-width: 500px;
  }

  img#fred-hero {
    z-index: 200;
    position: absolute;
    bottom: 2%;
    left: 2%;
    width: 95%;
    max-width: 800px;
    pointer-events: none;
  }
}

.section-card {
  @media (min-width: 1280px) {
    padding: var(--s-16) var(--s-32);
    max-width: 1600px;
    margin: auto;
  }
  padding: var(--s-12);
  margin-bottom: var(--s-12);

  .section-intro {
    font-size: var(--text-lg);
    font-weight: 200;
    img {
      width: 100%;
      height: auto;
      border-radius: var(--s-4);
    }
    margin-bottom: var(--s-8);
    @media (min-width: 979px) {
      display: flex;
      gap: var(--s-24);
      align-items: center;

      .section-intro-text {
        width: 50%;
      }
      img {
        width: 50%;
        max-width: none;
        padding: var(--s-8);
      }
    }
    @media (min-width: 1480px) {
      gap: var(--s-32);

      .section-intro-text {
        width: 40%;
      }
      img {
        width: 60%;
      }
    }
  }
}

.section-card {
  &#ueber-mich {
    margin-bottom: 0;
  }
  &#kontakt {
    padding-top: 0;
    .section-intro {
      .section-intro-text {
      width: 100%;
        max-width: 65ch;
      }
    }
  }

  &#legal{
    display: flex;
    flex-direction: column;
    gap: var(--s-16);
    h3{
      font-size: var(--text-lg);
      font-weight: 400;
      margin: 0;
      margin-bottom: var(--s-8);
    }
    p{
      margin: 0;
      font-size: var(--text-sm);
      font-weight: 200;
      text-align: center;
    }
    >div{
      display: flex;
      flex-direction: column;
      gap: var(--s-2);
      align-items: center;
    }
    @media (min-width: 979px){
      flex-direction: row;
      >div{
        width: 33%;
      }
    }
  }
}

.section-card h2 {
  margin-top: 0;
  font-size: var(--text-semi-huge);
  margin-top: var(--s-4);
}

.item-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.item-list li {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.item-list li:first-child {
  border-top: 0;
  padding-top: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero .hero-text,
.hero .hero-text p {
  font-size: var(--text-xl);
  margin: 0 32px 0 auto;
  font-weight: 200;
  max-width: 600px;
  text-align: right;
}

.section-intro-text p,
.meta p {
  margin: 0 0 var(--s-3);
}

.main-carousel {
  .fh-flickity-post-card {
    background: #111111;
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    max-width: 440px;
    min-height: 440px;
    margin: 0 var(--s-4);
    @media (min-width: 768px) {
      margin: 0 var(--s-4) 0 0;
    }
  }

  button.flickity-prev-next-button {
    width: 52px;
    height: 52px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--accent);
    border: none;
    z-index: 20;
    .flickity-button-icon {
      color: transparent;
    }

    &.next {
      top: 100%;
      right: 50%;
      transform: translate(140px, 12px);
      &::after {
        content: url("assets/static/arrow-right.svg");
      }
    }
    &.previous {
      top: 100%;
      left: 50%;
      transform: translate(-140px, 12px);
      &::after {
        content: url("assets/static/arrow-left.svg");
      }
    }
  }

  .flickity-page-dots {
    transform: translateY(20px);
    .dot {
      background: var(--muted);
    }
    .is-selected {
      background: var(--accent);
    }
  }

  &::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    @media (min-width: 768px) {
      background: linear-gradient(to right, transparent 90%, var(--bg) 100%);
    }
    pointer-events: none;
    z-index: 10;
  }
}

.fh-post-card-title {
  margin: 0;
  font-size: var(--text-lg);
}

.fh-post-card-category {
  margin: 0 0 var(--s-2);
  color: var(--accent);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fh-post-card-subtitle {
  margin: var(--s-4) 0 0;
  color: var(--accent);
  font-size: var(--text-sm);
}

.fh-post-card-description {
  margin: var(--s-4) 0 0;
  padding: var(--s-4) 0 var(--s-8);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.4;
  /* border-bottom: 1px solid var(--line); */
}

.fh-post-card-link {
  margin-top: auto;
  height: 32px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--s-1_5);
  font-size: var(--text-sm);
  color: var(--text);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  transition: color 150ms ease;
  &:hover,
  &:focus-visible {
    color: var(--accent);
  }
}

.fh-post-card-link-placeholder {
  margin-top: auto;
  height: 32px;

  margin-bottom: 0;
  font-size: var(--text-sm);
  color: var(--muted);
  font-style: italic;
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.fh-external-icon {
  font-size: 1.4em;
  transform: translateY(0.1em);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
}

[data-section] {
  scroll-margin-top: 100px;
}

.fh-anchor-nav {
  position: sticky;
  display: flex;
  height: 0;
  justify-content: flex-end;
  padding-top: var(--s-4);
  padding-right: var(--s-8);
  z-index: 100;
}

.fh-anchor-nav.is-stuck {
  position: sticky;
}

.fh-menu-toggle {
  display: none;
}

.fh-menu-panel {
  z-index: 300;
  &::before {
    content: "";
    position: absolute;
    inset: 0;
    height: 100px;
    backdrop-filter: blur(4px);
    mask: linear-gradient(white 70%, transparent 100%);
    background: rgba(0, 0, 0, 0.8);
    overflow: visible;
    z-index: -1;
  }
}

.fh-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  gap: var(--s-8);
  padding: var(--s-2) var(--s-8);
}

.fh-menu-item--contact {
  margin-left: var(--s-12);
  font-weight: 200;
}

.fh-menu-list a {
  position: relative;
  text-decoration: none;
  color: var(--text);
  font-size: var(--text-lg);
}

.fh-menu-list a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 150ms ease;
}

.fh-menu-list a:hover::after,
.fh-menu-list a:focus-visible::after,
.fh-menu-list a.is-active::after {
  width: 100%;
}

@media (min-width: 768px) {
  :root {
    --fluid-step: 0.8;
    --text-huge: 5rem;
    --text-semi-huge: 4rem;
  }
}

@media (min-width: 1200px) {
  :root {
    --fluid-step: 1;
    --text-huge: 7rem;
    --text-semi-huge: 5rem;
  }
}

@media (max-width: 900px) {
  .fh-anchor-nav {
    position: fixed;
    top: var(--s-4);
    right: var(--s-4);
    padding: 0;
    margin: var(--s-4) var(--s-4);
  }

  .fh-menu-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(8, 8, 8, 0.88);
    cursor: pointer;
  }

  .fh-menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text);
  }

  .fh-menu-panel {
    position: fixed;
    inset: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
  }

  .fh-anchor-nav.menu-open .fh-menu-panel {
    opacity: 1;
    pointer-events: auto;
  }

  .fh-menu-list {
    gap: var(--s-6);
    text-align: center;
    flex-direction: column;
  }

  .fh-menu-list a {
    font-size: var(--text-xl);
  }

  .fh-menu-item--contact {
    margin-top: var(--s-12);
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .fh-anchor-nav,
  .fh-menu-panel,
  .fh-menu-list a::after {
    transition: none;
  }
}
