/* projects.css — project list, project detail, gallery, user stories, README card */

/* ── PROJECTS ── */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.projects-groups { display: flex; flex-direction: column; gap: 2.6rem; }
.projects-subheading {
  font-size: 13px;
  color: var(--tan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 1rem;
}
.proj-card {
  background: var(--warm); border: 0.5px solid var(--cream-light);
  border-radius: 16px; overflow: hidden;
  cursor: pointer; transition: transform 0.25s, box-shadow 0.25s;
}
.proj-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(61,43,26,0.12); }
.proj-thumb {
  width: 100%; height: 160px; background: var(--sage);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; position: relative; overflow: hidden;
}
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-body { padding: 1rem 1.1rem 1.2rem; }
.proj-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.proj-tag { font-size: 11px; background: var(--cream-light); color: var(--brown); padding: 3px 10px; border-radius: 20px; font-weight: 500; }
.proj-title { font-family: 'Playfair Display', serif; font-size: 1rem; font-weight: 600; color: var(--dark); margin-bottom: 5px; }
.proj-desc { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ── PROJECT DETAIL ── */
.proj-detail { display: none; }
.proj-detail.open { display: block; animation: fadeUp 0.4s ease forwards; }
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--tan); font-size: 13px; font-weight: 500;
  padding: 0; margin-bottom: 1.5rem; font-family: 'DM Sans', sans-serif;
}
.back-btn:hover { color: var(--brown); }
.detail-hero {
  width: 100%; height: 220px; background: var(--sage);
  border-radius: 16px; margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px; overflow: hidden; position: relative;
}
.detail-hero img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.detail-title { font-family: 'Playfair Display', serif; font-size: 1.8rem; font-weight: 600; color: var(--dark); margin-bottom: 8px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.2rem; }
.detail-section { margin-bottom: 1.5rem; }
.detail-section h3 { font-size: 13px; color: var(--tan); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; margin-bottom: 8px; }
.detail-section p { font-size: 14px; color: var(--muted); line-height: 1.75; }
.detail-section ul { padding-left: 1.2rem; }
.detail-section ul li { font-size: 14px; color: var(--muted); line-height: 1.75; margin-bottom: 4px; }
.detail-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--dark); color: var(--cream);
  padding: 10px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
  text-decoration: none; border: none; cursor: pointer;
  margin-top: 8px; margin-right: 8px; transition: background 0.2s;
}
.detail-link:hover { background: var(--tan); }
.detail-link.outline { background: transparent; border: 0.5px solid var(--dark); color: var(--dark); }
.detail-link.outline:hover { background: var(--warm); }

/* ── TABLEAU EMBED ── */
.tableau-embed {
  width: 100%; border-radius: 12px; overflow: hidden;
  border: 0.5px solid var(--cream-light); background: var(--warm);
}

/* ── FIELD NOTE STORIES ── */
.field-note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 20px 4px 8px;
}
.field-note-card {
  display: flex;
  gap: 14px;
  background: var(--warm);
  border: 1px solid var(--tan);
  border-radius: 4px;
  padding: 1.1rem 1.2rem 1.1rem 1.4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.field-note-card:hover {
  transform: translateY(-3px);
  box-shadow: 3px 8px 18px rgba(61,43,26,0.12);
}
.field-note-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.3;
  font-size: 11px;
  font-weight: 600;
  color: var(--brown);
  letter-spacing: 0.03em;
  font-family: 'DM Sans', sans-serif;
  flex-shrink: 0;
}
.field-note-body { flex: 1; min-width: 0; }
.field-note-quote {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 14px;
  color: var(--dark);
  line-height: 1.6;
  margin-bottom: 10px;
}
.field-note-divider {
  height: 1px;
  background: var(--sage);
  margin-bottom: 8px;
}
.field-note-ac {
  list-style: none;
  padding: 0; margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.9;
}
.field-note-ac li::before {
  content: '✓';
  color: var(--brown);
  margin-right: 6px;
}

@media (max-width: 768px) {
  .field-note-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .field-note-card { padding: 1rem 1.1rem 1rem 1.2rem; }
}

