/*
Theme Name: maashof
Theme URI: https://maashof.test.bluect.nl
Author: BlueCT
Description: Bespoke block theme for Maashof, tuin- en landschapsarchitectuur in Noord-Brabant. Warm-editorial natuurlijke richting met terracotta accent op warm papier en diep bosgroen.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: maashof
*/

/* ============================================================
   ATMOSPHERE
   ============================================================ */
:root {
  --reveal-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A faint paper grain via a layered gradient sitting behind everything.
   Kept on body::before so it never creates a stacking context on content. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 85% -5%, rgba(181, 85, 47, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(28, 32, 24, 0.05), transparent 60%);
}

/* Do NOT add z-index here: it would trap the nav overlay. position:relative only. */
.wp-site-blocks > * {
  position: relative;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100001;
  background: var(--wp--preset--color--ink-deep);
  color: var(--wp--preset--color--paper);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 6px 0;
  text-decoration: none;
  font-family: var(--wp--preset--font-family--body);
}
.skip-link:focus {
  left: 0;
}

/* Visible focus everywhere */
:focus-visible {
  outline: 3px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Width utility used by header/footer parts */
.wrap {
  max-width: 1240px;
  margin-inline: auto;
  width: 100%;
}

/* ============================================================
   TYPE DETAILS
   ============================================================ */
h1, h2, h3 {
  text-wrap: balance;
}

.eyebrow {
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--small);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--wp--preset--color--accent-text);
}

/* Fraunces optical-size flourish on the big display headings */
.wp-block-post-content h1,
.hero h1,
.huge-display {
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  font-weight: 380;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--wp--preset--color--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--wp--preset--color--line);
}

.nav .wp-block-site-title a,
.nav .wp-block-site-title {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--wp--preset--color--ink-deep);
}

.nav .wp-block-navigation a {
  font-family: var(--wp--preset--font-family--body);
  font-size: var(--wp--preset--font-size--medium);
  text-decoration: none;
  color: var(--wp--preset--color--ink-deep);
}
.nav .wp-block-navigation a:hover {
  color: var(--wp--preset--color--accent-text);
}

/* Animated underline on desktop nav links */
@media (min-width: 600px) {
  .nav .wp-block-navigation .wp-block-navigation-item__content {
    position: relative;
  }
  .nav .wp-block-navigation .wp-block-navigation-item__content::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background: var(--wp--preset--color--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--reveal-ease);
  }
  .nav .wp-block-navigation .wp-block-navigation-item__content:hover::after {
    transform: scaleX(1);
  }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  overflow: clip;
}

.hero .wp-block-cover__background {
  background: linear-gradient(
    180deg,
    rgba(28, 32, 24, 0.35) 0%,
    rgba(28, 32, 24, 0.55) 55%,
    rgba(28, 32, 24, 0.78) 100%
  ) !important;
}

.hero h1 {
  letter-spacing: -0.02em;
}

/* Editorial split hero figure */
.hero-figure img {
  border-radius: 6px;
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ============================================================
   CARDS / SERVICES
   ============================================================ */
.cards {
  --card-gap: var(--wp--preset--spacing--40);
}

.card {
  background: var(--wp--preset--color--paper-warm);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 6px;
  padding: var(--wp--preset--spacing--40);
  transition: transform 0.35s var(--reveal-ease), box-shadow 0.35s var(--reveal-ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -24px rgba(28, 32, 24, 0.45);
}
.card .card-num {
  font-family: var(--wp--preset--font-family--display);
  font-size: 2rem;
  color: var(--wp--preset--color--accent);
  line-height: 1;
}

/* Numbered service rule */
.card h3 {
  margin-top: 0.5rem;
}

/* ============================================================
   STEPS / PROCESS
   ============================================================ */
.steps .step {
  display: flex;
  gap: var(--wp--preset--spacing--40);
  align-items: baseline;
  padding-block: var(--wp--preset--spacing--20);
  border-top: 1px solid var(--wp--preset--color--line);
}
.steps .step .step-num {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.75rem;
  color: var(--wp--preset--color--accent);
  min-width: 2.5rem;
}

/* ============================================================
   STATS
   ============================================================ */
.stat .stat-fig {
  font-family: var(--wp--preset--font-family--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1;
  color: var(--wp--preset--color--accent-text);
}

/* ============================================================
   PROOF / QUOTE
   ============================================================ */
.wp-block-quote.proof {
  border: none;
  padding-left: 0;
}
.wp-block-quote.proof p {
  font-family: var(--wp--preset--font-family--display);
  font-size: var(--wp--preset--font-size--x-large);
  line-height: 1.3;
  font-weight: 380;
}

/* ============================================================
   DARK SECTIONS (ink)
   ============================================================ */
.section-dark {
  background: var(--wp--preset--color--ink-deep);
  color: var(--wp--preset--color--paper);
}
.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--wp--preset--color--paper);
}
.section-dark .eyebrow {
  color: #E2A98D;
}
.section-dark a {
  color: #E2A98D;
}

/* ============================================================
   IMAGES
   ============================================================ */
.wp-block-image img {
  border-radius: 6px;
}

/* Full-bleed image utility: gives white text contrast over photos */
.media-overlay {
  position: relative;
}
.media-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 32, 24, 0.15), rgba(28, 32, 24, 0.65));
  border-radius: 6px;
  pointer-events: none;
}

