/* APU Theme Styles — Design Tokens */
:root {
  --color-apu-navy: 19 40 66;
  --color-apu-accent: 252 188 85;
  --color-brand-surface: 255 250 240;
  --color-brand-text-muted: 100 116 139;
  --apu-header-height: calc(5.5rem + 1px);
}

/* Navigation is styled by views/themes/apu/assets/css/nav.css */
.apu-site-navigation {
  position: sticky;
  inset-inline: 0;
  top: 0;
  z-index: 50;
  width: 100%;
}

/* Keep the three header regions balanced as the primary menu grows. */
#apu-nav .nav-bar-inner {
  padding-inline: 0;
}

.apu-utility-bar {
  display: none;
}

@keyframes apu-header-reveal {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes apu-header-rule-reveal {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@media (min-width: 1220px) {
  html:has(.apu-utility-bar) {
    --apu-header-height: calc(7.5rem + 3px);
  }

  #apu-nav.apu-site-navigation .nav-bar:has(.apu-utility-bar).nav-bar {
    border-bottom: 2px solid rgb(var(--color-apu-accent));
    background:
      linear-gradient(180deg, rgb(var(--color-brand-surface) / .98), rgb(var(--color-brand-surface) / .94)),
      radial-gradient(circle at top right, rgb(var(--color-apu-accent) / .12), transparent 32%);
  }

  .apu-utility-bar {
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-inline: -3rem;
    padding-inline: 3rem;
    border-bottom: 1px solid rgb(var(--color-apu-accent) / .42);
    background: #0b1d31;
    color: rgb(var(--color-brand-surface));
  }

  .apu-utility-label {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-family: "Space Mono", ui-monospace, monospace;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .18em;
    line-height: 1;
    text-transform: uppercase;
    animation: apu-header-reveal .7s cubic-bezier(.16, 1, .3, 1) both;
  }

  .apu-utility-label::before {
    width: 1.75rem;
    height: 1px;
    background: rgb(var(--color-apu-accent));
    content: "";
    transform-origin: left;
    animation: apu-header-rule-reveal .8s cubic-bezier(.16, 1, .3, 1) .15s both;
  }

  #apu-nav .apu-utility-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .15rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #apu-nav.apu-site-navigation .apu-utility-bar .apu-utility-nav .nav-link {
    position: relative;
    min-height: 2rem;
    padding: .25rem .75rem;
    border-radius: 0;
    background: transparent;
    color: rgb(var(--color-brand-surface));
    font-family: "Space Mono", ui-monospace, monospace;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
  }

  #apu-nav.apu-site-navigation .apu-utility-bar .apu-utility-nav .nav-link::after {
    position: absolute;
    right: .75rem;
    bottom: .2rem;
    left: .75rem;
    height: 1px;
    background: rgb(var(--color-apu-accent));
    content: "";
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .24s cubic-bezier(.16, 1, .3, 1);
  }

  #apu-nav .apu-utility-nav > li {
    animation: apu-header-reveal .7s cubic-bezier(.16, 1, .3, 1) both;
  }

  #apu-nav .apu-utility-nav > li:nth-child(1) {
    animation-delay: .08s;
  }

  #apu-nav .apu-utility-nav > li:nth-child(2) {
    animation-delay: .14s;
  }

  #apu-nav .apu-utility-nav > li:nth-child(3) {
    animation-delay: .2s;
  }

  #apu-nav.apu-site-navigation .apu-utility-bar .apu-utility-nav .nav-link:is(:hover, :focus-visible, [data-active="true"]) {
    background: transparent;
    color: rgb(var(--color-apu-accent));
  }

  #apu-nav.apu-site-navigation .apu-utility-bar .apu-utility-nav .nav-link:is(:hover, :focus-visible, [data-active="true"])::after {
    transform: scaleX(1);
    transform-origin: left;
  }

  #apu-nav .apu-utility-nav > li + li {
    position: relative;
  }

  #apu-nav .apu-utility-nav > li + li::before {
    position: absolute;
    top: 50%;
    left: -.08rem;
    width: 1px;
    height: .8rem;
    border-radius: 0;
    background: rgb(var(--color-apu-accent));
    content: "";
    opacity: .62;
    transform: translateY(-50%);
  }

  .apu-header-zone--utility {
    flex: 1;
    width: auto;
    text-align: right;
  }

  #apu-nav.apu-site-navigation .nav-bar-inner .nav-actions .nav-cta,
  #apu-nav.apu-site-navigation .nav-bar-inner .apu-header-zone--controls .nav-cta {
    gap: .65rem;
    min-height: 0;
    padding: .875rem 1.75rem;
    border-left: 8px solid rgb(var(--color-apu-accent));
    border-radius: 0;
    border-top-right-radius: 1.5rem;
    border-bottom-left-radius: 1.5rem;
    box-shadow: 0 12px 28px rgb(var(--color-apu-navy) / .16);
    font-family: "Lora", Georgia, serif;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    transition: transform .26s, background-color .26s, border-color .26s, color .26s, box-shadow .26s;
  }

  #apu-nav.apu-site-navigation .nav-bar-inner .nav-actions .nav-cta::after,
  #apu-nav.apu-site-navigation .nav-bar-inner .apu-header-zone--controls .nav-cta::after {
    width: .9rem;
    height: .65rem;
    background: currentColor;
    clip-path: polygon(0 42%, 68% 42%, 68% 8%, 100% 50%, 68% 92%, 68% 58%, 0 58%);
    content: "";
    transition: transform .26s cubic-bezier(.16, 1, .3, 1);
  }

  #apu-nav.apu-site-navigation .nav-bar-inner .nav-actions .nav-cta:hover::after,
  #apu-nav.apu-site-navigation .nav-bar-inner .apu-header-zone--controls .nav-cta:hover::after {
    transform: translateX(3px);
  }

  #apu-nav.apu-site-navigation .nav-bar-inner .nav-actions .nav-cta:hover,
  #apu-nav.apu-site-navigation .nav-bar-inner .apu-header-zone--controls .nav-cta:hover {
    transform: translateY(-1px) scale(1.02);
  }

  #apu-nav.apu-site-navigation .apu-language-switcher .ct-lang-select,
  #apu-nav.apu-site-navigation .apu-header-zone--controls .widget-lang-switcher .ct-lang-select {
    min-height: 2.5rem;
    padding-inline: .45rem 1.5rem;
    border: 0;
    border-bottom: 2px solid rgb(var(--color-apu-accent));
    border-radius: 0;
    background: transparent;
    font-family: "Space Mono", ui-monospace, monospace;
    font-size: .7rem;
    font-weight: 400;
    letter-spacing: .08em;
  }

  #apu-nav .nav-bar-inner > :is(.nav-brand, .apu-header-zone--logo, .nav-desktop, .nav-actions) {
    animation: apu-header-reveal .75s cubic-bezier(.16, 1, .3, 1) both;
  }

  #apu-nav .nav-bar-inner > :is(.nav-brand, .apu-header-zone--logo) {
    animation-delay: .08s;
  }

  #apu-nav .nav-bar-inner > .nav-desktop {
    animation-delay: .16s;
  }

  #apu-nav .nav-bar-inner > .nav-actions {
    animation-delay: .24s;
  }
}

