/*
  MARKETS PAGE STYLES
  =====================
  Powers markets.html -- intro section, purple market cards, and the
  small popover menus for choosing a maps app or calendar option.
*/

.markets-intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 24px 40px 24px;
  text-align: center;
}

.markets-intro h1 {
  font-family: var(--font-primary);
  font-size: var(--font-size-h2);
  font-weight: 400;
  color: var(--color-scheme5-foreground-heading);
  margin: 0 0 16px 0;
}

.markets-intro p {
  font-family: var(--font-body);
  color: var(--color-scheme5-foreground);
  opacity: 0.8;
  line-height: 1.8;
  margin: 0;
}

.markets-list {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px 24px;
  display: flex;
  flex-direction: column;
}

.markets-list__grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.markets-empty {
  text-align: center;
  font-family: var(--font-body);
  color: var(--color-scheme5-foreground);
  opacity: 0.7;
  padding: 40px 0;
}

/* Light purple market box with a dark purple outline */
.market-card {
  background-color: #f0e6ef;
  border: 2px solid #372345;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.market-card--popover-open {
  z-index: 40;
}

@media (min-width: 640px) {
  .market-card {
    flex-direction: row;
  }
}

.market-card__image-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 14px 14px 0 0;
}

@media (min-width: 640px) {
  .market-card__image-wrapper {
    width: 260px;
    aspect-ratio: auto;
    border-radius: 14px 0 0 14px;
  }
}

.market-card__image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.market-card__content {
  padding: 24px 28px;
  flex: 1;
}

/* Dim only the photo and text on past markets -- NOT the whole card,
   since that would also make any popover opened inside it see-through. */
.market-card--fulfilled .market-card__image-wrapper,
.market-card--fulfilled .market-card__content h3,
.market-card--fulfilled .market-card__blurb {
  opacity: 0.6;
}

.market-card__title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px 0;
}

.market-card__content h3 {
  font-family: var(--font-primary);
  font-size: 1.5rem;
  font-weight: 400;
  color: #372345;
  margin: 0;
}

.market-card__badge {
  display: inline-block;
  background-color: #372345;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.market-card__date,
.market-card__location {
  display: block;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.market-card__date {
  font-size: 0.9rem;
  font-weight: bold;
  color: #372345;
  margin: 0 0 4px 0;
}

.market-card__location {
  font-size: 0.85rem;
  color: #372345;
  opacity: 0.75;
  margin: 0 0 14px 0;
}

.market-card__blurb {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: #372345;
  line-height: 1.7;
  opacity: 0.85;
  margin: 0;
}

/* Popover menu (used for both the address and date buttons) */
.market-popover {
  position: absolute;
  box-sizing: border-box;
  background-color: #ffffff;
  border: 1px solid rgba(55, 35, 69, 0.15);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 999;
}

.market-popover__option {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: #372345;
  cursor: pointer;
  text-decoration: none;
}

.market-popover__option:hover {
  background-color: #f0e6ef;
}

.market-popover__option + .market-popover__option {
  border-top: 1px solid rgba(55, 35, 69, 0.1);
}
