/*
 * Content pages: hero, cards, announcement posts, rules menu, venue, clubs,
 * contact form. Tokens only, so sand surfaces switch roles automatically.
 */

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.hero__image {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A scrim keeps the text readable on any photo, and the page works with none. */
.hero:has(.hero__image)::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgb(11 11 11 / 0.88), rgb(11 11 11 / 0.4));
}

.hero__inner {
  display: grid;
  gap: var(--space-20);
  padding-block: var(--space-56) var(--space-64);
}

.hero__title {
  max-width: 14ch;
  font-size: var(--text-heading-hero);
  letter-spacing: -0.025em;
}

.hero__lead {
  max-width: 40ch;
  font-size: var(--text-lead);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-16) var(--space-32);
}

.hero__season {
  display: grid;
  gap: var(--space-4);
}

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: var(--grid-gap);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}

.announcement-card__body {
  display: grid;
  align-content: start;
  gap: var(--space-12);
  padding: var(--space-20);
  height: 100%;
}

.announcement-card__body .button {
  justify-self: start;
  align-self: end;
}

.announcement-card__date {
  color: var(--text-caption);
  font-size: var(--text-small);
}

.announcement-card__title {
  font-size: var(--text-heading-title);
}

.announcement-card__title a {
  text-decoration: none;
}

.announcement-card__title a:hover {
  text-decoration: underline;
}

.announcement-card__summary {
  color: var(--text-muted);
}

.announcement-card__image {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.announcement-card--featured .announcement-card__title {
  font-size: var(--text-heading-section);
}

@media (min-width: 900px) {
  .announcement-card--featured {
    flex-direction: row;
  }

  .announcement-card--featured .announcement-card__image {
    width: 50%;
    aspect-ratio: auto;
  }

  .announcement-card--featured .announcement-card__body {
    width: 50%;
    padding: var(--space-32);
  }
}

/* ---------- Announcement post ---------- */

.post {
  display: grid;
  gap: var(--space-24);
  padding: var(--space-24);
  background: var(--surface-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.post__head > * + * {
  margin-top: var(--space-12);
}

.post__image {
  width: 100%;
  border-radius: var(--radius-card);
}

/* ---------- Rules ---------- */

.rules--menu {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-32);
}

.rules__menu {
  padding: var(--space-18);
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

.rules__menu ul {
  margin-top: var(--space-8);
  list-style: none;
}

.rules__menu a {
  display: flex;
  align-items: center;
  min-height: var(--min-tap-target);
  text-decoration: none;
  font-weight: 600;
}

.rules__menu a:hover {
  text-decoration: underline;
}

/* Sticky section menu beside the rules on wide screens. */
@media (min-width: 1025px) {
  .rules--menu {
    grid-template-columns: 16rem minmax(0, 1fr);
    align-items: start;
  }

  .rules__menu {
    position: sticky;
    top: 7.5rem;
  }
}

/* ---------- Venue and clubs ---------- */

.venue-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-32);
  margin-top: var(--space-32);
  align-items: start;
}

.venue-main--solo {
  grid-template-columns: 1fr;
}

.venue-aside > * + * {
  margin-top: var(--space-24);
}

/*
 * The photo box has a fixed shape; the image (or the shared placeholder map, a
 * CSS background) is cropped to fill it. A shade sits over it: lighter on real
 * photos, darker on the placeholder. With an address and a hover-capable pointer,
 * hovering darkens the shade and shows "Get directions" (the same link as the button).
 */
.venue-photo {
  --shade: 0.25;
  --shade-hover: 0.7;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 824 / 360;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--ink-base);
  color: var(--paper-white);
}

.venue-photo__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.venue-photo--empty {
  --shade: 0.6;
  --shade-hover: 0.8;
  background: var(--ink-base) url("../img/location-no-image.webp") center / cover no-repeat;
}

.venue-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(11 11 11 / var(--shade));
  pointer-events: none;
  transition: background-color 150ms ease;
}

.venue-photo__pin {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  transition: opacity 150ms ease;
}

/* A redundant mouse shortcut: the button below is the real, focusable control. */
.venue-photo__cta {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  place-items: center;
  color: inherit;
  text-decoration: none;
}

.venue-photo__cta-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-12);
  font: 700 var(--text-label) / 1 var(--font-body);
  opacity: 0;
  transition: opacity 150ms ease;
}

@media (hover: hover) {
  .venue-photo--link .venue-photo__cta {
    display: grid;
  }

  .venue-photo--link:hover {
    --shade: var(--shade-hover);
  }

  .venue-photo--link:hover .venue-photo__cta-label {
    opacity: 1;
  }

  .venue-photo--link:hover .venue-photo__pin {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .venue-photo::after,
  .venue-photo__pin,
  .venue-photo__cta-label {
    transition: none;
  }
}

/* Backgrounds and overlays are not printed, so the empty placeholder would be a blank box. */
@media print {
  .venue-photo--empty,
  .venue-photo__cta {
    display: none;
  }
}

.venue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  margin-top: var(--space-16);
}

/* The map app's own icon sits left of the label inside the button. */
.button__app-icon {
  display: block;
  flex: none;
  width: 24px;
  height: 24px;
}

@media (max-width: 900px) {
  .venue-main {
    grid-template-columns: 1fr;
  }
}

/* Phones: Get directions takes a row, the two map app buttons share the row below. */
@media (max-width: 640px) {
  .venue-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .venue-actions__primary {
    grid-column: 1 / -1;
  }

  .venue-actions .button--compact {
    gap: var(--space-8);
    padding: 0 var(--space-8);
    font-size: var(--text-small);
  }
}

address {
  font-style: normal;
}

.club-card {
  align-content: start;
}

