/*
Theme Name: Kvartal Studio
Theme URI: http://localhost:8888/kvartalwarsaw/
Author: Kvartal Warsaw
Description: Functional frontend theme for the Kvartal Warsaw studio management system.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: kvartal-studio
*/

:root {
	--ks-bg: #f4efe7;
	--ks-paper: #fffaf2;
	--ks-surface: #ffffff;
	--ks-text: #1d1a17;
	--ks-muted: #746b60;
	--ks-border: #d8cfc1;
	--ks-hairline: #231f1a;
	--ks-accent: #7f1d2d;
	--ks-accent-dark: #59131f;
	--ks-sage: #66745f;
	--ks-gold: #a6762c;
	--ks-shadow: 0 24px 70px rgba(29, 26, 23, 0.12);
	--ks-width: 1180px;
	--ks-serif: Georgia, "Times New Roman", serif;
	--ks-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var(--ks-bg);
	color: var(--ks-text);
	font-family: var(--ks-sans);
	font-size: 16px;
	line-height: 1.62;
}

body::before {
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	content: "";
	background:
		linear-gradient(90deg, rgba(29, 26, 23, 0.035) 1px, transparent 1px),
		linear-gradient(180deg, rgba(29, 26, 23, 0.025) 1px, transparent 1px);
	background-size: 96px 96px;
}

a {
	color: var(--ks-accent-dark);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

img {
	display: block;
	height: auto;
	max-width: 100%;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ks-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(244, 239, 231, 0.92);
	border-bottom: 1px solid rgba(29, 26, 23, 0.2);
	backdrop-filter: blur(18px);
}

.ks-header__inner,
.ks-footer__inner,
.ks-content,
.ks-news {
	width: min(var(--ks-width), calc(100% - 48px));
	margin: 0 auto;
}

.ks-header__inner {
	min-height: 84px;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 20px;
}

.ks-brand {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	width: max-content;
	color: var(--ks-text);
	font-family: var(--ks-serif);
	font-size: 25px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0;
	text-decoration: none;
}

.ks-brand img {
	max-height: 50px;
	width: auto;
}

.ks-brand__mark {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: 1px solid var(--ks-hairline);
	border-radius: 50%;
	background: var(--ks-text);
	color: var(--ks-paper);
	font-family: var(--ks-serif);
	font-size: 25px;
	font-weight: 700;
}

.ks-account {
	position: relative;
}

.ks-account__button {
	display: inline-grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 1px solid rgba(29, 26, 23, 0.32);
	border-radius: 50%;
	background: transparent;
	color: var(--ks-text);
	cursor: pointer;
	transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.ks-account__button:hover,
.ks-account__button:focus-visible {
	background: var(--ks-text);
	border-color: var(--ks-text);
	color: var(--ks-paper);
	outline: none;
}

.ks-account__panel {
	position: absolute;
	top: calc(100% + 14px);
	right: 0;
	width: min(390px, calc(100vw - 32px));
	padding: 24px;
	border: 1px solid rgba(29, 26, 23, 0.18);
	border-radius: 8px;
	background: var(--ks-paper);
	box-shadow: var(--ks-shadow);
}

.ks-account__panel::before {
	display: block;
	width: 52px;
	height: 2px;
	margin-bottom: 18px;
	content: "";
	background: var(--ks-accent);
}

.ks-account__panel[hidden] {
	display: none;
}

.ks-account__title {
	margin: 0 0 12px;
	font-family: var(--ks-serif);
	font-size: 26px;
	line-height: 1.12;
}

.ks-account__name {
	margin: 0 0 16px;
	color: var(--ks-muted);
}

.ks-account__actions {
	display: grid;
	gap: 10px;
}

.ks-button,
.login-submit .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 10px 16px;
	border: 1px solid var(--ks-text);
	border-radius: 8px;
	background: var(--ks-text);
	color: var(--ks-paper);
	font: inherit;
	font-size: 14px;
	font-weight: 800;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	cursor: pointer;
}

.ks-button:hover,
.ks-button:focus-visible,
.login-submit .button:hover,
.login-submit .button:focus-visible {
	background: var(--ks-accent);
	border-color: var(--ks-accent);
	color: #fff;
	outline: none;
}

.ks-button--secondary {
	background: transparent;
	color: var(--ks-text);
	border-color: rgba(29, 26, 23, 0.24);
}

.ks-button--secondary:hover,
.ks-button--secondary:focus-visible {
	background: rgba(29, 26, 23, 0.06);
	color: var(--ks-text);
	border-color: rgba(29, 26, 23, 0.32);
}

.login-form label {
	display: block;
	margin-bottom: 6px;
	color: var(--ks-muted);
	font-size: 13px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.login-form p {
	margin: 0 0 14px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
	width: 100%;
	min-height: 46px;
	border: 1px solid rgba(29, 26, 23, 0.2);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.72);
	padding: 10px 12px;
	font: inherit;
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
	border-color: var(--ks-accent);
	box-shadow: 0 0 0 4px rgba(127, 29, 45, 0.1);
	outline: none;
}

.login-remember label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
}

