/* =============================================================================
   Help Desk Hours Component  —  helpdesk-hours.css
   -----------------------------------------------------------------------------
   Seasonal notice, contact options and a card grid of walk-up hours, grouped
   by day or by location.

   Location in CMS : /_resources/css/helpdesk-hours.css
   Methodology     : BEM (block__element--modifier)
   Approach        : Mobile-first, no JavaScript
   Breakpoints     : tablet 768px+, desktop 1024px+

   TABLE OF CONTENTS
     1.  Design tokens (CSS custom properties)
     2.  Themes
     3.  Block + header
     4.  Seasonal notice
     5.  Contact options + Submit a Ticket button
     6.  Campus header
     7.  Card grid
     8.  Cards + slots
     9.  Responsive breakpoints
     10. Accessibility (focus, sr-only, reduced motion, high contrast, forced colors)
     11. Edit-mode placeholder
     12. Print
   ========================================================================== */


/* -----------------------------------------------------------------------------
   1. DESIGN TOKENS — scoped to the block. Defaults = hccc-secondary (blue).
   -------------------------------------------------------------------------- */
.helpdesk-hours {
    /* Theme colors */
    --hh-accent-bg:        #2b3990;   /* card title bar, contact icon circle */
    --hh-accent-color:     #ffffff;   /* text/icon on the accent             */
    --hh-link-color:       #2b3990;
    --hh-link-hover-color: #00857a;
    --hh-focus-color:      #2b3990;
    /* Submit a Ticket buttons — HCCC yellow with black text in every theme,
       matching the intranet banner's buttons */
    --hh-button-bg:          #fff200;
    --hh-button-color:       #000000;
    --hh-button-hover-bg:    #000000; /* white (the banner's hover) would vanish on a white page */
    --hh-button-hover-color: #fff200;
    --hh-button-shadow:      none;     /* flat, like the banner's buttons */
    --hh-button-hover-shadow: none;
    --hh-button-size:        18px;
    --hh-button-padding:     14px 32px;
    --hh-notice-bg:        #eef0fa;
    --hh-notice-color:     #1c1c1c;
    --hh-notice-title-color: #2b3990;
    --hh-notice-border:    #2b3990;

    /* Neutrals */
    --hh-text-color:       #1c1c1c;
    --hh-muted-color:      #555555;   /* 7.4:1 on white                     */
    --hh-card-bg:          #ffffff;
    --hh-card-border:      #d9dce6;
    --hh-divider:          #e3e5ec;

    /* Layout */
    --hh-margin-block:     2rem;
    --hh-section-gap:      28px;      /* between notice / contact / campus  */
    --hh-grid-gap:         18px;
    --hh-card-radius:      8px;
    --hh-card-padding:     18px 20px 20px;
    --hh-title-padding:    12px 20px;
    --hh-notice-padding:   16px 18px;
    --hh-icon-size:        44px;

    /* Typography (Montserrat inherited from the site) */
    --hh-heading-size:         24px;
    --hh-heading-size-tablet:  30px;
    --hh-heading-size-desktop: 36px;
    --hh-campus-size:          20px;
    --hh-campus-size-tablet:   22px;
    --hh-card-title-size:      18px;
    --hh-text-size:            16px;
    --hh-small-size:           14px;

    /* Motion */
    --hh-transition:       color 0.2s ease, text-decoration-color 0.2s ease;
}


/* -----------------------------------------------------------------------------
   2. THEMES — every text pair meets WCAG 2.1 AA (see README contrast table).
   -------------------------------------------------------------------------- */

/* HCCC Secondary — blue (default) */
.helpdesk-hours--hccc-secondary {
    /* uses the defaults above */
}

/* HCCC Primary — teal */
.helpdesk-hours--hccc-primary {
    --hh-accent-bg:        #00857a;
    --hh-accent-color:     #ffffff;
    --hh-link-color:       #00857a;
    --hh-link-hover-color: #2b3990;
    --hh-focus-color:      #00857a;
    --hh-notice-bg:        #e6f4f2;
    --hh-notice-title-color: #006b62;
    --hh-notice-border:    #00857a;
}

/* HCCC Accent — yellow bars, blue links */
.helpdesk-hours--hccc-accent {
    --hh-accent-bg:        #fff200;
    --hh-accent-color:     #000000;
    --hh-link-color:       #2b3990;
    --hh-link-hover-color: #000000;
    --hh-focus-color:      #2b3990;
    --hh-notice-bg:        #fff200;
    --hh-notice-color:     #000000;
    --hh-notice-title-color: #000000;
    --hh-notice-border:    #000000;
}

