/* ==================================================================
   12 · Legacy conformance
   ------------------------------------------------------------------
   The retained /pma pages were built in the Avia Layout Builder on the
   previous retail design. Their bodies carry roughly 1,300 hard-coded
   hex colours as INLINE styles, spread over 30 pages, together with
   retail-era spacing, borders and button treatments.

   Inline styles beat stylesheets, so colour is normalised in PHP at
   render time (see pma_normalise_legacy_palette in functions.php),
   which leaves the stored Avia Builder data byte-identical. This file
   handles everything colour normalisation cannot: geometry, rhythm,
   typography inside legacy content, and the elements that should not
   be shown at all.

   Everything is anchored on #top.pma / body.pma, so nothing here can
   reach the root site, /courses or /psychology.
   ================================================================== */

/* ------------------------------------------------------------------
   1 · Dead buttons never render
   Ten Avia buttons are published with an empty href. A button that
   goes nowhere is worse than no button. They disappear until a real
   destination is set in the builder, at which point they return
   automatically — no code change needed.
   ------------------------------------------------------------------ */
#top.pma .avia-button[href=""],
#top.pma .avia_button[href=""],
#top.pma .avia-button-wrap:has(> .avia-button[href=""]),
#top.pma .entry-content-wrapper a.avia-button[href=""] {
  display: none !important;
}

/* ------------------------------------------------------------------
   2 · Section rhythm
   Legacy sections carry per-section padding chosen page by page. One
   institutional rhythm replaces it, so every retained page breathes
   like the new homepage.
   ------------------------------------------------------------------ */
#top.pma .avia-section > .container,
#top.pma .avia-section .content,
#top.pma .avia-section .sidebar {
  padding-top: clamp(var(--s-6), 3vw, var(--s-8));
  padding-bottom: clamp(var(--s-6), 3vw, var(--s-8));
}

#top.pma .avia-section.av-minimum-height > .container {
  padding-top: var(--s-7);
  padding-bottom: var(--s-7);
}

#top.pma .flex_column,
#top.pma .av_one_half,
#top.pma .av_one_third,
#top.pma .av_one_fourth {
  margin-bottom: var(--s-5);
}

/* ------------------------------------------------------------------
   3 · Typography inside legacy content
   Retail pages set heading sizes inline and per element. The
   institutional scale is reasserted so a legacy page and a new page
   read as one document.
   ------------------------------------------------------------------ */
#top.pma .entry-content-wrapper h1,
#top.pma .entry-content-wrapper h2,
#top.pma .entry-content-wrapper h3,
#top.pma .entry-content-wrapper h4,
#top.pma .av-special-heading .av-special-heading-tag {
  font-family: var(--pma-serif) !important;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-transform: none !important;
}

#top.pma .entry-content-wrapper h2,
#top.pma .av-special-heading h2 {
  font-size: var(--fs-h2) !important;
  line-height: 1.2;
}

#top.pma .entry-content-wrapper h3,
#top.pma .av-special-heading h3 {
  font-size: var(--fs-h3) !important;
  line-height: 1.3;
}

#top.pma .entry-content-wrapper p,
#top.pma .entry-content-wrapper li,
#top.pma .template-page .post-entry p {
  font-family: var(--pma-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  max-width: var(--measure);
}

#top.pma .entry-content-wrapper .av-special-heading + p,
#top.pma .av-subheading p {
  color: var(--pma-ink-muted);
}

/* Retail emphasis: all-caps, letterspaced, coloured shouting. */
#top.pma .entry-content-wrapper strong,
#top.pma .entry-content-wrapper b {
  font-weight: 600;
  color: inherit;
}

/* ------------------------------------------------------------------
   4 · Buttons — one language across the whole campus
   ------------------------------------------------------------------ */
#top.pma .entry-content-wrapper .avia-button,
#top.pma .avia-button.avia-color-theme-color,
#top.pma .avia-button.avia-color-light,
#top.pma .avia-button.avia-color-dark,
#top.pma .avia-button.avia-color-red,
#top.pma .avia-button.avia-color-green,
#top.pma .avia-button.avia-color-orange {
  background: var(--pma-navy-900) !important;
  border: 1px solid var(--pma-navy-900) !important;
  color: var(--pma-white) !important;
  border-radius: var(--radius-sm) !important;
  font-family: var(--pma-sans) !important;
  font-size: var(--fs-sm) !important;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none !important;
  padding: 0.75em 1.5em !important;
  box-shadow: none !important;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

#top.pma .entry-content-wrapper .avia-button:hover,
#top.pma .entry-content-wrapper .avia-button:focus-visible {
  background: var(--pma-navy-800) !important;
  border-color: var(--pma-gold-500) !important;
}

#top.pma .entry-content-wrapper .avia-button.avia-color-light,
#top.pma .avia-section.av-section-color-overlay-active .avia-button {
  background: transparent !important;
  color: var(--pma-white) !important;
  border-color: var(--pma-gold-300) !important;
}

/* ------------------------------------------------------------------
   5 · Cards, boxes and callouts left over from the retail theme
   ------------------------------------------------------------------ */
#top.pma .av_promobox,
#top.pma .avia-testimonial,
#top.pma .iconbox,
#top.pma .av-catalogue-list,
#top.pma .avia-content-slider .slide-entry-wrap,
#top.pma .toggle_wrap .single_toggle {
  background: var(--pma-white) !important;
  border: var(--hairline) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
}

#top.pma .iconbox .iconbox_icon,
#top.pma .av-icon-char {
  background: transparent !important;
  color: var(--pma-gold-500) !important;
  border-color: var(--pma-stone-300) !important;
  box-shadow: none !important;
}

