/*------------------------------------*\
    SPARTAN — NEWS LISTING V2

    Standalone stylesheet for the News listing redesign.
    Linked directly from template-news-v2.php, so it never touches
    main.scss / main.css and cannot affect the live site.

    HOW THIS PAGE IS SCOPED
    -----------------------
    template-news-v2.php wraps everything in one element:

        <div class="news-v2">

    Every rule below starts from that, so the live News page (home.php,
    same markup and classes) is untouched. That wrapper also adds a class
    to each selector, which is what puts these ahead of main.css — no
    !important needed anywhere.

    Keep any reset inside :where() so it carries zero specificity. Written
    as `.news-v2 p { margin: 0 }` a reset scores (0,1,1) and silently beats
    every single-class rule underneath it.
\*------------------------------------*/


/*------------------------------------*\
    DESIGN TOKENS
    Same values as the other v2 pages. Loaded after home-v2.css, so these
    win on this page only — the header, nav and footer pick them up
    without touching the homepage build.
\*------------------------------------*/

.v2 {
	--v2-orange: #e67f3f;
	--v2-orange-dark: #d16a2a;
	--v2-navy: #0b2240;
	--v2-navy-dark: #071729;
	--v2-grey: #ececec;
	--v2-border: #dcdcdc;
	--v2-text: #4a4a4a;
	--v2-font: "Chivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* The template files are template-news-v2.php / template-products-v2.php,
   so WordPress emits `page-template-template-news-v2` — the doubled word
   is expected.

   The products listing shares this stylesheet: its wrapper carries
   `news-v2` alongside `products-v2`, since the two pages are identical
   apart from their copy. Anything products-only goes under `.products-v2`
   at the bottom of this file. */
body.page-template-template-news-v2,
body.page-template-template-products-v2,
body.page-template-template-videos-v2 {
	padding: 0;
}


/*------------------------------------*\
    HEADER
\*------------------------------------*/

/* The nav bar and the breadcrumbs strip below it are both dark, so they
   read as one block. A white rule separates them.

   Scoped through the body class because .v2-nav lives in header-v2.php,
   outside the .news-v2 wrapper everything else here hangs off. */
body.page-template-template-news-v2 .v2-nav,
body.page-template-template-products-v2 .v2-nav,
body.page-template-template-videos-v2 .v2-nav {
	border-bottom: 5px solid #ffffff;
}


/*------------------------------------*\
    BRAND COLOUR REMAP

    The theme's gold ($secondary-colour, #84754d) becomes orange.

    main.css hard-codes the gold as a literal hex — it is not a CSS
    variable — so each place it lands on this page is remapped by hand.
\*------------------------------------*/

/* Utility class — "Filter News" heading and the "Read More" links */
.news-v2 .secondary { color: var(--v2-orange); }

/* Divider under each category filter */
.news-v2 .side-bar__nav li { border-bottom-color: var(--v2-orange); }

/* Category labels above each story title */
.news-v2 .news__item__cat a {
	color: var(--v2-orange);
	border-right-color: var(--v2-orange);
}

/* Tint that covers a story thumbnail on hover */
.news-v2 .news__item__image:hover a {
	background: rgba(230, 127, 63, .6);
}

/* Pagination prev/next arrows are an external SVG with the gold baked into
   its fill, so CSS cannot recolour it — swapped for the same chevron
   inlined as a data URI (# escaped as %23). */
.news-v2 .pagination .page-numbers.next,
.news-v2 .pagination .page-numbers.prev {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 138 258'%3E%3Cpath fill='%23e67f3f' d='M138 129a3 3 0 0 0-.92-2.19L5.08.83A3 3 0 1 0 .93 5.17L130.65 129 .93 252.83a3 3 0 0 0 4.15 4.34l132-126A3.06 3.06 0 0 0 138 129z'/%3E%3C/svg%3E");
}


/*------------------------------------*\
    NEWS DETAIL
    <div class="news-v2 news-v2--single"> in single-v2.php
    body class `single-news-v2`, added by single-v2.php itself
\*------------------------------------*/

/* main.css gives body 70px of top padding for the fixed nav, rising to
   120px on body.single-post above 1300px. Both are cleared here: matching
   that (0,1,1) specificity and loading later is enough, no !important. */
body.single-news-v2 {
	padding-top: 0;
}

/* Solid band behind the story title */
.news-v2 .news-banner { background-color: var(--v2-orange); }

/* Share icons — .cb_share_kit sets fill on the wrapper, and again on the
   svg itself, so both need overriding */
.news-v2 .cb_share_kit,
.news-v2 .cb_share_button svg {
	fill: var(--v2-orange);
}

/* Links inside the story body */
.news-v2 .markdown a { color: var(--v2-orange); }
.news-v2 .markdown a:hover { color: var(--v2-navy); }

/* Bullets in the story body use the same gold-filled SVG as elsewhere */
.news-v2 .markdown--custom-list ul li {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24.04 48.08'%3E%3Cpath fill='%23e67f3f' d='M0 48.08l24.04-24.04L0 0v48.08z'/%3E%3C/svg%3E");
}

/* "Go Back" button */
.news-v2 .btn--secondary { background: var(--v2-orange); height: unset; }
.news-v2 .btn--secondary:hover { background: var(--v2-orange-dark); }


/*------------------------------------*\
    CATEGORY FILTER
    .side-bar / __title / __nav
\*------------------------------------*/

/* Filtering happens on this page via ?news_cat=, so the active state is
   ours to mark — the theme has no equivalent. */
.news-v2 .side-bar__nav li.is-active a { color: var(--v2-orange); }


/*------------------------------------*\
    STORY GRID
    .news / .news__item / __image / __cat / __title / __more
\*------------------------------------*/

.news-v2 .news-v2__empty {
	padding: 40px 0;
	font-size: 18px;
}


/*------------------------------------*\
    VIDEOS LISTING
    <div class="news-v2 videos-v2"> in template-videos-v2.php

    Cards are videos rather than posts: the thumbnail comes from YouTube and
    clicking opens the lightbox app.js binds to .video__popup.
\*------------------------------------*/

/* No sidebar on this page, so the column runs the full width */
.videos-v2 .flex-col-2--full {
	width: 100%;
	float: none;
}

.videos-v2 .videos-v2__thumb {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--v2-navy);
}

/* hqdefault is 4:3 with letterbox bars top and bottom. Covering a 16:9 box
   scales to the width and crops exactly those bars away. */
.videos-v2 .videos-v2__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/**
 * main.css only gives this anchor a size on :hover, which is enough for a
 * tint overlay but leaves it unclickable the rest of the time. These cards
 * are the play button, so it is positioned permanently.
 */
.videos-v2 .videos-v2__thumb a {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 3;
	width: 100%;
	height: 100%;
}

.videos-v2 .videos-v2__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	transform: translate(-50%, -50%);
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .85);
	background: rgba(11, 34, 64, .55);
	/* The anchor above handles the click; this must not intercept it */
	pointer-events: none;
	transition: background .2s ease, transform .2s ease;
}

/* Play triangle, drawn from a border so it needs no asset */
.videos-v2 .videos-v2__play::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-42%, -50%);
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
}

.videos-v2 .videos-v2__thumb:hover .videos-v2__play {
	background: var(--v2-orange);
	transform: translate(-50%, -50%) scale(1.06);
}


/*------------------------------------*\
    PAGINATION
    .pagination / .page-numbers
\*------------------------------------*/


/*------------------------------------*\
    RESPONSIVE
\*------------------------------------*/
