/*
Theme Name: Reilika Foto
Theme URI: https://foto.reilika.eu
Author: Reilika Rootsma-Trall
Description: Minimalistlik editorial-fotoportfoolio. Kohandatud teema, ehitatud 2026 disainiprototüübi järgi.
Version: 1.0.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: reilika-foto
*/

:root {
  --paper: #f3f0e9;
  --ink: #101010;
  --muted: #6d6962;
  --line: #c9c4ba;
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --sans: "Helvetica Neue", "Arial Nova", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
}

body.lightbox-open {
  overflow: hidden;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

a {
  text-decoration: none;
}

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

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

.site-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 104px;
  padding: 28px 4.8vw 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.subpage-site-header {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.identity {
  display: flex;
  align-items: baseline;
  gap: 18px;
  white-space: nowrap;
}

.identity-name {
  font-size: clamp(1.32rem, 1.9vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.055em;
}

.identity-field {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.45rem;
  padding-top: 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.main-nav a {
  position: relative;
  padding-bottom: 5px;
}

.main-nav a::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 300ms ease;
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.menu-button {
  display: none;
}

.hero {
  position: relative;
  min-height: 900px;
  height: 100svh;
  max-height: 1080px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  position: absolute;
  z-index: 2;
  top: 22%;
  left: 4.8vw;
  width: min(39vw, 570px);
}

.eyebrow,
.section-index {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 2.15rem 0 1.4rem;
  font-family: var(--serif);
  font-size: clamp(5.3rem, 8vw, 8.4rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.06em;
}

.hero-intro {
  max-width: 440px;
  margin: 0 0 2.25rem;
  font-size: clamp(1.05rem, 1.3vw, 1.22rem);
  line-height: 1.55;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0 0.55rem;
  border-bottom: 1px solid currentColor;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.text-link span {
  transition: transform 300ms ease;
}

.text-link:hover span {
  transform: translate(4px, 4px);
}

.hero-photo {
  position: absolute;
  margin: 0;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 500ms ease;
}

.hero-photo:hover img {
  filter: contrast(1.04);
}

/* Pesade laiused kohanduvad valitud foto orientatsiooniga;
   külgede suhe tuleb inline-stiilina päris fotost.
   max-height + contain tagab, et fotot EI lõigata kunagi. */
.hero-photo-main {
  z-index: 1;
  top: auto;
  bottom: 0;
  left: auto;
  right: 4.8vw;
  width: 39.4%;
  max-height: 86%;
}

.hero-photo-main img {
  object-position: right bottom;
}

.hero-photo-main.is-landscape {
  max-height: 60%;
}

/* Alumine fotopaar: üks rida, ühesugune kõrgus, alt joondatud.
   Kõrguse arvutab JS nii, et rida mahub suure foto kõrvale. */
.hero-bottom {
  position: absolute;
  left: 4.8vw;
  bottom: 2.5%;
  height: 32%;
  display: flex;
  align-items: flex-end;
  gap: 1.4vw;
}

.hero-bottom .hero-photo {
  position: static;
  height: 100%;
  width: auto;
}

/* Keskmine foto istub veidi kõrgemal, mitte ühel joonel esimesega. */
.hero-bottom .hero-photo:nth-child(2) {
  margin-bottom: 20px;
}

.hero-bottom .hero-photo img {
  object-position: left bottom;
}

.about-section {
  padding: 9.5rem 4.8vw;
}

.portfolio-section {
  padding: 7rem 4.8vw 8rem;
  border-bottom: 1px solid var(--line);
}

.portfolio-header {
  margin-bottom: 3.8rem;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 32%);
  align-items: end;
  gap: 5vw;
}

.portfolio-header h2 {
  margin: 1rem 0 0;
  font-family: var(--serif);
  font-size: clamp(5rem, 9vw, 9rem);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.055em;
}

.portfolio-header > p {
  margin: 0 0 0.35rem;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}

.series-nav {
  margin-bottom: 2rem;
  padding: 1.2rem 0 1.4rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2.5vw;
  overflow-x: auto;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  scrollbar-width: none;
}

.series-nav::-webkit-scrollbar {
  display: none;
}

.series-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 0 0 0.45rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: #9b968e;
  transition: color 250ms ease;
}

.series-tab::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: currentColor;
  content: "";
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 300ms ease;
}

.series-tab:hover,
.series-tab.is-active {
  color: var(--ink);
}

.series-tab.is-active::after {
  transform: scaleX(1);
  transform-origin: left;
}

.series-tab-count {
  align-self: flex-start;
  padding-top: 0.25rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.series-tab-name {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.8vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.active-series-meta {
  margin-bottom: 3.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.active-series-title {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.series-detail-link {
  padding-bottom: 0.2rem;
  border-bottom: 1px solid currentColor;
}

/* Editorial-kollaaž: 12-veeruline raster, vahelduvad laiused ja nihked. */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.4vw;
  row-gap: clamp(3.5rem, 6vw, 6.5rem);
  align-items: start;
}

.gallery-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  text-align: left;
}

.gallery-item.is-hidden {
  display: none;
}


/* Paigutusmuster (kordub üle 7 foto): lai+kitsas paarid ja kolmene rida,
   iga teine foto veidi allapoole nihutatud. */
.gallery-item.g-a {
  grid-column: 1 / 6;
}

.gallery-item.g-b {
  grid-column: 7 / 12;
  margin-top: clamp(2.5rem, 5vw, 5.5rem);
}

.gallery-item.g-c {
  grid-column: 1 / 7;
}

.gallery-item.g-d {
  grid-column: 8 / 12;
  margin-top: clamp(1.5rem, 3vw, 3rem);
}

.gallery-item.g-e {
  grid-column: 1 / 5;
}

.gallery-item.g-f {
  grid-column: 5 / 9;
  margin-top: clamp(2rem, 4vw, 4rem);
}

.gallery-item.g-g {
  grid-column: 9 / 13;
}

.gallery-item > img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: filter 350ms ease, transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-item:hover > img {
  transform: scale(0.992);
  filter: contrast(1.03);
}

.about-section,
.contact-section {
  min-height: 720px;
  display: grid;
  grid-template-columns: 17% 45% 1fr;
  gap: 5vw;
  align-items: start;
}

.about-label,
.contact-label {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.about-label p,
.contact-label p {
  margin: 0;
}

.about-copy h2 {
  margin: 0 0 2rem;
  font-family: var(--serif);
  font-size: clamp(3.3rem, 6vw, 6.8rem);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.about-copy > p {
  max-width: 560px;
  margin: 0 0 2.6rem;
  font-size: clamp(1.1rem, 1.55vw, 1.45rem);
  line-height: 1.55;
}

.about-image {
  margin: 3rem 0 0;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  /* Portree alumine serv jääb peitu. */
  margin-bottom: -18%;
}

.contact-section {
  min-height: 680px;
  padding: 9.5rem 4.8vw;
  grid-template-columns: 17% 1fr;
  border-top: 1px solid var(--ink);
  background: #e7e2d8;
}

.contact-copy {
  max-width: 1040px;
}

.contact-copy h2 {
  margin: 0 0 2.2rem;
  font-family: var(--serif);
  font-size: clamp(4rem, 7.8vw, 8.5rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.065em;
}

.contact-copy > p {
  max-width: 710px;
  margin: 0 0 4.5rem;
  font-size: clamp(1.08rem, 1.45vw, 1.35rem);
  line-height: 1.58;
}

.contact-email {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 0 0.8rem;
  border-bottom: 1px solid currentColor;
  font-size: clamp(1.75rem, 4vw, 4.35rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.contact-email span {
  font-size: 0.7em;
  transition: transform 300ms ease;
}

.contact-email:hover span {
  transform: translate(6px, -6px);
}

.contact-form-toggle {
  margin: 1.4rem 0 0 auto;
  padding: 0 0 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.contact-form {
  max-width: 780px;
  margin: 4rem 0 0 auto;
  padding-top: 3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 1.5rem;
  border-top: 1px solid var(--ink);
  animation: contact-form-in 280ms ease both;
}

.contact-form[hidden] {
  display: none;
}

@keyframes contact-form-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.form-field > span {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.8rem 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.form-field textarea {
  min-height: 128px;
  resize: vertical;
  line-height: 1.5;
}

.form-field input:focus,
.form-field textarea:focus {
  border-bottom-width: 2px;
}

.form-field-message,
.form-actions {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* Robotilõks: päris kasutaja seda ei näe ega täida. */
.form-trap {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

.form-status {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.form-submit {
  min-height: 48px;
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 220ms ease, color 220ms ease;
}

.form-submit:hover,
.form-submit:focus-visible {
  background: transparent;
  color: var(--ink);
}

.site-footer {
  min-height: 170px;
  padding: 3rem 4.8vw;
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  gap: clamp(1.5rem, 3vw, 4rem);
  align-items: end;
  border-top: 1px solid var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

.footer-name {
  font-size: clamp(1.05rem, 1.6vw, 1.6rem);
  font-weight: 750;
  letter-spacing: -0.045em;
}

.footer-email,
.footer-instagram,
.footer-privacy {
  padding-bottom: 2px;
  border-bottom: 1px solid currentColor;
}

.legal-hero {
  padding: clamp(6rem, 10vw, 10rem) 4.8vw clamp(4.5rem, 7vw, 7rem);
  border-bottom: 1px solid var(--ink);
}

.legal-hero h1 {
  margin: 1.8rem 0 2rem;
  font-family: var(--serif);
  font-size: clamp(5rem, 10vw, 11rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.065em;
}

.legal-hero > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.legal-content {
  padding: 0 4.8vw 8rem;
  display: grid;
  grid-template-columns: 17% minmax(0, 780px);
  gap: 0;
}

.legal-aside {
  padding-top: 3rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.legal-copy {
  max-width: 780px;
}

.legal-section {
  padding: 3rem 0 3.5rem;
  border-bottom: 1px solid var(--line);
}

.legal-section h2 {
  margin: 0 0 1.4rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 3vw, 3.2rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
}

.legal-section p {
  margin: 0 0 1rem;
  font-size: 1.04rem;
  line-height: 1.65;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section a {
  border-bottom: 1px solid currentColor;
}

.series-intro {
  padding: clamp(6.5rem, 10vw, 10rem) 4.8vw clamp(4.5rem, 7vw, 7rem);
  display: grid;
  grid-template-columns: 17% 1fr;
  border-bottom: 1px solid var(--ink);
}

.series-intro-main h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(6rem, 13vw, 13.5rem);
  font-weight: 400;
  line-height: 0.82;
  letter-spacing: -0.075em;
}

.series-intro-meta {
  margin-top: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.series-intro-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.series-share-button {
  padding: 0 0 0.35rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.series-photo-flow {
  padding: clamp(5rem, 8vw, 9rem) 4.8vw clamp(7rem, 11vw, 12rem);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 1.5vw;
  row-gap: clamp(4.5rem, 8vw, 9rem);
  align-items: start;
}

.series-frame {
  margin: 0;
}

.series-frame img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.series-frame-lead {
  grid-column: 1 / 11;
}

.series-frame-offset {
  grid-column: 4 / 13;
}

.series-frame-pair-left {
  grid-column: 1 / 5;
}

.series-frame-pair-right {
  grid-column: 6 / 13;
}

.series-frame-center {
  grid-column: 2 / 12;
}

.series-frame-pair-wide-left {
  grid-column: 1 / 7;
}

.series-frame-pair-small-right {
  grid-column: 8 / 13;
}

.series-frame-narrow {
  grid-column: 3 / 11;
}

.series-frame-final {
  grid-column: 1 / 13;
}

/* Loo sissejuhatus ja lugude nimekiri */
.story-intro-text {
  max-width: 640px;
  margin: 2.2rem 0 0;
  font-size: clamp(1.05rem, 1.3vw, 1.22rem);
  line-height: 1.55;
}

.story-entry {
  display: block;
}

.story-entry img {
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: filter 350ms ease;
}

.story-entry:hover img {
  filter: contrast(1.04);
}

.story-entry-caption {
  margin-top: 1.1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
}

.story-entry-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.6vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.story-entry-meta {
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.series-end {
  padding: 0 4.8vw 8rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.series-end .section-index {
  margin: 0;
}

.series-back-link {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid currentColor;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.not-found-stage {
  min-height: calc(100svh - 104px);
  padding: 4rem 4.8vw;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: clamp(3rem, 8vw, 9rem);
  align-items: center;
}

.not-found-code {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(11rem, 24vw, 25rem);
  font-weight: 400;
  line-height: 0.65;
  letter-spacing: -0.09em;
}

.not-found-copy h1 {
  margin: 4rem 0 2.5rem;
  font-family: var(--serif);
  font-size: clamp(2.8rem, 5vw, 5.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.055em;
}

.not-found-image {
  margin: 0;
}

.not-found-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: grayscale(100%);
}

.back-to-top {
  position: fixed;
  z-index: 40;
  right: 1.6rem;
  bottom: 1.6rem;
  padding: 0.8rem 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 220ms ease, transform 220ms ease, background 220ms ease,
    color 220ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--ink);
  color: var(--paper);
}

.lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 7, 7, 0.97);
  color: #f1eee7;
  animation: lightbox-in 220ms ease both;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: 2rem;
  right: 2.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lightbox-figure {
  width: min(78vw, 1280px);
  height: 84vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.lightbox-figure img {
  width: 100%;
  min-height: 0;
  flex: 1;
  object-fit: contain;
}

.lightbox-figure figcaption {
  padding-top: 0.8rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.3rem;
  transform: translateY(-50%);
  transition: background 250ms ease, color 250ms ease;
}

.lightbox-nav:hover {
  background: #f1eee7;
  color: #101010;
}

.lightbox-prev {
  left: 2.2rem;
}

.lightbox-next {
  right: 2.2rem;
}

@keyframes lightbox-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy > * {
  animation: rise-in 600ms ease both;
}

.hero-copy > :nth-child(2) {
  animation-delay: 80ms;
}

.hero-copy > :nth-child(3) {
  animation-delay: 140ms;
}

.hero-copy > :nth-child(4) {
  animation-delay: 200ms;
}

@media (max-width: 1024px) {
  .identity {
    flex-direction: column;
    gap: 0.35rem;
  }

  .main-nav {
    gap: 0.85rem;
  }

  .hero-copy {
    left: 4.8vw;
    width: 42vw;
  }

  .portfolio-header {
    grid-template-columns: 1fr minmax(240px, 36%);
  }

  .series-nav {
    justify-content: flex-start;
    gap: 2.5rem;
  }
}

@media (max-width: 760px) {
  .site-header {
    position: absolute;
    height: 94px;
    padding: 22px 20px 0;
  }

  .site-header.subpage-site-header {
    position: relative;
  }

  .identity-name {
    font-size: 1.18rem;
  }

  .identity-field {
    font-size: 0.75rem;
  }

  .menu-button {
    position: relative;
    z-index: 22;
    width: 38px;
    height: 34px;
    padding: 8px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    border: 0;
    background: transparent;
  }

  .menu-button span {
    width: 100%;
    height: 1px;
    background: var(--ink);
  }

  .main-nav {
    position: fixed;
    z-index: 21;
    inset: 0;
    padding: 8rem 1.4rem 2rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.4rem;
    background: var(--paper);
    font-family: var(--serif);
    font-size: 2.5rem;
    font-weight: 400;
    letter-spacing: -0.04em;
    text-transform: none;
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav > span {
    display: none;
  }

  .hero {
    min-height: 850px;
    height: 100svh;
    max-height: 920px;
  }

  .hero-copy {
    top: 17%;
    left: 20px;
    width: calc(100% - 40px);
  }

  .hero h1 {
    margin: 1.35rem 0 0.9rem;
    font-size: clamp(4.9rem, 24vw, 7rem);
  }

  .hero-intro {
    width: 90%;
    max-width: 390px;
    margin-bottom: 1.4rem;
    font-size: 1rem;
  }

  .hero-photo-main {
    top: auto;
    right: 20px;
    bottom: 20px;
    left: auto;
    width: 58%;
    max-height: 52%;
  }

  .hero-photo-main img {
    object-position: right bottom;
  }

  .hero-bottom {
    left: 20px;
    bottom: 20px;
    height: auto;
    gap: 12px;
  }

  /* Mobiilis laiuse-, mitte kõrgusepõhine — ei roni suure foto alla. */
  .hero-bottom .hero-photo {
    height: auto;
    width: 30vw;
  }

  .hero-photo-night {
    display: none;
  }

  .portfolio-section,
  .about-section,
  .contact-section {
    padding: 6.5rem 20px;
  }

  .portfolio-section {
    padding-top: 4.5rem;
    padding-bottom: 5rem;
  }

  .portfolio-header {
    margin-bottom: 3.5rem;
    display: block;
  }

  .portfolio-header h2 {
    font-size: 4.8rem;
  }

  .portfolio-header > p {
    margin-top: 1.8rem;
  }

  .series-nav {
    margin-right: -20px;
    margin-bottom: 1.8rem;
    padding: 1.15rem 20px 1.35rem 0;
    gap: 1.6rem;
    justify-content: flex-start;
  }

  .series-tab {
    min-width: max-content;
    padding-bottom: 0.35rem;
  }

  .series-tab-name {
    font-size: 2rem;
  }

  .series-tab-count {
    padding-top: 0.1rem;
    font-size: 0.75rem;
  }

  .active-series-meta {
    margin-bottom: 3rem;
  }

  .active-series-title {
    gap: 0.8rem;
  }

  .series-detail-link {
    font-size: 0.75rem;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 2.5rem;
  }

  /* Mobiilis lihtne 2-veeruline rütm: iga kolmas foto üle rea. */
  .gallery-item.g-a,
  .gallery-item.g-b,
  .gallery-item.g-d,
  .gallery-item.g-e,
  .gallery-item.g-f,
  .gallery-item.g-g {
    grid-column: auto / span 1;
    margin-top: 0;
  }

  .gallery-item.g-c {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .about-section {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .contact-section {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .contact-copy h2 {
    margin-bottom: 1.7rem;
    font-size: 4.1rem;
  }

  .contact-copy > p {
    margin-bottom: 3.2rem;
    font-size: 1.05rem;
  }

  .contact-email {
    font-size: clamp(1.45rem, 6.7vw, 2rem);
  }

  .about-copy h2 {
    font-size: 4rem;
  }

  .about-image {
    margin: 0;
  }

  .site-footer {
    min-height: 170px;
    padding: 2.3rem 20px;
    grid-template-columns: 1fr auto;
    gap: 1rem;
  }

  .footer-field {
    display: none;
  }

  .footer-email {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
  }

  .footer-instagram {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }

  .footer-privacy {
    grid-column: 2;
    grid-row: 3;
    justify-self: end;
  }

  .footer-year {
    justify-self: end;
  }

  .legal-hero {
    padding: 5.5rem 20px 4rem;
  }

  .legal-hero h1 {
    margin-top: 1.3rem;
    font-size: clamp(4.1rem, 20vw, 6.2rem);
  }

  .legal-content {
    padding: 0 20px 5rem;
    grid-template-columns: 1fr;
  }

  .legal-aside {
    padding: 2.5rem 0 0;
  }

  .legal-section {
    padding: 2.5rem 0 3rem;
  }

  .contact-form {
    margin-top: 3rem;
    grid-template-columns: 1fr;
  }

  .contact-form-toggle {
    margin-left: 0;
  }

  .form-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .series-intro {
    padding: 5.5rem 20px 4rem;
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .series-intro-main h1 {
    font-size: clamp(5rem, 24vw, 7.4rem);
  }

  .series-intro-meta {
    margin-top: 2.4rem;
  }

  .series-photo-flow {
    padding: 4rem 20px 7rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 4.5rem;
  }

  .series-frame-lead,
  .series-frame-offset,
  .series-frame-center,
  .series-frame-narrow,
  .series-frame-final {
    grid-column: 1 / -1;
  }

  .series-frame-pair-left,
  .series-frame-pair-wide-left {
    grid-column: 1;
  }

  .series-frame-pair-right,
  .series-frame-pair-small-right {
    grid-column: 2;
  }

  .series-end {
    padding: 0 20px 5rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 2.5rem;
  }

  .not-found-stage {
    min-height: calc(100svh - 94px);
    padding: 3.5rem 20px 5rem;
    grid-template-columns: 1fr;
    gap: 4rem;
  }

  .not-found-code {
    font-size: clamp(10rem, 51vw, 14rem);
  }

  .not-found-copy h1 {
    margin: 3rem 0 2rem;
    font-size: 3.6rem;
  }

  .not-found-image {
    width: 62%;
    margin-left: auto;
  }

  .back-to-top {
    right: 1rem;
    bottom: 1rem;
    padding: 0.7rem 0.85rem;
  }

  .lightbox-close {
    top: 1.2rem;
    right: 1.2rem;
  }

  .lightbox-figure {
    width: 100vw;
    height: 76vh;
    padding: 0 1rem;
  }

  .lightbox-nav {
    top: auto;
    bottom: 1.1rem;
    transform: none;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
