/* WordPress integration and final production overrides. */
:root {
  --balance-deep-sage: #4e5b52;
  --balance-focus: #7d6233;
}

html { scroll-padding-top: 95px; }
body { overflow-x: hidden; }
body.menu-open { overflow: hidden; }
main { display: block; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.screen-reader-text:focus {
  clip: auto !important;
  width: auto;
  height: auto;
  top: 14px;
  left: 14px;
  padding: 12px 16px;
  background: #fff;
  color: #111714;
  z-index: 2147483647;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--balance-focus);
  outline-offset: 4px;
}

/* The logo always uses the real theme file; an older prototype used CSS content. */
.site-header .logo img { content: normal !important; width: 250px; height: auto; }
.site-header { z-index: 2147483000 !important; }
.menu-toggle { z-index: 2147483003 !important; }
.menu-shade { z-index: 2147483001 !important; }
.menu-panel { z-index: 2147483002 !important; max-height: 100dvh; }
.menu-toggle[open] > summary { z-index: 2147483004 !important; }
.site-header .language > div { z-index: 2147483005; }
.menu-toggle[open] .menu-shade,
.menu-toggle[open] .menu-panel { position: fixed; top: 0 !important; bottom: 0 !important; height: 100dvh !important; }
.menu-panel { overflow-y: auto; overscroll-behavior: contain; }
.menu-nav > details > summary span { min-width: 0; }
.menu-nav .level-two > a { font: 14px/1.35 var(--sans); padding: 7px 0; }
.menu-nav .level-three a { border-bottom: 0; font: 12px/1.3 var(--sans); padding: 5px 0; }
.menu-nav .level-two > details > summary b { font-weight: 300; color: var(--gold); }

body.admin-bar .site-header { top: 32px; }
body.admin-bar .menu-toggle[open] .menu-shade,
body.admin-bar .menu-toggle[open] .menu-panel { top: 32px !important; height: calc(100dvh - 32px) !important; }
body.admin-bar .menu-toggle[open] > summary { margin-top: 32px; }

/* Keep the palette light: dark ink is reserved for text, never full sections. */
.btn,
.btn.dark,
.floating-cta a,
.floating-contact a { background: var(--balance-deep-sage); }
.floating-cta a:last-child,
.floating-contact a:last-child { background: var(--gold); color: #111714; }
.image-chapter { background: #e8e1d5; color: #111714; }
.image-chapter > div { background: #f3efe6; }
.image-chapter p { color: #59605b; }
.symbol-watermark::after { content: none !important; display: none !important; background: none !important; }
.contact { background: #d9cfbd; color: #111714; }
.contact p { color: #565d58; }
.site-footer { background: #fff; color: #111714; }
figcaption { background: rgba(248, 245, 238, .9); color: #111714; }

.footer-mark a { display: block; }
.footer-mark img { content: normal !important; width: min(390px, 65vw); height: auto; }
.footer-bottom a { text-decoration: none; }
.footer-bottom .social-icons a { padding: 0; }

.wp-editor-content > :first-child { margin-top: 0; }
.wp-editor-content > :last-child { margin-bottom: 0; }
.wp-editor-content ul,
.wp-editor-content ol { color: #59605b; padding-left: 1.4em; }
.wp-editor-content li { margin: .55em 0; }
.wp-editor-content a:not(.btn) { text-decoration-thickness: 1px; text-underline-offset: 4px; }
.wp-editor-content figure { margin: 35px 0; }
.wp-editor-content iframe { max-width: 100%; }
.wp-editor-content .alignwide { width: min(1100px, calc(100vw - 50px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.wp-editor-content .alignfull { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }

.article-meta .article-toc { max-height: calc(100vh - 135px); overflow-y: auto; }
.article-toc a span { min-width: 0; }
.article-section > summary span { padding-right: 25px; }
.article-section > ul,
.article-section > ol { margin-left: 22px; margin-right: 22px; }

.taxonomy-selector {
  position: sticky;
  top: 100px;
  z-index: 14;
  background: rgba(248, 245, 238, .98);
  border-bottom: 1px solid var(--line);
  padding: 13px 7vw;
  backdrop-filter: blur(12px);
}
.header-condensed .taxonomy-selector { top: 75px; }
.taxonomy-selector__row { display: flex; align-items: center; gap: 22px; overflow-x: auto; white-space: nowrap; }
.taxonomy-selector__row + .taxonomy-selector__row { border-top: 1px solid rgba(17, 23, 20, .1); }
.taxonomy-selector__row > span { color: var(--gold); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; min-width: 90px; }
.taxonomy-selector__row a { padding: 10px 0 8px; text-decoration: none; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border-bottom: 2px solid transparent; }
.taxonomy-selector__row a[aria-current="page"] { border-color: var(--gold); color: #111714; }
.taxonomy-selector__children a { text-transform: none; letter-spacing: .03em; }

.navigation.pagination { margin-top: 55px; }
.nav-links { display: flex; gap: 8px; }
.nav-links .page-numbers { min-width: 38px; height: 38px; border: 1px solid var(--line); display: grid; place-items: center; text-decoration: none; font-size: 11px; }
.nav-links .current { background: var(--balance-deep-sage); color: #fff; }
.not-found { min-height: 72vh; display: flex; align-items: center; }
.profile-cover { height: auto; max-height: 760px; object-position: top; }
.media-proof > *,
.media-marks { min-width: 0; }
.media-marks { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
  body.admin-bar .menu-toggle[open] .menu-shade,
  body.admin-bar .menu-toggle[open] .menu-panel { top: 46px !important; height: calc(100dvh - 46px) !important; }
  body.admin-bar .menu-toggle[open] > summary { margin-top: 46px; }
}

@media (max-width: 700px) {
  .site-header .logo img { width: 160px; }
  .header-meta .enquiry { display: none; }
  .footer-mark img { width: 240px; }
  .taxonomy-selector { top: 85px; padding-inline: 25px; }
  .header-condensed .taxonomy-selector { top: 75px; }
  .taxonomy-selector__row > span { min-width: 72px; }
  .article-meta .article-toc { max-height: none; }
  .media-marks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-marks span { min-width: 0; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
