/*
Theme Name: melinalibu
Author: Melina Feldges
Description: Portfolio theme for melinalibu. Projects are managed under "Projects" in the admin.
Version: 1.12
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: melinalibu
*/

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
@font-face {
    font-family: "Desirable Calligraphy";
    src: url("fonts/DesirableCalligraphy.woff2") format("woff2"),
         url("fonts/DesirableCalligraphy.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: block; /* no fallback-font flash before the hero animation */
}

:root {
    --layout-width: 1200px;
    --script: "Desirable Calligraphy", "Snell Roundhand", cursive;
    --text: "Abel", sans-serif;
    --ink: #000000;
    --accent: #0044ff;
    --edge: 37px;          /* side margin from the Figma frame */
    --title-size: clamp(64px, 7.5vw, 120px);  /* 96px on a 1280px screen */
}

body {
    background-color: #ffffff;
    color: var(--ink);
    font-family: var(--text);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
  scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
body.work-page {
    overflow: hidden;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr 60px; /* Navbar / Content / Footer */
}

/* Chrome / Safari */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

html {
    scroll-behavior: smooth;
        height: 100%;

}

.page {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding: 32px 34px 80px;
}

/* NAVBAR */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    width: 100%;
    padding: 0 var(--edge);
    background: #ffffff;
}

/* Homepage: no bar, just the links floating top right */
.navbar--hero {
    position: fixed;
    justify-content: flex-end;
    background: transparent;
    pointer-events: none;
}
.navbar--hero nav {
    pointer-events: auto;
}

/* NAV LINKS */
.navbar nav {
    display: flex;
    gap: 40px;
    padding-top: 18px;
}

.navbar nav a {
    color: var(--ink);
    font-family: var(--script);
    font-size: 16px;
    line-height: normal;
    text-decoration: none;
    transition: color 0.3s ease;
}

.navbar nav a:hover,
.navbar nav a.is-current {
    color: var(--accent);
}

/* LOGO (every page except the homepage) */
.logo a {
    display: inline-block;
    font-family: var(--script);
    font-size: var(--title-size);
    line-height: normal;
    color: var(--accent);
    text-decoration: none;
}

/* HOMEPAGE
   1. The logo sits exactly in the middle and is "written" with a fountain pen (js/hero.js,
      timing constants at the top of that file).
   2. Then (body.is-hero-done) it glides to the top left, small and blue, the header and footer
      fade in, and the project panels appear one after another from left to right. */
:root {
    --hero-logo-small: 415px;                      /* afterwards, top left (ink 405px wide, as in Figma) */
    --hero-move-duration: 1.1s;                    /* logo gliding to the corner */
    --hero-move-ease: cubic-bezier(0.65, 0, 0.35, 1);
    --nav-fade-duration: 0.5s;                     /* header + footer fade in */
    --panel-width: 226px;
    --panel-height: calc(var(--panel-width) * 5 / 4);   /* 4:5 */
    --panel-curve: 14px;                               /* how deep the curved top/bottom edge cuts in (centre of the screen) */
    --panel-gap: 48px;
    --panel-stagger: 0.09s;                        /* delay between panels appearing */
    --panel-hover-scale: 1.08;                     /* how much a panel grows on hover */
    --panel-hover-duration: 0.6s;
    --panel-hover-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* One screen, no vertical scroll: the panel row scrolls sideways */
body.melinalibu-home {
    height: 100vh;
    overflow: hidden;
}

.home-main {
    position: relative;
    height: 100vh;
    background: #ffffff;
}

/* ---- Logo ----
   Its resting place is the final one: top left, small, black — blue on hover (16px / 18px to the ink, as in Figma).
   While writing, hero.js moves it to the centre and enlarges it with --hero-dx/--hero-dy/--hero-scale;
   removing those makes it glide to the corner in one smooth transform. */
.hero-title {
    position: fixed;
    z-index: 1001;
    left: calc(16px - var(--hero-logo-small) * 8 / 681);  /* the SVG has 8 units of padding */
    top: calc(18px - var(--hero-logo-small) * 8 / 681);
    margin: 0;
    line-height: 0;
    color: var(--ink);
    transform-origin: 0 0;
    transform: translate(var(--hero-dx, 0px), var(--hero-dy, 0px)) scale(var(--hero-scale, 1));
    transition:
        transform var(--hero-move-duration) var(--hero-move-ease),
        color 0.3s ease;
}
.hero-title:hover,
.hero-title:focus-within {
    color: var(--accent);
}

.hero-title a {
    display: block;
    color: inherit;
    text-decoration: none;
}

/* The viewBox reserves the logo's space (no layout shift); overflow stays visible
   so the M's flourish is never cut off. */
.hero-logo {
    display: block;
    width: var(--hero-logo-small);
    height: auto;
    overflow: visible;
}

/* With JS: keep the ink hidden until hero.js has attached the pen mask.
   Failsafe: if the script never runs, the logo still appears after 4s. */
.melinalibu-js .hero-logo__ink {
    visibility: hidden;
    animation: melinalibu-logo-failsafe 0s 4s forwards;
}
.melinalibu-js .hero-logo.is-writing .hero-logo__ink,
.melinalibu-js .hero-logo.is-written .hero-logo__ink {
    visibility: visible;
    animation: none;
}
@keyframes melinalibu-logo-failsafe {
    to { visibility: visible; }
}

/* ---- Header + footer fade in after the writing ---- */
.melinalibu-js .navbar--hero nav,
.melinalibu-js body.melinalibu-home .footer {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--nav-fade-duration) ease calc(var(--hero-move-duration) * 0.6);
}
.melinalibu-js body.is-hero-done .navbar--hero nav,
.melinalibu-js body.is-hero-done.melinalibu-home .footer {
    opacity: 1;
    pointer-events: auto;
}

/* ---- Project panels: one row, left to right, with the curved (lens) edges from Figma ---- */
.home-panels {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: var(--panel-height);
    transform: translateY(-50%);
}

.home-panels__track {
    display: flex;
    gap: var(--panel-gap);
    /* extra room above/below so a panel growing on hover isn't clipped */
    height: calc(100% + 48px);
    margin-top: -24px;
    padding: 24px var(--edge);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.home-panels__track::-webkit-scrollbar {
    display: none;
}

/* White ellipses over the top and bottom edge make the row look curved (Figma: Ellipse 1 + 2) */
.home-panels::before,
.home-panels::after {
    content: "";
    position: absolute;
    z-index: 1;
    left: -25.3vw;
    width: 150.6vw;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
}
.home-panels::before {
    top: calc(var(--panel-curve) - 92px);
    height: 92px;
}
.home-panels::after {
    top: calc(var(--panel-height) - var(--panel-curve));
    height: 92px;
}

.home-panel {
    flex: 0 0 var(--panel-width);
    height: 100%;
    background-color: #d9d9d9;
    background-size: cover;
    background-position: center;

    --delay: calc(var(--hero-move-duration) * 0.5 + var(--i, 0) * var(--panel-stagger));
    transition:
        opacity 0.6s ease var(--delay),
        translate 0.6s var(--hero-move-ease) var(--delay),
        scale var(--panel-hover-duration) var(--panel-hover-ease),
        clip-path var(--panel-hover-duration) var(--panel-hover-ease);
    position: relative;
    z-index: 0;
    will-change: scale;
}
/* Centre the row when it is narrower than the screen (and stay scrollable when wider) */
.home-panel:first-child { margin-left: auto; }
.home-panel:last-child  { margin-right: auto; }

.melinalibu-js .home-panel {
    opacity: 0;
    translate: -24px 0;
}
.melinalibu-js body.is-hero-done .home-panel {
    opacity: 1;
    translate: 0 0;
}
/* Hover (driven by hero.js): the panel lifts above the curved white edges with exactly their
   shape (--panel-clip), then grows while its edges straighten; on leave the reverse.
   Colours stay the same. */
.home-panel.is-lifted {
    z-index: 2;
    clip-path: var(--panel-clip);
    transition:
        opacity 0.6s ease,
        translate 0.6s var(--hero-move-ease),
        scale var(--panel-hover-duration) var(--panel-hover-ease),
        clip-path var(--panel-hover-duration) var(--panel-hover-ease);
}
.home-panel.is-lifted.is-hovered {
    scale: var(--panel-hover-scale);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}
html:not(.melinalibu-js) .home-panel:hover {
    scale: var(--panel-hover-scale);
}

/* Coming back to the homepage in the same session: logo, header and footer are there at once. */
.melinalibu-intro-seen .hero-logo__ink {
    visibility: visible;
    animation: none;
}
.melinalibu-intro-seen .hero-title,
.melinalibu-intro-seen.melinalibu-js .navbar--hero nav,
.melinalibu-intro-seen.melinalibu-js body.melinalibu-home .footer {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .melinalibu-js .hero-logo__ink {
        visibility: visible;
        animation: none;
    }
    .hero-title,
    .home-panel,
    .melinalibu-js .navbar--hero nav,
    .melinalibu-js body.melinalibu-home .footer {
        transition: none;
    }
}

/* /////////EXPERIENCE */

.experience {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding-left: 32px;
    padding-top: 3%;
    padding-bottom: 80px;
}
.title-pages {
    font-family: var(--script);
    font-size: clamp(56px, 6vw, 96px);
    font-weight: 400;
    line-height: normal;
    padding-bottom: 20px;
}
.experience-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 60px;
    padding-right: 34px;
}

.experience-block {
    margin-bottom: 40px;
}

.experience-label {
    display: block;
    font-family: var(--text);
    font-size: 13px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    opacity: 0.4;
    margin-bottom: 8px;
}

.experience-text {
    font-family: "Abel", sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink);
}

