/* ==========================================================================
   UGC Section 2(f)  —  /page/ugc-2f/ and /page/ugc-2f/<slug>/
   Loaded alongside page-head.css, which supplies the photo banner and the
   heading with its rule.

   Statutory papers, so the page is plain on purpose: a row of cards, then a
   PDF shown at a size somebody can actually read. The site's own palette -
   red for what you click, gold for the accents, paper on page-alt.
   ========================================================================== */

.ugc-section { background: var(--page-alt); }

.ugc-intro {
  max-width: 70ch;
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: .95rem;
  line-height: 1.8;
}

.ugc-crumbs { margin: 0 0 18px; font-size: .82rem; color: var(--muted); }
.ugc-crumbs a { color: var(--muted); }
.ugc-crumbs a:hover { color: var(--red); }
.ugc-crumbs span { margin: 0 7px; }

/* ------------------------------------------------------------- the cards --- */
.ugc-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.ugc-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: box-shadow var(--transition), transform var(--transition);
}
.ugc-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.ugc-card:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.ugc-card__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: rgba(184, 148, 46, .12);
  color: #7d631f;
}

.ugc-card__body { flex: 1 1 auto; min-width: 0; }
.ugc-card__title {
  display: block;
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
}
/* Says whether there is actually a document behind the card. A card that
   looks the same whether or not it opens anything wastes somebody's click. */
.ugc-card__state {
  display: block;
  margin-top: 5px;
  color: #7d631f;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ugc-card__state--wait {
  color: var(--muted);
  font-weight: 600;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
}

.ugc-card__go {
  flex: 0 0 auto;
  align-self: center;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  transition: color var(--transition), transform var(--transition);
}
.ugc-card:hover .ugc-card__go { color: var(--red); transform: translateX(3px); }

/* ---------------------------------------------------------- the document --- */
.ugc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
}
.ugc-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--ink);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.ugc-btn:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--ink); }
.ugc-btn:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* The second action is the same journey by another route, so it is quieter
   than the first rather than competing with it. */
.ugc-btn--quiet {
  background: var(--paper);
  color: #7d631f;
}
.ugc-btn--quiet:hover { background: var(--accent); color: var(--ink); }

/* Tall on purpose. A statutory form is portrait, and a viewer shorter than
   the page it is showing puts a scrollbar inside a scrollbar. */
.ugc-viewer {
  height: min(82vh, 980px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.ugc-viewer object { display: block; border: 0; }
.ugc-viewer__fallback {
  margin: 0;
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.8;
}
.ugc-viewer__fallback a { color: var(--red); font-weight: 700; }

.ugc-pending {
  margin: 0;
  padding: 40px 24px;
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.8;
}

/* ------------------------------------------------------------ the others --- */
.ugc-more {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.ugc-more__label {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ugc-more ul {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ugc-more a {
  display: inline-block;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}
.ugc-more a:hover { border-color: var(--accent); color: var(--ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
/* Four cards: two by two on a tablet, four across from a laptop. Three
   across would have left one stranded on a row of its own. */
@media (min-width: 768px) {
  .ugc-cards { grid-template-columns: repeat(2, 1fr); }
  .ugc-card { flex-direction: column; gap: 12px; }
  .ugc-card__go { align-self: flex-start; }
}
@media (min-width: 992px) {
  .ugc-cards { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 575.98px) {
  .ugc-card { padding: 16px 17px; gap: 13px; }
  .ugc-viewer { height: 70vh; }
  .ugc-btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ugc-card, .ugc-card__go, .ugc-btn { transition: none; }
  .ugc-card:hover { transform: none; }
  .ugc-card:hover .ugc-card__go { transform: none; }
}

/* ==========================================================================
   The appendices and the annexures — a numbered list of documents
   ========================================================================== */
.ugc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.ugc-list__row + .ugc-list__row { border-top: 1px solid var(--line); }

.ugc-list__link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 20px;
  text-decoration: none;
  transition: background var(--transition);
}
a.ugc-list__link:hover { background: rgba(184, 148, 46, .07); }
a.ugc-list__link:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }

/* The number. Fixed width so eighteen roman numerals and thirty-two arabic
   ones both leave their titles starting on the same line down the page. */
.ugc-list__ref {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 52px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: rgba(184, 148, 46, .12);
  color: #7d631f;
  font-size: .78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ugc-list__text { flex: 1 1 auto; min-width: 0; }
.ugc-list__title {
  display: block;
  color: var(--ink);
  font-size: .93rem;
  font-weight: 700;
}
.ugc-list__sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: .84rem;
  line-height: 1.55;
}

.ugc-list__go {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  transition: color var(--transition), transform var(--transition);
}
a.ugc-list__link:hover .ugc-list__go { color: var(--red); transform: translateX(3px); }

/* A row whose PDF is not uploaded yet. Deliberately NOT a link and visibly
   quieter: in a list of fifty-one, a row that looks live and is not costs
   somebody a click every single time. */
.ugc-list__row--wait { background: var(--page-alt); }
.ugc-list__link--dead { cursor: default; }
.ugc-list__row--wait .ugc-list__ref { background: var(--line); color: var(--muted); }
.ugc-list__row--wait .ugc-list__title { color: var(--muted); }
.ugc-list__row--wait .ugc-list__sub { color: var(--muted); }
.ugc-list__wait {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .76rem;
  font-style: italic;
  white-space: nowrap;
}

/* Warning above a very large download. */
.ugc-heavy {
  margin: 0 0 20px;
  padding: 13px 17px;
  background: rgba(184, 148, 46, .10);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: .88rem;
  line-height: 1.7;
}

/* Previous / all / next, at the foot of one appendix or annexure. */
.ugc-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ugc-step__link,
.ugc-step__all {
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}
.ugc-step__all { border-color: var(--accent); color: #7d631f; }
.ugc-step__link:hover,
.ugc-step__all:hover { border-color: var(--accent); color: var(--ink); }
.ugc-step__link:focus-visible,
.ugc-step__all:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

@media (max-width: 575.98px) {
  .ugc-list__link { gap: 12px; padding: 13px 14px; flex-wrap: wrap; }
  .ugc-list__ref { min-width: 44px; font-size: .72rem; }
  .ugc-list__go { display: none; }
  .ugc-step { justify-content: center; }
  .ugc-step__link, .ugc-step__all { flex: 1 1 auto; text-align: center; }
}
