/*
Theme Name: Blende Fotografie
Theme URI: https://example.com/blende-fotografie
Author: Studio
Author URI: https://example.com
Description: Ein neobrutalistisches, asymmetrisches Bento-Grid-Theme für professionelle Fotografie-Portfolios, inspiriert von creativeed.dev. Alle Kacheln, Überschriften, Links, Farben und das Lade-Icon lassen sich vollständig über den WordPress-Customizer anpassen. Animiert mit GSAP, inklusive dauerhaftem Blenden-Cursor.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: blende-fotografie
Tags: photography, portfolio, grid, custom-colors, custom-logo, full-width-template, one-column, threaded-comments, translation-ready
*/

/* ==========================================================================
   DESIGN TOKENS
   Palette:
     --bg          #0B0B0C  near-black studio background
     --bg-raised   #131315  panel / card background
     --fg          #F5F3EE  warm off-white (paper / print)
     --muted       #8A8A8E  EXIF-style secondary text
     --line        #242426  hairline rule
     --accent      #FF5A1F  default darkroom-safelight orange (per-tile customizable)
   Type:
     --font-display  "Space Grotesk" — tall geometric grotesk, tile + hero headlines
     --font-body     "Inter" — body copy, UI
     --font-mono     "JetBrains Mono" — frame numbers, EXIF labels, nav ticks
   ========================================================================== */

:root {
  --bg: #0b0b0c;
  --bg-raised: #131315;
  --fg: #f5f3ee;
  --muted: #8a8a8e;
  --line: #242426;
  --accent: #ff5a1f;

  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

  --gap: clamp(2px, 0.4vw, 6px);
  --radius: 2px;
  --ease-shutter: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ==========================================================================
   RESET
   ========================================================================== */

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font-family: inherit;
  background: none;
  border: none;
  color: inherit;
  cursor: none;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

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

::selection {
  background: var(--accent);
  color: #0b0b0c;
}

/* Respect reduced motion at the CSS level too (JS also checks this) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   CUSTOM CURSOR — "Blende" (aperture)
   Cursor stays visible everywhere; JS drives its position + blade animation.
   Hidden automatically on touch devices (see main.js + media query below).
   ========================================================================== */

.blende-cursor-active,
.blende-cursor-active a,
.blende-cursor-active button,
.blende-cursor-active input,
.blende-cursor-active textarea {
  cursor: none;
}

.blende-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  margin-left: -18px;
  margin-top: -18px;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  will-change: transform;
}

.blende-cursor svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.blende-cursor .blade {
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.4;
  transform-origin: 18px 18px;
}

.blende-cursor .blende-dot {
  fill: #ffffff;
}

.blende-cursor .blende-label {
  position: absolute;
  top: 22px;
  left: 24px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #ffffff;
  white-space: nowrap;
  opacity: 0;
}

@media (hover: none), (pointer: coarse) {
  .blende-cursor {
    display: none !important;
  }
  .blende-cursor-active,
  .blende-cursor-active a,
  .blende-cursor-active button {
    cursor: auto;
  }
}

/* ==========================================================================
   LOADER — shutter / aperture open reveal, icon set via Customizer > Medienbibliothek
   ========================================================================== */

.blende-loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
}

.blende-loader__icon {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blende-loader__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.blende-loader__icon svg {
  width: 100%;
  height: 100%;
}

.blende-loader__count {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.blende-loader__blade {
  position: fixed;
  top: 0;
  height: 100%;
  width: 12.6%;
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
}

/* ==========================================================================
   LAYOUT — skip link, header, footer
   ========================================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #0b0b0c;
  padding: 12px 18px;
  z-index: 10001;
  font-family: var(--font-mono);
  text-transform: uppercase;
  font-size: 13px;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.site {
  opacity: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 56px);
  background: rgba(11, 11, 12, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-branding {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.site-title {
  font-size: clamp(18px, 2vw, 22px);
  margin: 0;
  letter-spacing: 0.02em;
}

.site-title a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.custom-logo {
  max-height: 34px;
  width: auto;
}

.site-description {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.main-navigation ul {
  display: flex;
  gap: clamp(16px, 2.4vw, 34px);
}

.main-navigation a {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-shutter), color 0.3s var(--ease-shutter);
}

.main-navigation a:hover,
.main-navigation a:focus {
  border-color: var(--accent);
  color: var(--accent);
}

.menu-toggle {
  display: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px clamp(20px, 4vw, 56px) 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.site-footer a:hover {
  color: var(--accent);
}

.footer-social {
  display: flex;
  gap: 20px;
}

/* ==========================================================================
   HERO
   ========================================================================== */

.blende-hero {
  padding: clamp(60px, 12vw, 140px) clamp(20px, 4vw, 56px) clamp(40px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
}

.blende-hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 18px;
}

.blende-hero__eyebrow::before {
  content: "// ";
  color: var(--accent);
}

.blende-hero h1 {
  font-size: clamp(40px, 8.4vw, 118px);
  line-height: 0.94;
  max-width: 20ch;
}

.blende-hero__sub {
  margin-top: 24px;
  max-width: 56ch;
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--muted);
}

/* ==========================================================================
   BENTO GRID — Kacheln (tiles)
   Asymmetric contact-sheet layout; collapses to a single column on mobile.
   ========================================================================== */

.blende-grid-section {
  padding: 0 clamp(20px, 4vw, 56px) clamp(60px, 8vw, 110px);
}

.blende-grid-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 50px 0 26px;
  flex-wrap: wrap;
}

