/*
Theme Name: Canaries For Change
Theme URI: http://cfc2-library.local
Author: Josh Malone
Description: Block theme for the Canaries For Change video library. Magazilla is the reference design; our own code. Black + canary + amber, Newsreader and Archivo.
Version: 0.6.0
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cfc
*/

/* Brand rules: canary (#FDF705) only on black; amber (#FCBB01) = fills with black text. */

::selection { background: var(--wp--preset--color--canary); color: #000; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--wp--preset--color--amber); outline-offset: 2px; }

/* ---------- Header (Magazilla "Default") --------------------------------- */
.cfc-header { position: relative; z-index: 50; border-bottom: 3px solid var(--wp--preset--color--canary); }
.cfc-header-inner { min-height: 88px; }
.cfc-header .cfc-logo { margin: 0; line-height: 0; }
.cfc-header .cfc-logo img { height: 72px; width: auto; display: block; }
.cfc-header .wp-block-navigation { color: #fff; }
.cfc-header .wp-block-navigation a { text-decoration: none; position: relative; padding: 6px 0; }
.cfc-header .wp-block-navigation-item__content:hover,
.cfc-header .wp-block-navigation .current-menu-item > a,
.cfc-header .wp-block-navigation a[aria-current] { color: var(--wp--preset--color--canary); }
.cfc-header .wp-block-navigation a:hover::after,
.cfc-header .wp-block-navigation a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--wp--preset--color--canary); }
.cfc-header .wp-block-navigation__responsive-container.is-menu-open { background: #000; color: #fff; }
.cfc-header .wp-block-search__button { background: transparent; color: #fff; border: 0; padding: 8px; }
.cfc-header .wp-block-search__button:hover { color: var(--wp--preset--color--canary); }
.cfc-header .wp-block-search__input { border: 0; border-bottom: 2px solid var(--wp--preset--color--amber); background: #111; color: #fff; font: 500 14px/1.2 var(--wp--preset--font-family--ui); padding: 8px 10px; }
.cfc-header .wp-block-search.wp-block-search__button-behavior-expand .wp-block-search__inside-wrapper { border: 0; }
.admin-bar .cfc-header .wp-block-navigation__responsive-container.is-menu-open { top: 46px; }

/* ---------- Footer -------------------------------------------------------- */
.cfc-footer { color: #bdbdbd; font-size: 14px; }
.cfc-footer a { color: #fff; text-decoration: none; }
.cfc-footer a:hover { color: var(--wp--preset--color--canary); }
.cfc-footer .cfc-footer-logo img { height: 48px; width: auto; }
.cfc-footer .cfc-footer-small { border-top: 1px solid #262626; font-size: 12px; letter-spacing: .06em; }
.cfc-footer .wp-block-navigation { font-size: 12px; }

/* ---------- Video page (shared) ----------------------------------------- */
.cfc-video-title { text-wrap: balance; margin: 0; }
.cfc-video-title.has-paper-color { color: #fff; }
.cfc-topic-chips { margin: 0; }
.cfc-sidebar { position: relative; }
@media (min-width: 782px) {
	.cfc-sidebar > .cfc-sticky { position: sticky; top: 32px; }
	.admin-bar .cfc-sidebar > .cfc-sticky { top: 64px; }
}
.cfc-panel { background: var(--wp--preset--color--soft); padding: 22px 22px 18px; }
.cfc-rule-top { border-top: 1px solid var(--wp--preset--color--rule); padding-top: 24px; }
.cfc-meta-bar { border-block: 1px solid var(--wp--preset--color--rule); padding-block: 14px; }

/* Columns start at the top, whatever the core default. */
.cfc-video-page .wp-block-columns { align-items: flex-start !important; }

/* Standard: player sits flush in the column. */
.cfc-layout-standard .cfc-player { margin-top: 4px; }

/* Wide: bigger title block, player at wide width. */
.cfc-layout-wide .cfc-video-page .cfc-player + .wp-block-group { margin-top: var(--wp--preset--spacing--40) !important; }
.cfc-layout-wide .cfc-video-page .cfc-player { margin-top: 0; }
.cfc-layout-wide .cfc-breadcrumbs { margin-bottom: 6px; }
.cfc-layout-wide .cfc-video-title { font-size: var(--wp--preset--font-size--xxx-large); max-width: 20ch; }

/* Theatre: black band that continues the header. */
.cfc-theatre-band { color: #fff; }
.cfc-theatre-band .cfc-player-frame { box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.cfc-theatre-band .cfc-video-title { color: #fff; font-size: var(--wp--preset--font-size--xx-large); max-width: 26ch; }
.cfc-theatre-band .cfc-breadcrumbs ol, .cfc-theatre-band .cfc-breadcrumbs a { color: #8f8f8f; }
.cfc-theatre-band .cfc-breadcrumbs a:hover, .cfc-theatre-band .cfc-breadcrumbs [aria-current] { color: #fff; }
.cfc-theatre-band .cfc-hint { background: #111; border-color: #333; color: #999; }

/* Layout switcher strip (only shown while comparing ?layout= links). */
.cfc-layout-switch { position: fixed; right: 16px; bottom: 16px; z-index: 99; display: flex; gap: 2px; background: #000; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.3); font: 800 11px/1 var(--wp--preset--font-family--ui); letter-spacing: .12em; text-transform: uppercase; }
.cfc-layout-switch span { color: #777; padding: 10px 10px 10px 8px; }
.cfc-layout-switch a { color: #fff; text-decoration: none; padding: 10px 12px; }
.cfc-layout-switch a:hover { color: var(--wp--preset--color--canary); }
.cfc-layout-switch a[aria-current] { background: var(--wp--preset--color--amber); color: #000; }

/* ---------- Archive grid (basic, until M3) ------------------------------ */
.cfc-archive-head { border-bottom: 1px solid var(--wp--preset--color--rule); }

/* ==================================================================
   M2: shell
   ================================================================== */

/* ---------- Top bar ----------------------------------------------------- */
.cfc-top-bar { font-size: 12px; border-bottom: 1px solid #222; }
.cfc-top-bar p { margin: 0; white-space: nowrap; }
.cfc-top-date { color: #9a9a9a; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.cfc-top-links a { color: #d0d0d0; text-decoration: none; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 11px; }
.cfc-top-links a:hover { color: var(--wp--preset--color--canary); }
.cfc-grow { flex: 1 1 auto; min-width: 0; }
@media (max-width: 700px) { .cfc-top-date, .cfc-top-links { display: none; } }

/* ---------- Sticky header ---------------------------------------------- */
header.cfc-header-part { position: sticky; top: 0; z-index: 100; }
@media (min-width: 601px) { .admin-bar header.cfc-header-part { top: 32px; } }
@media (min-width: 601px) and (max-width: 782px) { .admin-bar header.cfc-header-part { top: 46px; } }
.cfc-header { position: relative; }
.cfc-header .cfc-logo img { transition: height .2s ease, width .2s ease; }
.cfc-header-inner { transition: min-height .2s ease; }
.cfc-header.is-compact .cfc-logo img { height: 48px !important; width: auto !important; }
.cfc-scrolled .cfc-header.is-default .cfc-header-inner { min-height: 64px !important; }
.cfc-scrolled .cfc-header.is-default .cfc-logo img { height: 48px !important; width: auto !important; }
.cfc-scrolled .cfc-header { box-shadow: 0 6px 20px rgba(0,0,0,.35); }

/* Compact, nav centre: true three-column balance. */
.cfc-header.is-nav-centre .cfc-header-inner { display: grid !important; grid-template-columns: 1fr auto 1fr; }
.cfc-header.is-nav-centre .cfc-header-tools { justify-self: end; }
/* Compact, nav left: menu sits right after the logo. */
.cfc-header.is-nav-left .cfc-mm { margin-left: 12px; }
@media (max-width: 1000px) {
	.cfc-header.is-nav-centre .cfc-header-inner { display: flex !important; }
	.cfc-header .cfc-mm { margin-left: auto !important; }
	.cfc-header .cfc-header-tools { gap: 10px !important; }
}
@media (max-width: 600px) { .cfc-header .cfc-logo img { height: 44px !important; width: auto !important; } .cfc-header.is-default .cfc-header-inner { min-height: 64px !important; } }

/* ---------- Back to top (Magazilla-style black square) ------------------ */
.cfc-to-top {
	position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; place-items: center; width: 44px; height: 44px;
	background: #000; color: #fff; opacity: 0; visibility: hidden; transform: translateY(8px);
	transition: opacity .2s, transform .2s, visibility 0s linear .2s, color .15s;
}
.cfc-to-top.is-visible { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.cfc-to-top:hover, .cfc-to-top:focus-visible { color: var(--wp--preset--color--canary); }
.cfc-layout-switch ~ .cfc-to-top, body:has(.cfc-layout-switch) .cfc-to-top { bottom: 76px; }

/* ---------- Footer (full) ----------------------------------------------- */
.cfc-footer.is-full .cfc-footer-cols { border-bottom: 1px solid #262626; }
.cfc-footer kbd { padding: 1px 6px; border: 1px solid #444; font: 700 11px/1.4 var(--wp--preset--font-family--ui); color: #fff; }
.cfc-footer.is-small .cfc-footer-small { border-top: 0; }
.cfc-footer-small p { margin: 0; }

/* ---------- Archive / search pages (basic until M3) --------------------- */
.cfc-page-heading { border-bottom: 1px solid var(--wp--preset--color--rule); padding-bottom: 20px; }
.cfc-page-heading .wp-block-query-title { margin: 0; font-size: var(--wp--preset--font-size--xxx-large); }
.cfc-page-heading .wp-block-term-description p { margin: 0; color: var(--wp--preset--color--muted); }
.cfc-archive-grid { gap: 32px 24px !important; }
.cfc-archive-grid > li { display: flex; flex-direction: column; gap: 10px; }
.cfc-archive-grid > li > * { margin: 0 !important; }
.cfc-archive-thumb { overflow: hidden; background: #111; }
.cfc-archive-thumb img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.cfc-archive-grid > li:hover .cfc-archive-thumb img { transform: scale(1.04); }
.cfc-archive-title { font-size: 19px !important; line-height: 1.28 !important; }
.cfc-archive-title a { text-decoration: none; }
.cfc-archive-title a:hover { text-decoration: underline; text-decoration-color: var(--wp--preset--color--amber); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cfc-archive-date { font: 700 11px/1.3 var(--wp--preset--font-family--ui); letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--muted); }
.cfc-inline-search { max-width: 560px; }
.cfc-inline-search .wp-block-search__input { border: 1px solid var(--wp--preset--color--rule); border-bottom: 2px solid #000; padding: 10px 12px; }

/* ---------- Boxed preview (the real switch is Styles → Boxed) ----------- */
body.cfc-preview-boxed { background: #e7e7e3; }
body.cfc-preview-boxed .wp-site-blocks { max-width: 1320px; margin: 0 auto; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 30px 80px rgba(0,0,0,.10); }

/* ---------- Preview switcher (extended) -------------------------------- */
.cfc-layout-switch { flex-wrap: wrap; max-width: calc(100vw - 32px); }
.cfc-layout-switch .cfc-sw-group { display: flex; align-items: center; }
.cfc-layout-switch .cfc-sw-group + .cfc-sw-group { border-left: 1px solid #333; margin-left: 4px; padding-left: 4px; }

/* Demo notes on the Layouts page. */
.cfc-demo-note { margin-top: 10px !important; color: var(--wp--preset--color--muted); font-size: 13px; }

/* ---------- M4: sidebar position (Videos → Settings, or ?sidebar= preview) ---------- */
@media (min-width: 782px) {
	.cfc-sidebar-left .cfc-with-sidebar { flex-direction: row-reverse; }
}
.cfc-sidebar-none .cfc-with-sidebar > .cfc-sidebar { display: none; }
.cfc-sidebar-none .cfc-with-sidebar > .wp-block-column:not(.cfc-sidebar) { flex-basis: 100% !important; }
.cfc-sidebar-part { display: block; }
.cfc-archive-page .cfc-with-sidebar > .wp-block-column:not(.cfc-sidebar) { min-width: 0; }

/* ---------- M5: Library page ---------- */
.cfc-library-page .cfc-page-heading { border-bottom: 0; padding-bottom: 0; }
.cfc-library-page .cfc-library-title { margin: 0; font-size: var(--wp--preset--font-size--xxx-large); }

/* ---------- M6: homepages ---------- */
.cfc-home-page > .wp-block-post-content > .cfc-home:first-child { margin-top: 0; }
.cfc-home-hello { max-width: 900px; }
.cfc-home-title { margin: 0; font-size: clamp(38px, 5vw, 64px); line-height: 1.02; letter-spacing: -.02em; }
.cfc-home-intro { margin: 0; color: var(--wp--preset--color--muted); font-size: 18px; }

/* Black bands (dark rows, Cinema homepage): cards and widgets read white on black. */
.cfc-band-dark { color: #fff; }
.cfc-band-dark .cfc-section-title, .cfc-band-dark .cfc-vl-head .cfc-section-title { color: #fff; }
.cfc-band-dark .cfc-vl-seeall { color: #fff; }
.cfc-band-dark .cfc-vl-seeall:hover { color: var(--wp--preset--color--canary); }
.cfc-band-dark .cfc-card-title a, .cfc-band-dark .cfc-vl-title a, .cfc-band-dark .cfc-card-title { color: #fff !important; }
.cfc-band-dark .cfc-card-title a:hover, .cfc-band-dark .cfc-vl-title a:hover { color: var(--wp--preset--color--canary) !important; text-decoration-color: var(--wp--preset--color--canary); }
.cfc-band-dark .cfc-card-meta, .cfc-band-dark .cfc-vl-kicker { color: #9a9a9a; }
.cfc-band-dark .cfc-vl-excerpt { color: #cfcfcf; }
.cfc-band-dark .cfc-vl-more { color: var(--wp--preset--color--canary); }
.cfc-band-dark .cfc-vl-item.is-list, .cfc-band-dark .cfc-rk-item + .cfc-rk-item { border-color: #262626; }
.cfc-band-dark .cfc-rk-link, .cfc-band-dark .cfc-tablist [role="tab"][aria-selected="true"] { color: #e6e6e6; }
.cfc-band-dark .cfc-sl-btn { border-color: #fff; }
.cfc-band-dark.cfc-band-narrow > * { max-width: 1040px; }
.cfc-band-dark .cfc-car-btn { background: #1d1d1d; }
/* Paper homepage: the three lead stories get bigger headlines. */
.cfc-paper-lead .cfc-card-title { font-size: clamp(22px, 2vw, 28px) !important; line-height: 1.15; }
/* Whole-page dark homepages: sidebar widgets and lists. */
.cfc-band-dark .cfc-rk-n, .cfc-band-dark .cfc-rk-item:first-child .cfc-rk-n { color: var(--wp--preset--color--canary); }
.cfc-band-dark .cfc-rk-metric, .cfc-band-dark .cfc-ch-sub { color: #9a9a9a; }
.cfc-band-dark .cfc-sidebar a:not(.cfc-chip), .cfc-band-dark .cfc-side-list li a, .cfc-band-dark .cfc-side-list span { color: #e6e6e6; border-color: #262626; }
.cfc-band-dark .cfc-sidebar a:not(.cfc-chip):hover { color: var(--wp--preset--color--canary); }
.cfc-band-dark .cfc-count { background: #1f1f1f; color: #cfcfcf; }
.cfc-band-dark .cfc-tablist [role="tab"] { color: #9a9a9a; border-color: #262626; }
.cfc-band-dark .cfc-tablist [role="tab"][aria-selected="true"] { color: #fff; box-shadow: inset 0 -3px 0 var(--wp--preset--color--canary); }
.cfc-band-dark .cfc-panel { background: #111; }
.cfc-band-dark .cfc-band-dark { background: #141414 !important; }
/* Homepages sit flush under the header and above the footer (no white strip around dark designs). */
.cfc-home-page, .cfc-home-page > .wp-block-post-content, .cfc-home-page ~ footer, .cfc-home-page + .wp-block-template-part { margin-block-start: 0 !important; }
.cfc-home-page > .wp-block-post-content > .cfc-home:last-child { margin-bottom: 0; }