.text-experience {
    font-family: "Abel", sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink);
    width: 100%;

}

.bottom-description {
    margin-top: 48px;
}

/* ////////////////// WORK PAGE ////////////////// */

.work {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px 0 0 32px;
    min-height: 0; /* 👈 kritisch bei grid/flex */
}

.work-scroll {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    min-height: 0; /* 👈 kritisch */
    flex: 1;
    padding: 20px 34px 20px 0;
}

/* Scrollbar clean */
.work-scroll::-webkit-scrollbar {
    height: 8px;
}

.work-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.work-scroll::-webkit-scrollbar-thumb {
    background: transparent ;
    border-radius: 999px;
}

/* PANEL BASIS */
.work-panel {
    flex: 0 0 auto;
    height: 85%;
    width: auto;
    aspect-ratio: 4 / 5;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

/* Hover Effekt */
.work-panel:hover {
    transform: scale(1.08);
}

/* Bilder */

.panel-a {
}

.panel-b {
    background-position: right;
}

.panel-c {
}

.panel-d {
}

.panel-e {
}

.panel-f {
}

.panel-g {
}

.panel-h {
}
.panel-i {
}
.panel-j {
}
.panel-k {
}

.panel-l {
    background-position: center;
}

/* OVERLAY STANDARD (unsichtbar) */
.work-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    padding: 20px;

    background: rgba(0, 0, 0, 0.25); /* leichter dunkler Layer */
    opacity: 0;

    transition: opacity 0.3s ease;

    color: white;
}

