/*
 * News & Guides: the hub (template-news.php), the category archives (category.php) and the
 * articles (single.php), with their cards (template-parts/news-*.php).
 *
 * Tokens only (tokens.css), no colour written here. Loaded on those views only (inc/news.php).
 *
 * Most article pictures are posters made for Instagram, square or upright, many with words on
 * them, so the listing shows each one whole (contain) on a pale square rather than cropping it,
 * and an article shows its picture at its own shape. Buttons follow the brand guide (capitals,
 * bold, rounded square) with navy text on Ballyhass Blue: white on that blue is 2.42:1.
 */

.bh-news {
    padding-block: var(--bh-space-8, 2rem) var(--bh-space-12, 3rem);
    font-family: var(--bh-font);
    color: var(--bh-navy);
}

/* The listing ------------------------------------------------------------------------------- */

.bh-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: var(--bh-space-6, 1.5rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bh-news-card {
    position: relative;
    display: flex;
    flex-direction: column;
    margin: 0;
    background: var(--bh-white);
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius-md);
    box-shadow: var(--bh-shadow-sm);
    overflow: hidden;
}

.bh-news-card:hover {
    box-shadow: var(--bh-shadow-md);
}

/* The card shows the focus of its title link, for the keyboard only (a click on the card is not
 * a reason to ring it). */
.bh-news-card:has(.bh-news-card__link:focus-visible) {
    outline: var(--bh-focus-width) solid var(--bh-focus-color);
    outline-offset: 2px;
    box-shadow: var(--bh-focus-shadow);
}

/* A square frame whatever the picture's shape: upright posters would otherwise make every card
 * in their row as tall as they are. */
.bh-news-card__media {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bh-surface-2);
}

.bh-news-card__media .bh-news-card__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: contain;
}

/* A page's photograph (the Cork guide) is a photograph, not a poster, so it fills its frame. */
.bh-news-card__media--cover .bh-news-card__image {
    object-fit: cover;
}

.bh-news-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--bh-space-2);
    padding: var(--bh-space-4) var(--bh-space-4) var(--bh-space-5, 1.25rem);
}

/* The category, then the date, on one quiet line above the title. */
.bh-news-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bh-space-1) var(--bh-space-3);
    margin: 0;
    color: var(--bh-muted);
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-medium);
}

.bh-news-card__label {
    color: var(--bh-blue-text);
    font-weight: var(--bh-weight-bold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bh-news-card__date {
    color: var(--bh-muted);
}

.bh-news-card__title {
    margin: 0;
    font-size: var(--bh-text-md);
    font-weight: var(--bh-weight-bold);
    line-height: 1.3;
    text-transform: none;
}

.bh-news-card__link,
.bh-news-card__link:visited {
    color: var(--bh-navy);
    text-decoration: none;
}

/* The title's link covers the card, so the whole card is one target and one link. */
.bh-news-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.bh-news-card__link:hover,
.bh-news-card__link:focus {
    color: var(--bh-navy);
    text-decoration: underline;
}

.bh-news-card__link:focus {
    outline: none;
}

.bh-news-card__excerpt {
    margin: 0;
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-medium);
    line-height: var(--bh-leading-body);
}

.bh-news-empty {
    margin: 0;
    font-size: var(--bh-text-md);
}

/* Pages of the listing ---------------------------------------------------------------------- */

.bh-news-pagination {
    margin-top: var(--bh-space-10, 2.5rem);
}

.bh-news-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--bh-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bh-news-pagination .page-numbers li {
    margin: 0;
}

.bh-news-pagination a.page-numbers,
.bh-news-pagination span.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 var(--bh-space-3);
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius-sm);
    background: var(--bh-white);
    color: var(--bh-navy);
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-bold);
    text-decoration: none;
}

.bh-news-pagination a.page-numbers:hover,
.bh-news-pagination a.page-numbers:focus {
    background: var(--bh-blue);
    border-color: var(--bh-blue);
    color: var(--bh-on-blue);
}

.bh-news-pagination a.page-numbers:focus-visible {
    outline: var(--bh-focus-width) solid var(--bh-focus-color);
    outline-offset: 2px;
}

.bh-news-pagination span.page-numbers.current {
    background: var(--bh-navy);
    border-color: var(--bh-navy);
    color: var(--bh-on-navy);
}

