/* brand-overrides.css — tiny tweaks on top of pico.classless. */

:root {
  --pico-form-element-spacing-vertical: 0.6rem;
}

/* Header wordmark — no underline, inherits the page color so the brand
   reads as a brand, not a link. Replaces the inline style on base.html
   so production CSP can tighten style-src toward nonce-based later. */
.brand-link {
  text-decoration: none;
  color: inherit;
}

.brand-link:hover,
.brand-link:focus {
  text-decoration: none;
  color: inherit;
}

body > header,
body > main,
body > footer {
  max-width: 800px;
  margin-inline: auto;
  /* viewport-fit=cover (base.html) lets the page paint under the notch +
     home-indicator on iOS. ``safe-area-inset-*`` pulls the layout back
     in so text doesn't render UNDER the notch. Logical properties so
     the LTR/RTL flip carries automatically. */
  padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
}

body > header {
  padding-block-start: env(safe-area-inset-top);
}

body > footer {
  padding-block-end: env(safe-area-inset-bottom);
}

/* Tab pills */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding-bottom: 0.5rem;
}

.tabs a {
  /* inline-flex + min-height 44px = Apple HIG / WCAG 2.5.5 touch target.
     Vertically center the label so the larger box doesn't look empty. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  background: transparent;
  color: var(--pico-color);
  border: 1px solid var(--pico-muted-border-color);
}

.tabs a[aria-current="page"] {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  border-color: var(--pico-primary);
}

/* Feed items */
.item {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.item:last-child {
  border-bottom: none;
}

.item .meta {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin-top: 0.15rem;
}

.empty {
  /* font-style: italic dropped 2026-06-11 (review LOW) - italic + muted
     was hard to read outdoors on iPhone. The muted color is already
     enough visual hint that this is empty-state copy. */
  color: var(--pico-muted-color);
}

/* htmx loading indicator */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  opacity: 1;
}

/* Primary nav (Feed / Clients) */
.primary-nav {
  display: flex;
  gap: 0.6rem;
  margin: 0.4rem 0 0.8rem;
  flex-wrap: wrap;
}

.primary-nav a {
  /* inline-flex + min-height 44px = Apple HIG / WCAG 2.5.5 touch target. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  color: var(--pico-color);
  border: 1px solid var(--pico-muted-border-color);
  font-size: 0.95rem;
}

.primary-nav a[aria-current="page"] {
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  border-color: var(--pico-primary);
}

/* Flash messages */
.flash {
  padding: 0.5rem 0.8rem;
  margin-bottom: 1rem;
}

.flash-success {
  border-left: 4px solid #2c7a3f;
  background: rgba(44, 122, 63, 0.08);
}

.flash-error {
  border-left: 4px solid #b3261e;
  background: rgba(179, 38, 30, 0.08);
}

/* Clients list */
.client-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

.client-row .meta {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
}

.client-row a {
  font-weight: 600;
}

/* Home dashboard */
.home-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.home-hero > div {
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--pico-muted-border-color);
  min-width: 7rem;
}

.home-hero strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1.1;
}

.home-hero small {
  color: var(--pico-muted-color);
  font-size: 0.85rem;
}

.home-hero .hero-overdue {
  border-color: #b3261e;
  background: rgba(179, 38, 30, 0.06);
}

.home-hero .hero-flag {
  border-color: #b3700a;
  background: rgba(179, 112, 10, 0.06);
}

.bucket-overdue { color: #b3261e; }
.bucket-today { color: #b3700a; }

.home-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.35rem;
  border-radius: 6px;
  background: transparent;
  gap: 1rem;
}

.home-row.tone-overdue { background: rgba(179, 38, 30, 0.05); border-left: 4px solid #b3261e; }
.home-row.tone-today   { background: rgba(179, 112, 10, 0.05); border-left: 4px solid #b3700a; }
.home-row.tone-soon    { background: rgba(44, 122, 63, 0.04); border-left: 4px solid #2c7a3f; }
.home-row.tone-upcoming { border-left: 4px solid var(--pico-muted-border-color); }
.home-row.tone-new      { border-left: 4px solid var(--pico-muted-border-color); }

.home-row .meta {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  margin-top: 0.15rem;
}

.home-flags {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

/* Retie-due badge */
.retie-due {
  background: rgba(44, 122, 63, 0.06);
  border-left: 4px solid #2c7a3f;
  padding: 0.6rem 0.9rem;
  margin: 1rem 0;
}

.status-warn {
  /* Darkened from #b3700a (WCAG AA fail at <small> font size) to
     #7a4d05 which matches the chip-warn text already used for
     consistency. Borders stay at the original amber so the visual
     warning cue survives. */
  color: #7a4d05;
  font-weight: 600;
}

.status-overdue {
  color: #b3261e;
  font-weight: 600;
}

/* Product chips on session rows */
.chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  margin: 0.1rem 0.15rem 0.1rem 0;
  border-radius: 999px;
  border: 1px solid var(--pico-muted-border-color);
  background: transparent;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: nowrap;
}

.chip-warn {
  border-color: #b3700a;
  color: #7a4d05;
  background: rgba(179, 112, 10, 0.07);
}

.product-dot {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: #b3700a;
  margin-right: 0.3em;
  vertical-align: middle;
}

/* Per-session progression cards (M10c) */
.progression-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.progression-card {
  margin: 0;
  padding: 0.6rem 0.8rem;
}

.progression-header {
  margin-bottom: 0.4rem;
}

.progression-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.progression-tile {
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--pico-muted-border-color);
}

.progression-tile a {
  display: block;
  line-height: 0;
}

.progression-tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.progression-tile figcaption {
  padding: 0.25rem 0.4rem;
  background: rgba(0, 0, 0, 0.02);
  text-align: center;
}

/* Photo timeline */
.photo-group {
  margin-top: 1rem;
}

.photo-group + .photo-group {
  margin-top: 1.4rem;
}

.photo-group-title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.photo-group-count {
  color: var(--pico-muted-color);
  font-weight: normal;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
  margin: 0.6rem 0 0;
}

.photo-tile {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--pico-muted-border-color);
}

.photo-tile a {
  display: block;
  line-height: 0;
}

.photo-tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}

.photo-tile figcaption {
  padding: 0.35rem 0.5rem;
  background: rgba(0, 0, 0, 0.02);
}

/* Photo delete  - 44px touch target per Apple HIG / WCAG 2.5.5, kept
   below the caption rather than next to the photo link so a misplaced
   thumb on the photo doesn't accidentally hit Delete. */
.photo-delete-btn {
  min-height: 44px;
  display: block;
  margin-top: 0.3rem;
}

/* Inline status / error region for the Web Share API button.
   Empty by default; populated by client_detail.js during a share
   fetch ("Preparing image...") or on error (gets .flash-error). */
.share-status {
  margin-left: 0.5rem;
  display: inline-block;
}

.share-status.flash {
  /* Reduce the default .flash padding so the inline pill doesn't
     visually overpower the share button it sits next to. */
  padding: 0.25rem 0.5rem;
  margin-bottom: 0;
}

/* "New" bucket on the home dashboard - hint copy that nudges the
   founder toward the natural next action (tap to log installation).
   Small, muted, sits right under the bucket header. */
.bucket-hint {
  margin: -0.4rem 0 0.6rem;
  color: var(--pico-muted-color);
}
