/*
Theme Name: Sheshi Opening Hours System
Version: 0.33.9
Description: Adds semantic open/closed signals to every listing surface and a structured weekly profile schedule.
*/

:root {
  --status-open-text: #1f6a43;
  --status-open-bg: #e9f6ee;
  --status-open-border: #b9ddc7;
  --status-closed-text: #8f2f2f;
  --status-closed-bg: #fbecec;
  --status-closed-border: #ebc4c4;
}

.sheshi-opening-status {
  display: inline-flex !important;
  width: max-content !important;
  min-height: 20px !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 2px 7px !important;
  border: 1px solid transparent !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  pointer-events: none !important;
}

.sheshi-opening-status.is-open {
  border-color: var(--status-open-border) !important;
  color: var(--status-open-text) !important;
  background: var(--status-open-bg) !important;
}

.sheshi-opening-status.is-closed {
  border-color: var(--status-closed-border) !important;
  color: var(--status-closed-text) !important;
  background: var(--status-closed-bg) !important;
}

.sheshi-opening-status-dot {
  width: 6px !important;
  height: 6px !important;
  flex: 0 0 6px !important;
  border-radius: 50% !important;
  background: currentColor !important;
}

/* Homepage cards keep the category/location header clean and place the live
   state in the existing footer rhythm. */
body.sheshi-home .sheshi-discovery-card-foot.has-opening-status {
  grid-template-columns: minmax(0, 1fr) auto 24px !important;
}

body.sheshi-home .sheshi-discovery-card-foot .sheshi-opening-status {
  min-height: 18px !important;
  align-self: center !important;
  padding: 1px 6px !important;
  font-size: 11px !important;
}

body.sheshi-home .sheshi-institution-location {
  display: flex !important;
  min-width: 0 !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 5px 8px !important;
}

/* Search, category and location results use the same compact live state. */
.sheshi-result-card--directory-row .sheshi-result-facts .sheshi-opening-status {
  margin-right: 1px !important;
  vertical-align: middle !important;
}

.sheshi-result-card--directory-row .sheshi-result-facts > .sheshi-opening-status:first-child + .sheshi-result-separator {
  margin-left: 7px !important;
}

/* Structured profile schedule. */
body.single-listing .sheshi-profile-hours-row {
  display: block !important;
  min-width: 0 !important;
}

body.single-listing .sheshi-profile-sidebar .sheshi-profile-sidebar-location dl > div.sheshi-profile-hours-row {
  display: block !important;
}

body.single-listing .sheshi-profile-hours-title {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 0 0 7px !important;
}

body.single-listing .sheshi-profile-hours-title dt {
  min-width: 0 !important;
  margin: 0 !important;
  color: var(--text-primary) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

body.single-listing .sheshi-profile-hours {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

body.single-listing .sheshi-profile-hours-structured,
body.single-listing .sheshi-profile-hours-table {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
}

body.single-listing .sheshi-profile-hours-context {
  margin: 0 0 5px !important;
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
}

body.single-listing .sheshi-profile-hours-table-row {
  display: grid !important;
  min-width: 0 !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 14px !important;
  align-items: start !important;
  padding: 6px 0 !important;
  border-top: 1px solid var(--border) !important;
}

body.single-listing .sheshi-profile-hours-days,
body.single-listing .sheshi-profile-hours-times {
  min-width: 0 !important;
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

body.single-listing .sheshi-profile-hours-days {
  font-weight: 600 !important;
}

body.single-listing .sheshi-profile-hours-times {
  display: grid !important;
  justify-items: end !important;
  color: var(--text-primary) !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 600 !important;
  text-align: right !important;
  white-space: nowrap !important;
}

body.single-listing .sheshi-profile-hours-times.is-closed {
  color: var(--text-muted) !important;
  font-weight: 500 !important;
}

body.single-listing .sheshi-profile-hours-note {
  display: flex !important;
  min-width: 0 !important;
  flex-wrap: wrap !important;
  gap: 3px 10px !important;
  margin: 5px 0 0 !important;
  color: var(--text-muted) !important;
  font-size: 10.5px !important;
  line-height: 1.35 !important;
}

body.single-listing .sheshi-profile-hours-fallback {
  display: block !important;
  color: var(--text-secondary) !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 767px) {
  body.single-listing .sheshi-profile-hours-row {
    padding-block: 13px !important;
  }

  body.single-listing .sheshi-profile-hours-title dt {
    font-size: 12.5px !important;
  }

  body.single-listing .sheshi-profile-hours-table-row {
    gap: 16px !important;
    padding-block: 7px !important;
  }

  body.single-listing .sheshi-profile-hours-days,
  body.single-listing .sheshi-profile-hours-times {
    font-size: 12.5px !important;
  }
}

@media (max-width: 420px) {
  body.sheshi-home .sheshi-discovery-card-foot .sheshi-opening-status {
    padding-inline: 5px !important;
  }
}
