/*
Theme Name: JE-Architecten
Theme URI: 
Author: 
Author URI: 
Description: 
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 5.7
Version: 1.0.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: je-architecten
Tags: 
*/

/* ── Fonts ─────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Cervo';
  src: url('assets/fonts/cervo-regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cervo';
  src: url('assets/fonts/cervo-light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

/* ── Reset / base ──────────────────────────────────────────────────────────── */

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

body {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
  font-family: var(--wp--preset--font-family--cervo), sans-serif;
  font-weight: 300;
}

/* ── Single Portfolio page ─────────────────────────────────────────────────── */

/* Scroll-progress indicator (injected via JS on single portfolio) */
.je-progress-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #00A878;
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 9999;
  pointer-events: none;
}

body.admin-bar .je-progress-line {
  top: 32px; /* adjust for admin bar */
}

/* Ignore if on mobile, where the progress bar goes on the top since admin bar doesnt
scorll with the page */
@media (max-width: 600px) {
    body.admin-bar .je-progress-line {
        top: 0;
    }
}

/* Portfolio hero: slideshow with title overlay */
.portfolio-hero {
  position: relative;
}

.portfolio-hero .wp-block-post-title.portfolio-hero__title {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 4;
  margin: 0;
  max-width: 70%;
}

/* Word-split clip masks — .je-w-outer clips, .je-w-inner is the animated child */
.je-w-outer {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  line-height: inherit;
}

.je-w-inner {
  display: inline-block;
  will-change: transform;
}

/* Injected thin separator between hero cover and content columns */
.je-sep {
  width: 100%;
  height: 1px;
  background: rgba(28, 28, 28, 0.12);
  will-change: transform;
}

.header-email a {
    font-size: 1rem;
    font-weight: 300;
    text-transform: uppercase;
    color: #ccc;
}

/* SEO subtitle under the logo */
.header-subtitle {
    margin: 0.25rem 0 0;
    font-size: 1.125rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5DC497;
}

/* ── Mobile responsiveness ─────────────────────────────────────────────────── */

@media (max-width: 781px) {
  /* Prevent any remaining overflow from making the page horizontally scrollable */
  html, body {
    overflow-x: clip;
  }

  /* Hide email from header row — injected into mobile nav overlay via JS */
  .header-email {
    display: none;
  }

  /* Allow header row to wrap so logo + hamburger don't overflow */
  .site-header .wp-block-group.alignfull > .wp-block-group {
    flex-wrap: wrap !important;
  }

  /* Shrink logo on small screens */
  .site-header .wp-block-site-logo img {
    width: 160px !important;
    height: auto !important;
  }

  /* Shrink SEO subtitle on small screens */
  .header-subtitle {
    font-size: 0.85rem;
  }

  /* Explicit equal padding on mobile — overrides the block's 2rem which can
     compound with WP constrained-layout root-padding vars asymmetrically. */
  .wp-block-je-architecten-portfolio-list {
    padding-inline: 1rem;
  }
}

/* Email shown inside mobile nav overlay */
.mobile-nav-email {
  display: none;
}

@media (max-width: 781px) {
  .mobile-nav-email {
    display: block;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .mobile-nav-email a {
    font-size: 1rem;
    font-weight: 300;
    text-transform: uppercase;
    color: inherit;
    text-decoration: none;
  }
}

.current-menu-item {
    color: var(--wp--preset--color--primary);
}

/* ── Back-to-top button ────────────────────────────────────────────────────── */

.je-back-to-top {
    position: fixed;
    /* Stack directly above the contact-cta circle (4.5rem tall) with a gap. */
    bottom: calc(clamp(1.25rem, 3vw, 2.5rem) + 4.5rem + 0.75rem);
    /* Centre-align with the wider contact circle: (4.5rem - 3.25rem) / 2. */
    right: calc(clamp(1.25rem, 3vw, 2.5rem) + 0.625rem);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: #1c1c1c;
    color: #ffffff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(1rem);
    transition: opacity 0.45s cubic-bezier(0.76, 0, 0.24, 1),
                transform 0.45s cubic-bezier(0.76, 0, 0.24, 1),
                visibility 0.45s cubic-bezier(0.76, 0, 0.24, 1),
                background-color 0.35s cubic-bezier(0.76, 0, 0.24, 1),
                color 0.35s cubic-bezier(0.76, 0, 0.24, 1);
}

.je-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.je-back-to-top:hover,
.je-back-to-top:focus-visible {
    background: var(--wp--preset--color--primary);
    color: #1c1c1c;
    outline: none;
}

.je-back-to-top svg {
    display: block;
    transition: transform 0.35s cubic-bezier(0.76, 0, 0.24, 1);
}

.je-back-to-top:hover svg,
.je-back-to-top:focus-visible svg {
    transform: translateY(-2px);
}

@media (max-width: 781px) {
    .je-back-to-top {
        /* Contact circle shrinks to 3.75rem on mobile; restack accordingly. */
        bottom: calc(clamp(1.25rem, 3vw, 2.5rem) + 3.75rem + 0.75rem);
        right: calc(clamp(1.25rem, 3vw, 2.5rem) + 0.25rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .je-back-to-top {
        transition: opacity 0.2s ease, visibility 0.2s ease;
        transform: none;
    }
    .je-back-to-top.is-visible {
        transform: none;
    }
}

/* ── Navigation micro-interaction ─────────────────────────────────────────── */

.wp-block-navigation-item__content {
    position: relative;
}

.wp-block-navigation-item__content::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 0.35s cubic-bezier(0.76, 0, 0.24, 1);
}

.wp-block-navigation-item__content:hover::after,
.wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content::after {
    transform: scaleX(1);
    transform-origin: left center;
}

/* ── Taxonomy archive: back-to-home link ──────────────────────────────────── */

.back-to-home {
    margin: 0;
    font-size: clamp(0.8rem, 1.1vw, 0.95rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.back-to-home a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    transition: gap 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.back-to-home a:hover,
.back-to-home a:focus-visible {
    gap: 0.7rem;
    opacity: 0.8;
}
