/*
Theme Name: DIER Photography
Author: DIER
Description: A monochrome, full-screen photography portfolio with a horizontal gallery and WordPress-managed works.
Version: 1.5.4
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: dier-photography
*/

:root {
  --dier-ink: #0a0a0a;
  --dier-paper: #f4f4f1;
  --dier-line: rgba(255, 255, 255, 0.28);
  --dier-signal: #ff3b24;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--dier-ink);
  color: #fff;
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}
body.dier-lightbox-open { overflow: hidden; }
button, a { color: inherit; }
button { font: inherit; }
a { text-decoration: none; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--dier-signal); color: #fff; }

.dier-shell { min-height: 100vh; overflow: clip; }
.dier-topbar {
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid var(--dier-line);
  position: relative;
  z-index: 10;
}
.dier-wordmark { font-size: 24px; font-weight: 900; letter-spacing: 0; justify-self: start; }
.dier-mark { color: var(--dier-signal); }
.dier-topbar-center, .dier-index-link { font-family: "Courier New", monospace; font-size: 11px; font-weight: 700; }
.dier-topbar-center { opacity: .62; }
.dier-index-link { justify-self: end; display: flex; gap: 16px; align-items: center; }
.dier-index-link span { font-size: 18px; transition: transform .2s ease; }
.dier-index-link:hover span { transform: translateY(4px); }

