/*
Theme Name: kfoto
Theme URI: https://example.com/kfoto
Author: Codex
Description: Minimal multilingual photography portfolio theme for Kateryna Herasymchuk in Bern.
Version: 1.5.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: kfoto
*/

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #ececea;
  --ink: #080808;
  --muted: #5f5f5c;
  --line: rgba(8, 8, 8, 0.14);
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.12);
  --radius: 6px;
  --body: "Roboto", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --heading: "Lexend", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  --bg: #080808;
  --surface: #101010;
  --surface-soft: #171717;
  --ink: #f7f7f5;
  --muted: #aaa9a4;
  --line: rgba(247, 247, 245, 0.16);
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: geometricPrecision;
}

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

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3,
.brand-mark {
  font-family: var(--heading);
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.site-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  gap: 24px;
  align-items: center;
  padding: 16px 24px;
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.brand-mark {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
}

.brand-location {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.site-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a,
.settings-toggle,
.btn,
.gallery-filter,
.theme-toggle,
.slider-btn,
.lightbox-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  color: var(--ink);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.site-nav a {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.settings-toggle:hover,
.settings-toggle:focus-visible,
.btn:hover,
.btn:focus-visible,
.gallery-filter:hover,
.gallery-filter:focus-visible,
.gallery-filter.is-active,
.theme-toggle:hover,
.theme-toggle:focus-visible,
.slider-btn:hover,
.slider-btn:focus-visible,
.lightbox-close:hover,
.lightbox-close:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--surface);
}

.header-actions,
.settings-menu {
  position: relative;
  display: flex;
  justify-content: end;
  align-items: center;
}

.header-actions {
  justify-self: end;
}

.settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: min(310px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: settingsIn 160ms ease both;
}

.settings-panel[hidden] {
  display: none;
}

.settings-title,
.settings-group-label {
  margin: 0;
}

.settings-title {
  margin-bottom: 10px;
  font-family: var(--heading);
  font-weight: 600;
}

.settings-group {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.settings-group + .settings-group {
  margin-top: 10px;
}

.settings-group-label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.language-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.language-switcher button {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.language-switcher button.is-active,
.language-switcher button:hover,
.language-switcher button:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
}

.theme-toggle {
  width: 100%;
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 0 24px;
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 900ms ease, transform 2000ms ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide.is-active img {
  animation: heroDrift 10s ease-in-out both;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--bg) 88%, transparent) 0%, color-mix(in srgb, var(--bg) 52%, transparent) 45%, transparent 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 28%);
}

.hero-inner {
  display: flex;
  align-items: end;
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 112px 0 80px;
}

.hero-copy {
  max-width: 740px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 14px;
  font-size: 8rem;
  font-weight: 800;
  line-height: 0.86;
}

.hero-title {
  max-width: 640px;
  margin-bottom: 18px;
  font-family: var(--heading);
  font-size: 2.65rem;
  font-weight: 600;
  line-height: 1.04;
}

.hero-text {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--surface);
  color: var(--ink);
}

.section {
  padding: 88px 24px;
}

