/* Content blocks — the hub and guide styling (inc/content-blocks.php).
 *
 * Built from the site's EXISTING components rather than the mockup's own
 * palette, so a hub or guide reads as part of Epic Pulls, not a bolt-on.
 * Every value below is lifted from somewhere already on the site:
 *
 *   panel     the competition page's info card (.ep-giveaway-info-card__inner):
 *             white, 16px radius, soft navy two-layer shadow, 32px padding
 *   card      the instant-win prize rows (giveaway-cards.css): white, 12px
 *             radius, 1px plum hairline at 25%
 *   pill      the prize rows' "remaining" tag: violet 8% wash, plum text
 *   circle    the prize rows' chevron: 34px, violet 10% wash, violet glyph
 *   label     the competition meta bar: 13px slate, uppercase, tracked, 600
 *   heading   .title-medium (_bootscore-custom.scss): h3 rung, navy, pulsing dot
 *   accordion the competition page's FAQs: Sora 600 questions, plum hairlines
 *   band      the How It Works block's deep violet (#1b0b38)
 *
 * Block styles are opt-in (editor Styles panel, or className): Group → Panel,
 * Card, Callout, CTA band; Table → Epic Pulls table. Details blocks take the
 * accordion look everywhere they are used inside content. Loaded on the front
 * end and inside the editor canvas.
 */

:root {
  --ep-navy: #14263a;
  --ep-text: #374758;
  --ep-muted: #64748b;
  --ep-violet: #6d28d9;
  --ep-plum: #5b21b6;
  --ep-plum-deep: #4c1d95;
  --ep-band: #1b0b38;
  --ep-strip: #3a1976;
  --ep-tint: #f4efff;
  --ep-hairline: rgba(76, 29, 149, 0.25);
  --ep-hairline-soft: rgba(76, 29, 149, 0.12);
  --ep-wash: rgba(109, 40, 217, 0.08);
  --ep-wash-strong: rgba(109, 40, 217, 0.1);
  --ep-radius-panel: 16px;
  --ep-radius-card: 12px;
  --ep-shadow-panel: 0 1px 2px rgba(20, 38, 58, 0.08), 0 6px 20px rgba(20, 38, 58, 0.06);
  --ep-shadow-lift: 0 2px 4px rgba(20, 38, 58, 0.08), 0 12px 28px rgba(20, 38, 58, 0.1);
}

/* ---- Section headings: the site's .title-medium, on hubs and guides ------- */
/* Same look as "Upcoming Competitions" on the homepage — h3 rung, navy, the
   pulsing violet dot — minus its text-transform: capitalize, which would turn
   "What is 30th Celebration?" into "What Is 30th Celebration?". Headings inside
   the hero, cards, callouts, bands and FAQ answers are labels, not sections. */

:is(.ep-hub, .ep-guide) .entry-content h2.wp-block-heading:not(:is(.ep-hub-hero, .is-style-ep-callout, .is-style-ep-cta-band, .is-style-ep-card, .wp-block-details) h2),
.ep-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 0; /* .title-medium's own padding, so the heading has the same air */
  margin-bottom: 0.25rem !important; /* beats the block-gap and WP layout resets; the padding carries the space */
  color: var(--ep-navy);
  font-size: var(--ep-fs-h3, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
}

:is(.ep-hub, .ep-guide) .entry-content h2.wp-block-heading:not(:is(.ep-hub-hero, .is-style-ep-callout, .is-style-ep-cta-band, .is-style-ep-card, .wp-block-details) h2)::before,
.ep-section-title::before {
  content: "";
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--ep-violet);
  animation: ep-pulse 2s infinite; /* keyframes defined with .title-medium in main.css */
}

@media (prefers-reduced-motion: reduce) {
  .ep-section-title::before,
  :is(.ep-hub, .ep-guide) .entry-content h2.wp-block-heading::before { animation: none; }
}

/* ---- Buttons on hubs and guides ------------------------------------------ */
/* Bootscore stamps Bootstrap's `gap-1` (0.25rem !important) onto every core
   button row, so two buttons sit 4px apart and read as stuck together (the
   homepage hero has the same). Hubs and guides get a proper gap; a utility
   marked !important can only be overridden the same way. The homepage is left
   as it is. */