@media (prefers-reduced-motion: reduce) {
  #apu-nav .apu-utility-label,
  #apu-nav .apu-utility-label::before,
  #apu-nav .apu-utility-nav > li,
  #apu-nav .nav-bar-inner > :is(.nav-brand, .apu-header-zone--logo, .nav-desktop, .nav-actions) {
    animation: none !important;
  }

  #apu-nav .nav-cta:hover,
  #apu-nav .nav-dropdown-item:hover {
    transform: none !important;
  }
}

@media (min-width: 1024px) and (max-width: 1219.98px) {
  #apu-nav .nav-desktop {
    display: none !important;
  }

  #apu-nav .menu-toggle {
    display: flex !important;
  }
}

@media (min-width: 1220px) and (max-width: 1343.98px) {
  #apu-nav :is(.nav-brand-copy, .apu-header-brand-copy) {
    display: none !important;
  }
}

html {
  scroll-padding-top: calc(var(--apu-header-height) + 1rem);
}

.apu-viewport-hero {
  min-height: calc(100dvh - var(--apu-header-height));
}

/* Tailwind's individual translate property otherwise survives the JS transform. */
.apu-viewport-hero #hero-on-bg-img {
  object-position: top;
  translate: none;
}

.apu-language-switcher .widget {
  margin: 0;
}

