/*
Theme Name: Novels Studio
Description: Password-gated portfolio for NOVELS STUDIO. Rebuilt from the v0 / Next.js reference. Requires Advanced Custom Fields PRO.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: novels-studio
*/

/*
 * Values are the reference's Tailwind classes converted to CSS. Comments name
 * the original class where it isn't obvious.
 */

:root {
	--bg: #e6f0f0;
	--fg: #1a1a1a;                    /* hsl(0 0% 10%) */
	--border: #e5e7eb;                /* border-gray-200 */
	--muted: #5f6b6b;                 /* secondary text; neutral grey read too grey on the teal */
	--placeholder: #d9e6e6;           /* behind images */
	--rule: #c9d6d6;                  /* progress track, dividers */
	--error: #ef4444;                 /* text-red-500 */
	--text-xs: 0.75rem;
	--leading-xs: 1rem;
	--text-sm: 0.875rem;
	--leading-sm: 1.25rem;
}

/* ---------- Reset (Tailwind preflight, trimmed) ---------- */

*, ::before, ::after { box-sizing: border-box; border: 0 solid var(--border); }
html { -webkit-text-size-adjust: 100%; line-height: 1.5; }
body {
	margin: 0;
	min-height: 100vh;
	background: var(--bg);
	color: var(--fg);
	font-family: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
	font-weight: 400;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p, ul, figure { margin: 0; }
h1, h2, h3 { font-size: inherit; font-weight: inherit; }
ul { list-style: none; padding: 0; }
a { color: inherit; text-decoration: inherit; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input { font: inherit; color: inherit; margin: 0; }
button { background: transparent; padding: 0; cursor: pointer; text-align: left; }
[hidden] { display: none !important; }

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

:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }

.link { text-decoration: underline; }
.link:hover { opacity: 0.6; }

/* ---------- Splash (app/page.tsx) ---------- */

.splash { min-height: 100vh; display: flex; flex-direction: column; }

.splash__header { padding: 2rem 2rem 1rem; }
.splash__title {
	font-size: var(--text-sm);
	line-height: var(--leading-sm);
	text-transform: uppercase;
	letter-spacing: 0.05em;         /* tracking-wider */
	text-align: center;
}

.splash__main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 1rem; }
.splash__form { width: 100%; max-width: 20rem; }
.splash__form > * + * { margin-top: 1rem; }  /* space-y-4 */

.splash__input {
	display: block;
	width: 100%;
	height: 2rem;
	padding: 0.5rem 0;
	border: 0;
	border-bottom: 1px solid #000;
	border-radius: 0;
	background: transparent;
	font-size: var(--text-sm);
	line-height: var(--leading-sm);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.splash__input::placeholder { color: var(--muted); opacity: 1; }
.splash__input:focus-visible { outline: none; }

.splash__error { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--error); }

.splash__submit {
	font-size: var(--text-xs);
	line-height: var(--leading-xs);
	text-decoration: underline;
}
.splash__submit:hover { opacity: 0.6; }
.splash__submit:focus-visible { outline-offset: 4px; }

.splash__footer { padding: 1rem 2rem; font-size: var(--text-xs); line-height: var(--leading-xs); text-align: center; }

@media (min-width: 768px) {
	.splash__header { padding-left: 3rem; padding-right: 3rem; }
	.splash__footer { padding-left: 3rem; padding-right: 3rem; }
}

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