.bh-news-pagination span.page-numbers.dots {
    border-color: transparent;
    background: transparent;
}

/* An article --------------------------------------------------------------------------------- */

/* The banner's 90px heading suits a page name. An article's title runs to 112 characters, which
 * at that size grew up behind the header. */
.single-post .banner .banner_content h1 {
    font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3.25rem);
    line-height: 1.1;
}

/* The category above the title was navy text straight on the photograph, about 2:1 on the
 * paddle boarding guide's (WCAG 1.4.3, assessment of 3 November 2026). It is the brand's
 * highlight now, as the 404 page's label already is: navy block, yellow text, square corners,
 * 13.34:1 whatever the photograph. */
.single-post .banner .banner_content > span {
    display: inline-block;
    margin-bottom: var(--bh-space-3);
    padding: var(--bh-space-1) var(--bh-space-3);
    border-radius: var(--bh-radius-none);
    background: var(--bh-navy);
    color: var(--bh-yellow);
    font-size: var(--bh-text-sm);
    font-weight: var(--bh-weight-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bh-news-article {
    max-width: 46rem;
    margin: 0 auto;
}

.bh-news-article__date {
    margin: 0 0 var(--bh-space-3);
    color: var(--bh-muted);
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-medium);
}

.bh-news-note {
    margin: 0 0 var(--bh-space-6, 1.5rem);
    padding: var(--bh-space-3) var(--bh-space-4);
    border-left: 4px solid var(--bh-blue);
    background: var(--bh-surface-2);
    color: var(--bh-navy);
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-medium);
}

.bh-news-article__picture {
    margin: 0 0 var(--bh-space-8, 2rem);
    text-align: center;
}

.bh-news-article__image {
    display: inline-block;
    width: auto;
    max-width: min(100%, 35rem);
    height: auto;
    border-radius: var(--bh-radius-md);
}

.bh-news-article__back {
    margin: var(--bh-space-10, 2.5rem) 0 0;
}

/* The article's own words: a reading measure, and the old editor's markup made even. */
.bh-news-body {
    font-size: var(--bh-text-sm);
    font-weight: var(--bh-weight-medium);
    line-height: 1.65;
    overflow-wrap: break-word;
}

.bh-news-body > * {
    max-width: 100%;
}

.bh-news-body p,
.bh-news-body ul,
.bh-news-body ol {
    margin: 0 0 var(--bh-space-4);
}

.bh-news-body ul,
.bh-news-body ol {
    padding-left: var(--bh-space-6, 1.5rem);
}

.bh-news-body li {
    margin-bottom: var(--bh-space-2);
}

.bh-news-body h2,
.bh-news-body h3,
.bh-news-body h4,
.bh-news-body h5,
.bh-news-body h6 {
    margin: var(--bh-space-8, 2rem) 0 var(--bh-space-3);
    color: var(--bh-navy);
    font-weight: var(--bh-weight-bold);
    line-height: 1.25;
    text-transform: none;
}

.bh-news-body h2 { font-size: var(--bh-text-xl); }
.bh-news-body h3 { font-size: var(--bh-text-lg); }
.bh-news-body h4,
.bh-news-body h5,
.bh-news-body h6 { font-size: var(--bh-text-md); }

.bh-news-body a:not(.bh-news-button) {
    color: var(--bh-blue-text);
    text-decoration: underline;
}

.bh-news-body a:not(.bh-news-button):hover,
.bh-news-body a:not(.bh-news-button):focus {
    color: var(--bh-navy);
}

.bh-news-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: var(--bh-radius-sm);
}

.bh-news-body figure {
    margin: var(--bh-space-6, 1.5rem) 0;
}

.bh-news-body figcaption {
    margin-top: var(--bh-space-2);
    color: var(--bh-muted);
    font-size: var(--bh-text-xs);
    text-align: center;
}

/* Videos keep their shape at any width. */
.bh-news-embed {
    position: relative;
    aspect-ratio: 16 / 9;
    margin: var(--bh-space-6, 1.5rem) 0;
    background: var(--bh-surface-2);
}

.bh-news-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Tables scroll on their own on a phone rather than widening the page. */
.bh-news-table {
    margin: var(--bh-space-6, 1.5rem) 0;
    overflow-x: auto;
}

