/*
 * BA Golf Core: the Golfamore block (bagolf/golfamore, "Köp Golfamore").
 * Loaded only where the block renders, and in the block editor.
 *
 * A centred column: heading and lede, an optional green campaign line, and
 * a sheet card (as the booking block) that holds Golfamore's form. The form
 * is at most about 582px wide inside its own page, so the frame is 37rem
 * wide and centred. Golfamore does not report its height: the frame is
 * 1000px tall where the form has its two-column layout (from about 600px)
 * and 1180px below that, where its fields stack (measured 2026-11-21:
 * 942px and 1077–1124px). A taller step scrolls inside the frame.
 *
 * Text selectors carry the block class twice: the content frame's
 * `.ba-content .site-main :is(p, ul, ol)` and heading rules would win otherwise.
 */

.bagolf-golfamore {
  --bagolf-golfamore-ink: #13241b;
  --bagolf-golfamore-green: #1c3a2a;
  --bagolf-golfamore-cream: #f7f6e5;
  --bagolf-golfamore-sheet: #fffefa;
  --bagolf-golfamore-line: #dfdacb;
  /* Link underlines: 3.6:1 on the cream ground (WCAG 1.4.11). */
  --bagolf-golfamore-control: #8c8672;
  /* Secondary text: 6.5:1 on the sheet and the cream ground. */
  --bagolf-golfamore-muted: #566057;

  box-sizing: border-box;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto clamp(2rem, 5vw, 3.5rem);
  padding: 0;
  color: var(--bagolf-golfamore-ink);
  font-family: var(--typography-family-main, "Mona Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: 1rem;
  line-height: 1.5;
  text-align: left;
}

.bagolf-golfamore *,
.bagolf-golfamore *::before,
.bagolf-golfamore *::after {
  box-sizing: border-box;
}

.bagolf-golfamore [hidden] {
  display: none !important;
}

/* ---- Heading and lede ---------------------------------------------- */

.bagolf-golfamore .bagolf-golfamore__intro {
  margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
  text-align: center;
}

.bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__title {
  margin: 0;
  color: var(--bagolf-golfamore-ink);
  font-family: inherit;
  font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}

.bagolf-golfamore.bagolf-golfamore h1.bagolf-golfamore__title {
  font-size: clamp(2.125rem, 1.6rem + 2.4vw, 3.25rem);
}

.bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__lede {
  max-width: 34rem;
  margin: 0.875rem auto 0;
  color: var(--bagolf-golfamore-muted);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---- Campaign line ------------------------------------------------- */

.bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__highlight {
  margin: 0 0 1rem;
  padding: 1rem 1.25rem;
  border: 2px solid transparent;
  border-radius: 1rem;
  background-color: var(--bagolf-golfamore-green);
  color: var(--bagolf-golfamore-cream);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
}

/* ---- The form ------------------------------------------------------ */

.bagolf-golfamore .bagolf-golfamore__sheet {
  padding: clamp(0.5rem, 0.25rem + 1.25vw, 1.25rem);
  border: 1px solid var(--bagolf-golfamore-line);
  border-radius: 1.5rem;
  background-color: var(--bagolf-golfamore-sheet);
}

.bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.25rem 0 0.75rem;
  color: var(--bagolf-golfamore-muted);
  font-size: 0.9375rem;
  line-height: 1.35;
  text-align: center;
}

.bagolf-golfamore .bagolf-golfamore__icon {
  display: block;
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

.bagolf-golfamore .bagolf-golfamore__frame {
  container: bagolf-golfamore-frame / inline-size;
  position: relative;
  width: 100%;
  max-width: 37rem;
  margin-inline: auto;
  overflow: hidden;
  border-radius: 0.75rem;
  background-color: #fff;
}

.bagolf-golfamore .bagolf-golfamore__iframe {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 1180px;
  border: 0;
}

/* Without JavaScript: a link to the form, in a plain box. */
.bagolf-golfamore .bagolf-golfamore__fallback {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__loading {
  display: none;
  margin: 0;
  color: var(--bagolf-golfamore-muted);
}

/* With JavaScript: the same box sits behind the loading frame, saying it is
 * on its way, and the view script hides it once the form has loaded. */
.bagolf-golfamore .has-frame .bagolf-golfamore__fallback {
  position: absolute;
  inset: 0;
  align-content: center;
}

.bagolf-golfamore.bagolf-golfamore .has-frame .bagolf-golfamore__loading {
  display: block;
}

@container bagolf-golfamore-frame (min-width: 36rem) {
  .bagolf-golfamore .bagolf-golfamore__iframe {
    height: 1000px;
  }
}

/* The brand pill, as the booking block. */
.bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.625rem;
  border: 2px solid transparent;
  border-radius: 999px;
  background-color: var(--bagolf-golfamore-green);
  color: var(--bagolf-golfamore-cream);
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

/* ---- Contact line -------------------------------------------------- */

.bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__help {
  margin: 1.25rem 0 0;
  color: var(--bagolf-golfamore-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  text-align: center;
  text-wrap: pretty;
}

.bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__help a {
  color: var(--bagolf-golfamore-ink);
  font-weight: 600;
  font-variant-numeric: lining-nums proportional-nums;
  text-decoration: underline;
  text-decoration-color: var(--bagolf-golfamore-control);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  white-space: nowrap;
}

/* ---- States -------------------------------------------------------- */

.bagolf-golfamore a:focus-visible {
  outline: 2px solid var(--bagolf-golfamore-green);
  outline-offset: 3px;
}

@media (hover: hover) {
  .bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__open:hover {
    background-color: #285039;
    color: var(--bagolf-golfamore-cream);
  }

  .bagolf-golfamore.bagolf-golfamore .bagolf-golfamore__help a:hover {
    text-decoration-color: currentColor;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .bagolf-golfamore .bagolf-golfamore__open {
    transition: background-color 0.2s ease;
  }

  .bagolf-golfamore .bagolf-golfamore__help a {
    transition: text-decoration-color 0.2s ease;
  }
}
