/*
 * AJ Competitions — public frontend styles.
 *
 * Deliberately built on the same design tokens as aj-events so a giveaway card
 * dropped onto an event page reads as part of the same site.
 */

:root {
  --aj-ink: var(--wp--preset--color--ink, #14202e);
  --aj-paper: var(--wp--preset--color--paper, #faf6ee);
  --aj-blue: var(--wp--preset--color--brand-blue, #0592ce);
  --aj-red: var(--wp--preset--color--brand-red, #ff1d27);
  --aj-line: rgba(20, 32, 46, 0.12);
  --aj-radius: 14px;
}

.aj-comp {
  margin: 2rem 0;
  color: var(--aj-ink);
}

.aj-comp-card {
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-radius);
  background: #fff;
  padding: 1.5rem;
  box-shadow: 0 6px 24px rgba(20, 32, 46, 0.06);
  /* The blue rule at the top is the shared aj-* card signature. */
  border-top: 4px solid var(--aj-blue);
}

.aj-comp--drawn .aj-comp-card { border-top-color: var(--aj-line); }
.aj-comp--closed .aj-comp-card { border-top-color: var(--aj-line); }

.aj-comp-card__head { margin-bottom: 1rem; }

.aj-comp-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--aj-blue);
  margin-bottom: 0.35rem;
}

.aj-comp-card__title {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  line-height: 1.25;
}

.aj-comp-partner {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.75;
}

/* Fact list — pills, not bullets. Theme content styles (Neve's .entry-content
   ul li, and anything using ::before or ::marker) reach these when a card is
   dropped inside an article, so the reset has to be emphatic. */
.aj-comp-facts {
  list-style: none !important;
  margin: 0 0 1.25rem !important;
  padding: 0 !important;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.9rem;
}

.aj-comp-facts li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(5, 146, 206, 0.08);
}

.aj-comp-facts li::marker { content: ""; }
.aj-comp-facts li::before { content: none !important; display: none !important; }

/* Form — collapsed to a single button until someone commits to entering. */
.aj-comp-form { margin: 0; }

.aj-comp-form--collapsible .aj-comp-form__fields { display: none; }
.aj-comp-form--collapsible.is-open .aj-comp-form__fields { display: block; }
.aj-comp-form--collapsible.is-open .aj-comp-reveal { display: none; }

/* The fields fade in rather than snapping, so the page growing under a click
   reads as a response to it. Skipped for anyone who asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .aj-comp-form--collapsible.is-open .aj-comp-form__fields {
    animation: aj-comp-reveal 0.18s ease-out;
  }
}

@keyframes aj-comp-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.aj-comp-row {
  display: grid;
  gap: 0 0.9rem;
  grid-template-columns: 1fr;
}

@media (min-width: 520px) {
  .aj-comp-row { grid-template-columns: 1fr 1fr; }
}

.aj-comp-field { margin: 0 0 0.9rem; }

.aj-comp-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.aj-comp-field input,
.aj-comp-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--aj-line);
  border-radius: 10px;
  background: #fff;
  color: var(--aj-ink);
  font-size: 1rem;
  font-family: inherit;
}

.aj-comp-field input:focus,
.aj-comp-field textarea:focus {
  outline: none;
  border-color: var(--aj-blue);
  box-shadow: 0 0 0 3px rgba(5, 146, 206, 0.18);
}

.aj-comp-field input:invalid.is-touched { border-color: var(--aj-red); }

.aj-comp-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  opacity: 0.7;
}

.aj-comp-check { margin: 0 0 1rem; font-size: 0.9rem; }
.aj-comp-check label { display: flex; gap: 0.5rem; align-items: flex-start; cursor: pointer; }
.aj-comp-check input { margin-top: 0.2rem; }

/* The honeypot must be reachable by a bot and invisible to a person — so it is
   moved off-screen rather than display:none, which some bots skip. */
.aj-comp-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.aj-comp-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  width: 100%;
  padding: 0.85rem 1.5rem;
  border: 0;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.12s ease, opacity 0.12s ease;
  text-decoration: none;
  text-align: center;
}

/* The class is doubled to raise specificity above the theme's button /
   [type=submit] rules, which otherwise take the hover to their own blue. Same
   problem aj-events solves with .aj-ev-btn.aj-ev-btn--primary, and the same
   dark red (#d6121b) so the two buttons behave identically. */
.aj-comp-btn.aj-comp-btn,
.aj-comp-btn.aj-comp-btn:link,
.aj-comp-btn.aj-comp-btn:visited { background-color: var(--aj-red); color: #fff; }

.aj-comp-btn.aj-comp-btn:hover,
.aj-comp-btn.aj-comp-btn:focus { background-color: #d6121b; color: #fff; }

.aj-comp-btn.aj-comp-btn:hover { transform: translateY(-1px); }
.aj-comp-btn.aj-comp-btn:disabled { opacity: 0.6; cursor: progress; transform: none; background-color: var(--aj-red); }

.aj-comp-terms {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  opacity: 0.8;
}

.aj-comp-terms summary { cursor: pointer; font-weight: 600; }
.aj-comp-terms div { margin-top: 0.5rem; }

.aj-comp-flash {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: rgba(5, 146, 206, 0.1);
  border: 1px solid var(--aj-blue);
  font-weight: 600;
}

.aj-comp-flash.is-error {
  background: rgba(255, 29, 39, 0.08);
  border-color: var(--aj-red);
}

.aj-comp-form.is-done .aj-comp-form__fields,
.aj-comp-form.is-done .aj-comp-reveal { display: none !important; }

/* Non-form states */
.aj-comp-state {
  margin: 0;
  padding: 0.85rem 1.1rem;
  border-radius: 10px;
  background: var(--aj-paper);
  border: 1px solid var(--aj-line);
  font-weight: 600;
}

.aj-comp-winners h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.aj-comp-winners ul { margin: 0 0 0.5rem; padding-left: 1.2rem; }
.aj-comp-winners li { font-weight: 700; }

.aj-comp-code {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.2rem;
  border: 1px dashed var(--aj-blue);
  border-radius: 12px;
  background: rgba(5, 146, 206, 0.06);
}

.aj-comp-code span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  opacity: 0.7;
}

.aj-comp-code strong { font-size: 1.35rem; letter-spacing: 0.03em; word-break: break-all; }

.aj-comp-subhead { margin: 1.6rem 0 0.5rem; font-size: 1.1rem; }

/* Confirm / claim landing page */
.aj-comp--page {
  max-width: 640px;
  margin: 3rem auto;
  padding: 0 15px;
}

/* Card grid for [aj_comp_list] */
.aj-comp-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin: 2rem 0;
}

.aj-comp-tile {
  border: 1px solid var(--aj-line);
  border-radius: var(--aj-radius);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(20, 32, 46, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.aj-comp-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(20, 32, 46, 0.1);
}

.aj-comp-tile__link { display: block; text-decoration: none; color: inherit; }
.aj-comp-tile__media { aspect-ratio: 1200 / 628; background: var(--aj-line); }
.aj-comp-tile__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aj-comp-tile__body { padding: 1rem 1.1rem 1.2rem; }
.aj-comp-tile__title { margin: 0.15rem 0 0.4rem; font-size: 1.1rem; line-height: 1.3; }
.aj-comp-tile__meta { margin: 0; font-size: 0.85rem; opacity: 0.7; }
