/* Hanifan theme – extras beyond theme.json */

::selection { background: var(--wp--preset--color--accent); color: #111; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* Sticky translucent header */
.wp-site-blocks > .wp-block-template-part:first-child { position: sticky; top: 0; z-index: 50; }
.admin-bar .wp-site-blocks > .wp-block-template-part:first-child { top: var(--wp-admin--admin-bar--height, 32px); }
.site-header {
	background: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.site-header .wp-block-navigation a[aria-current="page"],
.site-header .wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--accent); }
.site-header .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--surface) !important;
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 10px; padding: 6px 0;
	min-width: 220px !important;
}

/* Page transitions.
   Browsers with the View Transitions API (Chrome/Edge, Safari 18+) get a crossfade: swup runs in
   "native" mode, and full page loads use a cross-document transition. The header, player bar and
   library panel are named so they stay perfectly still while only the page content changes.
   Older browsers fall back to swup's class-based fade below. */
@view-transition { navigation: auto; }
#main { view-transition-name: hanifan-main; }
.wp-site-blocks > .wp-block-template-part:first-child { view-transition-name: hanifan-header; }
#hjf-player { view-transition-name: hjf-player; }
#hjf-library { view-transition-name: hjf-library; }
#wpadminbar { view-transition-name: hanifan-adminbar; }
::view-transition-group(hanifan-header),
::view-transition-group(hanifan-adminbar) { z-index: 1; }
::view-transition-group(hjf-player),
::view-transition-group(hjf-library) { z-index: 2; }
::view-transition-group(root) { animation-duration: .3s; }
::view-transition-group(hanifan-main) { animation-duration: 0s; }
::view-transition-old(hanifan-main) { animation: hanifan-vt-out .16s ease-in both; }
::view-transition-new(hanifan-main) { animation: hanifan-vt-in .32s cubic-bezier(.2, .7, .2, 1) .08s both; }
@keyframes hanifan-vt-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes hanifan-vt-in { from { opacity: 0; transform: translateY(10px); } }

