/* =========================================================
   Destruction page — content warning gate + photo gallery
   Extends styles.css + resources.css
   ========================================================= */

/* Lock body scroll while gate is visible */
body.locked {
  overflow: hidden;
  height: 100vh;
}

/* ========== Content warning gate ========== */
.cw-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: rgba(28, 25, 23, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: cw-fade-in 0.4s ease-out;
}
.cw-gate.dismissing {
  animation: cw-fade-out 0.35s ease-in forwards;
}
.cw-gate.hidden {
  display: none;
}
@keyframes cw-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes cw-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.cw-card {
  max-width: 640px;
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8) var(--space-8);
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.45);
  position: relative;
  animation: cw-slide-up 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cw-slide-up {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.cw-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pal-bg);
  color: var(--pal);
  margin-bottom: var(--space-6);
}
.cw-mark svg {
  width: 28px;
  height: 28px;
}

.cw-eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pal);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.cw-card h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.625rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-5);
  color: var(--ink);
  text-wrap: balance;
}

.cw-card p {
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 var(--space-4);
}

.cw-card .cw-meta {
  font-size: var(--text-sm);
  color: var(--ink-3);
  padding: var(--space-4);
  background: var(--paper-2);
  border-left: 3px solid var(--rule-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: var(--space-5) 0 var(--space-6);
}

.cw-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--space-6);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 40px;
  padding: 12px 22px;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-primary:hover { background: var(--ink-2); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible {
  outline: 2px solid var(--pal);
  outline-offset: 2px;
}
.btn-ghost {
  color: var(--ink-3);
  text-decoration: none;
  font-size: var(--text-sm);
  padding: 12px 8px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.btn-ghost:hover {
  color: var(--ink);
  border-bottom-color: var(--rule-2);
}

.cw-foot {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px dashed var(--rule);
  font-size: var(--text-xs);
  color: var(--ink-4);
  font-style: italic;
  font-family: var(--font-display);
}

/* ========== Gallery ========== */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-16);
}

.photo {
  margin: 0;
  background: #fcfaf6;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.photo:hover {
  border-color: var(--rule-2);
  box-shadow: 0 8px 28px -12px rgba(28, 25, 23, 0.18);
}
.photo.wide {
  grid-column: 1 / -1;
}

.photo img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--paper-3);
}

.photo figcaption {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.cap-loc {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.cap-date {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.photo figcaption p {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--ink-2);
  margin: var(--space-2) 0 0;
}
.cap-credit {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--rule);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--ink-4);
  line-height: 1.5;
}
.cap-credit a {
  color: var(--ink-3);
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 3px;
}
.cap-credit a:hover {
  color: var(--pal);
  text-decoration-color: var(--pal);
}

/* ========== Note panel ========== */
.note-panel {
  margin-bottom: var(--space-16);
  padding: var(--space-8);
  background: #fcfaf6;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  max-width: 820px;
}
.note-panel h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-4);
  color: var(--ink);
}
.note-panel p {
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 var(--space-4);
}
.note-panel p:last-child { margin-bottom: 0; }
.note-panel em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink);
}
.note-panel a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 3px;
}
.note-panel a:hover {
  color: var(--pal);
  text-decoration-color: var(--pal);
}

/* ========== Responsive ========== */
@media (max-width: 980px) {
  .gallery { grid-template-columns: 1fr; }
  .cw-card { padding: var(--space-8) var(--space-6) var(--space-6); }
}
@media (max-width: 640px) {
  .cw-gate { padding: var(--space-4); }
  .cw-card { padding: var(--space-6) var(--space-5) var(--space-5); }
  .cw-mark { width: 48px; height: 48px; margin-bottom: var(--space-4); }
  .cw-mark svg { width: 24px; height: 24px; }
  .cw-actions { flex-direction: column; align-items: stretch; }
  .btn-primary { width: 100%; }
  .btn-ghost { text-align: center; }
  .photo figcaption { padding: var(--space-4); }
  .note-panel { padding: var(--space-5); }
}