.dier-gallery-stage { height: calc(100svh - 72px); min-height: 540px; position: relative; }
.dier-gallery-rail {
  height: calc(100% - 92px);
  display: flex;
  gap: 9vw;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
  padding: 26px 15vw 8px;
  overscroll-behavior-x: contain;
}
.dier-gallery-rail::-webkit-scrollbar { display: none; }
.dier-gallery-rail:active { cursor: grabbing; }
.dier-gallery-slide {
  width: 70vw;
  min-width: 70vw;
  height: 100%;
  scroll-snap-align: center;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 28px;
  opacity: .28;
  transform: scale(.965);
  transition: opacity .35s ease, transform .35s ease;
}
.dier-gallery-slide.is-active { opacity: 1; transform: scale(1); }
.dier-media-frame {
  border: 0;
  padding: 0;
  width: 100%;
  min-height: 0;
  background: #111;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}
.dier-media-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: var(--dier-ink);
  pointer-events: none;
}
.dier-slide-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
}
.dier-slide-meta span:nth-child(2) { text-align: center; }
.dier-slide-meta span:last-child { text-align: right; }
.dier-gallery-controls {
  height: 92px;
  border-top: 1px solid var(--dier-line);
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
}
.dier-count { font-family: "Courier New", monospace; display: flex; align-items: baseline; gap: 6px; }
.dier-count strong { font-size: 28px; }
.dier-count span { opacity: .45; font-size: 12px; }
.dier-progress { height: 1px; background: rgba(255,255,255,.22); }
.dier-progress i { display: block; width: 4.76%; height: 3px; background: #fff; transform: translateY(-1px); transition: width .35s ease; }
.dier-gesture-hint { margin: 0; font-size: 12px; opacity: .66; white-space: nowrap; }
.dier-arrow-group { display: flex; }
.dier-arrow-group button {
  width: 56px;
  height: 56px;
  border: 1px solid #fff;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.dier-arrow-group .dier-next { background: #fff; color: #000; }
.dier-arrow-group button:hover:not(:disabled) { background: var(--dier-signal); border-color: var(--dier-signal); color: #fff; transform: rotate(-5deg); }
.dier-arrow-group button:disabled { opacity: .25; cursor: not-allowed; }

.dier-index-section { background: var(--dier-paper); color: var(--dier-ink); padding: 110px 28px 80px; }
.dier-index-intro { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 48px; margin-bottom: 100px; align-items: start; }
.dier-index-intro > p { margin: 8px 0 0; font-family: "Courier New", monospace; font-size: 11px; }
.dier-index-intro h1 { margin: 0; font-size: clamp(44px, 6vw, 94px); line-height: .94; font-weight: 800; letter-spacing: 0; }
.dier-index-intro h1 span { display: block; white-space: nowrap; }
.dier-about { padding-top: 8px; }
.dier-about > span { font-weight: 900; }
.dier-about p { font-size: 13px; line-height: 1.7; margin-top: 32px; }
.dier-index-grid { border-top: 2px solid #000; }
.dier-index-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #b9b9b4;
  background: transparent;
  color: #000;
  display: grid;
  grid-template-columns: 80px 1fr 100px 32px;
  align-items: center;
  min-height: 55px;
  padding: 0 2px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, padding .16s ease;
}
.dier-index-item:hover { background: #000; color: #fff; padding: 0 16px; }
.dier-index-item span:last-child { font-size: 19px; }
.dier-footer { min-height: 118px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; font-family: "Courier New", monospace; font-size: 11px; }
.dier-footer .dier-icp { color: inherit; text-decoration: none; }
.dier-footer .dier-icp:hover { text-decoration: underline; }

.dier-secret-page {
  min-height: 100svh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--dier-ink);
}
.dier-secret-page.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--dier-secret-image);
  background-position: center;
  background-size: cover;
}
.dier-secret-page.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(0, 0, 0, .62);
}
.dier-secret-header, .dier-secret-footer {
  min-height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "Courier New", monospace;
  font-size: 11px;
}
.dier-secret-header { border-bottom: 1px solid var(--dier-line); }
.dier-secret-footer { border-top: 1px solid var(--dier-line); opacity: .7; }
.dier-secret-back { font-size: 22px; width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #fff; transition: background .18s ease, color .18s ease; }
.dier-secret-back:hover { background: #fff; color: #000; }
.dier-secret-main { width: min(1120px, calc(100% - 56px)); margin: auto; padding: 64px 0; }
.dier-secret-kicker { margin: 0 0 28px; color: var(--dier-signal); font-family: "Courier New", monospace; font-size: 12px; font-weight: 700; }
.dier-secret-title { margin: 0; max-width: 900px; font-size: clamp(64px, 12vw, 180px); line-height: .82; font-weight: 900; letter-spacing: 0; overflow-wrap: anywhere; }
.dier-secret-note { margin-top: 72px; border-top: 1px solid rgba(255,255,255,.55); border-bottom: 1px solid rgba(255,255,255,.55); }
.dier-secret-note summary { min-height: 68px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; font-family: "Courier New", monospace; font-size: 12px; font-weight: 700; }
.dier-secret-note summary::-webkit-details-marker { display: none; }
.dier-secret-note summary span { color: var(--dier-signal); font-size: 24px; transition: transform .2s ease; }
.dier-secret-note[open] summary span { transform: rotate(45deg); }
.dier-secret-content { max-width: 720px; padding: 20px 0 64px; font-size: clamp(18px, 2.2vw, 28px); line-height: 1.75; }
.dier-secret-content > *:first-child { margin-top: 0; }
.dier-secret-content > *:last-child { margin-bottom: 0; }
.dier-secret-content a { border-bottom: 1px solid currentColor; }
.dier-secret-password { max-width: 520px; margin-top: 64px; }
.dier-secret-password label { display: block; font-size: 13px; line-height: 1.7; }
.dier-secret-password input[type="password"] { width: 100%; height: 54px; margin-top: 12px; padding: 0 14px; border: 1px solid #fff; border-radius: 0; background: transparent; color: #fff; font: inherit; }
.dier-secret-password input[type="submit"] { height: 54px; margin-top: 12px; padding: 0 26px; border: 1px solid #fff; border-radius: 0; background: #fff; color: #000; font-weight: 800; cursor: pointer; }
.dier-secret-password input[type="submit"]:hover { background: var(--dier-signal); border-color: var(--dier-signal); color: #fff; }

.dier-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.97); z-index: 99999; display: grid; place-items: center; }
.dier-lightbox-media { width: calc(100vw - 160px); height: calc(100svh - 110px); display: grid; place-items: center; }
.dier-lightbox-media img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.dier-lightbox-bar { position: absolute; left: 24px; right: 24px; bottom: 18px; display: flex; justify-content: space-between; font-family: "Courier New", monospace; font-size: 12px; }
.dier-lightbox-close, .dier-lightbox-prev, .dier-lightbox-next { position: absolute; border: 1px solid #fff; background: #000; color: #fff; width: 50px; height: 50px; font-size: 24px; cursor: pointer; }
.dier-lightbox-close { right: 24px; top: 20px; background: #fff; color: #000; font-size: 30px; }
.dier-lightbox-prev { left: 24px; top: calc(50% - 25px); }
.dier-lightbox-next { right: 24px; top: calc(50% - 25px); }
.dier-lightbox button:hover:not(:disabled) { background: var(--dier-signal); border-color: var(--dier-signal); color: #fff; }
.dier-lightbox button:disabled { opacity: .2; cursor: not-allowed; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--dier-signal); outline-offset: 3px; }

@media (max-width: 760px) {
  .dier-topbar { height: 60px; padding: 0 16px; grid-template-columns: 1fr auto; }
  .dier-wordmark { font-size: 20px; }
  .dier-topbar-center { display: none; }
  .dier-gallery-stage { height: calc(100svh - 60px); min-height: 520px; }
  .dier-gallery-rail { height: calc(100% - 82px); gap: 8vw; padding: 18px 6vw 6px; }
  .dier-gallery-slide { width: 88vw; min-width: 88vw; grid-template-rows: minmax(0, 1fr) 28px; }
  .dier-slide-meta { font-size: 11px; }
  .dier-gallery-controls { height: 82px; grid-template-columns: 68px 1fr auto; gap: 14px; padding: 0 16px; }
  .dier-gesture-hint { display: none; }
  .dier-count strong { font-size: 23px; }
  .dier-arrow-group button { width: 46px; height: 46px; }
  .dier-index-section { padding: 72px 16px 56px; }
  .dier-index-intro { grid-template-columns: 1fr; gap: 34px; margin-bottom: 64px; }
  .dier-index-intro h1 { font-size: 11vw; }
  .dier-about { display: grid; grid-template-columns: 90px 1fr; gap: 18px; }
  .dier-about p { margin: 0; }
  .dier-index-item { grid-template-columns: 48px 1fr 52px 24px; }
  .dier-footer { min-height: 112px; padding: 24px 16px; flex-wrap: wrap; gap: 18px 24px; }
  .dier-footer .dier-icp { width: 100%; order: 3; }
  .dier-lightbox-media { width: 100vw; height: calc(100svh - 120px); }
  .dier-lightbox-prev, .dier-lightbox-next { top: auto; bottom: 54px; }
  .dier-lightbox-prev { left: 16px; }
  .dier-lightbox-next { right: 16px; }
  .dier-lightbox-close { top: 14px; right: 16px; }
  .dier-lightbox-bar { left: 16px; right: 16px; }
  .dier-secret-header, .dier-secret-footer { min-height: 60px; padding: 0 16px; }
  .dier-secret-main { width: calc(100% - 32px); padding: 48px 0; }
  .dier-secret-title { font-size: 20vw; }
  .dier-secret-note { margin-top: 52px; }
  .dier-secret-content { font-size: 18px; }
}

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