html:not(.swup-native) .hanifan-transition-fade { transition: opacity .2s ease, transform .2s ease; }
html:not(.swup-native).is-animating .hanifan-transition-fade { opacity: 0; transform: translateY(6px); }
@media (prefers-reduced-motion: reduce) {
	.hanifan-transition-fade { transition: none !important; }
	html.is-animating .hanifan-transition-fade { transform: none !important; }
	::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
#main:focus { outline: none; }

/* Hero (home): sits over the fixed headshot background */
.hanifan-hero { min-height: calc(100svh - 88px - var(--hjf-bar-h, 84px)); display: flex; flex-direction: column; justify-content: flex-end; }
.hanifan-hero__inner { max-width: 560px; margin-left: auto !important; margin-right: max(0px, calc((100% - 1240px) / 2)) !important; }
.hanifan-hero h1 { max-width: 18ch; font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.1; margin-block: .5rem 1rem; text-shadow: 0 2px 24px rgba(0, 0, 0, .6); }
.hanifan-hero__lede { font-size: clamp(1rem, 1.5vw, 1.25rem) !important; line-height: 1.6; margin: 0; color: rgba(242, 239, 233, .85); text-shadow: 0 1px 12px rgba(0, 0, 0, .7); }
.hanifan-eyebrow { letter-spacing: .16em; text-transform: uppercase; font-size: .8rem; color: var(--wp--preset--color--accent); }

.hanifan-hero__award {
	margin-block: 1.5rem 1.25rem !important; padding: .7rem 1rem; display: inline-flex; flex-direction: column; gap: .15rem;
	border: 1px solid rgba(227, 169, 75, .5); border-radius: 8px; background: rgba(14, 15, 18, .55);
	color: var(--wp--preset--color--accent); font-weight: 600; text-shadow: 0 1px 12px rgba(0, 0, 0, .7);
}
.hanifan-hero__award > span:first-child::before { content: "★ "; }
/* the award line stays on one line: scale with the screen on phones */
.hanifan-hero__award > span:first-child { white-space: nowrap; font-size: min(1rem, calc((100vw - 4.5rem) / 27.5)); }
.hanifan-hero__award-years { font-weight: 400; font-size: .9em; color: rgba(242, 239, 233, .8); letter-spacing: .02em; }

/* "Composer & Music Producer" always stays on one line (header tagline) */
.site-header .wp-block-site-tagline { white-space: nowrap; }
.site-header .wp-block-site-title { white-space: nowrap; }
@media (max-width: 420px) {
	.site-header .wp-block-site-title { font-size: 1.15rem !important; }
	.site-header .wp-block-site-tagline { font-size: .68rem; letter-spacing: .02em; }
}


/* Major television credits (home + Television) */
.hanifan-majors { margin-block: var(--wp--preset--spacing--50); }
.hanifan-majors__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; list-style: none; margin: 0; padding: 0; }
.hanifan-major__link {
	position: relative; display: flex; align-items: flex-end; height: 100%; min-height: 150px; overflow: hidden; border-radius: 10px;
	background: rgba(14, 15, 18, .6); border: 1px solid var(--wp--preset--color--line); color: #fff; text-decoration: none !important;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hanifan-major.is-headline .hanifan-major__link { min-height: 200px; }
.hanifan-major__media { position: absolute; inset: 0; }
.hanifan-major__img { width: 100%; height: 100%; object-fit: cover; opacity: .45; transition: opacity .3s ease, transform .5s ease; }
.hanifan-major__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(14, 15, 18, .92) 0%, rgba(14, 15, 18, .2) 70%); }
.hanifan-major__body { position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem; }
.hanifan-major__title { font-family: var(--wp--preset--font-family--display, inherit); font-size: clamp(1.1rem, 1.6vw, 1.35rem); font-weight: 600; line-height: 1.2; }
.hanifan-major.is-headline .hanifan-major__title { font-size: clamp(1.25rem, 2vw, 1.6rem); }
.hanifan-major__meta { color: rgba(242, 239, 233, .8); font-size: .85rem; letter-spacing: .04em; }
.hanifan-major__note { color: var(--wp--preset--color--accent); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.hanifan-major__cta { margin-top: .35rem; color: var(--wp--preset--color--accent); font-size: .85rem; font-weight: 600; }
a.hanifan-major__link:hover .hanifan-major__img, a.hanifan-major__link:focus-visible .hanifan-major__img { opacity: .75; transform: scale(1.03); }
a.hanifan-major__link:hover { border-color: var(--wp--preset--color--accent); }
a.hanifan-major__link:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
@media (max-width: 1000px) { .hanifan-majors__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) {
	.hanifan-major__link, .hanifan-major.is-headline .hanifan-major__link { min-height: 120px; }
	.hanifan-major__body { padding: .8rem; }
}

/* Bio */
.hanifan-callout { border-left: 3px solid var(--wp--preset--color--accent); padding: .5rem 0 .5rem 1rem; font-weight: 600; }

/* Contact form */
.hanifan-form { display: grid; gap: 1rem; max-width: 640px; margin-block: var(--wp--preset--spacing--40); }
.hanifan-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .hanifan-form__row { grid-template-columns: 1fr; } }
.hanifan-form label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
.hanifan-form__opt { color: var(--wp--preset--color--muted); font-weight: 400; }
.hanifan-form input, .hanifan-form textarea {
	width: 100%; box-sizing: border-box; padding: .7rem .85rem; font: inherit; font-weight: 400; font-size: 1rem;
	color: var(--wp--preset--color--contrast); background: rgba(14, 15, 18, .7);
	border: 1px solid var(--wp--preset--color--line); border-radius: 8px;
}
.hanifan-form input:focus, .hanifan-form textarea:focus { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 1px; border-color: transparent; }
.hanifan-form textarea { resize: vertical; min-height: 9rem; }
.hanifan-form button[disabled] { opacity: .6; cursor: progress; }
.hanifan-form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.hanifan-form__status { margin: 0; padding: .75rem 1rem; border-radius: 8px; }
.hanifan-form__status.is-ok { background: rgba(80, 170, 110, .18); border: 1px solid rgba(80, 170, 110, .5); }
.hanifan-form__status.is-error { background: rgba(220, 80, 70, .16); border: 1px solid rgba(220, 80, 70, .5); }