.bh-news-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--bh-text-xs);
}

.bh-news-table th,
.bh-news-table td {
    padding: var(--bh-space-2) var(--bh-space-3);
    border: 1px solid var(--bh-line);
    text-align: left;
    vertical-align: top;
}

.bh-news-table thead th {
    background: var(--bh-navy);
    color: var(--bh-on-navy);
}

.bh-news-table th p,
.bh-news-table td ul {
    margin: 0;
}

/* The old "Book Your Adventure" box. */
.bh-news-cta {
    margin: var(--bh-space-8, 2rem) 0;
    padding: var(--bh-space-6, 1.5rem);
    border-radius: var(--bh-radius-md);
    background: var(--bh-navy);
    color: var(--bh-on-navy);
    text-align: center;
}

.bh-news-body .bh-news-cta__title {
    margin: 0 0 var(--bh-space-3);
    color: var(--bh-on-navy);
    font-size: var(--bh-text-lg);
}

.bh-news-cta p {
    margin: 0 0 var(--bh-space-4);
}

.bh-news-cta .bh-news-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--bh-space-3);
    margin: 0;
}

/* The brand's button: capitals, bold, rounded square, navy on blue. */
.bh-news-button,
.bh-news-button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: var(--bh-space-2) var(--bh-space-5, 1.25rem);
    border-radius: var(--bh-radius-sm);
    background: var(--bh-blue);
    color: var(--bh-on-blue);
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-bold);
    letter-spacing: 0.03em;
    text-decoration: none;
    text-transform: uppercase;
}

.bh-news-button:hover,
.bh-news-button:focus {
    background: var(--bh-yellow);
    color: var(--bh-on-yellow);
    text-decoration: none;
}

.bh-news-button:focus-visible {
    outline: var(--bh-focus-width) solid var(--bh-focus-color);
    outline-offset: 2px;
}

/* The hub and the category archives ---------------------------------------------------------- */

/* main.min.css gives every section a 100px bottom margin. These set their own. */
.bh-news section {
    margin: 0;
}

.bh-news-intro {
    max-width: 46rem;
    margin: 0 0 var(--bh-space-6, 1.5rem);
    font-size: var(--bh-text-md);
    font-weight: var(--bh-weight-medium);
    line-height: var(--bh-leading-body);
}

.bh-news-intro p {
    margin: 0 0 var(--bh-space-3);
}

.bh-news-intro p:last-child {
    margin-bottom: 0;
}

/* The category filter: links, wrapped onto a second line on a phone, never scrolled sideways. */
.bh-news-filter {
    margin: 0 0 var(--bh-space-8, 2rem);
}

.bh-news-filter__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bh-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.bh-news-filter__list li {
    margin: 0;
}

.bh-news-filter__link,
.bh-news-filter__link:visited {
    display: inline-flex;
    align-items: center;
    gap: var(--bh-space-2);
    min-height: var(--bh-target-min, 44px);
    padding: var(--bh-space-2) var(--bh-space-4);
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius-sm);
    background: var(--bh-white);
    color: var(--bh-navy);
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-bold);
    letter-spacing: 0.03em;
    text-decoration: none;
    text-transform: uppercase;
}

.bh-news-filter__link:hover,
.bh-news-filter__link:focus {
    border-color: var(--bh-blue);
    background: var(--bh-blue);
    color: var(--bh-on-blue);
    text-decoration: none;
}

.bh-news-filter__link:focus-visible {
    outline: var(--bh-focus-width) solid var(--bh-focus-color);
    outline-offset: 2px;
}

.bh-news-filter__link[aria-current="page"] {
    border-color: var(--bh-navy);
    background: var(--bh-navy);
    color: var(--bh-on-navy);
}

.bh-news-filter__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75em;
    padding: 0 var(--bh-space-1);
    border-radius: var(--bh-radius-sm);
    background: var(--bh-surface-2);
    color: var(--bh-navy);
    font-size: var(--bh-text-2xs, 0.75rem);
    letter-spacing: 0;
}

.bh-news .bh-news-section {
    margin-top: var(--bh-space-12, 3rem);
}

.bh-news .bh-news-filter + .bh-news-section {
    margin-top: 0;
}

