/*
Theme Name: LR Literary
Description: Tema dell'Agenzia Letteraria Loredana Rotundo. Richiede il plugin LR Catalogo.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Author: GRK
Text Domain: lr-literary
*/

:root {
	--paper: #faf7f2;
	--paper-2: #f2ece2;
	--white: #ffffff;
	--ink: #1f1b18;
	--ink-soft: #4a433d;
	--muted: #776e65;
	--line: #e4dccf;
	--accent: #a8161d;
	--accent-dark: #7e0f14;
	--accent-soft: #f6e7e5;
	--logo-gray: #8b8783;
	--serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
	--sans: 'Source Sans 3', -apple-system, 'Segoe UI', Roboto, sans-serif;
	--wrap: 1200px;
	--gutter: clamp(16px, 4vw, 40px);
	--radius: 4px;
	--shadow-book: 0 1px 2px rgba(31, 27, 24, .12), 0 8px 24px -8px rgba(31, 27, 24, .35);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

h1, h2, h3, h4 {
	font-family: var(--serif);
	font-weight: 600;
	line-height: 1.15;
	color: var(--ink);
	margin: 0 0 .5em;
	letter-spacing: -.005em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.45rem; }

p { margin: 0 0 1.1em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	position: fixed !important; top: 8px; left: 8px; z-index: 100;
	background: var(--white); padding: 8px 16px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
	display: inline-block;
	font-family: var(--sans);
	font-size: .78rem;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: .9rem;
}

.button {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	padding: .8em 1.5em;
	border: 1px solid var(--accent);
	border-radius: var(--radius);
	background: var(--accent);
	color: var(--white);
	font-family: var(--sans);
	font-weight: 600;
	font-size: .95rem;
	text-decoration: none;
	transition: background .2s, color .2s, border-color .2s;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); }
.button--ghost { background: transparent; color: var(--accent); }
.button--ghost:hover { background: var(--accent); color: var(--white); }

.link-arrow {
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.link-arrow::after { content: ' →'; transition: margin .2s; }
.link-arrow:hover::after { margin-left: .25em; }

/* ---------- Header ---------- */

.site-header {
	background: var(--white);
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 50;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 84px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: var(--ink);
}
.brand__mark { width: 40px; height: 40px; flex: none; color: var(--logo-gray); }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.brand__top {
	font-family: var(--sans);
	font-size: 1.15rem;
	color: var(--logo-gray);
	letter-spacing: .01em;
}
.brand__name {
	font-family: var(--sans);
	font-weight: 600;
	font-size: 1.15rem;
	color: var(--accent);
}

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav li { position: relative; }
.main-nav a {
	display: block;
	white-space: nowrap;
	padding: 10px 12px;
	color: var(--ink-soft);
	text-decoration: none;
	font-size: .97rem;
	font-weight: 600;
	border-radius: var(--radius);
}
.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a,
.main-nav .current_page_parent > a { color: var(--accent); }
.main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a { box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

.main-nav .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: var(--white);
	border: 1px solid var(--line);
	box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .2);
	padding: 6px;
	flex-direction: column;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu { display: flex; }
.main-nav .sub-menu a { font-weight: 400; box-shadow: none !important; }

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 10px;
	cursor: pointer;
	color: var(--ink);
}
.nav-toggle svg { display: block; }

@media (max-width: 1140px) {
	.nav-toggle { display: block; }
	.main-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--white);
		border-bottom: 1px solid var(--line);
		padding: 8px var(--gutter) 20px;
		max-height: calc(100vh - 84px);
		overflow-y: auto;
	}
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
	.main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a { box-shadow: none; }
	.main-nav .sub-menu { display: flex; position: static; box-shadow: none; border: 0; padding: 0 0 0 16px; min-width: 0; }
}

/* ---------- Notice ---------- */

.notice-bar {
	background: var(--ink);
	color: #eee7dc;
	font-size: .93rem;
}
.notice-bar .wrap { padding-top: 10px; padding-bottom: 10px; text-align: center; }
.notice-bar a { color: var(--white); font-weight: 600; }

/* ---------- Hero ---------- */

.hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(1200px 400px at 85% -10%, var(--accent-soft), transparent 60%),
		var(--paper);
	border-bottom: 1px solid var(--line);
}
.hero__inner {
	display: grid;
	grid-template-columns: 1.1fr .9fr;
	gap: 48px;
	align-items: center;
	padding-top: clamp(48px, 8vw, 96px);
	padding-bottom: clamp(48px, 8vw, 96px);
}
.hero__title {
	font-size: clamp(2.6rem, 6vw, 4.4rem);
	font-weight: 500;
	line-height: 1.02;
	margin-bottom: .4em;
}
.hero__title em { color: var(--accent); font-style: italic; }
.hero__lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 34em; margin-bottom: 1.8em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__books {
	position: relative;
	height: 400px;
}
.hero__books a {
	position: absolute;
	width: 190px;
	box-shadow: var(--shadow-book);
	transition: transform .35s ease;
}
.hero__books a:nth-child(1) { left: 6%; top: 40px; transform: rotate(-7deg); z-index: 1; }
.hero__books a:nth-child(2) { left: 32%; top: 0; z-index: 3; width: 210px; }
.hero__books a:nth-child(3) { left: 60%; top: 50px; transform: rotate(6deg); z-index: 2; }
.hero__books a:hover { transform: translateY(-8px) rotate(0); z-index: 4; }

@media (max-width: 860px) {
	.hero__inner { grid-template-columns: 1fr; }
	.hero__books { height: 300px; max-width: 420px; width: 100%; margin: 0 auto; }
	.hero__books a { width: 140px; }
	.hero__books a:nth-child(2) { width: 155px; }
}

/* ---------- Sections ---------- */

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--alt { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section__head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 40px;
	flex-wrap: wrap;
}
.section__head h2 { margin: 0; }

/* ---------- Page heading ---------- */

.page-head {
	padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 40px);
	border-bottom: 1px solid var(--line);
	background: var(--white);
}
.page-head h1 { margin: 0; }
.page-head__intro { color: var(--muted); margin: .6em 0 0; max-width: 46em; }
.breadcrumb { font-size: .88rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); }

/* ---------- Toolbar / filtri ---------- */

.toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 36px;
	font-size: .95rem;
	color: var(--muted);
}
.genre-filter { display: flex; align-items: center; gap: 10px; }
.genre-filter label { font-weight: 600; color: var(--ink-soft); }
.genre-filter select {
	font: inherit;
	padding: 9px 36px 9px 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23776e65' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
	appearance: none;
	color: var(--ink);
	min-width: 220px;
}

/* ---------- Book grid ---------- */

.book-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 44px 32px;
}
.book-grid--featured { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.book-card { display: flex; flex-direction: column; }
.book-card__cover {
	display: block;
	aspect-ratio: 2 / 3;
	background: var(--paper-2);
	box-shadow: var(--shadow-book);
	margin-bottom: 16px;
	overflow: hidden;
	transition: transform .25s ease, box-shadow .25s ease;
}
.book-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card__cover:hover { transform: translateY(-4px); }
.book-card__title {
	font-size: 1.3rem;
	margin: 0 0 4px;
}
.book-card__title a { color: var(--ink); text-decoration: none; }
.book-card__title a:hover { color: var(--accent); }
.book-card__author { font-size: .95rem; color: var(--accent); margin: 0 0 2px; font-weight: 600; }
.book-card__author a { text-decoration: none; }
.book-card__meta { font-size: .88rem; color: var(--muted); margin: 0; }

.cover-placeholder {
	width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	padding: 16px;
	text-align: center;
	font-family: var(--serif);
	font-size: 1.2rem;
	color: var(--muted);
	background: linear-gradient(135deg, var(--paper-2), var(--line));
}

/* ---------- Author grid ---------- */

.author-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 24px;
}
.author-card {
	display: flex;
	gap: 16px;
	padding: 20px;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-decoration: none;
	color: inherit;
	transition: border-color .2s, transform .2s;
}
.author-card:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }
.author-card__photo {
	flex: none;
	width: 72px; height: 72px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--paper-2);
	display: flex; align-items: center; justify-content: center;
	font-family: var(--serif); font-size: 1.6rem; color: var(--muted);
}
.author-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.author-card h3 { font-size: 1.3rem; margin: 0 0 4px; }
.author-card p { font-size: .9rem; color: var(--muted); margin: 0; line-height: 1.5; }

/* ---------- Single libro / autore ---------- */

.detail {
	display: grid;
	grid-template-columns: minmax(220px, 340px) 1fr;
	gap: clamp(32px, 6vw, 72px);
	align-items: start;
	padding: clamp(40px, 6vw, 72px) 0;
}
.detail__media { position: sticky; top: 120px; }
.detail__media img { box-shadow: var(--shadow-book); width: 100%; }
.detail__media--round img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; box-shadow: none; max-width: 260px; }
.detail__title { margin-bottom: .2em; }
.detail__author { font-size: 1.2rem; font-family: var(--serif); font-style: italic; margin-bottom: 1.5em; }

.facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
	margin: 0 0 2em;
}
.facts div { background: var(--white); padding: 14px 16px; }
.facts dt { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.facts dd a { text-decoration: none; }

.prose { max-width: 42em; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose blockquote {
	margin: 1.5em 0;
	padding: .2em 0 .2em 1.2em;
	border-left: 3px solid var(--accent);
	font-family: var(--serif);
	font-size: 1.35rem;
	font-style: italic;
}
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 8px; }

.author-box {
	display: flex;
	gap: 20px;
	margin-top: 48px;
	padding: 24px;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	max-width: 42em;
}
.author-box__photo { flex: none; width: 88px; height: 88px; border-radius: 50%; overflow: hidden; background: var(--paper-2); }
.author-box__photo img { width: 100%; height: 100%; object-fit: cover; }
.author-box h3 { margin: 0 0 6px; }
.author-box p { font-size: .95rem; color: var(--ink-soft); margin-bottom: .6em; }

@media (max-width: 760px) {
	.detail { grid-template-columns: 1fr; }
	.detail__media { position: static; max-width: 260px; }
	.author-box { flex-direction: column; }
}

/* ---------- Services ---------- */

.services {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 1px;
	background: var(--line);
	border: 1px solid var(--line);
}
.service {
	background: var(--white);
	padding: 32px 28px;
	display: flex;
	flex-direction: column;
}
.service__num { font-family: var(--serif); font-size: 2.4rem; color: var(--accent); line-height: 1; margin-bottom: 14px; }
.service h3 { margin-bottom: .4em; }
.service p { color: var(--ink-soft); font-size: .97rem; flex: 1; }

/* ---------- Quote band ---------- */

.quote-band {
	background: var(--accent);
	color: var(--white);
	text-align: center;
	padding: clamp(56px, 8vw, 88px) 0;
}
.quote-band blockquote {
	margin: 0 auto;
	max-width: 22em;
	font-family: var(--serif);
	font-size: clamp(1.8rem, 4vw, 2.8rem);
	font-style: italic;
	line-height: 1.2;
}
.quote-band cite { display: block; margin-top: 18px; font-family: var(--sans); font-style: normal; font-size: .9rem; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }

/* ---------- Vendite ---------- */

.sales { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); }
.sales th, .sales td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sales th { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--paper-2); }
.sales td:first-child { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.sales tr:hover td { background: #fffdf9; }
@media (max-width: 700px) {
	.sales thead { display: none; }
	.sales tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
	.sales td { display: block; padding: 2px 0; border: 0; }
	.sales td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: .85rem; }
}

.sales-teaser { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.sales-teaser li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sales-teaser strong { font-family: var(--serif); font-size: 1.2rem; }
.sales-teaser span { color: var(--muted); font-size: .95rem; text-align: right; }

/* ---------- Editori stranieri ---------- */

.publishers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.publisher {
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 28px;
}
.publisher__logo { height: 64px; margin-bottom: 18px; display: flex; align-items: center; }
.publisher__logo img { max-height: 64px; width: auto; }
.publisher h3 { margin-bottom: .3em; }

/* ---------- Posts ---------- */

.post-list { display: grid; gap: 28px; max-width: 48em; }
.post-item { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.post-item h2 { font-size: 1.8rem; margin-bottom: .2em; }
.post-item h2 a { color: var(--ink); text-decoration: none; }
.post-item h2 a:hover { color: var(--accent); }
.post-item time { font-size: .88rem; color: var(--muted); }

.content-area { padding: clamp(40px, 6vw, 72px) 0; }

/* ---------- Pagination ---------- */

.pagination { margin-top: 56px; display: flex; justify-content: center; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--white);
	color: var(--ink);
	text-decoration: none;
	font-weight: 600;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--white); }
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .dots { border: 0; background: none; }

/* ---------- Footer ---------- */

.site-footer {
	background: var(--ink);
	color: #cfc7bb;
	padding: 64px 0 28px;
	font-size: .95rem;
}
.site-footer a { color: #f1ebe2; text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.site-footer h4 { color: var(--white); font-size: 1.3rem; margin-bottom: .7em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .brand__top { color: #a9a39c; }
.site-footer .brand__name { color: #ff8f88; }
.site-footer .brand__mark { color: #a9a39c; }
.site-footer__bottom {
	margin-top: 48px;
	padding-top: 22px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	display: flex;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	font-size: .85rem;
	color: #9d958b;
}
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* ---------- WordPress ---------- */

.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text { font-size: .85rem; color: var(--muted); }

@media print {
	.site-header, .site-footer, .notice-bar, .toolbar, .pagination { display: none; }
	body { background: #fff; }
}