/* Child pages grid – modelled on the original site: 3 columns of 16:9 tiles, title over the image */
.hanifan-grid { margin-block: var(--wp--preset--spacing--50); }
.hanifan-grid__heading { margin-bottom: var(--wp--preset--spacing--30); }
.hanifan-grid__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; list-style: none; margin: 0; padding: 0; }
.hanifan-card__link { position: relative; display: block; color: #fff; text-decoration: none !important; overflow: hidden; background: #000; }
.hanifan-card__media { display: block; aspect-ratio: 16 / 9; }
.hanifan-card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; opacity: .62; transition: opacity .3s ease, transform .5s ease; }
.hanifan-card__placeholder {
	display: block; width: 100%; height: 100%;
	background: linear-gradient(135deg, rgba(227, 169, 75, .28), rgba(14, 15, 18, .2) 60%), var(--hanifan-img-guitars) center / cover;
	opacity: .7; transition: opacity .3s ease;
}
.hanifan-card__title {
	position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center;
	font-size: clamp(.8rem, 1.1vw, .95rem); font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
	text-shadow: 0 1px 8px rgba(0, 0, 0, .8); transition: color .2s ease;
}
.hanifan-card__link:hover .hanifan-card__media img, .hanifan-card__link:focus-visible .hanifan-card__media img { opacity: 1; transform: scale(1.03); }
.hanifan-card__link:hover .hanifan-card__placeholder { opacity: 1; }
.hanifan-card__link:hover .hanifan-card__title, .hanifan-card__link:focus-visible .hanifan-card__title { color: var(--wp--preset--color--accent); }
.hanifan-card__link:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
@media (max-width: 1000px) { .hanifan-grid__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .hanifan-grid__list { grid-template-columns: 1fr; } }

/* Old site's plain track lists (until converted to Jellyfin Playlist blocks) */
.entry-content ol li, .wp-block-post-content ol li { margin-bottom: .25rem; }

@media (max-width: 600px) {
	.hanifan-grid__list { grid-template-columns: repeat(2, 1fr); }
}

/* Network credits (home) */
.hanifan-networks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem 2rem; margin: 0 0 var(--wp--preset--spacing--40); }
.hanifan-networks > div { border-top: 1px solid var(--wp--preset--color--line); padding-top: .75rem; }
.hanifan-networks dt { font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; color: var(--wp--preset--color--accent); }
.hanifan-networks dd { margin: .3rem 0 0; color: var(--wp--preset--color--muted); font-size: .95rem; }

/* Bio portrait */
.wp-block-post-content .wp-block-image.alignright { max-width: min(42%, 320px); margin: 0 0 1rem 1.5rem; }
.wp-block-post-content .wp-block-image.alignright img { border-radius: 12px; }
@media (max-width: 600px) { .wp-block-post-content .wp-block-image.alignright { float: none; max-width: 100%; margin: 0 0 1rem; } }

/* Playlist pages (wide template, playlist hero acts as the page header) */
.wp-block-hjf-playlist.alignwide { margin-top: var(--wp--preset--spacing--40); }
.wp-block-hjf-playlist.alignwide .hjf-hero { padding-top: clamp(32px, 6vw, 72px); }

