/*
 * SASH Invigning — small additions for /invigning and /invigning-admin.php.
 * Uses only the design tokens already defined in styles-DQIH3GAp.css
 * (--foreground, --background, --muted, --sand, --stone, --border, --destructive).
 */

/* Placeholders for event details not yet provided. Remove the spans when real content is added. */
.invigning-placeholder {
  background: var(--sand);
  border-bottom: 1px dashed var(--stone);
  padding: 0 .25em;
}

/* Form additions not present in the compiled Tailwind build. */
.rsvp-select {
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  cursor: pointer;
  padding-right: 1.75rem;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - .65rem) 55%, calc(100% - .35rem) 55%;
  background-size: .3rem .3rem;
  background-repeat: no-repeat;
}

.rsvp-optional {
  color: var(--stone);
  letter-spacing: .1em;
  text-transform: none;
}

.rsvp-error {
  color: var(--destructive);
  font-size: .75rem;
  line-height: 1.5;
  margin-top: .5rem;
}

[data-rsvp-form] [aria-invalid="true"] {
  border-color: var(--destructive);
}

.rsvp-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .25rem .875rem;
  align-items: start;
}

.rsvp-consent input {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: .2rem;
  accent-color: var(--foreground);
  cursor: pointer;
}

.rsvp-consent .rsvp-error {
  grid-column: 2;
  margin-top: 0;
}

.rsvp-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Keep the form (deep link /invigning#anmalan), focused fields and the confirmation clear of the sticky nav bar. */
#anmalan,
[data-rsvp-form] :is(input, select, textarea),
.rsvp-success {
  scroll-margin-top: 6rem;
}

.rsvp-success:focus {
  outline: none;
}

.rsvp-success:focus-visible {
  outline: 1px solid var(--foreground);
  outline-offset: .5rem;
}

/*
 * Hero image must fill the hero. The production stylesheet's unlayered `img{height:auto}` safeguard
 * overrides the layered Tailwind `.h-full` utility, which leaves a hard image edge through the hero on
 * phones and tablets (the live homepage hero has the same issue). Scoped to this page only.
 */
.home-hero img.h-full {
  height: 100%;
}

/* Respect reduced-motion preferences for the existing entrance animation on this page. */
@media (prefers-reduced-motion: reduce) {
  .animate-reveal {
    animation: none;
  }
}

/* ---------- Admin ---------- */

.rsvp-admin-logout {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

@media (max-width: 39.999rem) {
  .rsvp-admin-user {
    display: none;
  }
}

.rsvp-admin-flash {
  border: 1px solid var(--border);
  background: var(--muted);
  padding: .875rem 1rem;
  margin-bottom: 2rem;
}

.rsvp-admin-warning {
  border: 1px solid var(--destructive);
  color: var(--destructive);
  padding: .875rem 1rem;
  margin-bottom: 2rem;
}

.rsvp-admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.rsvp-admin-stats > div {
  padding: 1.5rem 1.5rem 1.5rem 0;
}

.rsvp-admin-stats dd {
  font-size: 2.5rem;
  line-height: 1.1;
  margin: .75rem 0 0;
}

.rsvp-admin-notes {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  line-height: 1.8;
}

.rsvp-table-wrap {
  position: relative; /* contains absolutely positioned .sr-only headers inside the scroll area */
  overflow-x: auto;
  border-top: 1px solid var(--border);
}

.rsvp-table-wrap:focus-visible {
  outline: 1px solid var(--foreground);
  outline-offset: .25rem;
}

.rsvp-table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  font-size: .875rem;
}

.rsvp-table th {
  font-family: var(--font-mono);
  font-size: .625rem;
  font-weight: 400;
  letter-spacing: .25em;
  text-align: left;
  text-transform: uppercase;
  color: var(--stone);
  padding: 1rem 1rem 1rem 0;
  border-bottom: 1px solid var(--border);
}

.rsvp-table td {
  padding: 1rem 1rem 1rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.rsvp-nowrap {
  white-space: nowrap;
}

.rsvp-row-delete summary {
  cursor: pointer;
  color: var(--stone);
  list-style: none;
}

.rsvp-row-delete summary::-webkit-details-marker {
  display: none;
}

.rsvp-row-delete summary:hover,
.rsvp-row-delete[open] summary {
  color: var(--foreground);
}

.rsvp-row-delete form {
  margin-top: .5rem;
}

.rsvp-danger {
  color: var(--destructive);
  border-bottom: 1px solid currentColor;
  padding-bottom: .125rem;
  cursor: pointer;
}

.rsvp-danger-button {
  border: 1px solid var(--destructive);
  color: var(--destructive);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}

.rsvp-danger-button:hover,
.rsvp-danger-button:focus-visible {
  background: var(--destructive);
  color: var(--destructive-foreground);
}

.rsvp-admin-danger-zone > * {
  max-width: 36rem;
}