.blende-grid-section__head h2 {
  font-size: clamp(24px, 3.4vw, 40px);
}

.blende-grid-section__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.blende-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(140px, 1fr);
  gap: var(--gap);
}

/* Asymmetric span pattern for tiles 1–7 (extra tiles fall back to a default span) */
.blende-tile:nth-child(1) { grid-column: span 4; grid-row: span 4; }
.blende-tile:nth-child(2) { grid-column: span 2; grid-row: span 2; }
.blende-tile:nth-child(3) { grid-column: span 2; grid-row: span 2; }
.blende-tile:nth-child(4) { grid-column: span 3; grid-row: span 3; }
.blende-tile:nth-child(5) { grid-column: span 3; grid-row: span 3; }
.blende-tile:nth-child(6) { grid-column: span 2; grid-row: span 3; }
.blende-tile:nth-child(7) { grid-column: span 4; grid-row: span 3; }
.blende-tile:nth-child(n+8) { grid-column: span 3; grid-row: span 3; }

.blende-tile {
  position: relative;
  overflow: hidden;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  min-height: 220px;
}

.blende-tile__frame-index {
  position: absolute;
  top: 14px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--fg);
  z-index: 3;
  mix-blend-mode: difference;
}

.blende-tile__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.blende-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  filter: grayscale(65%) contrast(1.05);
  transition: filter 0.6s var(--ease-shutter);
}

.blende-tile:hover .blende-tile__media img,
.blende-tile:focus-within .blende-tile__media img {
  filter: grayscale(0%) contrast(1.05);
}

.blende-tile__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 12, 0) 40%, rgba(11, 11, 12, 0.92) 100%);
  z-index: 1;
}

.blende-tile__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 20px;
  z-index: 2;
}

.blende-tile__caption {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.blende-tile__title {
  font-size: clamp(18px, 2vw, 26px);
  line-height: 1.05;
}

.blende-tile__title a {
  display: inline-block;
  position: relative;
}

.blende-tile__title a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-shutter);
}

.blende-tile__title a:hover::after,
.blende-tile__title a:focus::after {
  transform: scaleX(1);
}

.blende-tile--empty .blende-tile__media {
  background: linear-gradient(135deg, #1c1c1e, #0e0e0f);
  display: flex;
  align-items: center;
  justify-content: center;
}

.blende-tile--empty .blende-tile__media span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 980px) {
  .blende-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blende-tile:nth-child(n) {
    grid-column: span 1;
    grid-row: span 2;
  }
  .blende-tile:nth-child(1) { grid-column: span 2; }
}

@media (max-width: 600px) {
  .blende-grid {
    grid-template-columns: 1fr;
  }
  .blende-tile:nth-child(n) {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
  .blende-tile {
    min-height: 300px;
  }
}

/* ==========================================================================
   GENERIC PAGE / SINGLE CONTENT
   ========================================================================== */

.blende-content {
  padding: clamp(40px, 6vw, 80px) clamp(20px, 4vw, 56px);
  max-width: 860px;
  margin: 0 auto;
}

.blende-content h1 {
  font-size: clamp(32px, 5vw, 56px);
  margin-bottom: 24px;
}

.blende-content p {
  margin: 0 0 1.2em;
  color: var(--fg);
}

.blende-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
