@import url('widget-fonts.css');

:root {
  /* Keep the iframe canvas transparent; palettes below color the card only. */
  color-scheme: normal;
  --widget-bg: #ffffff;
  --widget-surface: #f7f8fc;
  --widget-border: #e8eaf2;
  --widget-text: #20243b;
  --widget-muted: #73788f;
  --widget-primary: #5664d8;
  --widget-primary-soft: #eef0ff;
  --heat-empty: #e2f2e4;
  --heat-low: #80cf83;
  --heat-medium: #ffd77b;
  --heat-high: #ff9b9f;
  --widget-font-scale: 1;
  --widget-font-family: Montserrat, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: transparent;
}

body {
  padding: 3px;
  color: var(--widget-text);
  font-family: var(--widget-font-family);
  font-size: calc(14px * var(--widget-font-scale));
  line-height: 1.45;
}

.venue-widget {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--widget-border);
  border-radius: 22px;
  background: var(--widget-bg);
  color: var(--widget-text);
  box-shadow: none;
}

.venue-widget h1 a,
.venue-widget h1 a:visited,
.venue-widget h1 a:hover,
.venue-widget h1 a:active {
  color: inherit;
  font: inherit;
  text-decoration: none;
}
.venue-widget.venue-widget--compact { padding: 14px; font-size: calc(12px * var(--widget-font-scale)); }
.venue-widget--compact .venue-widget__cell { border-radius: 4px; }
.venue-widget--compact .venue-widget__heatmap td { height: 22px; }
.venue-widget--compact .venue-widget__insight { padding: 10px; }
.venue-widget--transparent { background: transparent; }
.venue-widget--borderless { border: none; }
.venue-widget.venue-widget--square { border-radius: 0; }
.venue-widget--shadow { box-shadow: 0 3px 6px rgba(40, 45, 78, 0.08); }

.venue-widget__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.venue-widget__eyebrow,
.venue-widget__insight strong {
  margin: 0;
  color: var(--widget-primary);
  font-size: calc(10px * var(--widget-font-scale));
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.venue-widget h1 {
  margin: 3px 0 2px;
  color: var(--widget-text);
  font-size: clamp(calc(18px * var(--widget-font-scale)), 3vw, calc(24px * var(--widget-font-scale)));
  line-height: 1.2;
}

.venue-widget__address {
  margin: 0;
  color: var(--widget-muted);
  font-size: calc(13px * var(--widget-font-scale));
}

.venue-widget__local-time {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  margin: 2px 0 0;
  padding: 7px 10px;
  border: 1px solid var(--widget-border);
  border-radius: 999px;
  background: var(--widget-surface);
  color: var(--widget-muted);
  font-size: calc(11px * var(--widget-font-scale));
  font-weight: 700;
}

.venue-widget__local-time span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--widget-primary);
  box-shadow: 0 0 0 3px var(--widget-primary-soft);
}

.venue-widget__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 18px 0 12px;
  color: var(--widget-muted);
  font-size: calc(10px * var(--widget-font-scale));
  font-weight: 700;
}

.venue-widget__legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.venue-widget__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.venue-widget__dot--low { background: var(--heat-low); }
.venue-widget__dot--medium { background: var(--heat-medium); }
.venue-widget__dot--high { background: var(--heat-high); }

.venue-widget__current-key {
  width: 10px;
  height: 10px;
  border: 2px solid var(--widget-primary);
  border-radius: 3px;
}

.venue-widget__closed-key {
  width: 10px;
  height: 10px;
  border: 1px solid var(--widget-border);
  border-radius: 3px;
  background: transparent;
}

.venue-widget__heatmap-scroll {
  max-width: 100%;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-color: #cdd1df transparent;
  scrollbar-width: thin;
}

.venue-widget__heatmap-scroll:focus-visible {
  outline: 2px solid var(--widget-primary);
  outline-offset: 3px;
  border-radius: 6px;
}

