/* ═══════════════════════════════════════════════════════════════
   SHP-ART Projects — Bento Grid + Atmospheric Hero
   ═══════════════════════════════════════════════════════════════ */

:root {
  --gold: #c8a46e;
  --gold-light: #e0c08a;
  --gold-dim: rgba(200,164,110,0.15);
  --gold-glow: rgba(200,164,110,0.08);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── HERO ──────────────────────────────────────────────────────── */

.projects-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 2rem 4rem;
  overflow: hidden;
  z-index: 1;
}

/* Schaltkreis-Muster + Gradient */
.projects-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cg fill='none' stroke='rgba(200,164,110,0.10)' stroke-width='1'%3E%3Crect x='10' y='10' width='20' height='20' rx='2'/%3E%3Crect x='90' y='90' width='20' height='20' rx='2'/%3E%3Crect x='55' y='30' width='14' height='14' rx='2'/%3E%3Cline x1='30' y1='20' x2='55' y2='20'/%3E%3Cline x1='69' y1='37' x2='69' y2='60'/%3E%3Cline x1='55' y1='60' x2='90' y2='60'/%3E%3Cline x1='90' y1='60' x2='90' y2='90'/%3E%3Ccircle cx='30' cy='20' r='2.5' fill='rgba(200,164,110,0.25)'/%3E%3Ccircle cx='69' cy='60' r='2.5' fill='rgba(200,164,110,0.25)'/%3E%3Ccircle cx='90' cy='60' r='2.5' fill='rgba(200,164,110,0.25)'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(200,164,110,0.07) 0%, transparent 70%),
    linear-gradient(180deg, #050505 0%, #0a0804 60%, #050505 100%);
  background-size: 120px 120px, 100% 100%, 100% 100%;
  z-index: 0;
}

/* Goldene Linie unten am Hero */
.projects-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.projects-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  animation: heroFadeIn 0.9s var(--ease-out) both;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.projects-hero-label {
  font-size: 0.7rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.7;
  margin-bottom: 1rem;
}

.projects-hero h1 {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 700;
  color: #f0ebe3;
  letter-spacing: -0.01em;
  line-height: 1;
  margin-bottom: 1.25rem;
}

.projects-hero h1 span {
  color: var(--gold);
}

.projects-hero p {
  color: rgba(255,255,255,0.38);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  max-width: 420px;
  margin: 0 auto;
}

/* ─── BENTO GRID ────────────────────────────────────────────────── */

.projects-section {
  padding: 3rem 1.5rem 7rem;
  max-width: 1280px;
  margin: 0 auto;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 260px;
  gap: 1rem;
}

/* Featured: erstes Projekt nimmt 2×2 ein */
.project-card:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

/* Zweites + drittes Projekt: je 2×1 */
.project-card:nth-child(2),
.project-card:nth-child(3) {
  grid-column: span 2;
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(200,164,110,0.1);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
  background: #0c0b09;
  opacity: 0;
  animation: cardReveal 0.7s var(--ease-out) forwards;
}

/* Gestaffelte Einblende-Animation */
.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.12s; }
.project-card:nth-child(3) { animation-delay: 0.19s; }
.project-card:nth-child(4) { animation-delay: 0.26s; }
.project-card:nth-child(5) { animation-delay: 0.33s; }
.project-card:nth-child(6) { animation-delay: 0.40s; }
.project-card:nth-child(7) { animation-delay: 0.47s; }
.project-card:nth-child(8) { animation-delay: 0.54s; }

@keyframes cardReveal {
  from { opacity: 0; transform: scale(0.97) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Hintergrundbild füllt die gesamte Karte */
.project-card-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s var(--ease-out);
  z-index: 0;
}

.project-card:hover .project-card-image {
  transform: scale(1.05);
}

/* Placeholder wenn kein Bild */
.project-card-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(200,164,110,0.03) 0px,
      rgba(200,164,110,0.03) 1px,
      transparent 1px,
      transparent 20px
    ),
    #0c0b09;
  color: rgba(200,164,110,0.15);
  font-size: 3.5rem;
  z-index: 0;
}

/* Gradient-Overlay: Text am unteren Rand */
.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(5,4,2,0.95) 0%,
    rgba(5,4,2,0.5) 40%,
    transparent 70%
  );
  z-index: 1;
  transition: opacity 0.4s ease;
}

/* Hover: Overlay etwas heller für Bildwirkung */
.project-card:hover::before {
  opacity: 0.88;
}

