/* Phase 5 — public portfolio styles.
 * Builds on /research/research.css for the cream-paper palette + Georgia
 * display serif; adds portfolio-specific surface styles (index cards,
 * mosaic, editorial lightbox card).
 */

/* Public nav chrome: research.css .public-topbar (shared with homepage). */
.pagefoot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
  font-family: var(--font-meta);
  font-size: 12.5px;
  color: var(--muted);
}

.state {
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--muted);
  padding: 32px 0;
  text-align: left;
}
.state.error { color: #b04a2f; }

/* ── Portfolio index ──────────────────────────────────────────── */
/* Shell + intro type: research.css main.public-page */

.p-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin: 32px 0 0;
}
@media (max-width: 900px) { .p-grid { grid-template-columns: repeat(2, 1fr); gap: 22px; } }
@media (max-width: 600px) { .p-grid { grid-template-columns: 1fr; gap: 18px; } }
.p-card {
  display: grid;
  grid-template-rows: 200px auto;
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  border-radius: 4px;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.p-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); }
.p-card-thumb {
  display: block;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--paper-deep);
}
.p-card-body { display: block; padding: 18px 22px 20px; }
.p-card-name { display: block; font-family: var(--font-display); font-size: 20px; color: var(--ink); letter-spacing: -0.005em; }
.p-card-loc  { display: block; font-family: var(--font-meta); font-size: 11.5px; letter-spacing: 0.06em; color: var(--accent); margin: 4px 0 10px; }
.p-card-brief { display: block; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

/* Text-only variant — no photograph for this garden yet, so the card
   leans into the prose. A quiet cream panel with a serif initial sits
   where the photograph would. Dignified, not "broken-looking". */
.p-card.text-only { background: var(--cream); border: 1px solid var(--line); }
.p-card.text-only .p-card-thumb {
  background: var(--paper);
  position: relative;
  border-bottom: 1px solid var(--line);
}
.p-card.text-only .p-card-thumb::before {
  content: attr(data-initial);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 500;
  color: var(--accent-soft);
  letter-spacing: -0.02em;
  line-height: 1;
}
.p-card.text-only .p-card-thumb::after {
  content: "Text only";
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-meta);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.p-card.text-only .p-card-brief { -webkit-line-clamp: 6; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Per-garden page ──────────────────────────────────────────── */
main.garden-page { max-width: 1180px; margin: 0 auto; padding: 56px var(--gutter) 80px; }

/* Breadcrumb: Home / Portfolio / Garden name */
main.garden-page .breadcrumb {
  margin: 0 0 28px;
}
main.garden-page .breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-meta);
  font-size: 12.5px;
  color: var(--muted);
}
main.garden-page .breadcrumb li {
  display: inline-flex;
  align-items: center;
}
main.garden-page .breadcrumb li:not(:last-child)::after {
  content: "/";
  margin: 0 10px;
  color: var(--line);
  speak: none;
}
main.garden-page .breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}
main.garden-page .breadcrumb a:hover {
  color: var(--accent);
}
main.garden-page .breadcrumb li[aria-current="page"] {
  color: var(--ink-soft);
}