.apu-language-switcher .ct-lang-select {
  min-width: 4.5rem;
  padding: .45rem .6rem;
  border: 1px solid rgb(var(--color-apu-navy) / .2);
  border-radius: 999px;
  background: #fff;
  color: rgb(var(--color-apu-navy));
  font: inherit;
}

/* Theme Zone output keeps the APU shell intact while allowing reviewed overrides. */
.apu-header-zone .tz-widget,
.apu-footer-zone .tz-widget,
.apu-theme-zone .tz-widget {
  width: 100%;
}

.apu-header-zone--logo .tz-image-link,
.apu-header-zone--logo .tz-image {
  display: block;
  max-height: 4.5rem;
  width: auto;
}

.apu-header-zone--logo {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.apu-header-brand-copy {
  display: none;
  color: rgb(var(--color-apu-navy));
  font-family: Epilogue, "Space Grotesk", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .apu-header-brand-copy {
    display: block;
  }
}

.mobile-nav-sections {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#apu-nav .mobile-nav-sections .mobile-nav-list {
  overflow: visible;
  flex: none;
}

.mobile-nav-section-title {
  margin: 0;
  padding: .85rem 1.5rem .35rem;
  color: rgb(var(--color-brand-text-muted));
  font-family: "Space Mono", ui-monospace, monospace;
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .14em;
  line-height: 1.4;
  text-transform: uppercase;
}

.mobile-nav-section--utility {
  border-top: 1px solid rgb(var(--color-apu-navy) / .1);
}

#apu-nav .mobile-nav-list--utility .mobile-nav-link {
  padding-block: .8rem;
  font-size: .92rem;
}

.apu-header-zone--controls {
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Zone HTML does not carry Astro's scoped attribute, so the theme owns this CTA. */
.apu-header-zone--controls :is(.tz-html, .tz-html-content) {
  display: contents;
}

#apu-nav .apu-header-zone--controls .nav-cta,
#apu-nav .apu-header-zone--controls .nav-cta:visited {
  display: none;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  background: rgb(var(--color-apu-navy));
  color: rgb(247 250 243);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

#apu-nav .apu-header-zone--controls .nav-cta:hover,
#apu-nav .apu-header-zone--controls .nav-cta:visited:hover {
  transform: translateY(-1px);
  background: rgb(var(--color-apu-accent));
  color: rgb(var(--color-apu-navy));
}

#apu-nav .apu-header-zone--controls .nav-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(var(--color-brand-surface)), 0 0 0 4px rgb(var(--color-apu-accent));
}

@media (min-width: 640px) {
  #apu-nav .apu-header-zone--controls .nav-cta {
    display: inline-flex;
  }
}

.apu-footer-zone,
.apu-theme-zone {
  color: rgb(var(--color-brand-text-muted));
}