/* ============================================================
   FORM (contact)
   ============================================================ */
.wp-block-form .wp-block-form-input__label-content {
  font-family: var(--wp--preset--font-family--body);
  font-weight: 600;
  font-size: var(--wp--preset--font-size--small);
  display: block;
  margin-bottom: 0.35rem;
}
.wp-block-form input,
.wp-block-form textarea {
  width: 100%;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  font-family: var(--wp--preset--font-family--body);
  background: #fff;
  color: var(--wp--preset--color--ink-deep);
}
.wp-block-form input:focus,
.wp-block-form textarea:focus {
  border-color: var(--wp--preset--color--accent);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--wp--preset--color--ink-deep);
  color: var(--wp--preset--color--paper);
}
.site-footer h2,
.site-footer h3,
.site-footer .footer-brand {
  font-family: var(--wp--preset--font-family--display);
  color: var(--wp--preset--color--paper);
}
.site-footer .footer-brand {
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.site-footer a {
  color: #D7CFC2;
  text-decoration: none;
}
.site-footer a:hover {
  color: #E2A98D;
  text-decoration: underline;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--reveal-ease), transform 0.7s var(--reveal-ease);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger children when a container is revealed */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--reveal-ease), transform 0.6s var(--reveal-ease);
}
.reveal-stagger.is-visible > * {
  opacity: 1;
  transform: none;
}
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.24s; }

/* Hero load-in */
.hero .hero-inner > * {
  opacity: 0;
  transform: translateY(22px);
  animation: heroIn 0.9s var(--reveal-ease) forwards;
}
.hero .hero-inner > *:nth-child(1) { animation-delay: 0.1s; }
.hero .hero-inner > *:nth-child(2) { animation-delay: 0.22s; }
.hero .hero-inner > *:nth-child(3) { animation-delay: 0.34s; }
.hero .hero-inner > *:nth-child(4) { animation-delay: 0.46s; }
@keyframes heroIn {
  to { opacity: 1; transform: none; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal-stagger > *,
  .hero .hero-inner > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .card { transition: none !important; }
}

/* ============================================================
   MOBILE  (mandatory section)
   ============================================================ */

/* Side padding so wide blocks never flush the edge; strip .wrap doubling */
@media (max-width: 599px) {
  .wp-site-blocks { padding-inline: 1.25rem; }
  .wrap { padding-inline: 0; }
}

/* Hamburger & close button: 44px tap target, always visible on mobile */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
  color: var(--wp--preset--color--ink-deep) !important;
  min-width: 44px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.5rem !important;
}
.wp-block-navigation__responsive-container-close {
  color: var(--wp--preset--color--paper) !important;
}
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg {
  width: 28px !important;
  height: 28px !important;
}

/* Bidirectional open/close animation. Never style the container without
   .is-menu-open, or the overlay stays visible permanently. */
.wp-block-navigation__responsive-container:not(.is-menu-open) {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}
.wp-block-navigation__responsive-container.is-menu-open {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  position: fixed !important;
  inset: 0 !important;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease, visibility 0s linear 0s;
  background: var(--wp--preset--color--ink-deep) !important;
  padding: 5rem 1.75rem 2.5rem !important;
  z-index: 100000 !important;
}

/* Overlay nav links: large editorial */
.wp-block-navigation__responsive-container.is-menu-open a,
.wp-block-navigation__responsive-container.is-menu-open
  .wp-block-navigation-item__content {
  font-family: var(--wp--preset--font-family--display) !important;
  font-size: clamp(2rem, 7vw, 3rem) !important;
  font-weight: 500 !important;
  color: var(--wp--preset--color--paper) !important;
  text-decoration: none !important;
  line-height: 1.1 !important;
  padding: 0.6rem 0 !important;
  display: block;
  border-bottom: 1px solid rgba(244, 241, 234, 0.12);
  transition: color 0.2s ease, padding-left 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.wp-block-navigation__responsive-container.is-menu-open a:hover {
  color: var(--wp--preset--color--accent-text) !important;
  padding-left: 0.5rem !important;
}

@media (prefers-reduced-motion: reduce) {
  .wp-block-navigation__responsive-container,
  .wp-block-navigation__responsive-container.is-menu-open {
    transition: none !important;
  }
}

/* Stack card and step rows on mobile (override the grid/flex layout) */
@media (max-width: 599px) {
  .wp-block-group.cards { display: flex !important; flex-direction: column !important; }
  .steps .step { flex-direction: column; gap: 0.5rem; }
  .steps .step .step-num { min-width: 0; }
  .site-footer .footer-brand { font-size: clamp(2.2rem, 12vw, 3rem); }
}

/* Hide nav CTA button on very small screens */
@media (max-width: 480px) {
  .nav .wp-block-buttons { display: none; }
}