#top.pma .av_promobox .avia-promocontent p {
  max-width: none;
}

/* ------------------------------------------------------------------
   6 · Images — one frame, one aspect ratio, nothing stretched
   ------------------------------------------------------------------ */
#top.pma .entry-content-wrapper .avia_image,
#top.pma .entry-content-wrapper img.wp-image-10505 {
  border-radius: var(--radius-sm);
}

#top.pma .avia-image-container .avia_image,
#top.pma .av-masonry-entry .av-masonry-image-container,
#top.pma .avia-gallery-thumb img {
  object-fit: cover;
}

#top.pma .avia-gallery img {
  border: none !important;
  padding: 0 !important;
}

#top.pma iframe,
#top.pma .av_textblock_section iframe {
  max-width: 100%;
  border: 0;
}

/* ------------------------------------------------------------------
   7 · Tables inside legacy content
   ------------------------------------------------------------------ */
#top.pma .entry-content-wrapper table {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--pma-sans);
  font-size: var(--fs-sm);
}

#top.pma .entry-content-wrapper table th {
  background: var(--pma-stone-100) !important;
  color: var(--pma-ink) !important;
  font-weight: 600;
  text-align: left;
}

#top.pma .entry-content-wrapper table th,
#top.pma .entry-content-wrapper table td {
  border: var(--hairline) !important;
  padding: var(--s-3) var(--s-4);
}

/* ------------------------------------------------------------------
   8 · Horizontal rules, dividers and separators
   ------------------------------------------------------------------ */
#top.pma .hr-inner,
#top.pma .av-divider-element,
#top.pma hr {
  border-color: var(--pma-stone-300) !important;
  background: transparent !important;
}

#top.pma .hr-inner-style {
  background: var(--pma-gold-500) !important;
}

/* ------------------------------------------------------------------
   9 · Legacy sections that were pure retail decoration
   Full-screen sliders, parallax overlays and animated counters carry
   the old look and cost the most to load. They are flattened, not
   deleted: the content inside them still renders.
   ------------------------------------------------------------------ */
#top.pma .avia-section.av-parallax-section .av-parallax,
#top.pma .av-section-color-overlay {
  opacity: 0.55 !important;
}

#top.pma .avia-slideshow-inner li,
#top.pma .av-slideshow-ui .avia-slideshow-arrows a {
  border-radius: 0 !important;
}

#top.pma .avia-slideshow-arrows a,
#top.pma .avia-slideshow-dots a {
  color: var(--pma-white) !important;
  background: rgba(11, 27, 51, 0.6) !important;
}

/* Counters and progress bars from the retail template. */
#top.pma .avia-animated-number .avia-animated-number-title,
#top.pma .avia-progress-bar .progressbar-title {
  font-family: var(--pma-sans) !important;
  color: var(--pma-ink) !important;
}

#top.pma .avia-progress-bar .progressbar-percentage,
#top.pma .avia-animated-number .heading {
  color: var(--pma-navy-900) !important;
}

/* ------------------------------------------------------------------
   10 · Belt and braces for the loudest inline colours
   Colour normalisation happens in PHP, so these should never fire.
   They exist so that a page rendered from a cached copy, an exported
   HTML file or a builder preview still cannot show retail red.
   ------------------------------------------------------------------ */
#top.pma [style*="#ff1111"],
#top.pma [style*="#FF1111"],
#top.pma [style*="#98012e"],
#top.pma [style*="#98012E"] {
  color: var(--pma-ink) !important;
}

#top.pma .avia-section[style*="#ff1111"],
#top.pma .avia-section[style*="#98012e"],
#top.pma .avia-section[style*="#21519e"] {
  background-color: var(--pma-navy-900) !important;
}

/* ------------------------------------------------------------------
   11 · Footer legibility
   The footer widget area inherits a full-bleed photograph from the
   previous design, and the widget text sits on it at roughly 2:1
   contrast — unreadable. Dark grounds are solid here by design;
   a photograph behind body text is decoration at the cost of reading.
   ------------------------------------------------------------------ */
#top.pma #footer {
  background-color: var(--pma-navy-900) !important;
  background-image: none !important;
}

#top.pma #footer,
#top.pma #footer p,
#top.pma #footer li,
#top.pma #footer a,
#top.pma #footer .widget,
#top.pma #footer .textwidget {
  color: var(--pma-stone-100) !important;
}

#top.pma #footer .widgettitle,
#top.pma #footer h3,
#top.pma #footer h4 {
  color: var(--pma-gold-300) !important;
  font-family: var(--pma-serif) !important;
  font-size: var(--fs-sm) !important;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#top.pma #footer a:hover,
#top.pma #footer a:focus-visible {
  color: var(--pma-white) !important;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

#top.pma #socket {
  background-color: var(--pma-navy-900) !important;
  background-image: none !important;
  border-top: 1px solid var(--pma-navy-600) !important;
}

#top.pma #socket,
#top.pma #socket a {
  color: var(--pma-stone-300) !important;
}

/* ------------------------------------------------------------------
   12 · The public Footer page
   /pma/footer/ (page 8386) is a content block that was never meant to
   be a page. It stays published so nothing that references it breaks,
   but its page furniture is suppressed.
   ------------------------------------------------------------------ */
body.pma.page-id-8386 .breadcrumb,
body.pma.page-id-8386 .title_container {
  display: none;
}

/* ------------------------------------------------------------------
   12 · Print
   ------------------------------------------------------------------ */
@media print {
  #top.pma #header,
  #top.pma #footer,
  #top.pma #socket,
  #top.pma .avia-button {
    display: none !important;
  }

  #top.pma .entry-content-wrapper {
    color: #000;
  }
}