/* 50th Anniversary — black & gold */
.helpdesk-hours--anniversary {
    --hh-accent-bg:        #1a1a1a;
    --hh-accent-color:     #d4af37;
    --hh-link-color:       #1a1a1a;
    --hh-link-hover-color: #2b3990;
    --hh-focus-color:      #1a1a1a;
    --hh-notice-bg:        #1a1a1a;
    --hh-notice-color:     #ffffff;
    --hh-notice-title-color: #d4af37;
    --hh-notice-border:    #d4af37;
}

/* 50th Anniversary Gold */
.helpdesk-hours--anniversary-gold {
    --hh-accent-bg:        #d4af37;
    --hh-accent-color:     #1a1a1a;
    --hh-link-color:       #1a1a1a;
    --hh-link-hover-color: #2b3990;
    --hh-focus-color:      #1a1a1a;
    --hh-notice-bg:        #f8f0d4;
    --hh-notice-color:     #1a1a1a;
    --hh-notice-title-color: #1a1a1a;
    --hh-notice-border:    #d4af37;
}


/* -----------------------------------------------------------------------------
   3. BLOCK + HEADER
   -------------------------------------------------------------------------- */
.helpdesk-hours {
    display: flex;
    flex-direction: column;
    gap: var(--hh-section-gap);
    margin: var(--hh-margin-block) 0;
    color: var(--hh-text-color);
    font-size: var(--hh-text-size);
    line-height: 1.5;
}

.helpdesk-hours *,
.helpdesk-hours *::before,
.helpdesk-hours *::after {
    box-sizing: border-box;
}

.helpdesk-hours p {
    margin: 0;
}

/* Header: heading on the left, Submit a Ticket on the right (wraps below on narrow screens) */
.helpdesk-hours__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
}

.helpdesk-hours__header-text {
    flex: 1 1 320px;
    min-width: 0;
}

.helpdesk-hours__header-action {
    flex: 0 0 auto;
}

.helpdesk-hours__heading {
    margin: 0;
    color: var(--hh-text-color);
    font-family: inherit;
    font-size: var(--hh-heading-size);
    font-weight: 800;
    line-height: 1.25;
}

.helpdesk-hours__intro {
    margin-top: 8px !important;
    color: var(--hh-muted-color);
}

.helpdesk-hours a {
    color: var(--hh-link-color);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: var(--hh-transition);
}

.helpdesk-hours a:hover {
    color: var(--hh-link-hover-color);
    text-decoration-thickness: 2px;
}


/* -----------------------------------------------------------------------------
   4. SEASONAL NOTICE
   -------------------------------------------------------------------------- */
.helpdesk-hours__notice {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: var(--hh-notice-padding);
    border-left: 6px solid var(--hh-notice-border);
    border-radius: 0 var(--hh-card-radius) var(--hh-card-radius) 0;
    background: var(--hh-notice-bg);
    color: var(--hh-notice-color);
}

.helpdesk-hours__notice-icon {
    flex: 0 0 auto;
    color: var(--hh-notice-title-color);
    font-size: 22px;
    line-height: 1.2;
}

.helpdesk-hours__notice-title {
    color: var(--hh-notice-title-color);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

.helpdesk-hours__notice-text {
    margin-top: 4px !important;
    font-weight: 700;
}

.helpdesk-hours__notice-note {
    margin-top: 6px !important;
    font-size: var(--hh-small-size);
    font-style: italic;
}


/* -----------------------------------------------------------------------------
   5. CONTACT OPTIONS
   -------------------------------------------------------------------------- */
/* Lists below are scoped under .helpdesk-hours (specificity 0,2,0) so they
   beat the site's rich-text rules (.wysiwyg ul / .wysiwyg ul li, 0,1,1–0,1,2)
   that add teal dots, a 41–52px indent and 12–39px gaps. See DEVELOPER-GUIDE §4. */
.helpdesk-hours .helpdesk-hours__contact {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hh-grid-gap);
    margin: 0;
    padding: 0;
    list-style: none;
    line-height: inherit;
}

.helpdesk-hours .helpdesk-hours__contact-item {
    position: static;
    display: grid;
    grid-template-columns: var(--hh-icon-size) 1fr;
    column-gap: 14px;
    align-content: start;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--hh-card-border);
    border-radius: var(--hh-card-radius);
    background: var(--hh-card-bg);
}

.helpdesk-hours .helpdesk-hours__contact-item::before,
.helpdesk-hours .helpdesk-hours__slot::before {
    content: none;                      /* removes the site's teal list dots */
    display: none;
}

.helpdesk-hours__contact-icon {
    grid-row: 1 / span 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--hh-icon-size);
    height: var(--hh-icon-size);
    border-radius: 50%;
    background: var(--hh-accent-bg);
    color: var(--hh-accent-color);
    font-size: 18px;
}