body :is(.ep-hub, .ep-guide) .wp-block-buttons.gap-1,
body :is(.ep-hub, .ep-guide) .wp-block-buttons {
  gap: 0.75rem !important;
}

/* ---- Group: Panel --------------------------------------------------------- */

.wp-block-group.is-style-ep-panel {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--ep-radius-panel);
  background: #fff;
  box-shadow: var(--ep-shadow-panel);
}

.wp-block-group.is-style-ep-panel > :first-child { margin-top: 0; }
.wp-block-group.is-style-ep-panel > :last-child { margin-bottom: 0; }

/* ---- Group: Card ---------------------------------------------------------- */

.wp-block-group.is-style-ep-card {
  height: 100%;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid var(--ep-hairline);
  border-radius: var(--ep-radius-card);
  background: #fff;
  transition: box-shadow 0.2s ease;
}

.wp-block-group.is-style-ep-card:hover {
  box-shadow: var(--ep-shadow-lift);
}

.wp-block-group.is-style-ep-card > :first-child { margin-top: 0; }
.wp-block-group.is-style-ep-card > :last-child { margin-bottom: 0; }

.wp-block-group.is-style-ep-card :is(h3, h4) {
  margin-bottom: 0.35rem;
  color: var(--ep-navy);
  font-size: var(--ep-fs-base, 1rem);
  font-weight: 700;
}

.wp-block-group.is-style-ep-card p {
  color: var(--ep-muted);
  font-size: var(--ep-fs-sm, 0.875rem);
  line-height: 1.55;
}

/* ---- Group: Callout (one standout figure) --------------------------------- */
/* The How It Works band's deep violet with the hero's violet glow, so a key
   number belongs to the same dark family as the hero and the bands. */

.wp-block-group.is-style-ep-callout {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 1.75rem;
  border-radius: var(--ep-radius-panel);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(124, 58, 237, 0.45) 0%, rgba(124, 58, 237, 0) 55%),
    var(--ep-band);
  color: rgba(255, 255, 255, 0.8);
}

.wp-block-group.is-style-ep-callout > :first-child { margin-top: 0; }
.wp-block-group.is-style-ep-callout > :last-child { margin-bottom: 0; }

.wp-block-group.is-style-ep-callout :is(h2, h3, h4, strong) {
  color: #fff;
}