/* Shared type for the site chrome: 12/16 uppercase, slightly tracked. */
.layout,
.project-page {
	font-size: var(--text-xs);
	line-height: var(--leading-xs);
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.layout { min-height: 100vh; display: flex; flex-direction: column; }
.layout__main { flex: 1; min-width: 0; padding: 3rem 1rem 6rem; }  /* top clears the MENU button */

@media (min-width: 768px) {
	.layout { flex-direction: row; }
	.layout__main { padding: 2rem 2rem 6rem; }
}

/* ---------- Sidebar ---------- */

.menu-toggle {
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 20;
	letter-spacing: inherit;
	text-transform: uppercase;
}

.sidebar {
	position: fixed;
	inset: 0;
	z-index: 10;
	background: var(--bg);
	padding: 4rem 2rem 2rem;
	transform: translateX(-100%);
	transition: transform 200ms ease-in-out;
	visibility: hidden;
}
.sidebar.is-open { transform: translateX(0); visibility: visible; }

.sidebar__inner > * + * { margin-top: 2rem; }
.sidebar__nav > * + * { margin-top: 1.5rem; }
.sidebar__categories { margin: 0.5rem 0 0 1rem; color: var(--muted); }
.sidebar__categories > * + * { margin-top: 0.25rem; }

.sidebar__link { display: block; }
.sidebar__link:hover { opacity: 0.6; }
.sidebar__link.is-active { font-weight: 500; color: var(--fg); }
.sidebar__link--muted { color: var(--muted); }

@media (min-width: 768px) {
	.menu-toggle { display: none; }
	.sidebar {
		position: static;
		flex: none;
		width: 16rem;
		padding: 2rem;
		transform: none;
		transition: none;
		visibility: visible;
	}
}

/* Keep the fixed toggle below the WP admin bar for logged-in editors. */
.admin-bar .menu-toggle { top: calc(46px + 1rem); }
.admin-bar .sidebar { top: 46px; }
@media (min-width: 783px) {
	.admin-bar .menu-toggle { top: calc(32px + 1rem); }
}

/* ---------- Work grid ---------- */

/* Three columns, dropping to two then one as cards would get narrower than 240px. */
.project-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(max(240px, calc((100% - 48px) / 3)), 1fr));
	column-gap: 1.5rem;
	row-gap: 3.5rem;
}

.project { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }

.project__media { position: relative; aspect-ratio: 4 / 5; background: var(--placeholder); overflow: hidden; }
.project__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project__open { position: absolute; inset: 0; cursor: zoom-in; }

/* Sits 8px under the image. The segment is 1/total wide and slides to the current image. */
.project__progress { position: relative; height: 1px; margin-top: -0.25rem; background: var(--rule); }
.project__progress-bar { position: absolute; top: 0; bottom: 0; left: 0; background: var(--fg); transition: left 200ms ease; }

.project__row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.project__row--meta { margin-top: -0.5rem; color: var(--muted); }

.project__title { font-weight: 500; text-wrap: pretty; }
.project__title a:hover { opacity: 0.6; }
.project__description { text-wrap: pretty; }
.project__year,
.project__counter { flex: none; font-variant-numeric: tabular-nums; }

.project__counter { display: flex; align-items: baseline; gap: 0.375rem; color: var(--muted); }
.project__step { padding: 0 0.25rem; }
.project__step:hover { color: var(--fg); }

.empty {
	padding: 3rem 0;
	text-align: center;
}

/* ---------- Pages / About (app/about/page.tsx) ---------- */

.entry { max-width: 48rem; margin: 0 auto; }
.entry__title {
	margin-bottom: 2rem;
	font-size: var(--text-sm);
	line-height: var(--leading-sm);
	text-transform: uppercase;
}
.entry__content { font-size: var(--text-xs); line-height: 1.625; text-transform: none; letter-spacing: normal; }  /* leading-relaxed; prose, not chrome */
.entry__content > * + * { margin-top: 1.5rem; }                     /* space-y-6 */
.entry__content a { text-decoration: underline; }
.entry__content a:hover { opacity: 0.6; }
.entry__content img { margin: 0 auto; }

.contact {
	margin-top: 3rem;
	font-size: var(--text-xs);
	line-height: 1.625;
	text-transform: uppercase;
}
.contact a:hover { opacity: 0.6; }

/* ---------- Single project ---------- */

.project-page { min-height: 100vh; display: flex; flex-wrap: wrap; }
.project-page__aside { flex: 0 0 16rem; padding: 2rem; }
.project-page__info { position: sticky; top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.admin-bar .project-page__info { top: calc(32px + 2rem); }

.project-page__back { align-self: flex-start; color: var(--muted); }
.project-page__back:hover { color: var(--fg); }

.project-page__details { display: flex; flex-direction: column; gap: 0.25rem; }
.project-page__title { font-weight: 500; text-wrap: pretty; }
.project-page__muted { color: var(--muted); text-wrap: pretty; }

.project-page__main {
	flex: 1 1 480px;
	min-width: 0;
	max-width: 1100px;
	padding: 2rem 2rem 6rem;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}
.project-page__image { width: 100%; height: auto; background: var(--placeholder); }

.project-page__footer {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--rule);
}
.project-page__footer a:hover { opacity: 0.6; }
.project-page__next { text-align: right; }

@media (max-width: 767px) {
	.project-page__aside { flex-basis: 100%; padding: 1rem 1rem 0; }
	.project-page__main { padding: 1.5rem 1rem 6rem; }
}

@media (prefers-reduced-motion: reduce) {
	.sidebar, .project__progress-bar { transition: none; }
}