main.garden-page .eyebrow { font-family: var(--font-meta); font-size: 11.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
main.garden-page h1 { font-family: var(--font-display); font-size: 42px; font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 22px; max-width: 28ch; }
main.garden-page .lede { font-size: 19px; line-height: 1.55; color: var(--ink-soft); margin: 0 0 28px; max-width: 64ch; font-style: italic; }
main.garden-page p.garden-body { font-size: 16.5px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 18px; max-width: 68ch; }
main.garden-page p.garden-body:last-of-type { margin-bottom: 0; }
main.garden-page .text-only-flourish {
  margin: 48px 0 24px;
  padding: 24px 28px;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  font-family: var(--font-meta);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
main.garden-page .mosaic-section { margin: 56px 0 0; }
main.garden-page .mosaic-section h2 { font-family: var(--font-display); font-size: 22px; font-weight: 500; letter-spacing: -0.005em; margin: 0 0 18px; }

/* ── Mosaic ───────────────────────────────────────────────────── */
.mosaic {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 92px;
  grid-auto-flow: dense;
  gap: 6px;
  margin: 24px 0 56px;
  max-width: none;
}
.tile {
  position: relative;
  padding: 0;
  border: 0;
  background: var(--paper);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
  border-radius: 2px;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--dur-base) var(--ease); }
.tile:hover { opacity: 0.96; }
.tile:hover img { transform: scale(1.02); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-large  { grid-column: span 6; grid-row: span 5; }
.tile-wide   { grid-column: span 4; grid-row: span 3; }
.tile-tall   { grid-column: span 3; grid-row: span 4; }
.tile-square { grid-column: span 3; grid-row: span 3; }
.tile-small  { grid-column: span 2; grid-row: span 2; }

.tile-cap {
  position: absolute;
  left: 8%; bottom: 8%;
  max-width: 78%;
  background: rgba(28, 38, 28, 0.42);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border-radius: 10px;
  padding: 14px 22px 16px;
  color: #faf8f3;
  font-family: var(--font-display);
  pointer-events: none;
  transition: background var(--dur-fast) var(--ease);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.tile-cap .t { font-size: 15px; line-height: 1.25; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-cap .d { font-size: 12.5px; line-height: 1.4; color: rgba(250, 248, 243, 0.86); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-large  .tile-cap { padding: 18px 26px 20px; border-radius: 12px; max-width: 70%; }
.tile-large  .tile-cap .d { -webkit-line-clamp: 3; }
.tile-wide   .tile-cap .d, .tile-tall .tile-cap .d { -webkit-line-clamp: 1; }
.tile-square .tile-cap { padding: 11px 18px 13px; border-radius: 8px; max-width: 86%; }
.tile-square .tile-cap .t { -webkit-line-clamp: 1; }
.tile-small  .tile-cap { padding: 8px 14px 10px; border-radius: 8px; max-width: 90%; }
.tile-small  .tile-cap .t { font-size: 12px; -webkit-line-clamp: 1; }
.tile:hover .tile-cap { background: rgba(28, 38, 28, 0.58); }

@media (max-width: 1023px) {
  .mosaic { grid-template-columns: repeat(8, 1fr); grid-auto-rows: 80px; }
  .tile-large  { grid-column: span 4; grid-row: span 4; }
  .tile-wide   { grid-column: span 4; grid-row: span 3; }
  .tile-tall   { grid-column: span 2; grid-row: span 4; }
  .tile-square { grid-column: span 2; grid-row: span 3; }
  .tile-small  { grid-column: span 2; grid-row: span 2; }
  .tile-cap    { padding: 12px 18px 14px; border-radius: 10px; left: 7%; bottom: 7%; }
  .tile-cap .t { font-size: 13.5px; }
  .tile-cap .d { font-size: 11.5px; }
  .tile-small .tile-cap, .tile-square .tile-cap { padding: 9px 14px 11px; border-radius: 8px; }
}
@media (max-width: 639px) {
  .mosaic { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 80px; gap: 4px; }
  .tile-large  { grid-column: span 4; grid-row: span 3; }
  .tile-wide   { grid-column: span 4; grid-row: span 2; }
  .tile-tall   { grid-column: span 2; grid-row: span 3; }
  .tile-square { grid-column: span 2; grid-row: span 2; }
  .tile-small  { grid-column: span 2; grid-row: span 2; }
  .tile-cap    { padding: 8px 14px 10px; border-radius: 8px; max-width: 88%; left: 5%; bottom: 5%; }
  .tile-cap .t { font-size: 12px; }
  .tile-cap .d { font-size: 11px; }
  .tile-wide .tile-cap .d, .tile-tall .tile-cap .d { display: none; }
}

/* ── Lightbox (editorial card, image-relative) ────────────────── */
.lb { position: fixed; inset: 0; background: #0f0f0f; display: none; align-items: center; justify-content: center; z-index: 1000; }
.lb.open { display: flex; }
.lb-frame { position: relative; display: inline-block; max-width: 94vw; max-height: 86vh; box-shadow: 0 30px 80px rgba(0,0,0,0.6); line-height: 0; }
.lb-frame img { display: block; max-width: 94vw; max-height: 86vh; width: auto; height: auto; cursor: zoom-out; }

.lb-card {
  position: absolute;
  width: 48%;
  min-width: min(320px, calc(100% - 56px));
  max-width: 480px;
  background: rgba(250, 248, 243, 0.78);
  backdrop-filter: blur(22px) saturate(108%);
  -webkit-backdrop-filter: blur(22px) saturate(108%);
  border: 1px solid rgba(30, 30, 28, 0.08);
  border-radius: 10px;
  padding: 22px 28px 24px;
  color: #1e1e1c;
  font-family: var(--font-display);
  line-height: 1.35;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}
.lb-card[data-position="bottom-left"]  { left: 28px;  bottom: 28px; right: auto; top: auto;  }
.lb-card[data-position="bottom-right"] { right: 28px; bottom: 28px; left: auto;  top: auto;  }
.lb-card[data-position="top-left"]     { left: 28px;  top: 28px;    right: auto; bottom: auto; }
.lb-card[data-position="top-right"]    { right: 28px; top: 28px;    left: auto;  bottom: auto; }

.lb-eyebrow { font-family: var(--font-meta); font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: #7a7569; min-height: 14px; }
.lb-rule { width: 28px; height: 1px; background: rgba(30, 30, 28, 0.22); margin: 12px 0 14px; }
.lb-title { font-size: 28px; font-weight: 500; line-height: 1.22; letter-spacing: -0.01em; color: #1e1e1c; }
.lb-desc { font-family: var(--font-display); font-style: italic; font-size: 15.5px; line-height: 1.5; color: #3a3631; margin-top: 10px; }
.lb-desc[hidden] { display: none; }

.lb-counter { position: fixed; top: 28px; left: 28px; color: rgba(255,255,255,0.55); font-family: var(--font-meta); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; }
/* Curator-only: fixed chrome + link inside the caption card */
.lb-edit {
  position: fixed;
  top: 28px;
  left: 120px;
  z-index: 1001;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-meta);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.lb-edit:hover { background: rgba(255, 255, 255, 0.2); color: #fff; }
.lb-edit[hidden] { display: none; }
.lb-edit-card {
  display: inline-block;
  margin-top: 14px;
  font-family: var(--font-meta);
  font-size: 12px;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5c564c;
  text-decoration: none;
  border-bottom: 1px solid rgba(92, 86, 76, 0.35);
  padding-bottom: 1px;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.lb-edit-card:hover { color: #1e1e1c; border-color: rgba(30, 30, 28, 0.55); }
.lb-edit-card[hidden] { display: none; }
.lb-btn { position: fixed; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.08); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: rgba(255,255,255,0.92); border: 0; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); transition: background var(--dur-fast) var(--ease); }
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-close { top: 22px; right: 28px; }
.lb-prev  { left: 22px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 22px; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }

@media (max-width: 760px) {
  .lb-card { padding: 18px 22px 20px; }
  .lb-title { font-size: 22px; }
  .lb-desc { font-size: 14px; }
}
@media (max-width: 639px) {
  .lb-prev { left: 10px; } .lb-next { right: 10px; }
  .lb-close { top: 12px; right: 14px; }
  .lb-counter { top: 14px; left: 14px; }
  .lb-edit {
    top: 48px;
    left: 14px;
    font-size: 10px;
    padding: 6px 10px;
  }
  .lb-card {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    left: 12px !important; right: 12px !important;
    bottom: 12px !important; top: auto !important;
    padding: 14px 18px 16px;
  }
  .lb-title { font-size: 19px; }
  .lb-desc { font-size: 13.5px; line-height: 1.45; margin-top: 6px; }
  .lb-edit-card { margin-top: 10px; font-size: 11px; }
}
