/* Public Image section visual kit (#1099). Rotary colours, workshop-slide look.
   Components: pi-panel, pi-stats, pi-tiles, pi-dodont, pi-steps, pi-timeline, pi-swatches. */
:root {
  --pi-royal: #17458f;
  --pi-gold: #f7a81b;
  --pi-azure: #0067c8;
  --pi-sky: #00a2e0;
  --pi-do: #009739;
  --pi-dont: #e02927;
  --pi-tint: #eef3fa;
}

/* Slide-style panel: Royal Blue band, gold eyebrow, big statement */
.pi-panel {
  background: var(--pi-royal);
  color: #fff;
  border-radius: var(--radius, 12px);
  padding: 28px 28px 26px;
  margin: 20px 0;
  overflow: hidden;
}
.pi-panel--photo {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 24px;
  align-items: center;
}
.pi-panel--photo img { width: 100%; height: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; }
.pi-eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--pi-gold); margin-bottom: 8px; }
.pi-statement { font-size: clamp(1.35rem, 3.2vw, 1.9rem); font-weight: 800; line-height: 1.2; color: #fff; }
.pi-panel p:not(.pi-eyebrow):not(.pi-statement) { color: rgba(255, 255, 255, 0.88); margin-top: 10px; }
.pi-panel a { color: var(--pi-gold); }

/* Stat tiles */
.pi-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 18px 0; }
.pi-stat { background: var(--pi-tint); border-top: 4px solid var(--pi-gold); border-radius: 8px; padding: 14px 16px; }
.pi-panel .pi-stat { background: rgba(255, 255, 255, 0.12); }
.pi-stat-num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--pi-royal); }
.pi-panel .pi-stat-num { color: var(--pi-gold); }
.pi-stat-label { font-size: 0.92rem; margin-top: 4px; }
.pi-stat-asat { font-size: 0.75rem; color: var(--muted, #555); margin-top: 6px; }
.pi-panel .pi-stat-asat { color: rgba(255, 255, 255, 0.7); }

/* Landing tiles */
.pi-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 20px 0 28px; }
.pi-tile {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--card-bg, #fff); border: 1px solid var(--border, #e8e6e2); border-radius: var(--radius, 12px);
  overflow: hidden; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pi-tile:hover, .pi-tile:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(23, 69, 143, 0.15); }
.pi-tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.pi-tile-title { font-weight: 700; color: var(--pi-royal); padding: 12px 14px 2px; font-size: 1.05rem; }
.pi-tile-desc { font-size: 0.9rem; color: var(--muted, #555); padding: 0 14px 14px; }

/* Do and don't pairs: label in text and colour, never colour alone */
.pi-dodont { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 18px 0; }
.pi-do, .pi-dont { border: 3px solid; border-radius: 10px; padding: 14px; background: #fff; }
.pi-do { border-color: var(--pi-do); }
.pi-dont { border-color: var(--pi-dont); }
.pi-do::before, .pi-dont::before {
  display: inline-block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; border-radius: 4px; padding: 2px 8px; margin-bottom: 10px;
}
.pi-do::before { content: "Do"; background: var(--pi-do); }
.pi-dont::before { content: "Don't"; background: var(--pi-dont); }
.pi-do img, .pi-dont img { width: 100%; border-radius: 6px; display: block; margin-bottom: 8px; }
.pi-quote { font-size: 1.05rem; font-style: italic; padding: 6px 0; }

/* Numbered steps */
ol.pi-steps { list-style: none; counter-reset: pi-step; margin: 18px 0; padding: 0; }
ol.pi-steps > li { counter-increment: pi-step; position: relative; padding: 0 0 18px 52px; min-height: 40px; }
ol.pi-steps > li::before {
  content: counter(pi-step); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--pi-royal); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
ol.pi-steps > li:last-child::before { background: var(--pi-gold); color: var(--pi-royal); }
ol.pi-steps img { display: block; max-width: 100%; margin-top: 10px; border: 1px solid var(--border, #e8e6e2); border-radius: 8px; }
.pi-steps-todo { display: inline-block; margin-top: 6px; font-size: 0.8rem; color: var(--muted, #555); border: 1px dashed var(--border, #ccc); border-radius: 6px; padding: 2px 8px; }

/* Timeline of moments: across on desktop, down on phones */
.pi-timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; counter-reset: pi-moment; }
.pi-moment { counter-increment: pi-moment; background: var(--pi-tint); border-radius: 8px; padding: 14px; position: relative; }
.pi-moment::before { content: counter(pi-moment); display: block; font-size: 1.6rem; font-weight: 800; color: var(--pi-gold); line-height: 1; margin-bottom: 6px; }
.pi-moment strong { display: block; color: var(--pi-royal); }
.pi-moment span { font-size: 0.88rem; }

/* Colour swatches with copy buttons */
.pi-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.pi-swatch { border: 1px solid var(--border, #e8e6e2); border-radius: 8px; overflow: hidden; background: #fff; }
.pi-swatch-chip { height: 64px; }
.pi-swatch--lg { grid-column: span 2; }
.pi-swatch--lg .pi-swatch-chip { height: 110px; }
.pi-swatch-name { font-weight: 700; padding: 8px 10px 0; font-size: 0.92rem; }
.pi-swatch-codes { font-size: 0.78rem; color: var(--muted, #555); padding: 2px 10px 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pi-swatch-code { font-family: Consolas, monospace; user-select: all; }
.pi-copy { font: inherit; font-size: 0.72rem; border: 1px solid var(--border, #ccc); background: #fff; border-radius: 4px; padding: 1px 6px; cursor: pointer; }
.pi-copy-msg { font-size: 0.72rem; color: var(--pi-royal); }

@media (max-width: 600px) {
  .pi-panel { padding: 20px; }
  .pi-panel--photo { grid-template-columns: 1fr; }
  .pi-swatch--lg { grid-column: auto; }
}

/* Image gallery (monthly theme graphics) */
.pi-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 18px 0; }
.pi-gallery figure { margin: 0; }
.pi-gallery img { width: 100%; border-radius: 8px; border: 1px solid var(--border, #e8e6e2); display: block; }
.pi-gallery figcaption { font-size: 0.82rem; margin-top: 4px; }

/* Long email addresses and links must wrap on small phones */
ol.pi-steps > li, .pi-panel p, .pi-dodont p { overflow-wrap: anywhere; }
.pi-stat-label { overflow-wrap: break-word; }

/* Posters and covers are shown whole, never cropped */
.pi-panel--photo img.pi-contain { object-fit: contain; max-height: 380px; height: auto; background: transparent; }

/* Rows that read as one line on desktop (Keiran: "all one line"); they wrap on phones */
@media (min-width: 800px) {
  .pi-stats--row, .pi-timeline { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .pi-stats--row .pi-stat { padding: 12px 10px; }
  .pi-stats--row .pi-stat-num { font-size: 1rem; }
  .pi-stats--row .pi-stat-label { font-size: 0.85rem; }
  .pi-timeline .pi-moment { padding: 12px 10px; }
  .pi-timeline .pi-moment strong { font-size: 0.95rem; }
  .pi-timeline .pi-moment span { font-size: 0.82rem; }
}

/* Next button at the foot of every Public Image guide */
.pi-next-wrap { margin: 32px 0 8px; }
.pi-next {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 16px;
  background: var(--pi-royal); color: #fff; text-decoration: none; border-radius: var(--radius, 12px); padding: 18px 22px;
  transition: background 0.15s ease;
}
.pi-next:hover, .pi-next:focus-visible { background: #0f2f63; }
.pi-next-label { grid-column: 1; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pi-gold); }
.pi-next-title { grid-column: 1; font-size: 1.15rem; font-weight: 700; color: #fff; }
.pi-next-arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 1.8rem; color: var(--pi-gold); }