/* Goldener Rand-Akzent bei Hover */
.project-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(200,164,110,0);
  border-radius: 6px;
  transition: border-color 0.35s ease;
  z-index: 2;
  pointer-events: none;
}

.project-card:hover::after {
  border-color: rgba(200,164,110,0.35);
}

/* Text-Körper: immer sichtbar am unteren Rand */
.project-card-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1.4rem 1.4rem;
  z-index: 3;
  transform: translateY(4px);
  transition: transform 0.4s var(--ease-out);
}

.project-card:hover .project-card-body {
  transform: translateY(0);
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}

.project-tag {
  font-size: 0.65rem;
  padding: 0.12rem 0.45rem;
  background: rgba(200,164,110,0.15);
  border: 1px solid rgba(200,164,110,0.25);
  border-radius: 20px;
  color: var(--gold-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.project-card-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  font-weight: 600;
  color: #f0ebe3;
  margin-bottom: 0.4rem;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* Featured-Karte: größere Schrift */
.project-card:first-child .project-card-title {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
}

.project-card-summary {
  color: rgba(240,235,227,0.65);
  font-size: 0.85rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s var(--ease-out), opacity 0.4s ease;
}

.project-card:hover .project-card-summary {
  max-height: 4rem;
  opacity: 1;
}

/* Featured-Karte: Summary immer sichtbar */
.project-card:first-child .project-card-summary {
  max-height: 4rem;
  opacity: 1;
}

.project-card-meta {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: rgba(200,164,110,0.5);
  letter-spacing: 0.03em;
}

/* ─── RESPONSIVE ────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }
  .project-card:first-child {
    grid-column: span 2;
    grid-row: span 1;
  }
  .project-card:nth-child(2),
  .project-card:nth-child(3) {
    grid-column: span 1;
  }
}

@media (max-width: 540px) {
  .projects-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 240px;
  }
  .project-card:first-child,
  .project-card:nth-child(2),
  .project-card:nth-child(3) {
    grid-column: span 1;
    grid-row: span 1;
  }
  .projects-hero h1 {
    font-size: clamp(2.2rem, 12vw, 3rem);
  }
}

/* ─── EMPTY STATE ──────────────────────────────────────────────── */

.projects-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: rgba(232,228,223,0.25);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

/* ─── DETAIL PAGE ──────────────────────────────────────────────── */

.project-detail-hero {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.project-detail-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

.project-detail-header {
  margin-bottom: 2rem;
}

.project-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.project-detail-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--gold);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.project-detail-meta {
  color: rgba(232,228,223,0.4);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.project-detail-summary {
  font-size: 1.1rem;
  color: rgba(232,228,223,0.7);
  line-height: 1.7;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(200,164,110,0.15);
}

/* Markdown content */
.project-detail-content {
  color: rgba(232,228,223,0.85);
  line-height: 1.8;
  font-size: 1rem;
}
.project-detail-content h1,
.project-detail-content h2,
.project-detail-content h3 {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  margin: 2rem 0 0.75rem;
}
.project-detail-content h2 { font-size: 1.4rem; }
.project-detail-content h3 { font-size: 1.1rem; }
.project-detail-content p { margin-bottom: 1rem; }
.project-detail-content ul,
.project-detail-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.project-detail-content li { margin-bottom: 0.25rem; }
.project-detail-content a { color: var(--gold); }
.project-detail-content code {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
  font-family: 'Fira Code', 'Courier New', monospace;
}
.project-detail-content pre {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.project-detail-content pre code {
  background: none;
  border: none;
  padding: 0;
}
.project-detail-content blockquote {
  border-left: 3px solid rgba(200,164,110,0.4);
  padding-left: 1rem;
  color: rgba(232,228,223,0.5);
  margin: 1rem 0;
}

/* Project gallery */
.project-gallery {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(200,164,110,0.15);
}

.project-gallery h2 {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.project-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.project-gallery-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  cursor: zoom-in;
  transition: opacity 0.2s;
}

.project-gallery-grid img:hover { opacity: 0.85; }

/* Project links */
.project-links {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid rgba(200,164,110,0.3);
  border-radius: 4px;
  color: var(--gold);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}
.project-link-btn:hover {
  background: rgba(200,164,110,0.1);
  border-color: rgba(200,164,110,0.6);
}

/* Loading/Error states */
.loading-state, .error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 2rem;
  color: rgba(232,228,223,0.25);
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}