.helpdesk-hours__contact-label {
    color: var(--hh-muted-color);
    font-size: var(--hh-small-size);
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.helpdesk-hours__contact-link {
    justify-self: start;
    overflow-wrap: anywhere;
    font-size: 17px;
}

.helpdesk-hours__contact-hours {
    display: block;
    margin-top: 2px;
    color: var(--hh-muted-color);
    font-size: var(--hh-small-size);
    line-height: 1.4;
}

.helpdesk-hours__contact-hours:first-of-type {
    margin-top: 6px;
}

.helpdesk-hours__external {
    margin-left: 0.35em;
    font-size: 0.75em;
}


/* Submit a Ticket button (header and after the locations) */
.helpdesk-hours__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}

.helpdesk-hours .helpdesk-hours__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6em;
    min-height: 52px;                   /* well above the 44px touch target */
    padding: var(--hh-button-padding);
    border-radius: 30px;
    background: var(--hh-button-bg);
    color: var(--hh-button-color);
    box-shadow: var(--hh-button-shadow);
    font-size: var(--hh-button-size);
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.helpdesk-hours .helpdesk-hours__button:hover {
    background: var(--hh-button-hover-bg);
    color: var(--hh-button-hover-color);
    box-shadow: var(--hh-button-hover-shadow);
    text-decoration: none;
}

.helpdesk-hours__button-icon {
    font-size: 1.1em;
}

/* Phones: full-width buttons so they can't be missed */
@media (max-width: 767px) {
    .helpdesk-hours__header-action,
    .helpdesk-hours .helpdesk-hours__button {
        width: 100%;
    }
}

/* Divider between the last campus and the closing button */
.helpdesk-hours__campus ~ .helpdesk-hours__cta {
    padding-top: var(--hh-section-gap);
    border-top: 1px solid var(--hh-divider);
}

.helpdesk-hours__cta-note {
    color: var(--hh-muted-color);
    font-size: var(--hh-small-size);
}


/* -----------------------------------------------------------------------------
   6. CAMPUS HEADER
   -------------------------------------------------------------------------- */
.helpdesk-hours__campus + .helpdesk-hours__campus {
    padding-top: var(--hh-section-gap);
    border-top: 1px solid var(--hh-divider);
}

.helpdesk-hours__campus-header {
    margin-bottom: 14px;
}

.helpdesk-hours__campus-name {
    margin: 0;
    color: var(--hh-text-color);
    font-family: inherit;
    font-size: var(--hh-campus-size);
    font-weight: 800;
    line-height: 1.2;
}

.helpdesk-hours__campus-address {
    margin-top: 4px !important;
    color: var(--hh-muted-color);
    font-size: var(--hh-small-size);
}

.helpdesk-hours__campus-phone {
    margin-top: 2px !important;
    font-size: var(--hh-small-size);
}

.helpdesk-hours__campus-icon {
    margin-right: 6px;
}


/* -----------------------------------------------------------------------------
   7. CARD GRID — 1 column on mobile; see section 9 for larger screens.
   -------------------------------------------------------------------------- */
.helpdesk-hours__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--hh-grid-gap);
}


/* -----------------------------------------------------------------------------
   8. CARDS + SLOTS
   -------------------------------------------------------------------------- */
.helpdesk-hours__card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--hh-card-border);
    border-radius: var(--hh-card-radius);
    background: var(--hh-card-bg);
}

.helpdesk-hours__card-title {
    display: flex;
    gap: 10px;
    align-items: baseline;
    margin: 0;
    padding: var(--hh-title-padding);
    background: var(--hh-accent-bg);
    color: var(--hh-accent-color);
    font-family: inherit;
    font-size: var(--hh-card-title-size);
    font-weight: 700;
    line-height: 1.3;
}

.helpdesk-hours__card-icon {
    flex: 0 0 auto;
    font-size: 0.9em;
}

.helpdesk-hours__card-subtitle {
    padding: 12px 20px 0;
    color: var(--hh-muted-color);
    font-size: var(--hh-small-size);
}

.helpdesk-hours .helpdesk-hours__slots {
    margin: 0;
    padding: 4px 20px 8px;
    list-style: none;
    line-height: inherit;
}

.helpdesk-hours .helpdesk-hours__slot {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 12px 0;
}

.helpdesk-hours__slot + .helpdesk-hours__slot {
    border-top: 1px dashed var(--hh-divider);
}

.helpdesk-hours__slot-time {
    font-weight: 700;
}

.helpdesk-hours__slot-primary {
    font-weight: 500;
}