.ks-lost-password {
	display: inline-block;
	margin-top: 4px;
	font-size: 14px;
}

.ks-main {
	min-height: calc(100vh - 260px);
}

.ks-news {
	padding: 56px 0 86px;
}

.ks-news__header {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 330px;
	align-items: end;
	gap: 42px;
	margin-bottom: 34px;
	padding-bottom: 28px;
	border-bottom: 2px solid var(--ks-hairline);
}

.ks-news__header::after {
	position: absolute;
	right: 0;
	bottom: -9px;
	left: 0;
	height: 1px;
	content: "";
	background: rgba(29, 26, 23, 0.28);
}

.ks-eyebrow,
.ks-story-kicker {
	margin: 0 0 10px;
	color: var(--ks-accent);
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.ks-news h1,
.ks-content h1 {
	margin: 0;
	font-family: var(--ks-serif);
	font-size: 74px;
	font-weight: 500;
	line-height: 0.96;
	letter-spacing: 0;
}

.ks-news__intro {
	margin: 0;
	color: var(--ks-muted);
	font-size: 18px;
	line-height: 1.55;
}

.ks-featured-story {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
	gap: 0;
	margin-bottom: 44px;
	border: 1px solid rgba(29, 26, 23, 0.2);
	background: var(--ks-paper);
	box-shadow: var(--ks-shadow);
}

.ks-featured-story__media {
	position: relative;
	min-height: 520px;
	background: #ded2bf;
	overflow: hidden;
}

.ks-featured-story__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ks-featured-story__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 42px;
	border-left: 1px solid rgba(29, 26, 23, 0.18);
}

.ks-featured-story h2 {
	margin: 0 0 20px;
	font-family: var(--ks-serif);
	font-size: 48px;
	font-weight: 500;
	line-height: 1;
}

.ks-featured-story h2 a,
.ks-news-card h2 a {
	color: var(--ks-text);
	text-decoration: none;
}

.ks-featured-story h2 a:hover,
.ks-featured-story h2 a:focus-visible,
.ks-news-card h2 a:hover,
.ks-news-card h2 a:focus-visible {
	color: var(--ks-accent);
	text-decoration: underline;
}

.ks-section-rule {
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 0 0 22px;
	color: var(--ks-sage);
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.ks-section-rule::after {
	flex: 1;
	height: 1px;
	content: "";
	background: rgba(29, 26, 23, 0.22);
}

.ks-news__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.ks-news-card {
	display: flex;
	min-height: 100%;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid rgba(29, 26, 23, 0.16);
	border-radius: 8px;
	background: rgba(255, 250, 242, 0.86);
	box-shadow: 0 12px 34px rgba(29, 26, 23, 0.07);
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.ks-news-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 18px 42px rgba(29, 26, 23, 0.11);
}

.ks-news-card__media {
	aspect-ratio: 4 / 3;
	background: #ded2bf;
	overflow: hidden;
}

.ks-news-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ks-news-card__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	color: var(--ks-muted);
	font-family: var(--ks-serif);
	font-size: 28px;
	font-weight: 700;
}

