/* DETAIL PAGES — shared by gallery.html and project.html */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

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

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.2s, color 0.2s;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 88px 48px 96px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}
.layout-grid { flex: 1 0 auto; }

/* DESKTOP TWO-COLUMN LAYOUT: intro sidebar left, gallery board right */
@media (min-width: 1025px) {
  .page { max-width: 1280px; }
  .layout-grid {
    display: grid;
    grid-template-columns: minmax(300px, 380px) 1fr;
    column-gap: 64px;
    align-items: start;
  }
  .col-side .section-label { margin-top: 0; }

  /* sidebar is too narrow for side-by-side label/value + wrapping tags */
  .col-main .prop-row { flex-direction: column; }
  .col-main .prop-key {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 6px 12px;
  }
  .col-main .prop-val { padding: 8px 12px 12px; }
}

.page-icon {
  width: auto;
  height: 64px;
  max-width: min(280px, 72vw);
  margin-bottom: 14px;
  object-fit: contain;
  display: block;
}
.page-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
  max-width: 760px;
}
.page-subtitle {
  font-size: 14px;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.75;
}

.properties {
  border: 1px solid var(--border);
  border-radius: 6px;
  margin: 28px 0 34px;
  overflow: hidden;
}
.prop-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.prop-row:last-child { border-bottom: none; }
.prop-key {
  width: 156px;
  flex-shrink: 0;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg2);
  border-right: 1px solid var(--border);
}
.prop-val {
  flex: 1;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
}
.prop-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
}
.tag-blue { background: var(--tag-blue-bg); color: var(--accent); }
.tag-green { background: var(--tag-green-bg); color: var(--accent2); }

.page-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.gallery-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  min-height: 180px;
}
.gallery-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}
.gallery-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg2);
  aspect-ratio: 4 / 3;
}
.gallery-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}
.gallery-card:hover .gallery-frame img {
  transform: scale(1.04);
  filter: saturate(1.04);
}

footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 1024px) {
  .page { padding: 88px 32px 80px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .page { padding: 80px 24px 64px; }
  .page-title { font-size: 30px; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prop-key { width: 130px; }
}

@media (max-width: 480px) {
  .page { padding: 68px 16px 48px; }
  .page-icon { height: 48px; }
  .page-title { font-size: 24px; }
  .page-subtitle { font-size: 13px; }
  .prop-row { flex-direction: column; }
  .prop-key {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 6px 12px;
  }
  .prop-val { padding: 6px 12px 10px; }
  .gallery-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 10px; text-align: center; }
}

@media (hover: none), (pointer: coarse) {
  .gallery-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
  }
  .gallery-card:hover .gallery-frame img {
    transform: none;
    filter: none;
  }
}
