/* ==========================================================================
   News / Activities page
   Colour badge, "Upcoming Activities" slider, category pills, compact filters,
   search. Loaded via phi/news (attached from the news view, bubbles page-wide).
   ========================================================================== */

/* --- Colour-coded category badge (top-left of each card/slide image) ------ */
.view-id-news .views-row {
    position: relative;
}
.news-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-family: var(--display-font);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
    color: #fff;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}
.news-cat-badge a,
.news-cat-badge a:hover {
    color: #fff;
    border-bottom: none;
    text-decoration: none;
}

/* --- Section heading ("Upcoming Activities") ------------------------------ */
.news-section-title {
    text-align: center;
    font-family: var(--display-font);
    font-weight: 800;
    font-size: 2.3rem;
    margin: 0 0 2rem;
    color: var(--phi-dark);
}
.news-section-title span {
    color: var(--phi-orange);
}

/* ==========================================================================
   Upcoming Activities slider (news view, display block_5)
   ========================================================================== */
.news-slider {
    /* Full width with side padding — the card fills the content box and the
       chevrons are pulled out into the padding, landing at the container edge. */
    max-width: 100%;
    margin: 0 auto 1rem;
    position: relative;
    padding: 0 6rem;
}
/* .news-slider also carries the .contentslider class, whose theme rule strips
   the border (.contentslider .flexslider { border: none }). Win on specificity.
   overflow MUST stay visible so the prev/next arrows can sit in the gutters —
   the rounded-card look is produced by rounding the two columns individually. */
.news-slider.contentslider .flexslider,
.news-slider .flexslider {
    background: none;
    border: none;
    overflow: visible;
    margin: 0;
}
/* Each slide is the bordered, rounded card: image left, content right. */
.news-slider .flexslider ul.slides > li {
    display: flex !important;
    align-items: stretch;
    /* Fixed height so every slide matches — the image fills it and short slides
       just centre their content, instead of flexslider reserving the tallest
       slide's height and leaving a gap. Reset to auto when stacked (<=650px). */
    height: 420px;
    background: #fff;
    border: 1px solid var(--phi-gray-200);
    border-radius: 16px;
    overflow: hidden;
}
.news-slider .views-field-field-news-image-media {
    position: relative;
    flex: 0 0 50%;
    max-width: 50%;
    overflow: hidden;
}
.news-slider .views-field-field-news-image-media .field-content,
.news-slider .views-field-field-news-image-media .field-content > a,
.news-slider .views-field-field-news-image-media .media,
.news-slider .views-field-field-news-image-media .field--type-image,
.news-slider .views-field-field-news-image-media .field__item,
.news-slider .views-field-field-news-image-media picture,
.news-slider .views-field-field-news-image-media img {
    height: 100%;
    width: 100%;
    display: block;
}
.news-slider .views-field-field-news-image-media img {
    object-fit: cover;
}
/* The image is wrapped in a link, and `.region-content a` in global.css gives
   every link in the content region a dotted 0.1rem underline. On a card that
   draws a dotted line across the bottom edge of the photo. Two classes here
   against that rule's one, so this wins despite global.css loading later.
   `border: none` rather than `border-bottom`, so nothing is left on the sides. */