.apu-footer-zone--about {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.apu-footer-zone .tz-title,
.apu-theme-zone .tz-title {
  margin: 0 0 1rem;
  color: rgb(var(--color-brand-text, 27 41 32));
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.apu-footer-zone .tz-image-link,
.apu-footer-zone .tz-image {
  display: block;
  width: auto;
  max-width: 100%;
}

.apu-footer-zone :is(.tz-html, .tz-richtext) p,
.apu-footer-copyright-zone p {
  margin: .5rem 0 0;
  color: rgb(var(--color-brand-text-muted));
  line-height: 1.7;
}

.apu-footer-zone.apu-footer-zone--about .tz-html p {
  margin: 0;
  color: rgb(var(--color-brand-text, 27 41 32));
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-weight: 500;
}

.apu-footer-zone--about .tz-html {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.apu-footer-zone.apu-footer-zone--about .tz-html .apu-footer-brand-name {
  font-size: .875rem;
  line-height: 1.25rem;
}

.apu-footer-zone.apu-footer-zone--about .tz-html .apu-footer-address {
  font-size: .875rem;
  line-height: 1.625;
}

.apu-footer-zone--contact .apu-zone-list li {
  color: rgb(var(--color-brand-text, 27 41 32));
}

.apu-footer-copyright-zone p {
  margin: 0;
  color: rgb(var(--color-brand-text, 27 41 32));
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .05em;
}

.apu-footer-zone--about .tz-image {
  width: auto;
  height: 10rem !important;
  max-width: none !important;
}

.apu-footer-zone :is(.apu-zone-pages, .apu-zone-list, .tz-pages, .tz-theme-content) {
  display: grid;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.apu-footer-zone :is(.apu-zone-pages, .apu-zone-list, .tz-pages, .tz-theme-content) a {
  color: rgb(var(--color-brand-text, 27 41 32));
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-decoration: none;
  transition: color .3s ease;
}

.apu-footer-zone :is(.apu-zone-pages, .apu-zone-list, .tz-pages, .tz-theme-content) a:hover {
  color: rgb(var(--color-brand-primary, 43 122 74));
}

.apu-footer-zone .tz-social {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: .5rem;
  padding-top: .5rem;
}

.apu-footer-zone .tz-social .social-btn {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgb(var(--color-brand-text, 27 41 32));
  text-decoration: none;
  transition: color .3s ease, background-color .3s ease;
}

.apu-footer-zone .tz-social .social-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.apu-footer-zone .tz-social .social-btn:hover {
  background: rgb(var(--color-brand-primary, 43 122 74) / .1);
  color: rgb(var(--color-brand-accent, 228 152 78));
}

.apu-footer-zone .tz-social .social-btn:focus-visible {
  outline: 2px solid rgb(var(--color-brand-primary, 43 122 74));
  outline-offset: 2px;
}

.apu-theme-zone {
  margin: 1.5rem 0;
}

/* Category lists use a compact navigation surface below the in-flow header. */
.apu-category-list {
  width: min(100%, 860px);
  margin: clamp(2.5rem, 6vw, 4rem) auto 3.75rem;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}

.apu-category-breadcrumb {
  --apu-breadcrumb-slant: 1.4rem;
  position: relative;
  margin: 0 0 clamp(1.75rem, 4vw, 2.5rem);
  padding: 1px;
  overflow-x: auto;
  background: #0b1d31;
  clip-path: polygon(0 0, calc(100% - var(--apu-breadcrumb-slant)) 0, 100% 100%, var(--apu-breadcrumb-slant) 100%);
  color: rgb(226 232 240);
  filter: drop-shadow(0 12px 22px rgb(var(--color-apu-navy) / .22));
  scrollbar-width: thin;
}

.apu-category-breadcrumb::before {
  position: absolute;
  z-index: 2;
  inset-block: 1px;
  inset-inline-start: 0;
  width: calc(var(--apu-breadcrumb-slant) + 4px);
  background: #fcbc55;
  clip-path: polygon(0 0, 3px 0, 100% 100%, calc(100% - 3px) 100%);
  content: "";
  pointer-events: none;
}

.apu-category-breadcrumb__list {
  position: relative;
  z-index: 1;
  display: flex;
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
  align-items: center;
  gap: .65rem;
  margin: 0;
  padding: .8rem calc(1rem + var(--apu-breadcrumb-slant)) .8rem calc(1.2rem + var(--apu-breadcrumb-slant));
  background: linear-gradient(115deg, #132842 0%, #244d78 52%, #132842 100%);
  clip-path: polygon(0 0, calc(100% - var(--apu-breadcrumb-slant)) 0, 100% 100%, var(--apu-breadcrumb-slant) 100%);
  list-style: none;
  font-size: .82rem;
  line-height: 1.45;
}

.apu-category-breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  white-space: nowrap;
}

.apu-category-breadcrumb__item + .apu-category-breadcrumb__item::before {
  width: .4rem;
  height: .4rem;
  flex: 0 0 .4rem;
  transform: rotate(45deg);
  border-top: 1.5px solid rgb(252 188 85 / .72);
  border-right: 1.5px solid rgb(252 188 85 / .72);
  content: "";
}

.apu-category-breadcrumb a {
  color: rgb(226 232 240);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: .2em;
  transition: color .18s ease, text-decoration-color .18s ease;
}

.apu-category-breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: #fcbc55;
}

.apu-category-breadcrumb a:focus-visible {
  border-radius: 4px;
  outline: 2px solid #fcbc55;
  outline-offset: 3px;
}

.apu-category-breadcrumb [aria-current="page"] {
  color: #ffd27f;
  font-weight: 700;
}

@media (max-width: 639px) {
  .apu-category-list {
    margin-top: 2rem;
  }

  .apu-category-breadcrumb {
    --apu-breadcrumb-slant: .9rem;
  }

  .apu-category-breadcrumb__list {
    padding: .72rem calc(.8rem + var(--apu-breadcrumb-slant)) .72rem calc(.9rem + var(--apu-breadcrumb-slant));
  }

  .apu-category-breadcrumb__list,
  .apu-category-breadcrumb__item {
    gap: .5rem;
  }
}

/* CMS content areas */
.apu-cms-content {
  padding: 2rem 1rem;
  max-width: 860px;
  margin: 3rem auto 60px;
}

.apu-cms-content h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: rgb(var(--color-apu-navy));
}

.apu-cms-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgb(var(--color-apu-navy));
}

.apu-single-post .apu-cms-content h3 {
  font-size: 20px;
  font-weight: 500;
}

.apu-cms-content p {
  line-height: 1.8;
  margin-bottom: 1rem;
  color: #334155;
  text-align: justify;
}

.apu-cms-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.apu-cms-content p > img:only-child {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.apu-cms-content figure {
  margin: 1.5rem 0;
}

.apu-cms-content figcaption {
  font-size: .85rem;
  color: #64748b;
  text-align: center;
  margin-top: .5rem;
}

.apu-cms-content blockquote {
  border-left: 3px solid rgb(var(--color-apu-accent));
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: #475569;
  font-style: italic;
}

.apu-cms-content a {
  color: rgb(var(--color-apu-navy));
  text-decoration: underline;
  text-decoration-color: rgb(var(--color-apu-accent) / .4);
  text-underline-offset: 2px;
  transition: text-decoration-color .2s;
}

.apu-cms-content a:hover {
  text-decoration-color: rgb(var(--color-apu-accent));
}

.apu-cms-content ul,
.apu-cms-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
  line-height: 1.8;
  list-style: revert;
}

.apu-cms-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: .95rem;
}

