/**
 * COACCM Theme 1.4.15 — Accessibility hardening
 * Targeted WCAG 2.1 AA / WCAG 2.2 improvements.
 */

/* 1. Visible keyboard focus */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #005fcc !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 5px rgba(0, 95, 204, 0.22) !important;
}

/* Never globally remove focus outlines as a fallback for browsers without :focus-visible. */

/* 2. Screen-reader-only utility */
.sr-only,
.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* 3. Skip link */
.skip-link:focus,
a.skip-link:focus,
a[href="#primary"]:focus {
  position: fixed !important;
  top: 10px !important;
  left: 10px !important;
  z-index: 999999 !important;
  display: inline-flex !important;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px !important;
  background: #005fcc !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  border-radius: 4px !important;
  clip: auto !important;
  width: auto !important;
  height: auto !important;
}

/* 4. Clear affordance for footer links */
.site-footer a,
footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.site-footer a:hover,
.site-footer a:focus-visible,
footer a:hover,
footer a:focus-visible {
  text-decoration-thickness: 2px;
}

/* 5. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .carousel-track,
  .n2-ss-slider,
  .n2-ss-slide,
  [class*="smart-slider"],
  [class*="soliloquy"] {
    animation: none !important;
    transition: none !important;
  }
}

/* 6. Primary interactive targets. Inline prose links intentionally keep native flow. */
:where(
  button,
  input[type="submit"],
  input[type="button"],
  input[type="reset"],
  .btn,
  .button,
  .wp-element-button,
  .menu-toggle,
  .submenu-toggle,
  .go-to-top-link,
  .main-nav .menu > li > a
) {
  min-width: 44px;
  min-height: 44px;
}

/* 7. Accessible submenu disclosure: desktop uses hover/focus-within; mobile uses button state. */
@media (min-width: 992px) {
  .main-nav .submenu-toggle {
    display: none !important;
  }
  .main-nav .menu-item-has-children.submenu-open > .sub-menu {
    display: block;
  }
}

@media (max-width: 991px) {
  .main-nav .menu-item-has-children {
    position: relative;
  }
  .main-nav .menu-item-has-children > a {
    padding-right: 58px !important;
  }
  .main-nav .submenu-toggle {
    position: absolute;
    top: 2px;
    right: 6px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }
  .main-nav .submenu-toggle > span {
    display: inline-block;
    transition: transform 0.2s ease;
  }
  .main-nav .submenu-toggle[aria-expanded="true"] > span {
    transform: rotate(180deg);
  }
  .main-nav .menu li:hover > .sub-menu,
  .main-nav .menu li:focus-within > .sub-menu {
    display: none;
  }
  .main-nav .menu li.submenu-open > .sub-menu {
    display: block !important;
  }
}

/* 8. Audit-confirmed contrast corrections */
.flavor-breadcrumbs a,
.posts-grid .read-more,
.flavor-single .entry-meta a,
.post-navigation a,
.author-website,
.job-sector {
  color: #047857 !important;
}

.entry-meta,
.entry-meta time,
.reading-time,
.posts-grid .entry-meta {
  color: #4b5563 !important;
}

.entry-meta a,
a[rel~="category"],
a[rel~="tag"],
.posts-grid .read-more,
.post-navigation a,
.author-website {
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

[data-theme="dark"] .flavor-breadcrumbs a,
[data-theme="dark"] .posts-grid .read-more,
[data-theme="dark"] .flavor-single .entry-meta a,
[data-theme="dark"] .post-navigation a,
[data-theme="dark"] .author-website {
  color: #6ee7b7 !important;
}

.coaccm-sub,
.coaccm-card .coaccm-sub,
.coaccm-card p {
  color: #3d3d3d !important;
}

.coaccm-badge {
  color: #fff !important;
  background-color: #2a6496 !important;
}

.coaccm-card h3,
.coaccm-card h4,
.coaccm-card .coaccm-price {
  color: #1a1a1a !important;
}

#centenario-tab,
div#centenario-tab,
#centenario-tab span.label,
.centenario-tab span.label {
  color: #fff !important;
  background-color: #1a6b3c !important;
}

#centenario-tab a,
#centenario-tab a:link,
#centenario-tab a:visited {
  color: #fff !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
}

