/* renfaire.ca tools: calendar cards, tiles and list, the shared toolbar, prices heatmap, map, history, homepage hero. */
/* Calendar cards (generated by strategic-db/faire_report/renfaire_calendar.py) */

.cal-scale {
  margin: 0 0 1.5rem;
}

.cal-scale-bar {
  height: 12px;
  border-radius: 6px;
  border: 1px solid rgba(74, 53, 34, 0.2);
}

.cal-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.cal-scale-note,
.cal-stamp {
  font-size: 0.85rem;
  opacity: 0.7;
  margin: 0.35rem 0 0;
}

.cal-month-title {
  margin: 1.6rem 0 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.05rem;
}

.cal-month-group:first-child .cal-month-title {
  margin-top: 0.4rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 0.75rem;
}

#cal-by-price {
  margin-top: 0.4rem;
}

.cal-card {
  display: flex;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(74, 53, 34, 0.18);
  border-radius: 10px;
}

.cal-card[hidden],
.cal-month-group[hidden] {
  display: none;
}

.cal-leaf {
  width: 82px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.6rem 0.3rem;
  background: var(--color-primary);
  color: var(--color-cream);
}

.cal-mon {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
}

.cal-day {
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1;
}

.cal-yr {
  font-size: 0.72rem;
  opacity: 0.7;
}

.cal-pill {
  margin-top: 0.4rem;
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(247, 240, 223, 0.55);
}

.cal-body {
  padding: 0.65rem 0.9rem;
}

.prose-card .cal-name {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
  line-height: 1.25;
}

.cal-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.cal-muted {
  opacity: 0.72;
}

.cal-small {
  font-size: 0.78rem !important;
  margin-top: 0.3rem !important;
}

.cal-note {
  opacity: 0.7;
}

.cal-empty {
  font-style: italic;
  opacity: 0.7;
}

@media (max-width: 760px) {
  .cal-grid {
    grid-template-columns: 1fr;
  }
}

/* Price tiles (sort by price) and list rows (list view), built by assets/js/calendar.js */

.cal-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.cal-tile {
  display: flex;
  flex-direction: column;
  min-height: 118px;
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

.cal-view[hidden],
.cal-tile[hidden],
.cal-row[hidden] {
  display: none;
}

.cal-tile-price {
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
}

.cal-tile-price small {
  font-family: "Lora", Georgia, serif;
  font-weight: 600;
  font-size: 0.72rem;
  margin-left: 0.4rem;
  opacity: 0.85;
  vertical-align: 0.2em;
  display: inline-block;
  white-space: nowrap;
}

.cal-tile-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.25;
  margin: 0.45rem 0 0.2rem;
}

.cal-tile-when {
  margin-top: auto;
  font-size: 0.78rem;
  opacity: 0.85;
}

.cal-ours {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.cal-list {
  border-top: 1px solid rgba(74, 53, 34, 0.18);
  margin-top: 0.4rem;
}

.cal-row {
  display: grid;
  grid-template-columns: 78px 1.4fr 1fr 1fr;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.3rem;
  border-bottom: 1px solid rgba(74, 53, 34, 0.18);
}

.cal-row-pill {
  text-align: center;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.cal-row-name {
  font-weight: 600;
  color: var(--color-primary);
}

.cal-row-when,
.cal-row-loc {
  font-size: 0.9rem;
  opacity: 0.85;
}

@media (max-width: 760px) {
  .cal-row {
    grid-template-columns: 70px 1fr;
    row-gap: 0.1rem;
  }

  .cal-row-when,
  .cal-row-loc {
    grid-column: 2;
  }
}

/* Events already past: their dates fade */
.cal-card.is-past .cal-leaf .cal-mon,
.cal-card.is-past .cal-leaf .cal-day,
.cal-card.is-past .cal-leaf .cal-yr,
.cal-card.is-past .cal-body > p:first-of-type,
.cal-tile.is-past .cal-tile-when,
.cal-row.is-past .cal-row-when {
  opacity: 0.4;
}

/* Calendar toolbar: segmented region filter, then sort and an icon view toggle on the right */
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  margin: 0.4rem 0 0.8rem;
}

.cal-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid rgba(74, 53, 34, 0.25);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.5);
}