.ks-news-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 22px;
}

.ks-news-card h2 {
	margin: 0 0 12px;
	font-family: var(--ks-serif);
	font-size: 29px;
	font-weight: 500;
	line-height: 1.08;
}

.ks-news-card__excerpt {
	margin: 0 0 22px;
	color: var(--ks-muted);
}

.ks-news-card__read {
	position: relative;
	width: max-content;
	margin-top: auto;
	color: var(--ks-text);
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 0.12em;
	text-decoration: none;
	text-transform: uppercase;
}

.ks-news-card__read::after {
	display: inline-block;
	margin-left: 8px;
	content: "/";
	color: var(--ks-gold);
}

.ks-content {
	padding: 60px 0 86px;
}

.ks-article {
	max-width: 780px;
	padding: 36px;
	border: 1px solid rgba(29, 26, 23, 0.16);
	border-radius: 8px;
	background: var(--ks-paper);
	box-shadow: 0 18px 46px rgba(29, 26, 23, 0.08);
}

.ks-article h1 {
	margin-bottom: 22px;
}

.ks-article__meta {
	margin: 0 0 24px;
	color: var(--ks-muted);
}

.ks-article__image {
	margin: 0 0 30px;
	overflow: hidden;
	border-radius: 8px;
}

.ks-empty {
	padding: 34px;
	border: 1px dashed rgba(29, 26, 23, 0.26);
	border-radius: 8px;
	background: rgba(255, 250, 242, 0.76);
	color: var(--ks-muted);
}

.ks-footer {
	border-top: 1px solid rgba(255, 250, 242, 0.16);
	background: #1d1a17;
	color: var(--ks-paper);
}

.ks-footer__inner {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 28px;
	padding: 40px 0;
}

.ks-footer .ks-brand {
	color: var(--ks-paper);
}

.ks-footer .ks-brand__mark {
	border-color: var(--ks-paper);
	background: var(--ks-paper);
	color: var(--ks-text);
}

.ks-footer__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 14px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ks-footer__links a {
	color: var(--ks-paper);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-decoration: none;
	text-transform: uppercase;
}

.ks-footer__links a:hover,
.ks-footer__links a:focus-visible {
	color: #d9b06a;
}

@media (max-width: 980px) {
	.ks-news h1,
	.ks-content h1 {
		font-size: 54px;
	}

	.ks-news__header,
	.ks-featured-story {
		grid-template-columns: 1fr;
	}

	.ks-featured-story__media {
		min-height: 420px;
	}

	.ks-featured-story__body {
		border-top: 1px solid rgba(29, 26, 23, 0.18);
		border-left: 0;
	}

	.ks-news__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 720px) {
	.ks-footer__inner {
		grid-template-columns: 1fr;
	}

	.ks-footer__links {
		justify-content: flex-start;
	}
}

@media (max-width: 560px) {
	.ks-header__inner,
	.ks-footer__inner,
	.ks-content,
	.ks-news {
		width: min(100% - 28px, var(--ks-width));
	}

	.ks-header__inner {
		min-height: 76px;
	}

	.ks-brand {
		font-size: 20px;
	}

	.ks-brand__mark {
		width: 40px;
		height: 40px;
		font-size: 22px;
	}

	.ks-account__button {
		width: 44px;
		height: 44px;
	}

	.ks-account__panel {
		position: fixed;
		top: 86px;
		left: 14px;
		right: 14px;
		width: auto;
	}

	.ks-news {
		padding-top: 38px;
	}

	.ks-news h1,
	.ks-content h1 {
		font-size: 42px;
	}

	.ks-featured-story__media {
		min-height: 320px;
	}

	.ks-featured-story__body,
	.ks-article {
		padding: 24px;
	}

	.ks-featured-story h2 {
		font-size: 36px;
	}

	.ks-news__grid {
		grid-template-columns: 1fr;
	}
}
