/* Welma Carità — identità raku: nero fumo, terracotta, cenere, rame ossidato */

:root {
  --ink: #1a1614;
  --smoke: #2a2320;
  --ash: #e8e2d8;
  --ash-warm: #f2ede4;
  --terracotta: #b5654a;
  --terracotta-dark: #8f4c37;
  --copper: #8a6d4f;
  --copper-light: #b8987a;
  --cream-text: #ddd4c8;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-caption: "Inter", sans-serif;

  --max-width: 1080px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream-text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--terracotta); text-decoration: none; }
a:hover, a:focus-visible { color: var(--copper-light); text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 3px; }

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

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ash-warm); margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

/* ---------- Header / Nav ---------- */

.site-header {
  border-bottom: 1px solid rgba(184, 152, 122, 0.25);
  background: linear-gradient(180deg, var(--smoke), var(--ink));
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ash-warm);
  letter-spacing: 0.01em;
}
.brand span { color: var(--terracotta); }

nav.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  color: var(--cream-text);
  font-size: 0.92rem;
  padding: 0.5rem 0.8rem;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

nav.main-nav a:hover,
nav.main-nav a:focus-visible {
  background: rgba(181, 101, 74, 0.18);
  color: var(--terracotta);
  text-decoration: none;
}

nav.main-nav a.active {
  color: var(--terracotta);
  font-weight: 600;
}

/* ---------- Layout ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--copper-light);
  font-family: var(--font-caption);
  margin-bottom: 0.6rem;
  display: block;
}

/* ---------- Homepage hero / memorial ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-bottom: 3rem;
}

@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .hero img { max-width: 240px; margin: 0 auto; }
}

.memorial {
  border-left: 3px solid var(--terracotta);
  background: rgba(181, 101, 74, 0.08);
  padding: 1.3rem 1.5rem;
  border-radius: 0 4px 4px 0;
  margin: 1.5rem 0;
  font-style: normal;
}

.memorial em { color: var(--copper-light); font-style: italic; }

.site-footer {
  border-top: 1px solid rgba(184, 152, 122, 0.2);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--copper-light);
}

/* ---------- Gallery hub ---------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-card {
  position: relative;
  display: block;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--smoke);
  border: 1px solid rgba(184, 152, 122, 0.15);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
  filter: saturate(0.85) brightness(0.85);
}

.category-card:hover img,
.category-card:focus-visible img {
  transform: scale(1.06);
  filter: saturate(1) brightness(0.95);
}

/* craquelé hover seam */
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(232, 226, 216, 0);
  transition: box-shadow 0.4s ease;
}
.category-card:hover::after,
.category-card:focus-visible::after {
  box-shadow: inset 0 0 0 1px rgba(232, 226, 216, 0.35);
}

.category-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 0.9rem 1rem 0.7rem;
  background: linear-gradient(180deg, transparent, rgba(10, 8, 7, 0.92));
  color: var(--ash-warm);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.category-count {
  display: block;
  font-family: var(--font-caption);
  font-size: 0.72rem;
  color: var(--copper-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

/* ---------- Photo grid inside a category ---------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.photo-grid button {
  padding: 0;
  border: 1px solid rgba(184, 152, 122, 0.2);
  background: var(--smoke);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
}

.photo-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-grid button:hover img,
.photo-grid button:focus-visible img {
  transform: scale(1.08);
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--copper-light);
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 8, 7, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.lightbox.open { display: flex; }

.lightbox-content {
  max-width: 900px;
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-content img {
  max-height: 68vh;
  width: auto;
  margin: 0 auto;
  border-radius: 3px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-caption {
  color: var(--cream-text);
  text-align: center;
  font-size: 0.95rem;
  max-width: 640px;
}

.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--copper-light);
  color: var(--ash-warm);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(181, 101, 74, 0.2); }

.lightbox-vr-link {
  font-size: 0.85rem;
  color: var(--terracotta);
}

/* ---------- 360 viewer ---------- */

.vr-viewer {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  cursor: grab;
  user-select: none;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(184, 152, 122, 0.25);
  background: var(--smoke);
}
.vr-viewer:active { cursor: grabbing; }
.vr-viewer img { width: 100%; pointer-events: none; }

.vr-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--copper-light);
  margin-top: 0.6rem;
}

.vr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}

.vr-item h3 { text-align: center; }

/* ---------- misc content pages ---------- */

.content-block { max-width: 720px; }
.content-block ul { padding-left: 1.2rem; }
.content-block li { margin-bottom: 0.5rem; }

.links-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}
.links-list .link-card {
  border: 1px solid rgba(184, 152, 122, 0.2);
  border-radius: 5px;
  padding: 1rem;
  background: rgba(255,255,255,0.02);
}
.links-list img { margin-bottom: 0.6rem; }