.news-slider .views-field-field-news-image-media a {
    border: none;
}
/* Content column. */
.news-slider .views-field-nothing {
    flex: 1 1 50%;
    padding: 2.75rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* "Featured" pill above the date. */
.news-slider .views-field-nothing .field-content::before {
    content: "Featured";
    display: inline-block;
    align-self: flex-start;
    background: var(--phi-orange);
    color: #fff;
    /* Match .tagitem sizing. */
    font-size: 0.875rem;
    line-height: 1.3;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 1.1rem;
}
.news-slider .views-field-nothing .orange-subheading,
.news-slider .views-field-nothing time {
    color: var(--phi-orange);
    font-family: var(--display-font);
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.news-slider .views-field-nothing h4 {
    font-size: 1.9rem;
    line-height: 1.2;
    margin: 0.6rem 0 1rem;
    /* Clamp so slides stay a consistent height. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-slider .views-field-nothing h4 a {
    color: var(--phi-dark);
    border-bottom: none;
}
.news-slider .views-field-nothing p {
    color: var(--phi-gray-600);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0 0 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-slider .views-field-nothing .tagscon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
/* Read-article + divider are redundant in the slide (design omits them). */
.news-slider .views-field-nothing .hrline,
.news-slider .views-field-nothing .orange-link {
    display: none;
}

/* Slider dots. */
.news-slider .flex-control-nav {
    position: static;
    margin-top: 1.25rem;
    text-align: center;
}
.news-slider .flex-control-nav li a {
    background: var(--phi-gray-200);
    box-shadow: none;
    width: 11px;
    height: 11px;
}
.news-slider .flex-control-nav li a.flex-active {
    background: var(--phi-orange);
}
/* Arrows pinned at the slide edges. Pinned for BOTH rest and :hover (the :hover
   rules also carry the compound .news-slider selector) so they never shift when
   the pointer enters the slider. */
.news-slider .flex-direction-nav a {
    --slider-arrow-size: 44px;
    --slider-arrow-color: var(--phi-gray-600);
}
.news-slider.flexshowicon .flex-direction-nav a.flex-prev,
.news-slider.contentslider.flexshowicon .flexslider:hover .flex-direction-nav a.flex-prev { left: -6rem; }
.news-slider.flexshowicon .flex-direction-nav a.flex-next,
.news-slider.contentslider.flexshowicon .flexslider:hover .flex-direction-nav a.flex-next { right: -6rem; }
.news-slider .flex-direction-nav a:hover { --slider-arrow-color: var(--phi-orange); }

/* ==========================================================================
   Filter bar — category pills (left) + search + compact Filters (right)
   ========================================================================== */
.news-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px 16px;
    padding: 0.25rem 0;
}

/* Category pills take the row and wrap internally; search + filters stay right. */
.news-filter-bar .news-cat-pills {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}
.news-filter-bar .news-cat-pills h2,
.news-filter-bar .news-cat-pills .facets-widget__title,
.news-filter-bar .news-cat-pills h3 {
    display: none;
}
.news-cat-pills ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.news-cat-pills li {
    margin: 0;
    list-style: none;
}
.news-cat-pills li a {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--phi-gray-200);
    border-radius: 999px;
    background: #fff;
    color: var(--phi-gray-800);
    font-family: var(--display-font);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    border-bottom: 1px solid var(--phi-gray-200);
    transition: all 0.15s var(--ease);
    white-space: nowrap;
}
.news-cat-pills li a:hover {
    border-color: var(--phi-orange);
    color: var(--phi-orange);
}
/* Active pill (facets marks the <a> or <li> active) + the All pill. */
.news-cat-pills li.facet-item--active a,
.news-cat-pills li a.is-active,
.news-cat-pills li.is-active a,
.news-cat-pills li a.facet-item--active {
    background: var(--phi-orange);
    border-color: var(--phi-orange);
    color: #fff;
}
.news-cat-pills li a .facet-item__count,
.news-cat-pills li a .facet-item__status { display: none; }

/* Search — right side, rounded pill with icon. */
.news-filter-bar .views-exposed-form {
    order: 3;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    background: none;
}
.news-filter-bar .views-exposed-form .form--inline,
.news-filter-bar .views-exposed-form form {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
}
.news-filter-bar .views-exposed-form label,
.news-filter-bar .views-exposed-form .block-title { display: none; }
.news-filter-bar .views-exposed-form .form-item {
    margin: 0;
    position: relative;
}
.news-filter-bar .views-exposed-form input[type="text"],
.news-filter-bar .views-exposed-form input.form-text {
    max-width: 42vw;
    height: 44px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--phi-gray-200);
    border-radius: 999px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23a0a3a7' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 14px center;
    font-size: 0.9375rem;
    color: var(--phi-dark);
}
/* Narrow on desktop so the category pills keep to a single row. Higher
   specificity than the theme's `.filterssearch ... input[type="text"] {width:100%}`
   (same-specificity rule that loads later in global.css). */
/* Collapsed by default: just the magnifier. Expands on click, and stays
   expanded whenever the box holds a term (.is-open is set by news.js). */
.news-filter-bar .views-exposed-form input.form-text.form-control {
    width: 44px;
    padding-left: 40px;
    cursor: pointer;
    transition: width 0.28s var(--ease);
}
.news-filter-bar .views-exposed-form.is-open input.form-text.form-control {
    width: 240px;
    cursor: text;
}
.news-filter-bar .views-exposed-form input[type="text"]:focus {
    outline: none;
    border-color: var(--phi-orange);
    box-shadow: 0 0 0 3px rgba(245, 120, 32, 0.15);
}
/* The exposed form's own submit button is redundant (auto-submit / icon). */
.news-filter-bar .views-exposed-form .form-actions,
.news-filter-bar .views-exposed-form button[type="submit"],
.news-filter-bar .views-exposed-form input[type="submit"] {
    display: none;
}

/* Compact "Filters" dropdown (Date + News Tags). */
.news-filters-dd {
    order: 2;
    position: relative;
}
.news-filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 18px;
    border: 1px solid var(--phi-gray-200);
    border-radius: 999px;
    background: #fff;
    color: var(--phi-gray-800);
    font-family: var(--display-font);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}
.news-filters-toggle:hover,
.news-filters-dd.open .news-filters-toggle {
    border-color: var(--phi-orange);
    color: var(--phi-orange);
}
.news-filters-caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -4px;
    transition: transform 0.2s var(--ease);
}
.news-filters-dd.open .news-filters-caret {
    transform: rotate(-135deg);
    margin-top: 2px;
}
.news-filters-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    min-width: 240px;
    padding: 1rem 1.1rem;
    background: #fff;
    border: 1px solid var(--phi-gray-200);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.news-filters-panel .block-facets { margin: 0; }