/* ── README CARD (tech mode project deep-dive) ── */
.readme-card {
  border-radius: 14px;
  background: #fffdf7;
  border: 1px solid var(--tan);
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(61,43,26,0.1);
}
.readme-card-topbar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: var(--warm);
  border-bottom: 1px solid var(--tan);
}
.readme-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tan); opacity: 0.55; }
.readme-dot:nth-child(1) { background: #d4a373; }
.readme-dot:nth-child(2) { background: #ccd5ae; }
.readme-dot:nth-child(3) { background: #a07850; }
.readme-more-link {
  display: block;
  text-align: right;
  padding: 0 1.6rem 1.4rem;
  font-size: 13px;
  font-weight: 500;
  color: var(--brown);
  text-decoration: none;
}
.readme-more-link:hover { text-decoration: underline; }

.markdown-body {
  padding: 1.5rem 1.6rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.75;
  color: var(--dark);
}
.markdown-body h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--dark);
  margin: 0 0 0.6em;
  border-bottom: 2px solid var(--tan);
  padding-bottom: 0.4em;
}
.markdown-body h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--brown);
  margin: 1.8em 0 0.7em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--tan);
}
.markdown-body h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--dark);
  margin: 1.4em 0 0.5em;
  padding-left: 0.65em;
  border-left: 3px solid var(--sage);
}
.markdown-body p { margin-bottom: 1em; color: var(--dark); }
.markdown-body ul, .markdown-body ol { padding-left: 1.4rem; margin-bottom: 1em; color: var(--dark); }
.markdown-body li { margin-bottom: 0.3em; }
.markdown-body em, .markdown-body i {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--brown);
}

.markdown-body strong { color: var(--dark); font-weight: 600; }
.markdown-body a { color: var(--brown); text-decoration: underline; text-underline-offset: 2px; }
.markdown-body blockquote {
  margin: 1em 0;
  padding: 0.6em 1em;
  border-left: 3px solid var(--sage);
  background: var(--warm);
  color: var(--dark);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  font-family: 'Playfair Display', serif;
}
.markdown-body code {
  font-family: 'DM Mono', monospace;
  background: var(--warm);
  color: var(--brown);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}
.markdown-body pre {
  background: var(--dark);
  color: var(--cream);
  padding: 1em 1.2em;
  border-radius: 10px;
  overflow-x: auto;
  margin-bottom: 1em;
}
.markdown-body pre code {
  background: none;
  color: var(--cream);
  padding: 0;
}
.markdown-body table { width: 100%; border-collapse: collapse; margin-bottom: 1em; font-size: 13px; }
.markdown-body th, .markdown-body td { border: 1px solid var(--tan); padding: 0.5em 0.8em; text-align: left; }
.markdown-body th { background: var(--warm); color: var(--dark); }
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 0.5em 0; }
.markdown-body hr { border: none; border-top: 1px solid var(--tan); margin: 1.5em 0; }

/* ── PROJECT GALLERY ──
   Stacked cards: the front picture holds, the next one waits just behind it,
   and slides forward as the front one drifts out to the left. */
.gallery { margin-bottom: 1.5rem; }
.gallery-stage { position: relative; width: 100%; height: 240px; }
.gallery.is-stack .gallery-stage { width: calc(100% - 28px); }
.gallery-card {
  position: absolute; inset: 0;
  border-radius: 16px; overflow: hidden; background: var(--sage);
  border: 0.5px solid var(--cream-light);
  box-shadow: 0 8px 24px rgba(61,43,26,0.14);
  transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.5s ease;
}
.gallery-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-card[data-pos="front"] { transform: none; opacity: 1; z-index: 3; }
.gallery-card[data-pos="next"]  { transform: translate(26px, -6px) rotate(2.2deg); opacity: 0.95; z-index: 2; cursor: pointer; }
.gallery-card[data-pos="far"]   { transform: translate(40px, -10px) rotate(3.5deg) scale(0.97); opacity: 0; z-index: 1; pointer-events: none; }
.gallery-card[data-pos="out"]   { transform: translateX(-14%) rotate(-3deg); opacity: 0; z-index: 4; pointer-events: none; }
.gallery-dots { display: flex; gap: 6px; margin-top: 14px; }
.gallery-dot {
  width: 7px; height: 7px; border-radius: 4px; border: none; padding: 0;
  background: var(--tan); opacity: 0.4; cursor: pointer;
  transition: width 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}
.gallery-dot.on { width: 20px; opacity: 1; background: var(--brown); }
@media (prefers-reduced-motion: reduce) { .gallery-card { transition: opacity 0.3s ease; } }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .projects-grid { grid-template-columns: 1fr; }
  .gallery-stage { height: 200px; }
}