/*!
 * PWM public accessibility — copy to the next town as-is.
 * Town CSS must not remove :focus-visible or skip-link styles.
 */

html {
    scroll-padding-top: var(--pwm-sticky-nav, 85px);
}

/* Safety net for 1.4.10. Off-screen panels are parked first; this only
   stops a stray descendant from opening a horizontal scrollbar. */
html,
body {
    overflow-x: clip;
}

.pwm-skip {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 10000;
    padding: 10px 16px;
    background: var(--pwm-focus, #003d66);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transform: translateY(-200%);
}

.pwm-skip:focus,
.pwm-skip:focus-visible {
    transform: translateY(0);
    outline: 3px solid #fff;
    outline-offset: 2px;
}

#main-content:focus {
    outline: none;
}

#main-content,
:focus {
    scroll-margin-top: 80px;
    scroll-margin-bottom: 60px;
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--pwm-focus, #003d66);
    outline-offset: 2px;
}

/* Bootstrap's .nav-link:focus-visible sets outline: 0, and the tab chrome
   clears box-shadow, so the News tab had no ring (2.4.7). */
.section-tabs .nav-link:focus-visible {
    outline: 3px solid var(--pwm-focus, #003d66);
    outline-offset: 2px;
}

a.quick-links-tab:focus,
a.quick-links-tab:focus-visible,
.cod-link:focus,
.cod-link:focus-visible,
.site-header .nav-search-bar input:focus,
.pwm-drawer-search input:focus,
.pwm-mast-utility a:focus,
.pwm-mast-search:focus,
.pwm-mast-menu:focus,
.pwm-translate-trigger:focus-visible,
.pwm-translate-q:focus-visible,
.pwm-translate-option:focus-visible,
.pwm-translate-more:focus-visible,
.pwm-cal-archive:focus-visible,
.pwm-cal-reset:focus-visible,
.pwm-cal-nav-btn:focus-visible,
.pwm-cal-today:focus-visible,
.pwm-cal-view-btn:focus-visible,
.section-calendar .fc .fc-daygrid-day-number:focus-visible,
.section-calendar .fc .fc-daygrid-more-link:focus-visible {
    outline: 2px solid var(--pwm-focus, #003d66);
    outline-offset: 2px;
}

/* The header search box is a borderless input inside the white slot, with
   Search inset beside it. A ring on the input draws a rectangle through that
   button — and where --pwm-focus matches the button, the ring fuses with it.
   The caret is the focus cue. Search and Close keep their own rings. */
#search-bar-container .pwm-sitesearch-field input:focus,
#search-bar-container .pwm-sitesearch-field input:focus-visible {
    outline: none;
    box-shadow: none;
}

/* A list card clips its own corners, so its ring is drawn inside. */
.pwm-cal-card:focus-visible {
    outline: 2px solid var(--pwm-focus, #003d66);
    outline-offset: -3px;
}

/* The footer sits on --pwm-footer-bkg, where the brand ring has almost no
   contrast (1.4.11). Ring from the footer text color there. */
footer.site-footer :focus-visible {
    outline: 2px solid var(--pwm-footer-focus, #ffffff);
    outline-offset: 2px;
}

/* The newsletter band uses the footer background, so the brand ring fails
   the same way it does in the footer (1.4.11). The field and Subscribe sit
   on the white slot and keep the brand ring. */
.pwm-newsletter-note a:focus-visible {
    outline: 2px solid var(--pwm-footer-focus, #ffffff);
    outline-offset: 2px;
}

/* The Contact Us name plate is filled with --pwm-primary, usually the brand
   ring's own colour (1.4.11). Ring from white there. */
.pwm-contact-plate :focus-visible {
    outline: 2px solid var(--pwm-white, #ffffff);
    outline-offset: 2px;
}

/* Featured home cards clip their children (overflow: hidden for the rounded
   photo corners), which would swallow the brand focus ring — draw it inset
   and white so it stays visible over the photo scrim (1.4.11). */
.featured-home-buttons .button-parent a:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -6px;
}

/* The nav band is --pwm-nav-bkg, usually the same brand colour as
   --pwm-focus, so the default ring vanishes there (2.4.7, 1.4.11). Ring from
   the link colour the town already pairs with the band. Flyout rows run
   edge to edge in their card, so their ring is drawn inside. */
#main-menu > li > a:focus-visible,
#main-menu > li > .nav-trigger:focus-visible,
#main-menu .pwm-nav-search:focus-visible,
.pwm-sitesearch-close:focus-visible {
    outline: 2px solid var(--pwm-nav-link, #ffffff);
    outline-offset: 2px;
}

#main-menu .nav-sub a:focus-visible,
#main-menu .nav-sub .nav-trigger:focus-visible {
    outline: 2px solid var(--pwm-focus, #003d66);
    outline-offset: -2px;
}

/* Photo slider controls sit on the picture, where the navy ring can disappear. */
.home-bottom-slider .carousel-control-prev:focus-visible,
.home-bottom-slider .carousel-control-next:focus-visible,
.home-bottom-slider .carousel-indicators [data-bs-target]:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

/* Hero copy and controls sit on the dark glow behind the words or the panel,
   where the brand ring disappears (1.4.11). The dark gap keeps the white
   ring readable against the light CTA fill. */
.pwm-hero :focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px rgba(9, 16, 22, 0.9);
}

/* Forced colors drop background fills, which would erase the hero dots, the
   current-slide bar and the nav's current-section bar. Draw them in system
   colors. */
@media (forced-colors: active) {
    #main-menu > li > a[aria-current="page"]::after,
    #main-menu > li.is-current-branch > a::after,
    #main-menu > li.is-current-branch > .nav-trigger::after,
    #main-menu .nav-sub a[aria-current="page"]::before {
        forced-color-adjust: none;
        background-color: Highlight;
    }

    .pwm-hero-dot span {
        forced-color-adjust: none;
        border-color: ButtonText;
        background-color: Canvas;
    }

    .pwm-hero-dot.is-active span,
    .pwm-hero-dot.is-active span::after {
        border-color: Highlight;
        background-color: Highlight;
    }
}

.touch-target,
.main-menu-btn,
.pwm-mast-search,
.pwm-mast-menu,
.pwm-translate-trigger,
.pwm-translate-option,
.pwm-translate-more,
#quicklinks-btn,
.nav-search-bar button,
#main-menu > li > a,
#main-menu > li > .nav-trigger,
#main-menu .pwm-nav-search,
#main-menu .nav-sub a,
#main-menu .nav-sub .nav-trigger,
/* Feature cards keep chrome's 160px min-height; only the chrome
   controls need this 2.5.8 floor. Listing .feature-card a here
   overwrote that height and clipped the titles. */
.feature-cards-arrow,
.feature-cards-dot,
.main-content .tab-content .btn-lm,
#sidebar-quicklinks .ql-heading,
.pwm-footer-toggle,
.pwm-footer-sub-toggle {
    min-width: 24px;
    min-height: 24px;
}

.section-tabs .nav-link,
.section-tabs-scroll-btn {
    min-width: 24px;
    min-height: 24px;
}

.section-tabs .nav-link {
    min-height: 48px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .ticker span {
        animation: none !important;
        transform: none !important;
    }

    .featured-home-buttons .buttons-child:hover,
    .featured-home-buttons .buttons-child:focus-within,
    .featured-home-buttons .buttons-child .icon-arrow {
        transform: none !important;
    }

    .pwm-hero-img,
    .pwm-hero-slide {
        transition-delay: 0s !important;
    }
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Public Sans WCAG floors — 1.4.4 rem body (0.9375rem), 1.4.8/1.4.12 leading + measure */
html {
    font-size: 100%;
}

.page-body,
.page-body-more,
.main-content article,
.main-content .tab-content article {
    font-size: var(--pwm-font-body);
    line-height: var(--pwm-line-body);
}

.main-content .tab-content article header h2,
.sidebar-resources .panel h4 {
    font-weight: var(--pwm-weight-normal);
}

.sidebar .title-sidebar {
    font-weight: var(--pwm-weight-bold);
    line-height: var(--pwm-line-heading);
}

.dept-contact .contact-heading {
    font-weight: var(--pwm-weight-bold);
}

.dept-contact .contact-name {
    font-weight: var(--pwm-weight-ui);
}

.main-content .tab-content article header .article-date,
.main-content article.article-full header .article-date {
    font-size: var(--pwm-font-small);
}

/* 2.5.8 Target Size — the mobile sidebar dock is thumb-first. Bar buttons
   clear 56px. The sheet close control is 44px so it lines up with the
   smaller sheet title; _pwm-chrome.css derives --pwm-dock-h from the 56px. */
.pwm-dock-btn {
    min-height: 56px;
}

.pwm-sheet-close {
    min-width: 44px;
    min-height: 44px;
}

.form-list-sb-more {
    min-height: 44px;
}

/* 2.5.8 Target Size — hero controls. A dot draws 10px but hits 24 × 44. */
.pwm-hero-btn {
    min-width: 44px;
    min-height: 44px;
}

.pwm-hero-dot {
    min-width: 24px;
    min-height: 44px;
}

/* 2.5.8 Target Size — FAQ expand control and each question row. */
.pwm-faq-expand,
.pwm-faq-q,
.pwm-translate-trigger,
.pwm-translate-option,
.pwm-translate-more {
    min-height: 44px;
}

/* 2.5.8 Target Size — calendar controls. The day number is a nav link to
   that day's list, and each list row is a full-width event link. */
.pwm-cal-archive,
.pwm-cal-reset,
.pwm-cal-band-trigger,
.pwm-cal-nav-btn,
.pwm-cal-today,
.pwm-cal-view-btn,
.pwm-cal-picker-step,
.pwm-cal-picker-month {
    min-height: 44px;
}

.section-calendar .fc .fc-daygrid-day-number {
    min-width: 34px;
    min-height: 34px;
}

.section-calendar .fc .fc-list-event {
    min-height: 56px;
}

/* 2.5.8 Target Size — directory form and email icons. */
.directory-table .dir-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

/* 1.4.1 — links in prose need more than color. Button links stay plain. */
.pwm-contact-lede a,
.pwm-policy-content a,
.page-body a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.page-body .article-btn a,
.page-body a.article-btn,
.page-body a.article-btn-full,
.page-body .article-btn-full a {
    text-decoration: none;
}
