/*
 * HSC DEVELOPER NOTE
 * Purpose: News/image-header styles.
 * Where to change: Final layer from the original custom.css stack for News and image-header presentation.
 * Load order/conditions are defined in inc/theme/assets.php.
 */

/* News year archive */
.hsc-news-year-heading {
    margin: 20px 0 30px;
}

.hsc-news-year-heading h2 {
    margin: 0 0 5px;
    color: var(--main-text-colour);
}

.hsc-news-year-heading span {
    color: var(--main-text-colour);
}

.hsc-news-year-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 12px 0 14px;
    padding: 0;
}

.hsc-news-archive-divider {
    margin: 0 0 16px;
    border: 0;
    border-top: 1px solid var(--main-text-colour);
}

.hsc-news-year-link a {
    font-size: 0.9rem;
}

.hsc-news-archive {
    margin-top: 0;
    margin-bottom: 1em;
    padding-top: 0;
}

.hsc-news-archive-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 8px 0;
}

.hsc-news-archive-label {
    color: var(--main-text-colour);
    font-weight: bold;
	margin-right: 0.5em;
}

.hsc-news-archive-row a.button {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px;
    margin: 0 6px 6px 0;
    text-decoration: none;
}

.hsc-news-archive-count {
    font-size: 0.9em;
}

.hsc-news-archive-row a.button:hover,
.hsc-news-archive-row a.button:focus {
    text-decoration: none;
}

@media screen and (max-width: 768px) {
    .hsc-news-year-link,  .hsc-news-archive-label {	
	padding-left: 0.9375rem;
	padding-right: 0.9375rem;
	}
}

@media screen and (max-width: 500px) {
    .hsc-news-year-link,  .hsc-news-archive-label {	
	padding-left: 0rem;
	padding-right: 0.9375rem;
	}
}

@media screen and (max-width: 639px) {
    .hsc-news-year-heading {
        margin-bottom: 25px;
    }

    .hsc-news-year-link {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .hsc-news-archive-divider {
        margin-bottom: 14px;
    }

    .hsc-news-archive-row {
        align-items: flex-start;
        gap: 7px 0;
    }

    .hsc-news-archive-label {
        flex-basis: 100%;
        margin-right: 0;
    }
}

/* HSC Theme 2.6 - Image Header content section.
 * Mirrors the standard Hero Image treatment but is restrained to the current
 * content column: about 768px on a 75/25 layout and no more than 1024px on a
 * full-width layout.
 */
.hsc-image-header {
    width: 100%;
    max-width: 1024px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    box-sizing: border-box;
}

/* The shared Hero CSS gives section heroes a 1.2rem margin and width:100%.
 * Reduce the row width by the same amount so a contained Image Header never
 * spills outside its content column.
 */
.hsc-image-header .hsc-image-header__row {
    width: calc(100% - 2.4rem);
    box-sizing: border-box;
}

.hsc-image-header .hsc-image-header__content {
    position: relative;
    z-index: 2;
    box-sizing: border-box;
}

.hsc-image-header .hsc-image-header__content h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: inherit;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 600;
}

.hsc-image-header .hsc-image-header__summary,
.hsc-image-header .hsc-image-header__summary p:last-child {
    margin-bottom: 0;
}

/* The same black translucent text box used by the existing Hero Image. */
.hsc-image-header--box .hsc-image-header__content {
    background: #00000074;
    color: #fff;
}

/* Theme-colour text boxes extend the Hero choices without changing its
 * shadows/no-effect behaviour.
 */
.hsc-image-header--primary .hsc-image-header__content,
.hsc-image-header--secondary .hsc-image-header__content,
.hsc-image-header--highlight .hsc-image-header__content {
    background: var(--hsc-image-header-bg);
    color: var(--hsc-image-header-text);
}

@media screen and (max-width: 639px) {
    .hsc-image-header .hsc-image-header__row {
        width: calc(100% - 2rem);
    }

    .hsc-image-header .hsc-image-header__content h2 {
        font-size: 1.5rem;
    }
}


/* 2.6.4: isolated Slim news layout; Featured and Tall retain their styles. */
.hsc-slim-news { display: grid; gap: 0; }
.hsc-slim-news .hsc-slim-news__item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 16px 10px 0; min-width: 0; border-bottom: 1px solid #b7c1c8;
}
.hsc-slim-news .hsc-slim-news__image {
    flex: 0 0 112px; width: 112px; height: 84px;
    object-fit: cover; border-radius: 3px; margin: 0;
}
.hsc-slim-news .hsc-slim-news__content { flex: 1; min-width: 0; }
.hsc-slim-news .hsc-slim-news__title {
    margin: 0 0 8px; padding: 0; font-size: 1.25rem;
    font-weight: 600; line-height: 1.4; word-break: normal; overflow-wrap: anywhere;
}
.hsc-slim-news .hsc-slim-news__title a {
    text-decoration: underline; text-underline-offset: .15em;
}
.hsc-slim-news .hsc-slim-news__title a:focus-visible {
    outline: 3px solid #111 !important; outline-offset: 3px !important;
    background: #ffeb3b; color: #111 !important; box-shadow: 0 0 0 6px #ffeb3b;
}
.hsc-slim-news .hsc-slim-news__date {
    display: block; flex: 0 0 auto; margin-left: auto;
    font-size: 16px; line-height: 1.5; text-align: right;
}
.hsc-slim-news .hsc-slim-news__summary {
    margin: 0; padding: 0; font-size: 16px; line-height: 1.5; color: inherit;
    overflow-wrap: anywhere;
}
/* Mobile Slim uses Featured's secondary-story proportions and typography. */
@media (max-width: 640px) {
    .hsc-slim-news { gap: var(--default-margin-bottom, 2.1rem); }
    .hsc-slim-news .hsc-slim-news__item {
        display: grid; grid-template-columns: minmax(0, 1fr);
        grid-template-rows: min-content 1fr; gap: .35rem 1rem;
        padding: 0; border-bottom: 0;
    }
    .hsc-slim-news .hsc-slim-news__image {
        grid-column: 1; grid-row: 1 / span 2;
        width: 100%; height: auto; aspect-ratio: 2 / 1;
        object-fit: cover; border-radius: 4px; display: block;
    }
    .hsc-slim-news .hsc-slim-news__item--image {
        grid-template-columns: clamp(150px, 30vw, 220px) minmax(0, 1fr);
    }
    .hsc-slim-news .hsc-slim-news__content { grid-column: -2 / -1; }
    .hsc-slim-news .hsc-slim-news__title {
        margin: 0; font-size: clamp(1rem, 1.1vw + .85rem, 1.2rem);
        line-height: 1.25; font-weight: 500;
    }
    .hsc-slim-news .hsc-slim-news__title a {
        font-weight: 500; text-decoration: none !important;
    }
    .hsc-slim-news .hsc-slim-news__title a:hover,
    .hsc-slim-news .hsc-slim-news__title a:focus-visible {
        text-decoration: underline !important;
    }
    .hsc-slim-news .hsc-slim-news__date {
        grid-column: -2 / -1; margin-left: 0; text-align: left;
        font-size: .875rem;
    }
    .hsc-slim-news .hsc-slim-news__summary { display: none; }
}