/* Subtitles: capitals, bold (the brand guide). */
.bh-news-section__title,
.bh-news .bh-news-section__title {
    margin: 0 0 var(--bh-space-5, 1.25rem);
    color: var(--bh-navy);
    font-size: var(--bh-text-lg);
    font-weight: var(--bh-weight-bold);
    letter-spacing: 0.03em;
    line-height: 1.25;
    text-transform: uppercase;
}

/* Featured guides: the first across the row, photograph beside its words, the other three in one
 * row beneath (three columns, so four guides leave no empty place). */
@media (min-width: 768px) {
    .bh-news-grid--featured {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .bh-news-card--featured {
        grid-column: 1 / -1;
        flex-direction: row;
    }

    .bh-news-card--featured .bh-news-card__media {
        flex: 0 0 50%;
        aspect-ratio: 3 / 2;
    }

    .bh-news-card--featured .bh-news-card__body {
        justify-content: center;
        padding: var(--bh-space-8, 2rem);
    }

    .bh-news-card--featured .bh-news-card__title {
        font-size: var(--bh-text-xl);
    }

    .bh-news-card--featured .bh-news-card__excerpt {
        font-size: var(--bh-text-sm);
    }
}

/* An article: its category, its headings, what it is about and what to read next ------------- */

.bh-news-article__date {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bh-space-1) var(--bh-space-3);
    align-items: baseline;
}

.bh-news-article__category,
.bh-news-article__category:visited {
    color: var(--bh-blue-text);
    font-weight: var(--bh-weight-bold);
    letter-spacing: 0.03em;
    text-decoration: none;
    text-transform: uppercase;
}

.bh-news-article__category:hover,
.bh-news-article__category:focus {
    color: var(--bh-navy);
    text-decoration: underline;
}

/* "In this article": the body's own headings, for the long guides. */
.bh-news-toc {
    margin: 0 0 var(--bh-space-8, 2rem);
    padding: var(--bh-space-4) var(--bh-space-5, 1.25rem);
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius-md);
    background: var(--bh-white);
}