/* The label line above the figure: the meta-bar style, on dark. */
.wp-block-group.is-style-ep-callout > p:first-child {
  color: #c4b5fd;
  font-size: var(--ep-fs-xs, 0.8125rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wp-block-group.is-style-ep-callout :is(h2, h3) {
  margin: 0.15rem 0 0.4rem;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.05;
}

/* ---- Group: CTA band ------------------------------------------------------ */
/* The How It Works band again — deep violet, full width — which the site
   already uses to close a section, with the site's own primary button. */

.wp-block-group.is-style-ep-cta-band {
  width: 100vw;
  max-width: 100vw;
  margin: 3rem calc(50% - 50vw) 0;
  padding: clamp(2.5rem, 5vw, 4rem) max(1.25rem, calc((100vw - 1296px) / 2));
  background:
    radial-gradient(60% 120% at 85% 50%, rgba(124, 58, 237, 0.35) 0%, rgba(124, 58, 237, 0) 60%),
    var(--ep-band);
  color: rgba(255, 255, 255, 0.82);
}

.wp-block-group.is-style-ep-cta-band.is-layout-constrained > * {
  max-width: 1296px;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.wp-block-group.is-style-ep-cta-band :is(h2, h3) {
  margin-top: 0;
  margin-bottom: 0.5rem; /* the band's heading has no padding of its own (unlike section headings), so it needs this to clear the line below */
  color: #fff;
  font-size: var(--ep-fs-h2, 2rem);
}

.wp-block-group.is-style-ep-cta-band p {
  max-width: 40rem;
  color: rgba(255, 255, 255, 0.82);
}

/* An outline button on the band reads white, as on the hero (main.css forces
   button colours with !important, so the override must too). */
.wp-block-group.is-style-ep-cta-band .wp-block-button.is-style-outline > .wp-block-button__link {
  border-color: rgba(255, 255, 255, 0.55) !important;
  background: transparent !important;
  color: #fff !important;
}

.wp-block-group.is-style-ep-cta-band .wp-block-button.is-style-outline > .wp-block-button__link:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* A closing band sits flush on the footer: no content padding under it. */
#content:has(.entry-content:last-child > .is-style-ep-cta-band:last-child) {
  padding-bottom: 0 !important;
}

.entry-content > .is-style-ep-cta-band:last-child {
  margin-bottom: 0;
}

/* ---- Table: Epic Pulls ---------------------------------------------------- */
/* Bootscore re-renders core tables as Bootstrap's `figure.table-responsive >
   table.table`, dropping `wp-block-table` but keeping the style class, so the
   selectors key on `.is-style-ep-table` alone and colours go through
   Bootstrap's table variables. Header in the card band indigo (#3a1976). */

.is-style-ep-table {
  margin-bottom: var(--ep-block-gap, 1.5rem);
}

.is-style-ep-table table {
  --bs-table-bg: #fff;
  width: 100%;
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--ep-hairline);
  border-radius: var(--ep-radius-card);
  overflow: hidden;
  font-size: var(--ep-fs-sm, 0.875rem);
}

.is-style-ep-table :is(th, td) {
  padding: 0.8rem 1.1rem;
  border: 0;
  border-top: 1px solid var(--ep-hairline-soft);
  color: var(--ep-text);
  text-align: left;
}

.is-style-ep-table thead th {
  --bs-table-bg: var(--ep-strip);
  --bs-table-color: #fff;
  border-top: 0;
  background-color: var(--ep-strip);
  color: #fff;
  font-size: var(--ep-fs-xs, 0.8125rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.is-style-ep-table tbody td:last-child {
  color: var(--ep-navy);
  font-weight: 700;
}

.is-style-ep-table tbody tr:hover > td {
  --bs-table-bg: var(--ep-tint);
}

.is-style-ep-table figcaption,
.is-style-ep-table + p {
  margin-top: 0.6rem;
  color: var(--ep-muted);
  font-size: var(--ep-fs-xs, 0.8125rem);
  text-align: left;
}

/* ---- Details: the competition page's FAQ accordion ------------------------ */
/* No box per question: Sora questions between plum hairlines, as on every
   competition page, with the prize rows' violet chevron circle. */

:is(.entry-content, .editor-styles-wrapper) .wp-block-details {
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ep-hairline);
  background: transparent;
}

:is(.entry-content, .editor-styles-wrapper) :not(.wp-block-details) + .wp-block-details,
:is(.entry-content, .editor-styles-wrapper) .wp-block-details:first-child {
  border-top: 1px solid var(--ep-hairline);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-details > summary {
  position: relative;
  padding: 1.1rem 3.25rem 1.1rem 0;
  color: var(--ep-navy);
  font-family: Sora, sans-serif;
  font-size: var(--ep-fs-lg, 1.125rem);
  font-weight: 600;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}

.entry-content .wp-block-details > summary::-webkit-details-marker { display: none; }

:is(.entry-content, .editor-styles-wrapper) .wp-block-details > summary::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  width: 34px;
  height: 34px;
  margin-top: -17px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%236d28d9' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat,
    var(--ep-wash-strong);
  transition: transform 0.2s ease;
}

.entry-content .wp-block-details[open] > summary::after {
  transform: rotate(180deg);
}

.entry-content .wp-block-details > summary:hover {
  color: var(--ep-violet);
}

.entry-content .wp-block-details > summary:focus-visible {
  outline: 2px solid var(--ep-violet);
  outline-offset: 4px;
  border-radius: 4px;
}

.entry-content .wp-block-details > :not(summary) {
  margin: 0;
  padding: 0 3.25rem 1.2rem 0;
  color: var(--ep-text);
}

/* ---- Free-entry section (hub template) ------------------------------------ */

.ep-free-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  align-items: center;
  margin: 3rem 0 1rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: var(--ep-radius-panel);
  background: #fff;
  box-shadow: var(--ep-shadow-panel);
}

.ep-free-entry__label {
  margin: 0 0 0.35rem;
  color: var(--ep-muted);
  font-size: var(--ep-fs-xs, 0.8125rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ep-free-entry h2 {
  margin: 0 0 0.6rem;
  color: var(--ep-navy);
  font-size: var(--ep-fs-h3, 1.5rem);
}

.ep-free-entry p {
  margin: 0 0 0.6rem;
  color: var(--ep-text);
}

.ep-free-entry p:last-child { margin-bottom: 0; }

.ep-free-entry address {
  margin: 0;
  padding: 1.1rem 1.25rem;
  border-radius: var(--ep-radius-card);
  background: var(--ep-tint);
  color: var(--ep-navy);
  font-style: normal;
  font-weight: 600;
  line-height: 1.6;
}

@media (max-width: 767.98px) {
  .ep-free-entry { grid-template-columns: 1fr; }
}

/* ---- Hubs/guides: the winners block sits left, like the rest of the page -- */

:is(.ep-hub, .ep-guide) .ep-winners-block__title,
:is(.ep-hub, .ep-guide) .ep-winners-block .row {
  justify-content: flex-start !important;
}

:is(.ep-hub, .ep-guide) .ep-winners-block__more {
  text-align: left;
}

/* ---- Columns on hubs/guides: room between the contents and the content ---- */

@media (min-width: 782px) {
  :is(.ep-hub, .ep-guide) .wp-block-columns {
    gap: 2.5rem;
  }
}

/* ---- Phones -------------------------------------------------------------- */
/* One pass for the shared pieces: smaller section titles and dot, panels with
   less padding (a 32px inset leaves too little line length at 375px), the
   callout figure and the CTA band scaled down, FAQ questions one step smaller,
   the table denser. */

@media (max-width: 575.98px) {
  :is(.ep-hub, .ep-guide) .entry-content h2.wp-block-heading:not(:is(.ep-hub-hero, .is-style-ep-callout, .is-style-ep-cta-band, .is-style-ep-card, .wp-block-details) h2),
  .ep-section-title {
    gap: 8px;
    padding: 9px 0;
    font-size: 1.25rem;
  }

  :is(.ep-hub, .ep-guide) .entry-content h2.wp-block-heading:not(:is(.ep-hub-hero, .is-style-ep-callout, .is-style-ep-cta-band, .is-style-ep-card, .wp-block-details) h2)::before,
  .ep-section-title::before {
    width: 12px;
    height: 12px;
  }

  .wp-block-group.is-style-ep-panel,
  .ep-free-entry {
    padding: 1.1rem 1rem;
    border-radius: var(--ep-radius-card);
  }

  .wp-block-group.is-style-ep-callout {
    padding: 1.15rem 1.25rem;
  }

  .wp-block-group.is-style-ep-callout :is(h2, h3) {
    font-size: 2rem;
  }

  .wp-block-group.is-style-ep-cta-band {
    margin-top: 2rem;
    padding-top: 2rem;
    padding-bottom: 2.25rem;
  }

  .wp-block-group.is-style-ep-cta-band :is(h2, h3) {
    font-size: 1.375rem;
  }

  .wp-block-group.is-style-ep-cta-band .wp-block-button {
    width: 100%;
  }

  .wp-block-group.is-style-ep-cta-band .wp-block-button__link {
    width: 100%;
  }

  :is(.entry-content, .editor-styles-wrapper) .wp-block-details > summary {
    padding: 0.95rem 2.75rem 0.95rem 0;
    font-size: var(--ep-fs-base, 1rem);
  }

  :is(.entry-content, .editor-styles-wrapper) .wp-block-details > summary::after {
    width: 30px;
    height: 30px;
    margin-top: -15px;
  }

  .entry-content .wp-block-details > :not(summary) {
    padding-right: 0;
    font-size: var(--ep-fs-sm, 0.875rem);
  }

  .is-style-ep-table :is(th, td) {
    padding: 0.6rem 0.75rem;
  }

  .wp-block-group.is-style-ep-card {
    padding: 1rem;
  }

  .ep-free-entry {
    margin-top: 2rem;
  }
}
