/* Components shared by the SPA (app.css) and the server-rendered pages (page.css). Tokens only; no Bootstrap. */

/* Type badge = color + icon + label. Health Hustlers badge = brass ring, never recolored. */
.badge-type, .badge-hh, .hh-badge { display: inline-flex; align-items: center; gap: .3em; padding: .3em .7em; border-radius: var(--r-pill); font-size: var(--fs-caption); font-weight: 700; line-height: 1.2; }
.badge-type { background: var(--surface); color: var(--tc, var(--primary-strong)); border: 1.5px solid var(--tc, var(--primary-strong)); }
.badge-hh { background: var(--c-cream); color: var(--ink); border: 1.5px solid var(--c-brass); }
.t-event { --tc: var(--c-t-event); } .t-offer { --tc: var(--c-t-offer); } .t-promotional { --tc: var(--c-t-promo); }
.t-provider_tip { --tc: var(--c-t-provider-tip); } .t-wellness_tip { --tc: var(--c-t-wellness-tip); }

/* Date block: the lead element of every card and detail header */
.date-block { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 3.5rem; height: 3.75rem; flex: none; background: var(--date-default); color: var(--ink); border: 1px solid var(--border); border-radius: var(--r-date); line-height: 1; }
.date-block b { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.date-block i { font-style: normal; font-size: 1.7rem; font-weight: 800; margin-top: 2px; }
.date-block.t-event { background: var(--date-event); } .date-block.t-offer { background: var(--date-offer); } .date-block.t-wellness_tip { background: var(--date-wellness-tip); }

/* Health Hustlers mark (SVG disc + text). Alt text and tooltip are the same exact sentence. */
.hh-badge { gap: var(--sp-2); padding: 2px var(--sp-3) 2px 2px; background: var(--c-cream); color: var(--ink); border: 1.5px solid var(--c-brass); }
.hh-badge img { width: 1.75rem; height: 1.75rem; flex: none; }

/* Offer and provider detail (SPA modal and /o, /p pages) */
.dt { display: grid; gap: var(--sp-4); color: var(--ink); }
.dt > * { min-width: 0; margin: 0; }
.dt-media { border-radius: var(--r-md); overflow: hidden; background: var(--primary-soft); }
.dt-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.dt-band { display: flex; align-items: center; justify-content: center; width: 100%; height: 7.5rem; background: var(--tc, var(--primary)); color: var(--on-primary); font-size: 2.25rem; }
.dt-head { display: flex; gap: var(--sp-3); align-items: flex-start; }
.dt-head .date-block { width: 4rem; height: 4.25rem; }
.dt-head .date-block i { font-size: 2rem; }
.dt-headtext { min-width: 0; display: grid; gap: var(--sp-1); }
.dt-headtext > * { margin: 0; }
.dt-rel { font-size: var(--fs-meta); font-weight: 700; color: var(--strong); }
.dt-rel:empty { display: none; }
.dt-title { font-size: var(--fs-page); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.dt-meta { display: grid; gap: var(--sp-1); padding: 0; list-style: none; font-size: var(--fs-meta); color: var(--muted); }
.dt-meta li { display: flex; gap: var(--sp-2); align-items: flex-start; }
.dt-meta li[hidden] { display: none; }
.dt-meta .dt-ic { flex: none; margin-top: .15em; color: var(--primary); }
.dt-meta a { color: inherit; }
.dt-badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

.dt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.dt-actions > * { justify-content: center; min-height: var(--tap); }
.dt-actions .dt-primary, .dt-actions .dt-wide { grid-column: 1 / -1; }
.dt-actions [hidden] { display: none; }
.dt-status { grid-column: 1 / -1; margin: 0; font-size: var(--fs-meta); color: var(--muted); }
.dt-status:empty { display: none; }
@media (min-width: 576px) {
  .dt-actions { display: flex; flex-wrap: wrap; }
  .dt-actions .dt-primary { flex-basis: 100%; }
}

.dt-provider { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); color: inherit; text-decoration: none; box-shadow: var(--shadow-card); transition: border-color var(--dur) var(--ease); }
a.dt-provider:hover { border-color: var(--primary); }
.dt-logo { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: var(--r-sm); object-fit: cover; background: var(--primary-soft); color: var(--primary); font-size: 1.4rem; }
.dt-provider-text { display: grid; gap: var(--sp-1); min-width: 0; }
.dt-provider-text > * { margin: 0; }
.dt-provider-by { font-size: var(--fs-caption); color: var(--muted); }
.dt-provider-name { font-weight: 800; font-size: var(--fs-card); line-height: 1.15; overflow-wrap: anywhere; }

.dt-body { max-width: 65ch; line-height: 1.6; }
.dt-body p { margin: 0 0 var(--sp-3); }
.dt-body p:last-child { margin-bottom: 0; }
.dt-section { font-size: var(--fs-section); font-weight: 800; letter-spacing: -.01em; margin: 0; }
.dt-facts { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) var(--sp-4); margin: 0; padding-top: var(--sp-4); border-top: 1px solid var(--border); font-size: var(--fs-meta); }
.dt-facts dt { font-weight: 700; color: var(--muted); }
.dt-facts dd { margin: 0; overflow-wrap: anywhere; }
.dt-facts [hidden] { display: none; }
.dt-code { display: inline-block; padding: 2px var(--sp-3); border: 1.5px dashed var(--strong); border-radius: var(--r-sm); font-weight: 800; letter-spacing: .04em; color: var(--strong); user-select: all; }
.dt-foot { padding-top: var(--sp-3); border-top: 1px solid var(--border); font-size: var(--fs-meta); }
.dt-foot a { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); color: var(--muted); }
.dt-note { font-size: var(--fs-caption); color: var(--muted); }