.seg button {
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--color-secondary);
  background: none;
  border: none;
  border-left: 1px solid rgba(74, 53, 34, 0.15);
  padding: 0.4rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.seg button:first-child {
  border-left: none;
}

.seg button span {
  font-size: 0.78rem;
  opacity: 0.6;
}

.seg button:hover,
.seg button:focus-visible {
  background: rgba(194, 161, 74, 0.16);
}

.seg button[aria-pressed="true"] {
  background: var(--color-primary);
  color: var(--color-cream);
}

.seg-icons button {
  padding: 0.45rem 0.65rem;
}

.seg-icons svg {
  fill: currentColor;
  display: block;
}

.seg [data-dir="asc"]::after {
  content: " \2191";
}

.seg [data-dir="desc"]::after {
  content: " \2193";
}

.cal-region-link {
  margin: -0.3rem 0 0.8rem;
  font-size: 0.92rem;
}

.cal-region-link[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .cal-toolbar,
  .cal-tools {
    width: 100%;
  }

  .cal-tools {
    justify-content: space-between;
  }
}

.seg-label {
  font-size: 0.85rem;
  opacity: 0.7;
}

.cal-toolbar .heat-find {
  flex: 1;
  min-width: 12rem;
  max-width: 20rem;
}

.cal-toolbar .heat-find input {
  width: 100%;
  border-radius: 10px;
  padding: 0.4rem 0.85rem;
}

/* Price pages (prices.php, price-history.php) */
.heat-group {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.8rem;
  align-items: start;
  margin: 0 0 0.7rem;
}

.heat-region {
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 700;
  color: var(--color-primary);
  padding-top: 0.6rem;
}

.heat-group .cal-tiles {
  margin-top: 0;
}

.heat-unpriced {
  background: rgba(74, 53, 34, 0.06);
  border: 1px dashed rgba(74, 53, 34, 0.3);
  color: var(--color-secondary);
}

.hist-svg {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 0.6rem;
}

.hist-svg text {
  font-family: "Lora", Georgia, serif;
}

.hist-grid {
  stroke: rgba(74, 53, 34, 0.12);
}

.hist-ax {
  fill: var(--color-secondary);
  font-size: 12px;
  opacity: 0.75;
}

.hist-line {
  fill: none;
  stroke-width: 2;
}

.hist-pt {
  stroke: #faf6ea;
  stroke-width: 1.5;
}

.hist-end {
  font-size: 12px;
  font-weight: 600;
  paint-order: stroke;
  stroke: var(--color-cream);
  stroke-width: 3px;
  cursor: default;
}

.hist-svg [data-s] {
  transition: opacity 0.12s;
}

.hist-svg.hl [data-s]:not(.on) {
  opacity: 0.12;
}

.hist-svg.hl .hist-line.on {
  stroke-width: 3.5;
}

@media (max-width: 760px) {
  .heat-group {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .heat-region {
    padding-top: 0;
  }
}

.heat-free {
  background: rgba(194, 161, 74, 0.16);
  border: 1px solid rgba(194, 161, 74, 0.55);
  color: var(--color-primary);
}

.container-wide {
  width: min(1600px, 96%);
}

.section-wide {
  padding-bottom: 1.5rem;
}

.page-tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 2px solid rgba(74, 53, 34, 0.18);
}

.page-tabs button {
  font: inherit;
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-secondary);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 0.6rem 1rem;
  cursor: pointer;
}

.page-tabs button[aria-selected="true"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.tab-panel[hidden] {
  display: none;
}

/* Compact heatmap tiles on the prices page */
#heat .cal-tiles {
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 0.4rem;
}

#heat .cal-tile {
  min-height: 0;
  padding: 0.4rem 0.55rem 0.45rem;
  border-radius: 7px;
}

#heat .cal-tile-price {
  font-size: 1.05rem;
  white-space: nowrap;
}

#heat .cal-tile-price small {
  font-size: 0.62rem;
  margin-left: 0.3rem;
  vertical-align: 0.15em;
}