/* HOVER EFFECT */
.work-panel:hover .work-overlay {
    opacity: 1;
}

/* TEXT STYLING */
.work-overlay h3 {
    font-family: var(--script);
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 6px;
}

.work-overlay p {
    font-family: "Abel", sans-serif;
    font-size: 14px;
    opacity: 0.9;
}

/* ////WORK DETAIL */

.work-layout {
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    margin-top: 60px;
}

.work-detail {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    margin: 0 auto;
    padding: 3% 32px 80px;
}

.detail-image {
    width: 45%;
    height: calc(100vh - 200px);
    background-size: cover;
    background-position: center;
    position: sticky;
    top: 180px;
    flex-shrink: 0;
}

.work-gallery {
    width: 55%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-bottom: 80px;
}
.work-layout.work-layout-fotikurs .detail-image {
    width: 40%;
}
.work-layout.work-layout-fotikurs .work-gallery {
    width: 60%;
}
.work-gallery.work-video {
    display: block;
    width: 55%;
    margin: 0;
}
.video-embed {
    width: 100%;
    max-width: 820px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin: 0 auto;
    padding-left: 22px;
    box-sizing: border-box;
}
.video-embed iframe,
.video-embed video {
    width: 100%;
    height: 100%;
    border: 0;
}

.work-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: calc(100% - 64px);
    max-width: 100%;
    margin: 10px auto;
    box-sizing: border-box;
}

.work-navigation a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.9rem;
    border: none;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    font-family: 'Abel', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.work-navigation a:hover {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
    text-decoration-thickness: 2px;
}

.work-navigation a.prev::before,
.work-navigation a.next::after {
    font-size: 1.2rem;
    line-height: 1;
}

.work-navigation a.prev::before {
    content: '‹';
    margin-right: 0.5rem;
}

.work-navigation a.next::after {
    content: '›';
    margin-left: 0.5rem;
}
.gallery-note {
    margin-top: 24px;
    margin-bottom: 24px;
    font-family: "Abel", sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink);
    max-width: 650px;
}
.gallery-item {
    display: block;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);

    display: none;
    justify-content: center;
    align-items: center;

    z-index: 9999;
}

.lightbox:target {
    display: flex;
}

.lightbox img {
    max-width: 85%;
    max-height: 85%;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color: white;
    text-decoration: none;
    padding: 20px;
    user-select: none;
}

.prev { left: 20px; }
.next { right: 20px; }

.close {
    position: absolute;
    inset: 0;
}

.work-top {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    align-items: flex-start;

    margin-top: 60px;
}

/* TEXT LINKS */
.work-top-text {
    flex: 1;
}

/* ////CONTACT //// */
.contact-link {
    font-family: "Abel", sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: var(--ink);
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: block; /* 👈 damit jeder Link eine eigene Zeile hat */
}

.contact-link:hover {
    opacity: 0.5;
}

/* ////ABOUT //// */

/* //////// FOOTER: "About" + "Contact", bottom right */
.footer {
    display: flex;
    gap: 24px;
    position: fixed;
    right: var(--edge);
    bottom: 16px;
    z-index: 999;
}

.footer a {
    font-family: var(--script);
    font-size: 16px;
    color: var(--ink);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover,
.footer a.is-current {
    color: var(--accent);
}

@media (max-width: 768px) {
    html, body {
        min-height: 100vh;
        overflow: hidden;
    }

    body > * {
        display: none !important;
    }

    body::before {
        content: "This website is only available on desktop computers.\A\APhone version coming soon.";
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 999999;
        padding: 32px;
        background: #ffffff;
        color: var(--ink);
        font-family: var(--script);
        font-size: 32px;
        line-height: 1.5;
        text-align: center;
        justify-content: center;
        align-items: center;
        white-space: pre-wrap;
    }
}

/* ////// WORDPRESS ADDITIONS ////// */
.text-experience p + p { margin-top: 1em; }
.gallery-empty { font-family: "Abel", sans-serif; opacity: 0.5; }
