/* ============================================================
   COMPONENTS.CSS — Pitch Green component classes (.fm-*)
   GLOBAL — not scoped to [data-theme]; reference --pc-* vars.
   Rounded + soft throughout. No uppercase except .fm-eyebrow.
   ============================================================ */

/* ============================================================
   .fm-link — in-content links with animated green underline
   ============================================================ */
.fm-link {
  color: var(--pc-text, #16201A);
  text-decoration: none;
  background-image: linear-gradient(var(--pc-accent, #0B8A4D), var(--pc-accent, #0B8A4D));
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: 0% 100%;
  transition:
    color 200ms var(--pc-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    background-size 200ms var(--pc-ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.fm-link:hover {
  color: var(--pc-accent, #0B8A4D);
  background-size: 100% 1.5px;
}

/* ============================================================
   .fm-eyebrow — small uppercase label (the ONLY uppercase)
   ============================================================ */
.fm-eyebrow {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pc-muted, #6F766F);
  display: block;
}
.fm-eyebrow--accent {
  color: var(--pc-accent, #0B8A4D);
}

/* ============================================================
   .fm-rule — soft divider with center fade
   ============================================================ */
.fm-rule {
  border: none;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--pc-border, #E3E7E3) 20%,
    var(--pc-border, #E3E7E3) 80%,
    transparent 100%
  );
  margin: 1.5rem 0;
}

/* ============================================================
   .fm-bloom — soft mint/green gradient-mesh backdrop utility
   ============================================================ */
.fm-bloom {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%,  rgba(11,138,77,0.07)  0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%,  rgba(45,190,138,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 100% 100% at 50% 50%, rgba(244,247,244,1)   0%, transparent 100%);
  background-color: var(--pc-bg, #F7F8F7);
}

/* ============================================================
   .fm-card — rounded soft-shadow card system
   ============================================================ */
.fm-card {
  background: var(--pc-surface, #FFFFFF);
  border: 1px solid var(--pc-border, #E3E7E3);
  border-radius: var(--pc-radius, 16px);
  box-shadow: var(--pc-shadow-1);
  overflow: hidden;
  transition:
    box-shadow 240ms var(--pc-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    transform  240ms var(--pc-ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.fm-card:hover {
  box-shadow: var(--pc-shadow-2);
  transform: translateY(-2px);
}

/* Accent card — 3px green top bar */
.fm-card--accent {
  border-top: 3px solid var(--pc-accent, #0B8A4D);
  background-image: linear-gradient(
    to bottom,
    rgba(11,138,77,0.03) 0%,
    transparent 3rem
  );
}

.fm-card__header {
  padding: 1rem 1.25rem 0.875rem;
  border-bottom: 1px solid var(--pc-border, #E3E7E3);
  background: var(--pc-surface-2, #EDF0ED);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--pc-text, #16201A);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================================
   .fm-stat — stat tile (Fraunces/JetBrains-mono number)
   ============================================================ */
.fm-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.fm-stat__num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1;
  color: var(--pc-text, #16201A);
  letter-spacing: -0.02em;
}
.fm-stat__label {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--pc-muted, #6F766F);
  text-transform: none;
}

/* ============================================================
   .fm-hero — compact rounded hero panel (v2.2)
   ============================================================ */
.fm-hero {
  padding: 1.25rem 1.5rem;
  border-radius: var(--pc-radius, 16px);
  background:
    radial-gradient(ellipse 80% 60% at 10% 0%,   rgba(11,138,77,0.08)  0%, transparent 55%),
    radial-gradient(ellipse 60% 80% at 90% 100%,  rgba(45,190,138,0.06) 0%, transparent 60%),
    var(--pc-surface, #FFFFFF);
  border: 1px solid var(--pc-border, #E3E7E3);
  box-shadow: var(--pc-shadow-2);
  position: relative;
  overflow: hidden;
}
@media (min-width: 768px) {
  .fm-hero {
    padding: 1.5rem 2rem;
  }
  /* Desktop: title row with actions inline on the right */
  .fm-hero__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
  }
}

.fm-hero__eyebrow {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pc-accent, #0B8A4D);
  display: block;
  margin-bottom: 0.35rem;
}
/* The title+sub block (left side on desktop) */
.fm-hero__body {
  flex: 1 1 0;
  min-width: 0;
}
.fm-hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--pc-text, #16201A);
  margin: 0;
}
.fm-hero__sub {
  font-size: 0.9rem;
  color: var(--pc-muted, #6F766F);
  line-height: 1.5;
  margin: 0.3rem 0 0;
  max-width: 60ch;
}
/* Actions sit inline on desktop via .fm-hero__row; stack on mobile */
.fm-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}
@media (min-width: 768px) {
  .fm-hero__actions {
    margin-top: 0;
    flex-shrink: 0;
  }
}

/* Compact hero variant for settings/admin sub-pages: tighter padding,
   no background bloom — just surface + border */
.fm-hero--compact {
  padding: 0.75rem 1.25rem;
  background: var(--pc-surface, #FFFFFF);
}
@media (min-width: 768px) {
  .fm-hero--compact {
    padding: 0.875rem 1.5rem;
  }
}
.fm-hero--compact .fm-hero__title {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
}

/* ============================================================
   .fm-empty — friendly empty state
   ============================================================ */
.fm-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  gap: 0.75rem;
}
.fm-empty__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--pc-radius, 16px);
  background: var(--pc-surface-2, #EDF0ED);
  border: 1px solid var(--pc-border, #E3E7E3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--pc-muted, #6F766F);
  margin-bottom: 0.25rem;
}
.fm-empty__title {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--pc-text, #16201A);
  margin: 0;
}
.fm-empty__body {
  font-size: 0.875rem;
  color: var(--pc-muted, #6F766F);
  line-height: 1.5;
  max-width: 36ch;
  margin: 0;
}

/* ============================================================
   .fm-pill — phase / category pill with semantic colors
   ============================================================ */
.fm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.2em 0.65em;
  border-radius: var(--pc-radius-pill, 999px);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  background: var(--pc-surface-2, #EDF0ED);
  color: var(--pc-text, #16201A);
  white-space: nowrap;
}

/* Drill phases */
.fm-pill[data-phase="warmup"],
.fm-pill--warmup {
  background: rgba(224,162,60,0.15);
  color: #7A5508;
}
.fm-pill[data-phase="drill"],
.fm-pill[data-phase="øvelse"],
.fm-pill--drill {
  background: var(--pc-accent-soft, rgba(11,138,77,0.10));
  color: var(--pc-accent, #0B8A4D);
}
.fm-pill[data-phase="cooldown"],
.fm-pill[data-phase="nedkøling"],
.fm-pill--cooldown {
  background: rgba(62,143,176,0.12);
  color: #1E4D6B;
}
.fm-pill[data-phase="game"],
.fm-pill[data-phase="leg"],
.fm-pill--game {
  background: rgba(11,138,77,0.12);
  color: #0C5C32;
}

/* Semantic variants */
.fm-pill--success {
  background: rgba(11,138,77,0.12);
  color: #0C5C32;
}
.fm-pill--danger {
  background: rgba(229,84,75,0.12);
  color: #7A1F1A;
}
.fm-pill--warning {
  background: rgba(224,162,60,0.15);
  color: #7A5508;
}
.fm-pill--info {
  background: rgba(62,143,176,0.12);
  color: #1E4D6B;
}
.fm-pill--accent {
  background: var(--pc-accent-soft, rgba(11,138,77,0.10));
  color: var(--pc-accent, #0B8A4D);
}

/* ============================================================
   .fm-flash — soft rounded flash with icon + warm tint
   ============================================================ */
.fm-flash {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--pc-radius, 16px);
  border: none;
  font-size: 0.9rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  margin-bottom: 0.75rem;
  position: relative;
  background: rgba(62,143,176,0.10);
  color: #1E4D6B;
  border-left: 3px solid var(--pc-info, #3E8FB0);
}
.fm-flash__icon {
  flex: 0 0 auto;
  font-size: 1rem;
  margin-top: 0.05rem;
}
.fm-flash__body {
  flex: 1;
  min-width: 0;
}
.fm-flash .btn-close {
  position: absolute;
  top: 0.625rem;
  right: 0.75rem;
  opacity: 0.6;
}
.fm-flash .btn-close:hover {
  opacity: 1;
}

.fm-flash--success {
  background: rgba(11,138,77,0.10);
  color: #0C5C32;
  border-left-color: var(--pc-success, #0B8A4D);
}
.fm-flash--danger,
.fm-flash--error {
  background: rgba(229,84,75,0.10);
  color: #7A1F1A;
  border-left-color: var(--pc-danger, #E5544B);
}
.fm-flash--warning {
  background: rgba(224,162,60,0.12);
  color: #7A5508;
  border-left-color: var(--pc-accent-2, #17A65E);
}
.fm-flash--info,
.fm-flash--message {
  background: rgba(62,143,176,0.10);
  color: #1E4D6B;
  border-left-color: var(--pc-info, #3E8FB0);
}

/* ============================================================
   .fm-avatar — circle avatars, size variants
   ============================================================ */
.fm-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--pc-surface-2, #EDF0ED);
  border: 1.5px solid var(--pc-border, #E3E7E3);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--pc-muted, #6F766F);
  object-fit: cover;
}
.fm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.fm-avatar--sm {
  width: 24px;
  height: 24px;
  font-size: 0.65rem;
}
.fm-avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 1rem;
  border-width: 2px;
}
.fm-avatar--xl {
  width: 72px;
  height: 72px;
  font-size: 1.5rem;
  border-width: 2px;
}

/* ============================================================
   .fm-skeleton — warm loading placeholder
   ============================================================ */
.fm-skeleton {
  display: block;
  border-radius: var(--pc-radius-sm, 10px);
  background: var(--pc-surface-2, #EDF0ED);
  height: 1em;
}
/* Animation is in motion.css (behind reduced-motion guard) */

/* ============================================================
   Page background with mint bloom + faint grain
   ============================================================ */
body {
  background-color: var(--pc-bg, #F7F8F7);
  min-height: 100vh;
}

/* Cool mint ambient bloom on the page (fixed, so it doesn't scroll) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 60% -10%, rgba(11,138,77,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at -10% 80%, rgba(45,190,138,0.04) 0%, transparent 55%);
}

/* Faint paper grain texture overlay (SVG fractal noise, very subtle) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ============================================================
   .fm-breadcrumb + .fm-back — hybrid nav (v2.4)
   Sits just under the navbar, above the hero.
   Desktop: breadcrumb trail; Mobile: compact back button.
   ============================================================ */
.fm-breadcrumb {
  display: none; /* hidden on mobile */
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  padding: 0.6rem 0;
  font-size: 0.8rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
@media (min-width: 768px) {
  .fm-breadcrumb {
    display: flex;
  }
}
.fm-breadcrumb__item {
  color: var(--pc-muted, #6F766F);
  text-decoration: none;
  transition: color 200ms var(--pc-ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.fm-breadcrumb__item:hover {
  color: var(--pc-accent, #0B8A4D);
}
.fm-breadcrumb__sep {
  color: var(--pc-border, #E3E7E3);
  user-select: none;
  font-size: 0.85em;
}
.fm-breadcrumb__current {
  color: var(--pc-text, #16201A);
  font-weight: 600;
}

/* Mobile compact back button */
.fm-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-weight: 500;
  color: var(--pc-muted, #6F766F);
  text-decoration: none;
  transition: color 200ms var(--pc-ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.fm-back:hover {
  color: var(--pc-accent, #0B8A4D);
}
@media (min-width: 768px) {
  .fm-back {
    display: none; /* hidden on desktop — breadcrumb takes over */
  }
}

/* ============================================================
   .fm-session-card — unified session card (v2.5)
   ============================================================ */
.fm-session-card {
  position: relative; /* stretched-link anchor */
  display: flex;
  flex-direction: column;
  height: 100%;        /* fill the grid/col cell → equal height per row */
  min-height: 150px;   /* consistent floor even with no focus/thumbnails */
  background: var(--pc-surface, #FFFFFF);
  border: 1px solid var(--pc-border, #E3E7E3);
  border-radius: var(--pc-radius, 16px);
  box-shadow: var(--pc-shadow-1);
  overflow: hidden;
  transition:
    box-shadow 240ms var(--pc-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    transform  240ms var(--pc-ease, cubic-bezier(0.22, 1, 0.36, 1));
}
.fm-session-card:hover {
  box-shadow: var(--pc-shadow-2);
  transform: translateY(-3px);
}
.fm-session-card__body {
  padding: 1rem 1.25rem 0.75rem;
}
.fm-session-card__title {
  font-family: 'Fraunces', Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--pc-text, #16201A);
  text-decoration: none;
  display: block;
  margin-bottom: 0.3rem;
}
.fm-session-card__title:hover {
  color: var(--pc-accent, #0B8A4D);
}
.fm-session-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  font-size: 0.78rem;
  color: var(--pc-muted, #6F766F);
  margin-bottom: 0.5rem;
}
.fm-session-card__time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--pc-muted, #6F766F);
}
.fm-session-card__focus {
  font-size: 0.82rem;
  color: var(--pc-muted, #6F766F);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

/* Drill thumbnails strip */
.fm-session-card__thumbs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1.25rem 0.75rem;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-top: auto;   /* always sit at the bottom of the card */
}
.fm-session-card__thumb {
  width: 36px;
  height: 36px;
  border-radius: var(--pc-radius-sm, 10px);
  object-fit: cover;
  background: var(--pc-surface-2, #EDF0ED);
  border: 1px solid var(--pc-border, #E3E7E3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pc-muted, #6F766F);
  font-size: 0.85rem;
  overflow: hidden;
}
.fm-session-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--pc-radius-sm, 10px);
}
.fm-session-card__thumb-more {
  width: 36px;
  height: 36px;
  border-radius: var(--pc-radius-sm, 10px);
  background: var(--pc-accent-soft, rgba(11,138,77,0.10));
  border: 1px solid var(--pc-border, #E3E7E3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--pc-accent, #0B8A4D);
  white-space: nowrap;
}