#heat .cal-tile-name {
  font-size: 0.78rem;
  line-height: 1.2;
  margin: 0.2rem 0 0.15rem;
}

#heat .cal-tile-when {
  font-size: 0.68rem;
  margin-top: auto;
}

#heat .heat-group {
  grid-template-columns: 44px 1fr;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

#heat .heat-region {
  padding-top: 0.35rem;
  font-size: 0.9rem;
}

/* Prices page: type to find faires */
.heat-find {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.heat-find input {
  font: inherit;
  font-size: 0.9rem;
  color: var(--color-secondary);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(74, 53, 34, 0.25);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  width: 15rem;
  max-width: 100%;
}

.heat-find input:focus {
  outline: none;
  border-color: var(--color-accent);
}

#heat .cal-tile {
  transition: opacity 0.12s;
}

#heat.heat-finding .cal-tile:not(.heat-hit) {
  opacity: 0.22;
}

#heat .heat-hit {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Price map (prices page, Map tab) */
.price-map {
  margin-top: 0.4rem;
  border: 1px solid rgba(74, 53, 34, 0.18);
  border-radius: 10px;
  overflow: hidden;
  background: #e9e2cf;
}

.map-svg {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
}

.map-grat {
  fill: none;
  stroke: rgba(74, 53, 34, 0.08);
  stroke-width: 0.6;
}

.map-land {
  fill: var(--color-cream);
  stroke: rgba(74, 53, 34, 0.35);
  stroke-width: 0.7;
}

.map-lake {
  fill: #e9e2cf;
  stroke: rgba(74, 53, 34, 0.2);
  stroke-width: 0.5;
}

.map-states {
  fill: none;
  stroke: rgba(74, 53, 34, 0.2);
  stroke-width: 0.5;
}

.map-dot {
  stroke: #2d1f12;
  stroke-opacity: 0.55;
  stroke-width: 0.8;
  cursor: pointer;
}

.map-dot.map-unpriced {
  fill: var(--color-cream);
  stroke: rgba(74, 53, 34, 0.6);
}

.map-dot.map-free {
  fill: rgba(194, 161, 74, 0.35);
}

.map-tip {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  max-width: 260px;
  background: #fffaf0;
  color: var(--color-secondary);
  border: 1px solid rgba(74, 53, 34, 0.3);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
  line-height: 1.4;
  box-shadow: var(--shadow-soft);
}

.map-tip[hidden] {
  display: none;
}

/* Homepage hero: live counts and the two tool cards (includes/home-highlights.php) */
.hero-tools {
  padding-bottom: 2rem;
}

.stat-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.6rem;
  font-size: 0.95rem;
  opacity: 0.85;
  margin: 0.4rem 0 1.6rem;
}

.stat-line b {
  font-family: "Cinzel", "Times New Roman", serif;
  color: var(--color-primary);
  font-size: 1.15rem;
  margin-right: 0.25rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.2rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--color-secondary);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(74, 53, 34, 0.2);
  border-radius: 14px;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s, transform 0.15s;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  color: var(--color-secondary);
}

.tool-card-prices {
  background: var(--color-featured-bg);
  color: var(--color-cream);
  border: 2px solid var(--color-accent);
}

.tool-card-prices:hover,
.tool-card-prices:focus-visible {
  color: var(--color-cream);
}

.tool-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-accent);
}

.tool-title {
  font-family: "Cinzel", "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--color-primary);
}

.tool-card-prices .tool-title {
  color: var(--color-cream);
}

.tool-go {
  margin-top: auto;
  padding-top: 0.6rem;
  font-weight: 600;
}

.mini-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.cal-tile.mini {
  min-height: 0;
  padding: 0.4rem 0.5rem;
  border-radius: 7px;
}

.cal-tile.mini .cal-tile-price {
  font-size: 1rem;
  white-space: nowrap;
}

.cal-tile.mini .cal-tile-price small {
  font-size: 0.6rem;
  margin-left: 0.25rem;
}

.cal-tile.mini .cal-tile-name {
  font-size: 0.72rem;
  margin: 0.15rem 0 0;
  line-height: 1.2;
}

@media (max-width: 760px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .mini-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