.helpdesk-hours__slot-details {
    color: var(--hh-muted-color);
    font-size: var(--hh-small-size);
    line-height: 1.4;
}

/* By-location: the day range leads, the time follows */
.helpdesk-hours--by-location .helpdesk-hours__slot-primary {
    font-weight: 700;
}

.helpdesk-hours--by-location .helpdesk-hours__slot-time {
    font-weight: 500;
}


/* -----------------------------------------------------------------------------
   9. RESPONSIVE
   -------------------------------------------------------------------------- */

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .helpdesk-hours__heading {
        font-size: var(--hh-heading-size-tablet);
    }

    .helpdesk-hours__campus-name {
        font-size: var(--hh-campus-size-tablet);
    }

    .helpdesk-hours .helpdesk-hours__contact {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .helpdesk-hours__grid--grid-2,
    .helpdesk-hours__grid--grid-3,
    .helpdesk-hours__grid--grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .helpdesk-hours {
        --hh-margin-block: 3rem;
    }

    .helpdesk-hours__heading {
        font-size: var(--hh-heading-size-desktop);
    }

    .helpdesk-hours__grid--grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .helpdesk-hours__grid--grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}


/* -----------------------------------------------------------------------------
   10. ACCESSIBILITY
   -------------------------------------------------------------------------- */
.helpdesk-hours a:focus-visible {
    outline: 3px solid var(--hh-focus-color);
    outline-offset: 3px;
    border-radius: 2px;
}

@supports not selector(:focus-visible) {
    .helpdesk-hours a:focus {
        outline: 3px solid var(--hh-focus-color);
        outline-offset: 3px;
    }
}

.helpdesk-hours__sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .helpdesk-hours a,
    .helpdesk-hours .helpdesk-hours__button {
        transition: none;
    }

}

@media (prefers-contrast: more) {
    .helpdesk-hours {
        --hh-card-border: #000000;
        --hh-divider: #000000;
        --hh-muted-color: #1c1c1c;
    }

    .helpdesk-hours a {
        text-decoration-thickness: 2px;
    }
}

@media (forced-colors: active) {
    .helpdesk-hours__card,
    .helpdesk-hours .helpdesk-hours__contact-item,
    .helpdesk-hours__notice {
        border: 1px solid CanvasText;
    }

    .helpdesk-hours__card-title {
        border-bottom: 1px solid CanvasText;
    }

    .helpdesk-hours .helpdesk-hours__button {
        border: 2px solid ButtonText;
    }

    .helpdesk-hours a:focus-visible {
        outline-color: Highlight;
    }
}


/* -----------------------------------------------------------------------------
   11. EDIT-MODE PLACEHOLDER (only rendered when $ou:action = 'edt')
   -------------------------------------------------------------------------- */
.helpdesk-hours-placeholder {
    margin: 1rem 0;
    padding: 16px 20px;
    border: 2px dashed #2b3990;
    background: #f4f5fb;
    color: #2b3990;
    font-size: 14px;
    font-weight: 500;
}


/* -----------------------------------------------------------------------------
   12. PRINT — a clean, ink-light schedule to post at a service desk
   -------------------------------------------------------------------------- */
@media print {
    .helpdesk-hours {
        gap: 16px;
        color: #000000;
    }

    .helpdesk-hours__notice {
        border: 2px solid #000000;
        background: none;
        color: #000000;
    }

    .helpdesk-hours__notice-title,
    .helpdesk-hours__notice-icon {
        color: #000000;
    }

    .helpdesk-hours__contact-icon,
    .helpdesk-hours__external {
        display: none;
    }

    .helpdesk-hours .helpdesk-hours__contact-item {
        display: block;
        border: 1px solid #000000;
    }

    .helpdesk-hours__contact-label {
        display: block;
    }

    .helpdesk-hours a {
        color: #000000;
        text-decoration: none;
    }

    .helpdesk-hours .helpdesk-hours__button {
        width: auto;
        min-height: 0;
        padding: 0;
        background: none;
        box-shadow: none;
        color: #000000;
        font-weight: 700;
    }

    .helpdesk-hours__button-icon {
        display: none;
    }

    .helpdesk-hours .helpdesk-hours__button::after,
    .helpdesk-hours__contact-item--virtual a::after {
        content: " (" attr(href) ")";
        font-weight: 400;
        font-size: 0.85em;
    }

    .helpdesk-hours__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .helpdesk-hours__card {
        break-inside: avoid;
        border: 1px solid #000000;
    }

    .helpdesk-hours__card-title {
        background: none;
        color: #000000;
        border-bottom: 2px solid #000000;
    }
}
