/*
Theme Name: Cinema Stark
Description: A stark, editorial black-and-white theme with a portrait poster grid and very large, tightly set type. Built to pair with the Cinema Landing plugin (fullscreen random video landing, top bar and full-screen menu), and it also works on its own.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cinema-stark
*/

/* ---------- Tokens ----------
   Zero-specificity defaults, so the Cinema Landing plugin's colour scheme,
   typeface and highlight settings always win when the plugin is active. */

:where(:root) {
	--cl-paper: #fff;
	--cl-ink: #000;
	--cl-accent: #1a1aff;
	--cl-font: "Helvetica Neue", Helvetica, Arial, "Nimbus Sans", sans-serif;
	--cs-gutter: clamp(1rem, 3vw, 2rem);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
}
body {
	margin: 0;
	background: var(--cl-paper);
	color: var(--cl-ink);
	font-family: var(--cl-font);
	font-size: 1.0625rem;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img,
video,
svg {
	max-width: 100%;
	height: auto;
}
figure {
	margin: 0;
}
a {
	color: inherit;
}
::selection {
	background: var(--cl-accent);
	color: #fff;
}
:focus-visible {
	outline: 2px solid var(--cl-accent);
	outline-offset: 3px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 500;
	letter-spacing: -0.035em;
	line-height: 1.05;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	margin: 0;
	padding: 0.75rem 1rem;
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100000;
	background: var(--cl-ink);
	color: var(--cl-paper);
}

/* ---------- Layout ---------- */

.wrap {
	max-width: 120rem;
	margin-inline: auto;
	padding-inline: var(--cs-gutter);
}
.site-main {
	min-height: 60vh;
}

/* Header (only drawn when the plugin's top bar is off) */

.site-header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.5rem 2rem;
	padding: 1rem var(--cs-gutter);
}
.site-title {
	font-size: 1.125rem;
	font-weight: 500;
	letter-spacing: -0.02em;
	text-decoration: none;
	color: inherit;
}
.site-nav,
.footer-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.site-nav a,
.footer-nav a {
	text-decoration: none;
}
.site-nav a:hover,
.footer-nav a:hover,
.site-nav .current-menu-item > a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

/* Footer */

.site-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem 2rem;
	margin-top: clamp(3rem, 8vw, 6rem);
	padding: 1.5rem var(--cs-gutter) 2rem;
	border-top: 1px solid currentColor;
}
.site-footer__name {
	margin: 0;
}

/* ---------- Headings ---------- */

.page-head {
	padding-block: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem);
}
.wrap .page-title {
	margin: 0;
	font-size: clamp(3rem, 11vw, 10rem);
	font-weight: 500;
	line-height: 0.88;
	letter-spacing: -0.055em;
	overflow-wrap: anywhere;
}
.page-desc {
	max-width: 40ch;
	margin-top: 1.25rem;
}
.wrap .section-title {
	margin: 0 0 1.25rem;
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	letter-spacing: -0.035em;
}
.latest {
	padding-block: clamp(2rem, 5vw, 4rem) 0;
}

/* ---------- Poster grid ---------- */

.grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(1.5rem, 3vw, 2.5rem) clamp(0.75rem, 2vw, 1.5rem);
}
.wrap > .grid:first-child {
	margin-top: clamp(1rem, 3vw, 2rem);
}
@media (min-width: 48em) {
	.grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (min-width: 75em) {
	.grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.card {
	margin: 0;
}
.card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}
.card__media {
	display: block;
	aspect-ratio: 2 / 3;
	overflow: hidden;
	background: color-mix(in srgb, var(--cl-ink) 8%, var(--cl-paper));
}
.card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.card__title {
	display: block;
	margin-top: 0.6rem;
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.15;
}
.card__meta {
	display: block;
	margin-top: 0.15rem;
	font-size: 0.9375rem;
	opacity: 0.6;
}
.card__link:hover .card__title {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

/* Pagination */

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	padding-block: clamp(2rem, 5vw, 3rem) 0;
}
.pagination .page-numbers {
	text-decoration: none;
}
.pagination a.page-numbers:hover,
.pagination .page-numbers.current {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

.empty {
	padding-block: 1rem clamp(2rem, 5vw, 4rem);
	max-width: 40rem;
}

/* ---------- Single posts and pages ---------- */

.entry-head {
	padding-block: clamp(2rem, 6vw, 5rem) clamp(1.5rem, 3vw, 2.5rem);
}
.wrap .entry-title {
	margin: 0;
	font-size: clamp(3rem, 10vw, 9rem);
	font-weight: 500;
	line-height: 0.9;
	letter-spacing: -0.05em;
	overflow-wrap: anywhere;
}
.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.5rem;
	margin: 1.25rem 0 0;
}
.entry-meta a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.entry-body {
	display: grid;
	gap: clamp(1.5rem, 4vw, 4rem);
	padding-bottom: clamp(2rem, 6vw, 4rem);
}
@media (min-width: 60em) {
	.entry-body--poster {
		grid-template-columns: minmax(16rem, 28rem) minmax(0, 1fr);
	}
	.entry-body--poster .entry-poster {
		position: sticky;
		top: 4.5rem;
		align-self: start;
	}
}
.entry-poster img {
	display: block;
	width: 100%;
	height: auto;
}

.entry-content {
	font-size: 1.125rem;
	line-height: 1.6;
	overflow-wrap: break-word;
}
.entry-content > * + * {
	margin-top: 1.25em;
}
.entry-content :where(h2, h3, h4) {
	margin-top: 1.8em;
}
.entry-content a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}
.entry-content :where(blockquote) {
	margin-inline: 0;
	padding: 0;
	border: 0;
	font-size: clamp(1.5rem, 3.2vw, 2.5rem);
	line-height: 1.15;
	letter-spacing: -0.03em;
}
.entry-content :where(figcaption, .wp-caption-text) {
	margin-top: 0.5rem;
	font-size: 0.9375rem;
	opacity: 0.7;
}
.entry-content hr {
	border: 0;
	border-top: 1px solid currentColor;
	opacity: 1;
}

/* Text column next to a poster */
.entry-body--poster .entry-content {
	max-width: 44rem;
}
/* Pages and posts without a poster: readable text, wide media allowed */
.entry-body:not(.entry-body--poster) .entry-content > :not(.alignwide):not(.alignfull) {
	max-width: 44rem;
}
.entry-body:not(.entry-body--poster) .entry-content > .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
}

/* Pages that start with a [cinema_landing] hero and the static front page */
.front-content > :not(.cl-landing) {
	max-width: 44rem;
	margin-inline: var(--cs-gutter);
}
.front-content > .cl-landing + * {
	margin-top: 1.5rem;
}

.post-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1rem 2rem;
	padding-block: 1rem 0;
	border-top: 1px solid currentColor;
}
.post-navigation a {
	text-decoration: none;
}
.post-navigation a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}
.nav-sub {
	display: block;
	font-size: 0.9375rem;
	opacity: 0.6;
}

/* ---------- Forms and buttons ---------- */

input[type="search"],
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
	border: 0;
	border-bottom: 1px solid currentColor;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	padding: 0.6em 0;
	box-shadow: none;
}
.search-form {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem 1.5rem;
}
.search-form label {
	flex: 1 1 14rem;
}
.search-form .search-field {
	width: 100%;
}
.search-submit,
.wp-block-button__link,
.wp-element-button {
	display: inline-block;
	border: 1px solid var(--cl-ink);
	border-radius: 0;
	background: transparent;
	color: var(--cl-ink);
	padding: 0.85rem 1.6rem;
	font: inherit;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}
.search-submit:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
	background: var(--cl-ink);
	color: var(--cl-paper);
}

@media (prefers-reduced-motion: reduce) {
	.search-submit,
	.wp-block-button__link,
	.wp-element-button {
		transition-duration: 0.01ms;
	}
}
