/* === F3 HC Events — mobile-first UI (scoped + stable) ================ */
:root{
  --f3-font:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
  --f3-text:#0B1220; --f3-muted:#5B6573; --f3-line:#E6E6EA; --f3-bg:#fff; --f3-shadow:0 6px 24px rgba(15,23,42,.06);
  --f3-accent:#0B1220; --f3-accent-contrast:#fff; --f3-radius:16px;
}

/* scope/normalize */
.f3hc-wrap *{box-sizing:border-box}
.f3hc-wrap button,.f3hc-wrap input,.f3hc-wrap select{font:inherit}

/* wrapper & card */
.f3hc-wrap{max-width:720px;margin:0 auto;padding:16px;font:16px/1.5 var(--f3-font);color:var(--f3-text)}
.f3hc-card{border:1px solid var(--f3-line);border-radius:var(--f3-radius);padding:14px;margin:16px 0;background:var(--f3-bg);box-shadow:0 6px 24px rgba(15,23,42,.06);transition:box-shadow .15s ease, transform .05s ease}
.f3hc-card.is-collapsed .f3hc-h{cursor:pointer}
.f3hc-card.is-collapsed:hover{box-shadow:0 8px 28px rgba(15,23,42,.08)}

/* header */
.f3hc-h{
  display:flex; align-items:center; gap:10px; outline:none;
}
.f3hc-h:focus-visible{box-shadow:0 0 0 3px rgba(11,18,32,.2);border-radius:12px}

/* left side (title + date) */
.f3hc-head-main{
  display:flex; flex-direction:column; gap:2px;
  flex:1 1 auto; min-width:0;
}
.f3hc-title{
  margin:0; font-size:22px; font-weight:800;
  overflow:hidden; text-overflow:ellipsis; display:-webkit-box;
  -webkit-box-orient:vertical; line-clamp:2; -webkit-line-clamp:2;
}
/* Disable title link while collapsed */
.f3hc-card.is-collapsed .f3hc-title a{
  pointer-events:none; cursor:default; color:inherit; text-decoration:none;
}

.f3hc-meta{font-size:13px; color:var(--f3-muted); margin:0}

/* right side (location + icon) */
.f3hc-head-actions{
  margin-left:auto; display:flex; align-items:center; gap:10px; flex-wrap:wrap;
}
.f3hc-ao{border:1.5px solid var(--f3-text);border-radius:999px;padding:6px 12px;font-size:13px;font-weight:800;white-space:nowrap}

/* counts & tags */
.f3hc-badges{display:flex;gap:8px;margin:10px 0;flex-wrap:wrap}
.f3hc-pill{padding:6px 12px;border-radius:999px;border:1px solid var(--f3-line);background:#F5F6F8;font-size:12px}
.f3hc-tag{padding:6px 12px;border-radius:8px;background:#F5F6F8;font-size:12px}

/* actions row (buttons left, links right) */
.f3hc-actions{
  display:flex; flex-wrap:wrap; align-items:center; gap:12px;
  margin-top:16px;
}

/* big buttons */
.f3hc-actions .f3hc-btn,
.f3hc-actions .f3hc-btn-outline{
  flex:1 1 calc(33.333% - 12px);
  min-width:180px;
  padding:14px;
  border-radius:14px;
  border:2px solid var(--f3-accent);
  font-weight:900; letter-spacing:.2px;
  text-align:center; cursor:pointer;
}
.f3hc-btn{background:var(--f3-accent);color:var(--f3-accent-contrast)}
.f3hc-btn-outline{background:#fff;color:var(--f3-accent)}

/* selected */
.f3hc-btn.is-selected,
.f3hc-btn-outline.is-selected{
  background:#0B1220 !important;
  color:#fff !important;
  border-color:#0B1220 !important;
  box-shadow:0 0 0 2px rgba(0,0,0,.04) inset;
}
.f3hc-btn:not(.is-selected){
  background:#fff !important;
  color:#0B1220 !important;
}

/* forms */
.f3hc-inline{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:10px;
  /* ⬇️ bottom-align everything so the submit lines up with inputs */
  align-items:end;
  margin-top:12px;
}
.f3hc-field{display:grid;gap:6px}
.f3hc-field label{font-size:12px;color:#555}
.f3hc-inline input,.f3hc-inline select{
  padding:12px;border-radius:12px;border:1px solid var(--f3-line);
  width:100%;min-width:0;
}
.f3hc-submit{
  padding:12px 16px;border-radius:12px;border:none;background:var(--f3-accent);color:#fff;font-weight:800;cursor:pointer;
  /* ⬇️ ensure the button hugs the same baseline as fields */
  align-self:end;
}
.f3hc-submit:disabled{opacity:.6;cursor:not-allowed}

/* inline sections */
.f3hc-roster-inline,.f3hc-details-inline,.f3hc-update-inline{
  border-top:1px dashed var(--f3-line); margin-top:10px; padding-top:8px;
}
.f3hc-detail{margin:6px 0}
.f3hc-list{margin:6px 0 0 18px;font-size:14px}

/* icon-only toggle */
.f3hc-toggle{
  width:36px; height:36px; min-width:36px;
  display:flex; align-items:center; justify-content:center;
  background:#fff; color:var(--f3-accent);
  border:1.5px solid var(--f3-line);
  border-radius:999px; padding:0;
  cursor:pointer;
}
.f3hc-toggle .chev{
  width:10px; height:10px; display:inline-block;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform: rotate(-45deg); transition: transform .18s ease;
}
.f3hc-toggle[aria-expanded="true"] .chev{ transform: rotate(135deg); }

.f3hc-body{ margin-top:10px; }

/* ====================== Mobile polish & HARD STACK ===================== */
@media (max-width:700px){
  .f3hc-card{padding:12px;border-radius:14px;box-shadow:0 4px 14px rgba(15,23,42,.06)}

  /* grid header: main (title+date) left, actions right */
  .f3hc-h{
    display:grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "main actions";
    align-items:center; gap:6px 10px;
  }
  .f3hc-head-main{grid-area:main}
  .f3hc-head-actions{grid-area:actions; justify-self:end}
  .f3hc-title{font-size:18px; line-height:1.2}
  .f3hc-meta{font-size:12px}

  .f3hc-actions{gap:8px;margin-top:16px}
  .f3hc-actions .f3hc-btn,
  .f3hc-actions .f3hc-btn-outline{
    flex:1 1 100%; min-width:0; padding:12px;border-radius:12px;
  }

  /* force the inline form to stack AND align full-width */
  .f3hc-card form.f3hc-inline{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:10px !important;
    align-items:stretch !important;          /* ⬅️ override desktop bottom-align */
  }
  .f3hc-card form.f3hc-inline > *{
    grid-column:1 / -1 !important;
    width:100% !important;
  }
  .f3hc-card form.f3hc-inline .f3hc-submit{
    width:100% !important;
    justify-self:stretch !important;
    align-self:stretch !important;           /* ⬅️ full-width button matches fields */
  }
}

/* micro devices */
@media (max-width:360px){
  .f3hc-toggle{width:32px;height:32px}
}