.bh-news-toc__title {
    margin: 0 0 var(--bh-space-2);
    color: var(--bh-navy);
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-bold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bh-news-toc__list {
    margin: 0;
    padding-left: var(--bh-space-5, 1.25rem);
    list-style: disc;
    font-size: var(--bh-text-sm);
    font-weight: var(--bh-weight-medium);
}

.bh-news-toc__list li {
    margin: 0 0 var(--bh-space-1);
}

.bh-news-toc__list a {
    color: var(--bh-blue-text);
    text-decoration: underline;
}

.bh-news-toc__list a:hover,
.bh-news-toc__list a:focus {
    color: var(--bh-navy);
}

/* A heading reached from the list clears the fixed header. */
.bh-news-body h2[id] {
    scroll-margin-top: 7rem;
}

/* "Explore related experiences": the booking system's cards, then the venue. */
.bh-news .bh-news-about {
    margin-top: var(--bh-space-12, 3rem);
    padding-top: var(--bh-space-8, 2rem);
    border-top: 1px solid var(--bh-line);
}

.bh-news-about__lede,
.bh-news-about__note {
    max-width: 46rem;
    margin: calc(-1 * var(--bh-space-3)) 0 var(--bh-space-5, 1.25rem);
    color: var(--bh-muted);
    font-size: var(--bh-text-sm);
    font-weight: var(--bh-weight-medium);
}

.bh-news-about__note {
    margin-top: var(--bh-space-5, 1.25rem);
    color: var(--bh-navy);
}

.bh-news-about__note a {
    color: var(--bh-blue-text);
    text-decoration: underline;
}

/* One or two cards keep a card's width rather than stretching across the page, and three fill
 * the row rather than leaving a fourth place empty. */
.bh-news-about__cards--1 {
    max-width: 24rem;
}

.bh-news-about__cards--2 {
    max-width: 50rem;
}

@media (min-width: 768px) {
    .bh-news-about__cards--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.bh-news-venue {
    display: flex;
    flex-direction: column;
    margin-top: var(--bh-space-6, 1.5rem);
    overflow: hidden;
    border: 1px solid var(--bh-line);
    border-radius: var(--bh-radius-md);
    background: var(--bh-white);
    box-shadow: var(--bh-shadow-sm);
}

.bh-news-venue__media {
    aspect-ratio: 16 / 9;
    background: var(--bh-surface-2);
}

.bh-news-venue__image {
    display: block;
    width: 100%;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

.bh-news-venue__body {
    display: flex;
    flex-direction: column;
    gap: var(--bh-space-2);
    padding: var(--bh-space-5, 1.25rem);
}

.bh-news-venue__body p {
    margin: 0;
}

.bh-news-venue__eyebrow {
    color: var(--bh-blue-text);
    font-size: var(--bh-text-xs);
    font-weight: var(--bh-weight-bold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.bh-news .bh-news-venue__name {
    margin: 0;
    color: var(--bh-navy);
    font-size: var(--bh-text-xl);
    font-weight: var(--bh-weight-bold);
    text-transform: none;
}

.bh-news-venue__line,
.bh-news-venue__address,
.bh-news-venue__today {
    font-size: var(--bh-text-sm);
    font-weight: var(--bh-weight-medium);
}

.bh-news-venue__address {
    color: var(--bh-muted);
}

.bh-news-venue__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--bh-space-3) var(--bh-space-5, 1.25rem);
    margin-top: var(--bh-space-2);
}

.bh-news-venue__link,
.bh-news-venue__link:visited,
.bh-news-article__more,
.bh-news-article__more:visited {
    display: inline-flex;
    align-items: center;
    min-height: var(--bh-target-min, 44px);
    color: var(--bh-blue-text);
    font-size: var(--bh-text-sm);
    font-weight: var(--bh-weight-bold);
    text-decoration: underline;
}

.bh-news-venue__link:hover,
.bh-news-venue__link:focus,
.bh-news-article__more:hover,
.bh-news-article__more:focus {
    color: var(--bh-navy);
}

@media (min-width: 768px) {
    .bh-news-venue {
        flex-direction: row;
        max-width: 50rem;
    }

    .bh-news-venue__media {
        flex: 0 0 40%;
        aspect-ratio: auto;
        min-height: 14rem;
    }
}

/* Three related articles, one row of three. */
@media (min-width: 768px) {
    .bh-news-related .bh-news-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.bh-news-article__back {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--bh-space-3) var(--bh-space-6, 1.5rem);
}

/* On a phone ------------------------------------------------------------------------------------ */

@media (max-width: 575.98px) {
    /* Every card a square poster across the screen made the hub eight thousand pixels long. A
     * card is a row on a phone: the picture small beside the category, date and title. The lead
     * featured guide keeps its photograph. */
    .bh-news-card:not(.bh-news-card--featured) {
        flex-direction: row;
        align-items: stretch;
    }

    .bh-news-card:not(.bh-news-card--featured) .bh-news-card__media {
        flex: 0 0 6.5rem;
        align-self: flex-start;
        width: 6.5rem;
        aspect-ratio: 1 / 1;
    }

    /* A thumbnail fills its square: at this size a letterboxed poster is mostly empty frame. */
    .bh-news-card:not(.bh-news-card--featured) .bh-news-card__media .bh-news-card__image {
        object-fit: cover;
    }

    .bh-news-card--featured .bh-news-card__media {
        aspect-ratio: 3 / 2;
    }

    .bh-news-card:not(.bh-news-card--featured) .bh-news-card__body {
        min-width: 0;
        padding: var(--bh-space-3) var(--bh-space-4);
    }

    .bh-news-card:not(.bh-news-card--featured) .bh-news-card__title {
        font-size: var(--bh-text-sm);
    }

    .bh-news-card:not(.bh-news-card--featured) .bh-news-card__excerpt {
        display: none;
    }

    .bh-news-grid {
        gap: var(--bh-space-3);
    }

    /* The filter: two to a row rather than one. */
    .bh-news-filter__list {
        gap: var(--bh-space-2) var(--bh-space-1);
    }

    .bh-news-filter__link,
    .bh-news-filter__link:visited {
        gap: var(--bh-space-1);
        padding: var(--bh-space-2) var(--bh-space-3);
        letter-spacing: 0;
    }

    .bh-news .bh-news-section {
        margin-top: var(--bh-space-8, 2rem);
    }
}