/* Provider page: banner, logo, chips, links */
.pv-banner { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: var(--r-md); background: var(--primary); }
.pv-id { display: flex; gap: var(--sp-3); align-items: flex-end; margin-top: calc(var(--sp-8) * -1); padding: 0 var(--sp-4); }
.pv-id--plain { margin-top: 0; padding: 0; align-items: center; }
.pv-id .dt-logo { width: 4.5rem; height: 4.5rem; border: 3px solid var(--surface); box-shadow: var(--shadow-card); background: var(--surface); }
.pv-name { display: grid; gap: var(--sp-2); min-width: 0; justify-items: start; }
.pv-name > * { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0; list-style: none; }
.tag { display: inline-flex; align-items: center; padding: .3em .85em; border: 1.5px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--strong); font-size: var(--fs-meta); font-weight: 600; }
.pv-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding: 0; list-style: none; }
.pv-links a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--sp-4); border: 1.5px solid var(--border); border-radius: var(--r-pill); background: var(--surface); color: var(--primary); font-weight: 600; text-decoration: none; }
.pv-links a:hover { border-color: var(--primary); }

/* Date-first rows: upcoming and related offers on detail pages */
.oc-list { display: grid; gap: var(--sp-3); padding: 0; list-style: none; }
.oc-row { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); color: inherit; text-decoration: none; box-shadow: var(--shadow-card); transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.oc-row:hover { border-color: var(--primary); transform: translateY(-2px); }
.oc-row-text { display: grid; gap: var(--sp-1); min-width: 0; }
.oc-row-text > * { margin: 0; }
.oc-row-title { font-size: var(--fs-card); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.oc-row-sub { font-size: var(--fs-meta); color: var(--muted); }
.oc-row-rel { font-size: var(--fs-meta); font-weight: 700; color: var(--strong); }
.oc-row-rel:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  .oc-row, .dt-provider { transition: none; }
  .oc-row:hover { transform: none; }
}

/* Share form */
.req { color: #000; font-weight: 800; margin-left: .1em; }
.form-legend-note { margin: 0 0 var(--sp-3); font-size: var(--fs-meta); color: var(--muted); }
.share-panel legend.form-label { float: none; font-size: 1rem; padding: 0; margin-bottom: var(--sp-1); }
.share-rule { margin: var(--sp-4) 0; border-color: var(--border); opacity: 1; }
.share-sub { font-weight: 800; color: var(--strong); margin-bottom: var(--sp-3); }
.seg { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.seg .btn { min-height: var(--tap); border-radius: var(--r-pill); font-weight: 700; }
.btn-check:checked + .btn-outline-primary { background: var(--strong); border-color: var(--strong); color: var(--on-primary); }
.btn-check:focus-visible + .btn { outline: 3px solid var(--primary); outline-offset: 2px; }
.offer-details { padding: var(--sp-3); background: var(--primary-soft); border-radius: var(--r-md); }

/* Date and time picker */
.dp { position: relative; }
.dp-trigger { display: flex; align-items: center; gap: var(--sp-2); width: 100%; text-align: left; cursor: pointer; }
.dp-trigger.is-invalid { border-color: var(--danger); }
.dp-trigger .text-muted { color: var(--muted) !important; }
.dp-panel { z-index: 20; padding: var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: 0 12px 32px rgba(16, 41, 26, .18); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); }
.dp-title { font-weight: 800; color: var(--strong); }
.dp-nav { min-width: var(--tap); min-height: var(--tap); padding: 0; font-size: 1.5rem; line-height: 1; }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; font-size: var(--fs-meta); color: var(--muted); padding: var(--sp-1) 0; }
.dp-day { min-height: var(--tap); border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); font-weight: 600; }
.dp-day:not(.is-selected):hover:not(:disabled) { background: var(--primary-soft); }
.dp-day:disabled { color: var(--muted); opacity: .45; cursor: not-allowed; }
.dp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.dp-day.is-selected { background: var(--primary-soft); color: var(--strong); }
.dp-day.is-edge-start, .dp-day.is-edge-end { background: var(--strong); color: var(--on-primary); }
.dp-day:focus-visible, .dp-trigger:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }
.dp-times { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.dp-times .form-select { flex: 1; min-width: 0; }
.dp-allday { margin-top: var(--sp-2); }
.dp-hint { margin: var(--sp-2) 0; font-size: var(--fs-meta); color: var(--muted); }
.dp-actions { display: flex; justify-content: space-between; align-items: center; }
.dp-actions .btn { min-height: var(--tap); }
@media (min-width: 576px) {
  .dp-panel { position: absolute; top: calc(100% + var(--sp-1)); left: 0; width: min(22rem, 100%); }
}
@media (max-width: 575.98px) {
  .dp-panel { position: fixed; left: 0; right: 0; bottom: 0; max-height: 85vh; overflow-y: auto; border-radius: var(--r-md) var(--r-md) 0 0; animation: dp-up var(--dur) var(--ease); }
}
@keyframes dp-up { from { transform: translateY(1rem); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .dp-panel { animation: none; } }

/* Provider dashboard: approved banner with the logo overlapping its lower-left corner */
.prov-brand { position: relative; padding-bottom: 2rem; }
.prov-banner { display: block; width: 100%; aspect-ratio: 3 / 1; max-height: 14rem; object-fit: cover; border-radius: var(--r-sm); background: var(--primary-soft); }
.prov-logo { position: absolute; left: 1rem; bottom: 0; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: var(--r-sm); border: 3px solid #fff; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