.news-filters-panel .block-facets h2,
.news-filters-panel .block-facets h3 {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--phi-gray-400);
    margin: 0 0 0.35rem;
}
.news-filters-panel select {
    width: 100%;
    height: 40px;
    border: 1px solid var(--phi-gray-200);
    border-radius: 8px;
    padding: 0 10px;
}

/* The standalone Reset block is replaced by the All pill. */
.news-reset-hidden { display: none; }

/* The result summary exists only as the source of the "All (N)" total — the
   News page does not show a count line. Unhide this to display one (the
   Knowledge Center page shows the same summary).
   Scoped to block_1: the other news displays use their header for a real
   "View More" link, which must stay visible. */
.view-news.view-display-id-block_1 > .view-header { display: none; }

/* "Reset Filters" — mirrors .products-reset / .kc-reset, sat at the end of the
   filter bar. .orange-link supplies the colour and type; this drops that
   class's trailing arrow and sizes the leading icon. !important because
   .orange-link's ::after rule is in custom-classes.css, which loads later. */
.news-filter-bar .news-reset {
    order: 4;
    flex: 0 0 auto;
}
.news-reset::after { content: none !important; }
.news-reset svg {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}
.news-reset[hidden] { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    /* Smaller gutters — keep the card roomy while the arrows stay at the edge. */
    .news-slider { padding: 0 3.25rem; }
    .news-slider.flexshowicon .flex-direction-nav a.flex-prev,
    .news-slider.contentslider.flexshowicon .flexslider:hover .flex-direction-nav a.flex-prev { left: -3.25rem; }
    .news-slider.flexshowicon .flex-direction-nav a.flex-next,
    .news-slider.contentslider.flexshowicon .flexslider:hover .flex-direction-nav a.flex-next { right: -3.25rem; }
    .news-slider .flex-direction-nav a { --slider-arrow-size: 34px; }
    .news-slider .views-field-nothing { padding: 1.75rem 2rem; }
    .news-slider .views-field-nothing h4 { font-size: 1.5rem; }
    .news-section-title { font-size: 1.9rem; }
    .news-filter-bar .views-exposed-form { order: 2; margin-left: auto; }
    .news-filters-dd { order: 3; }
}

@media (max-width: 650px) {
    /* No room for gutters — drop the padding and overlay the arrows on the
       image edges (white, so they read over the photo). */
    .news-slider { padding: 0; }
    .news-slider.flexshowicon .flex-direction-nav a.flex-prev,
    .news-slider.contentslider.flexshowicon .flexslider:hover .flex-direction-nav a.flex-prev { left: 0; }
    .news-slider.flexshowicon .flex-direction-nav a.flex-next,
    .news-slider.contentslider.flexshowicon .flexslider:hover .flex-direction-nav a.flex-next { right: 0; }
    .news-slider .flex-direction-nav a { --slider-arrow-size: 30px; --slider-arrow-color: #fff; }

    /* ...but they were landing on the text, not the photo. FlexSlider centres
       its arrows on the whole slide with `top: 50%`, and the rule below stacks
       the slide image-over-content, so the middle of the slide is in the middle
       of the copy. White chevrons then sat on top of the headline.

       The image is full width at 16/9, so half its height is
       (slider width) * 9/32, and the slider is the viewport less a 48px gutter
       (measured constant at 360, 390, 480 and 650). The existing -30px margin
       still centres the 60px hit area on that point.

       clamp() is the safety net: even if that gutter ever changes, the arrows
       cannot travel out of the photo, which is 175px tall at the narrowest of
       these widths and 339px at the widest. */
    .news-slider .flex-direction-nav a {
        top: clamp(60px, calc((100vw - 3rem) * 9 / 32), 170px);
    }

    /* Slide stacks: image on top, content below — natural height. */
    .news-slider .flexslider ul.slides > li { flex-direction: column; height: auto; }
    .news-slider .views-field-field-news-image-media {
        flex-basis: auto;
        max-width: 100%;
        /* Stacked: round the top corners instead of the left. */
        border-radius: 16px 16px 0 0;
    }
    .news-slider .views-field-field-news-image-media img { aspect-ratio: 16 / 9; }
    .news-slider .views-field-nothing { padding: 1.5rem 1.35rem; }
    .news-slider .views-field-nothing h4 { font-size: 1.35rem; }

    /* Filter bar wraps to two rows: pills, then search + filters. */
    .news-filter-bar { gap: 10px; flex-wrap: wrap; }
    .news-filter-bar .news-cat-pills {
        order: 1;
        flex-basis: 100%;
        width: 100%;
    }
    /* Wrap onto multiple rows instead of a horizontal scroll. */
    .news-cat-pills ul { flex-wrap: wrap; }
    .news-filter-bar .views-exposed-form { order: 2; margin: 0; flex: 1 1 auto; }
    .news-filter-bar .views-exposed-form input.form-text.form-control { width: 100%; max-width: none; }
    .news-filters-dd { order: 3; }
    .news-filters-panel { right: 0; left: auto; }
    .news-section-title { font-size: 1.6rem; margin-bottom: 1.25rem; }
}