/* ============ Full-page photo backgrounds ============ */
body { background-color: var(--wp--preset--color--base); }
body[class*="hanifan-bg--"]::before {
	content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
	background-color: var(--wp--preset--color--base);
	background-image:
		linear-gradient(180deg, rgba(14, 15, 18, calc(var(--hanifan-shade-top, .55) + .35 * var(--hanifan-dim, 0))) 0%, rgba(14, 15, 18, calc(var(--hanifan-shade-bottom, .85) + .1 * var(--hanifan-dim, 0))) 100%),
		var(--hanifan-photo);
	background-size: cover;
	background-position: var(--hanifan-photo-pos, center);
	transition: background-image .4s ease;
}
.hanifan-bg--headshot { --hanifan-photo: var(--hanifan-img-headshot); --hanifan-photo-pos: 30% 30%; --hanifan-shade-top: .05; --hanifan-shade-bottom: .8; }
.hanifan-bg--guitars  { --hanifan-photo: var(--hanifan-img-guitars); --hanifan-shade-top: .45; --hanifan-shade-bottom: .88; }
.hanifan-bg--piano    { --hanifan-photo: var(--hanifan-img-piano);   --hanifan-photo-pos: 60% 40%; --hanifan-shade-top: .45; --hanifan-shade-bottom: .88; }
/* Left-side shade on the home hero so the headline reads over the photo */
.hanifan-bg--headshot .hanifan-hero { background: linear-gradient(270deg, rgba(14, 15, 18, .75) 0%, rgba(14, 15, 18, .35) 45%, rgba(14, 15, 18, 0) 65%); }
@media (max-width: 720px) {
	.hanifan-hero__inner { margin-left: 0 !important; }
	.hanifan-bg--headshot .hanifan-hero { background: linear-gradient(0deg, rgba(14, 15, 18, .85) 0%, rgba(14, 15, 18, 0) 70%); }
}
@media (max-width: 720px) {
	.hanifan-bg--headshot { --hanifan-photo-pos: 28% 0; --hanifan-shade-top: .1; }
}

/* Transparent header over the home photo until the page scrolls */
.site-header { transition: background-color .25s ease, border-color .25s ease; }
.hanifan-bg--headshot .site-header { background: transparent; border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.hanifan-scrolled .hanifan-bg--headshot .site-header {
	background: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent);
	border-bottom-color: var(--wp--preset--color--line);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.hanifan-bg--headshot .hanifan-hero { margin-top: -88px; padding-top: calc(88px + var(--wp--preset--spacing--60)) !important; 
	/* header overlaps the photo, so the hero fills the whole screen above the player and the next section starts below the fold */
	min-height: calc(100svh - var(--hjf-bar-h, 84px) - env(safe-area-inset-bottom, 0px)); }
/* phones: the player floats with a gap under it, so fill the screen and pad the content clear of the player */
@media (min-width: 721px) { .hanifan-bg--headshot .hanifan-hero { justify-content: center; } }
@media (max-width: 720px) { .hanifan-bg--headshot .hanifan-hero { min-height: 100svh; padding-bottom: calc(var(--hjf-bar-h, 64px) + 16px + 1.5rem + env(safe-area-inset-bottom, 0px)) !important; } }

/* Content cards stay readable over photos */
.hanifan-networks > div { background: rgba(14, 15, 18, .55); padding: .75rem 1rem; border-radius: 8px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hjf-playlist { box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }

/* Contact: quieter type than the other pages */
.hanifan-page-contact .wp-block-post-title { font-size: clamp(2rem, 4vw, 2.75rem); }
.hanifan-page-contact .entry-content h2, .hanifan-page-contact .wp-block-post-content h2 { font-size: clamp(1.35rem, 2.4vw, 1.6rem); }

/* Music: the page is the player; keep the title for screen readers only */
.hanifan-page-music .wp-block-post-title { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hanifan-page-music .hjf-library-dock { margin-top: 0; }
.hanifan-page-music .wp-block-post-content, .hanifan-page-music main { padding-top: 0; }