.apu-cms-content th,
.apu-cms-content td {
  padding: .75rem 1rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.apu-cms-content th {
  background: rgb(var(--color-apu-navy) / .04);
  font-weight: 600;
  color: rgb(var(--color-apu-navy));
}

.apu-cms-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 12px;
  overflow-x: auto;
  font-size: .9rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}

.apu-cms-content code {
  font-family: 'Space Mono', monospace;
  font-size: .9em;
}

.apu-cms-content :not(pre) > code {
  background: #f1f5f9;
  padding: .15em .4em;
  border-radius: 4px;
  color: rgb(var(--color-apu-navy));
}

.apu-cms-content .ql-align-justify {
  text-align: justify;
}

.apu-cms-content .ql-align-center {
  text-align: center;
}

/* Tailwind v4 removed the default container centering (v3 had margin auto).
   CMS controllers output <div class="container"> — re-center it. */
.container {
  margin-inline: auto;
}

/* Neutralize quill.snow.pub.css global "a { text-decoration: underline; color: #06c }"
   outside CMS content — that vendor rule is unlayered and would beat Tailwind v4
   preflight + utilities. Nav links get colors from cid-scoped component styles;
   footer links revert to their layered Tailwind utility values. */
#apu-nav a {
  color: revert-layer;
  text-decoration: none;
}
footer a {
  color: revert-layer;
  text-decoration: revert-layer;
}

/* Preserve breathing room for long localized copy without compensating for the header. */
.hero-on-content[data-astro-cid-bzueocsr] {
  padding-top: clamp(3rem, 8vh, 5rem);
}