.section-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(260px, 0.3fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 26px;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.section h2 {
  margin-bottom: 0;
  font-size: 3.6rem;
  font-weight: 700;
  line-height: 0.98;
}

.section-title {
  margin-bottom: 0;
  font-size: 3.6rem;
  font-weight: 700;
  line-height: 0.98;
}

.section-heading p,
.about-copy p,
.contact-copy p,
.story-card p {
  color: var(--muted);
}

.gallery-section,
.stories-section,
.imprint-page {
  background: var(--bg);
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.gallery-filter {
  min-width: auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 78px;
  gap: 8px;
}

.gallery-item {
  position: relative;
  grid-column: span 4;
  grid-row: span 5;
  min-height: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
}

.gallery-item.is-wide {
  grid-column: span 6;
  grid-row: span 4;
}

.gallery-item.is-tall {
  grid-row: span 7;
}

.gallery-item.is-feature {
  grid-column: span 8;
  grid-row: span 6;
}

.gallery-item[hidden] {
  display: none;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 650ms ease;
}

.gallery-item:hover img,
.gallery-item:focus-visible img,
.gallery-item:hover video,
.gallery-item:focus-visible video {
  transform: scale(1.045);
}

.gallery-item.is-video {
  cursor: default;
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px;
  color: #ffffff;
  text-align: left;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus-visible .gallery-caption {
  transform: translateY(0);
  opacity: 1;
}

.gallery-title {
  display: block;
  font-family: var(--heading);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.1;
}

.gallery-meta {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
}

.about-layout,
.contact-layout,
.imprint-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.44fr) minmax(0, 0.56fr);
  gap: 48px;
  align-items: center;
}

.about-image-stack {
  display: grid;
  gap: 8px;
}

.about-image img {
  width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.about-image-primary {
  aspect-ratio: 4 / 5;
}

.about-image-secondary {
  width: 82%;
  aspect-ratio: 16 / 10;
  justify-self: end;
}

.about-note {
  margin-top: 10px;
  color: var(--muted);
}

.about-note strong {
  display: inline-block;
  margin-right: 8px;
  font-family: var(--heading);
  font-size: 1.35rem;
  color: var(--ink);
}

.about-copy h2 {
  margin-bottom: 24px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 28px 0;
}

.stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat strong {
  display: block;
  font-family: var(--heading);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
}

.stat span,
.recognition span {
  color: var(--muted);
  font-size: 0.86rem;
}

.recognition {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recognition span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stories-section {
  padding-top: 0;
}

.story-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(310px, 36%);
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.story-track::-webkit-scrollbar {
  display: none;
}

.story-card {
  position: relative;
  min-height: 450px;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.story-card img,
.story-card video {
  width: 100%;
  height: 100%;
  min-height: 450px;
  object-fit: cover;
}

.story-card-content {
  position: absolute;
  inset: auto 0 0;
  padding: 22px;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent);
}

.story-card h3 {
  margin-bottom: 8px;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.08;
}

.story-card p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.74);
}

.slider-controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.contact-section {
  background: var(--surface-soft);
}

.contact-copy h2 {
  margin-bottom: 20px;
}

.contact-list {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.contact-list a,
.contact-list span {
  width: fit-content;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.contact-form {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  outline: none;
}

.field textarea {
  min-height: 142px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--ink);
}

.form-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 14px;
}

.footer-nav a {
  color: var(--muted);
  transition: color 180ms ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--ink);
}

.imprint-page {
  min-height: 100vh;
  padding: 120px 24px 80px;
}

.imprint-page .section-inner {
  display: grid;
  gap: 34px;
}

.imprint-page .section-heading {
  margin-bottom: 0;
}

.imprint-disclaimer {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.imprint-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.imprint-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.imprint-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.imprint-card p,
.imprint-card a {
  margin: 0;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox.is-open {
  display: grid;
}

.lightbox-figure {
  width: min(1040px, 100%);
  margin: 0;
}

.lightbox img {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 10px;
  color: #ffffff;
}

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes heroDrift {
  0% {
    transform: scale(1.01) translate3d(0, 0, 0);
  }

  100% {
    transform: scale(1.06) translate3d(-1.2%, -1%, 0);
  }
}

@keyframes settingsIn {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px 16px;
  }

  .site-nav {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: center;
    flex-wrap: wrap;
    order: 3;
  }

  .hero,
  .section,
  .imprint-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-inner {
    padding-top: 138px;
    padding-bottom: 60px;
  }

  .hero h1 {
    font-size: 5.8rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .section h2 {
    font-size: 2.9rem;
  }

  .section-title {
    font-size: 2.9rem;
  }

  .section-heading,
  .about-layout,
  .contact-layout,
  .imprint-layout {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 72px;
  }

  .gallery-item,
  .gallery-item.is-wide,
  .gallery-item.is-tall,
  .gallery-item.is-feature {
    grid-column: span 3;
    grid-row: span 5;
  }

  .story-track {
    grid-auto-columns: minmax(280px, 72%);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .brand-location {
    display: none;
  }

  .site-nav a {
    flex: 1 1 auto;
    min-height: 34px;
    padding: 0 8px;
    text-align: center;
  }

  .settings-toggle {
    min-height: 38px;
  }

  .theme-label {
    display: none;
  }

  .hero-title {
    max-width: 330px;
    font-size: 1.75rem;
  }

  .hero h1 {
    font-size: 4.1rem;
  }

  .section h2 {
    font-size: 2.2rem;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .hero-text {
    max-width: 320px;
  }

  .hero-actions,
  .field-grid,
  .stats,
  .imprint-details {
    grid-template-columns: 1fr;
  }

  .field-grid {
    display: grid;
  }

  .gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .gallery-item,
  .gallery-item.is-wide,
  .gallery-item.is-tall,
  .gallery-item.is-feature {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 5;
  }

  .gallery-item.is-wide {
    aspect-ratio: 16 / 11;
  }

  .gallery-caption {
    transform: translateY(0);
    opacity: 1;
  }

  .about-note {
    display: block;
  }

  .about-image-secondary {
    width: 100%;
  }

  .story-track {
    grid-auto-columns: 86%;
  }

  .site-footer {
    grid-template-columns: 1fr;
    padding: 18px 16px;
  }

  .footer-nav {
    justify-content: start;
  }
}