.venue-widget__heatmap {
  width: 100%;
  min-width: 720px;
  border-spacing: 3px;
  table-layout: fixed;
}

.venue-widget__heatmap th {
  color: var(--widget-muted);
  font-size: calc(8px * var(--widget-font-scale));
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.venue-widget__heatmap thead th {
  height: 18px;
  vertical-align: bottom;
}

.venue-widget__heatmap th:first-child {
  width: 60px;
  padding-right: 6px;
  text-align: right;
}

.venue-widget__day-short {
  display: none;
}

.venue-widget__heatmap td {
  position: relative;
  height: 25px;
  padding: 0;
}

.venue-widget__cell {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.venue-widget__cell--empty { background: var(--heat-empty); }
.venue-widget__cell--low { background: var(--heat-low); }
.venue-widget__cell--medium { background: var(--heat-medium); }
.venue-widget__cell--high { background: var(--heat-high); }
.venue-widget__cell--closed { background: transparent; }

.venue-widget__heatmap td[data-open="true"]:hover .venue-widget__cell {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(40, 45, 78, 0.18);
}

.venue-widget__heatmap td.is-current .venue-widget__cell {
  outline: 3px solid var(--widget-primary);
  outline-offset: 1px;
  box-shadow: 0 0 0 5px var(--widget-primary-soft);
}

.venue-widget__heatmap td.is-current::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(32, 36, 59, 0.2);
  content: "";
  transform: translate(-50%, -50%);
}

.venue-widget__insights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
  margin-top: 16px;
}

.venue-widget__insight {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--widget-border);
  border-radius: 14px;
  background: var(--widget-surface);
}

.venue-widget__insight-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--widget-primary-soft);
  color: var(--widget-primary);
}

.venue-widget__insight-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.venue-widget__insight p {
  margin: 3px 0 0;
  color: var(--widget-text);
  font-size: calc(11px * var(--widget-font-scale));
  line-height: 1.4;
}

.venue-widget__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--widget-border);
  color: var(--widget-muted);
  font-size: calc(10px * var(--widget-font-scale));
}

.venue-widget__footer a {
  color: var(--widget-muted);
  text-decoration: none;
}

.venue-widget__footer a:hover,
.venue-widget__footer a:focus-visible {
  color: var(--widget-primary);
  text-decoration: underline;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 640px) {
  body { padding: 2px; }
  .venue-widget { padding: 16px; border-radius: 18px; }
  .venue-widget__header { gap: 10px; }
  .venue-widget__local-time { padding: 6px 8px; font-size: calc(9px * var(--widget-font-scale)); }
  .venue-widget__legend { margin-top: 14px; gap: 6px 12px; }
  .venue-widget__insights { grid-template-columns: 1fr; }
  .venue-widget__insight { padding: 10px; }
  .venue-widget__day-long { display: none; }
  .venue-widget__day-short { display: inline; }
  .venue-widget__heatmap th:first-child { width: 38px; }
  .venue-widget__footer { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .venue-widget__cell { transition: none; }
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --widget-bg: #161927;
    --widget-surface: #202438;
    --widget-border: #30354c;
    --widget-text: #f3f4fb;
    --widget-muted: #b0b5ca;
    --widget-primary: #96a0ff;
    --widget-primary-soft: #2a3054;
    --heat-empty: #294031;
    --heat-low: #438d59;
    --heat-medium: #b98631;
    --heat-high: #c15e68;
  }

}

:root[data-theme="dark"] {
  --widget-bg: #161927;
  --widget-surface: #202438;
  --widget-border: #30354c;
  --widget-text: #f3f4fb;
  --widget-muted: #b0b5ca;
  --widget-primary: #96a0ff;
  --widget-primary-soft: #2a3054;
  --heat-empty: #294031;
  --heat-low: #438d59;
  --heat-medium: #b98631;
  --heat-high: #c15e68;
}