.club-card__logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.club-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-24);
}

.club-head__logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

/* ---------- Contact form ---------- */

.contact {
  display: grid;
  gap: var(--space-32);
}

@media (min-width: 1025px) {
  .contact:has(.contact__notes) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: start;
  }
}

.contact__form {
  padding: var(--space-24);
  border-radius: var(--radius-card);
}

.form-field {
  display: grid;
  gap: var(--space-8);
  margin: 0 0 var(--space-20);
  padding: 0;
  border: 0;
}

.form-field label,
.form-field legend {
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: 56px;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--stone-caption);
  border-radius: var(--radius-control);
  background: var(--paper-white);
  color: var(--ink-base);
  font: 400 var(--text-label) / 1.4 var(--font-body);
}

.input--select {
  padding-right: var(--space-48);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23444' stroke-width='2'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-16) center;
}

.form-optional {
  font-weight: 400;
}

.input--area {
  min-height: 9rem;
  resize: vertical;
}

.input[aria-invalid="true"] {
  border-color: #991b1b;
}

.choice {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-height: var(--min-tap-target);
  font-weight: 400;
  cursor: pointer;
}

.choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--ink-base);
}

.form-error {
  color: #991b1b;
  font-size: var(--text-small);
  font-weight: 600;
}

.form-message {
  margin-bottom: var(--space-20);
  padding: var(--space-14) var(--space-18);
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  font-weight: 600;
}

.form-message--error {
  border-color: #991b1b;
  color: #991b1b;
}

.form-message--success {
  border-color: #166534;
  color: #166534;
}

/* Honeypot: off-screen, not display:none, so simple bots still fill it. */
.form-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Form block (jellypistol/forms) ----------
   The plugin ships neutral `forms-*` markup and no stylesheet. This matches the Contact form
   above: a sand card (the roles come from the sand surface in tokens.css), the same fields,
   choices, messages and dark button (classes added through `jellypistol.forms.classes`). */

.forms-block {
  padding: var(--space-24);
  border-radius: var(--radius-card);
}

.forms-form,
.forms-fields,
.forms-group {
  display: grid;
  gap: var(--space-20);
  min-width: 0;
}

.forms-group {
  gap: var(--space-8);
  margin: 0;
  padding: 0;
  border: 0;
}

.forms-field {
  display: grid;
  gap: var(--space-8);
  min-width: 0;
}

.forms-label {
  font-weight: 700;
}

.forms-required {
  font-weight: 400;
}

.forms-description {
  margin: 0;
}

.forms-description > * + * {
  margin-top: var(--space-12);
}

.forms-help {
  color: var(--text-caption);
  font-size: var(--text-small);
}

.forms-control {
  width: 100%;
  min-height: 56px;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--stone-caption);
  border-radius: var(--radius-control);
  background: var(--paper-white);
  color: var(--ink-base);
  font: 400 var(--text-label) / 1.4 var(--font-body);
}

select.forms-control {
  padding-right: var(--space-48);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%23444' stroke-width='2'%3E%3Cpath d='M3 6l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-16) center;
}

textarea.forms-control {
  min-height: 9rem;
  resize: vertical;
}

.forms-control[aria-invalid="true"] {
  border-color: var(--status-error-on-sand);
}

.forms-option {
  display: flex;
  align-items: center;
  gap: var(--space-12);
  min-height: var(--min-tap-target);
}

.forms-option label {
  cursor: pointer;
}

.forms-choice {
  flex: none;
  width: 20px;
  height: 20px;
  accent-color: var(--ink-base);
}

.forms-error {
  color: var(--status-error-on-sand);
  font-size: var(--text-small);
  font-weight: 600;
}

.forms-banner,
.forms-confirmation {
  padding: var(--space-14) var(--space-18);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-weight: 600;
}

.forms-banner {
  border-color: var(--status-error-on-sand);
  color: var(--status-error-on-sand);
}

.forms-confirmation {
  border-color: var(--status-success-on-sand);
  color: var(--status-success-on-sand);
}

/* The script moves focus to these after a send; show where it landed. */
.forms-banner:focus,
.forms-confirmation:focus {
  outline: var(--focus-ring-width) solid var(--focus-ring);
  outline-offset: var(--focus-ring-offset);
}

.forms-form[data-state="pending"] {
  cursor: progress;
}

.forms-button {
  justify-self: start;
}

/* Hero seal: decorative, sits at the right on wide screens. */
.hero__seal {
  display: none;
}

@media (min-width: 1025px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .hero__text {
    display: grid;
    gap: var(--space-20);
  }

  .hero__seal {
    display: block;
    width: clamp(160px, 18vw, 260px);
    height: auto;
  }
}

/* ---------- Alerts page list ---------- */

.alert-list {
  display: grid;
  gap: var(--space-20);
  margin-top: var(--space-24);
  list-style: none;
}

.alert-list__item {
  --alert-dot: var(--status-info);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-12);
}

/* A colored dot in place of the bullet. The label carries the meaning too,
   so the color is never the only cue. */
.alert-list__item::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-top: 0.4em;
  border-radius: 50%;
  background: var(--alert-dot);
}

.alert-list__item--success {
  --alert-dot: var(--status-success);
}

.alert-list__item--warning {
  --alert-dot: var(--status-warning);
}

.alert-list__item--error {
  --alert-dot: var(--status-error);
}

.alert-list__item strong {
  margin-right: var(--space-8);
}

.alert-list__item a {
  margin-left: var(--space-8);
  font-weight: 700;
}

.alert-group-title {
  margin-top: var(--space-40);
  font-size: var(--text-heading-title);
}

.alert-list__ended {
  margin-left: var(--space-8);
  color: var(--text-muted);
  font-size: var(--text-small);
}
