/* Components: small reusable pieces. Each block matches a Figma component. */

/* Button ------------------------------------------------------------------
   <a class="button button--primary">Label <span aria-hidden="true">→</span></a>
   Primary = magenta. Secondary = empty with a magenta outline.
   The hard shadow uses --line, so it turns night-deep inside .theme-night. */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  /* Patrick Hand SC's small caps sit low in the line, so there's less padding on top than below. */
  padding: 0.45em 1.5rem 0.75em;
  border: 2.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--font-hand);
  font-size: var(--size-button);
  line-height: 1;
  letter-spacing: 0.03em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--line);
}

.button:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--line);
}

.button--primary {
  background: var(--magenta);
  color: var(--white);
}

.button--secondary {
  background: var(--button-secondary-fill);
  color: var(--button-secondary-label);
  border-color: var(--magenta);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}

/* Wordmark ------------------------------------------------------------------
   "Krewe of the" small and hand-printed, "Youthful Yams" big in Besley. */

.wordmark {
  font-weight: 400;
}

.wordmark__krewe {
  display: block;
  font-family: var(--font-hand);
  font-size: var(--size-krewe);
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--text);
}

.wordmark__yams {
  display: block;
  font-family: var(--font-wordmark);
  font-weight: 900;
  font-size: var(--size-display);
  line-height: 0.98;
  letter-spacing: -0.01em;
  color: var(--marigold);
}

/* Smaller wordmark for the footer and page headers. */
.wordmark--small {
  --size-krewe: 1.0625rem;
  --size-display: 2.375rem;
}

@media (min-width: 50em) {
  .wordmark--small {
    --size-krewe: 1.25rem;
    --size-display: 2.75rem;
  }
}

/* Checkbox -------------------------------------------------------------------
   <label class="checkbox"><input type="checkbox"> Label</label>
   Magenta with a white tick when checked. */

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2.5px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  appearance: none;
  cursor: pointer;
}

.checkbox input:checked {
  background: var(--magenta) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}

/* Text field ------------------------------------------------------------------ */

.text-field {
  min-width: 0;
  padding: 0.75rem 1rem;
  border: 2.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
}

.text-field::placeholder {
  color: var(--ink);
  opacity: 0.55;
}

/* Section heading -----------------------------------------------------------
   <h2 class="section-heading"><span>Heading</span></h2>
   Hand-printed heading with a marigold highlighter swipe behind the lower half
   of each line. The swipe is on the span so it follows the text if it wraps. */

.section-heading {
  font-family: var(--font-hand);
  font-weight: 400;
  font-size: var(--size-heading);
  line-height: 1.1;
}

.section-heading span {
  padding: 0 0.2em 0 0.15em;
  background: linear-gradient(to bottom, transparent 50%, var(--marigold) 50%, var(--marigold) 95%, transparent 95%);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Event ----------------------------------------------------------------------
   One row in the upcoming events list. Date on the left, details beside it.
   On phones the "Event details" link sits under the details; on desktop it moves right. */

.event-list {
  padding: 0;
  list-style: none;
}

.event {
  display: grid;
  grid-template-columns: 3.75rem 1fr;
  gap: 0 1rem;
  padding: 1.25rem 0;
  border-bottom: 1.5px dashed var(--ink);
}

.event__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-wordmark);
  font-weight: 900;
  line-height: 1;
  color: var(--magenta-deep);
}

.event__month,
.event__weekday {
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.event__day {
  font-size: 2.625rem;
  line-height: 0.92;
}

.event__name {
  font-size: 1.375rem;
  margin-bottom: 0.25rem;
}

.event__place {
  font-size: 1rem;
  line-height: 1.4;
}

.event__times {
  font-size: 0.9375rem;
  line-height: 1.4;
  margin-top: 0.25rem;
  opacity: 0.8;
}

.event__price {
  font-family: var(--font-hand);
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--teal-deep);
  margin-top: 0.25rem;
}

.event__link {
  grid-column: 2;
  justify-self: start;
  margin-top: 0.5rem;
  font-family: var(--font-hand);
  font-size: 1.125rem;
  letter-spacing: 0.03em;
  text-underline-offset: 0.2em;
}

@media (min-width: 50em) {
  .event {
    grid-template-columns: 5.5rem 1fr auto;
    gap: 0 2rem;
    padding: 1.75rem 0;
  }

  .event__month,
  .event__weekday {
    font-size: 1.5rem;
  }

  .event__day {
    font-size: 3.5rem;
  }

  .event__name {
    font-size: 1.75rem;
  }

  .event__place {
    font-size: 1.125rem;
  }

  .event__times {
    font-size: 1rem;
  }

  .event__price {
    font-size: 1.125rem;
  }

  .event__link {
    grid-column: 3;
    grid-row: 1;
    margin-top: 0.25rem;
    font-size: 1.25rem;
  }
}

/* Tip jar pop-up ---------------------------------------------------------------
   Built by js/tip-jar.js. A centred night panel on desktop; a sheet that
   rises from the bottom on phones. Ko-fi's form sits inside in an iframe. */

.tip-jar {
  width: 100%;
  max-width: none;
  max-height: 92dvh;
  margin: auto 0 0;
  padding: 0;
  border: 2.5px solid var(--night-deep);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 12px 40px rgb(0 0 0 / 0.35);
  overflow: auto;
}

.tip-jar::backdrop {
  background: rgb(11 12 34 / 0.72);
}

body:has(.tip-jar[open]) {
  overflow: hidden;
}

.tip-jar__panel {
  display: grid;
  gap: 1rem;
  padding: 1.375rem 1.25rem 1.75rem;
}

.tip-jar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tip-jar__title {
  font-size: 1.875rem;
}

.tip-jar__close {
  padding: 0.2rem 0.65rem 0.35rem;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  background: none;
  color: var(--text);
  font-family: var(--font-hand);
  font-size: 1.125rem;
  cursor: pointer;
}

.tip-jar__intro {
  font-size: 1rem;
  line-height: 1.5;
}

.tip-jar__form {
  display: block;
  width: 100%;
  height: 590px; /* Ko-fi's form plus its "Powered by Ko-fi" line, without a scrollbar */
  border: 0;
  border-radius: 14px;
}

.tip-jar__fallback {
  font-size: var(--size-small);
  text-align: center;
  opacity: 0.8;
}

@media (min-width: 50em) {
  .tip-jar {
    width: 460px;
    max-height: calc(100dvh - 3rem);
    margin: auto;
    border-bottom: 2.5px solid var(--night-deep);
    border-radius: 20px;
  }

  .tip-jar__panel {
    padding: 1.625rem 1.75rem 1.75rem;
  }

  .tip-jar__title {
    font-size: 2.125rem;
  }
}

/* Nav ----------------------------------------------------------------------- */

.site-nav {
  position: absolute;
  z-index: 1;
  top: 1.375rem;
  right: 1.5rem;
  display: flex;
  gap: 1.375rem;
  font-family: var(--font-hand);
  font-size: 1.1875rem;
  letter-spacing: 0.03em;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (min-width: 50em) {
  .site-nav {
    top: 2.5rem;
    right: var(--gutter);
    gap: 2.25rem;
    font-size: 1.375rem;
  }
}