#centenario-tab a:hover,
#centenario-tab a:focus-visible {
  color: #fff !important;
  text-decoration-thickness: 2px !important;
}

.entry-content a[href*="centenario.coaccm"] {
  color: #065f46 !important;
  text-shadow: none !important;
}

/* 9. Residual contrasts confirmed after deploying 1.4.11. */
.flavor-single .tag-label,
.flavor-single .tags-links,
.wpcf7-form label,
.categoria-intro,
.video-price-old,
.video-price-old s,
.video-hero-note {
  color: #4b5563 !important;
}

/* The content styles lower opacity on these text blocks. The blended colour
 * fails 1.4.3 even though the declared colour itself passes. */
.categoria-intro,
.video-price-old,
.video-hero-note {
  opacity: 1 !important;
}

body.postid-2641 .entry-content .wp-block-paragraph {
  color: #4b5563 !important;
}

.posts-grid .read-more {
  color: #065f46 !important;
}

.entry-content h4 {
  color: #064e3b !important;
}

.entry-content th {
  color: #fff !important;
  background-color: #064e3b !important;
}

[data-theme="dark"] .flavor-single .tag-label,
[data-theme="dark"] .flavor-single .tags-links,
[data-theme="dark"] .wpcf7-form label,
[data-theme="dark"] .categoria-intro,
[data-theme="dark"] .video-price-old,
[data-theme="dark"] .video-price-old s,
[data-theme="dark"] .video-hero-note,
[data-theme="dark"] .entry-content h4 {
  color: #e2e8f0 !important;
}

/* 10. Reflow: constrain intrinsic-width content inside the outer flex layout. */
.site-content > .container {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.content-area,
.content-column,
.entry-content {
  min-width: 0;
  max-width: 100%;
}

.entry-content :where(a, code) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.entry-content :where(iframe, video, embed, object) {
  max-width: 100%;
}

/* Cookie-video placeholders can retain a 320px intrinsic width while the
 * content column is narrower. Keep the complete notice and its controls in
 * the available column at the 320 CSS-pixel reflow breakpoint. */
.entry-content :where(
  .wp-block-embed,
  .wp-block-embed__wrapper,
  [class*="video-placeholder"],
  .video-placeholder-text-youtube
) {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.entry-content :where(.tabla-wrap, .wp-block-table) {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 782px) {
  .site-content > .container,
  #primary,
  #primary > .container,
  .content-column,
  .entry-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .fh-agenda-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .fh-agenda-col,
  .fh-tweet-card,
  .fh-tweet-card :where(blockquote, iframe) {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .fh-tweet-card a {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .posts-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #wpmem_login fieldset,
  #wpmem_login legend,
  #wpmem_login .div_text,
  #wpmem_login .button_div,
  #wpmem_login input:not([type="hidden"]) {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .grecaptcha-badge {
    right: 0 !important;
    max-width: calc(100vw - 8px) !important;
  }
}

/* 11. WAVE post-deployment review.
 * Essential article content must not depend on an IntersectionObserver to
 * become perceivable. Brand-colour social buttons retain their identity while
 * providing at least 4.5:1 against their white icon/hidden label. */
.entry-content .flavor-anim {
  opacity: 1 !important;
  transform: none !important;
}

.breadcrumb-sep {
  color: #64748b !important;
}

.wp-social-link-youtube {
  background-color: #c00 !important;
}

.wp-social-link-instagram {
  background-color: #b80059 !important;
}

.wp-social-link-bluesky {
  background-color: #005cbf !important;
}

.wp-social-link-vk {
  background-color: #315f91 !important;
}

/* Slider text over imagery: retain contrast reinforcement found in the audit. */
.n2-ss-slide h1,
.n2-ss-slide h2,
.n2-ss-slide p,
.n2-ss-slide a {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 8px rgba(0, 0, 0, 0.5) !important;
}
