/*
Theme Name:  InspireCards
Description: A modern, card-first theme for quote sites — masonry grid of quote cards, elegant single-quote pages, dark mode, and clean ad slots. Built for thoughtstoinspire.in to pair with the Quote Card Engine plugin.
Version:     1.1.0
Author:      ChapterFlow
License:     GPL-2.0-or-later
Text Domain: inspirecards
Requires PHP: 7.2
*/

/* ---------------------------------------------------------------- fonts */
@font-face {
	font-family: 'Playfair Display';
	src: url('fonts/PlayfairDisplay-Medium.ttf') format('truetype');
	font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Playfair Display';
	src: url('fonts/PlayfairDisplay-MediumItalic.ttf') format('truetype');
	font-weight: 500; font-style: italic; font-display: swap;
}
@font-face {
	font-family: 'Montserrat';
	src: url('fonts/Montserrat-Regular.ttf') format('truetype');
	font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
	font-family: 'Montserrat';
	src: url('fonts/Montserrat-SemiBold.ttf') format('truetype');
	font-weight: 600; font-style: normal; font-display: swap;
}

/* ---------------------------------------------------------------- tokens */
:root {
	--bg: #f7f4ee;
	--surface: #ffffff;
	--ink: #191b20;
	--muted: #6d7078;
	--line: rgba(25, 27, 32, .1);
	--accent: #a8842f;
	--accent-soft: rgba(168, 132, 47, .12);
	--radius: 14px;
	--shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 10px 30px -12px rgba(20, 20, 30, .18);
	--serif: 'Playfair Display', Georgia, serif;
	--sans: 'Montserrat', -apple-system, 'Segoe UI', sans-serif;
	--maxw: 1240px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #101217;
		--surface: #181b22;
		--ink: #ece7dd;
		--muted: #9a9da6;
		--line: rgba(236, 231, 221, .12);
		--accent: #d4af6a;
		--accent-soft: rgba(212, 175, 106, .12);
		--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px -12px rgba(0, 0, 0, .6);
	}
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------------------- header */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}
.site-header .wrap {
	display: flex; align-items: center; justify-content: space-between;
	gap: 18px; min-height: 64px;
}
.site-title {
	font-family: var(--serif); font-size: 22px; font-weight: 500;
	letter-spacing: .01em; margin: 0;
}
.site-title a { color: var(--ink); }
.site-title a:hover { text-decoration: none; color: var(--accent); }
.site-title .dot { color: var(--accent); }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a {
	display: inline-block; padding: 7px 13px; border-radius: 999px;
	color: var(--muted); font-size: 13.5px; font-weight: 600; letter-spacing: .02em;
}
.main-nav a:hover, .main-nav .current-menu-item > a {
	color: var(--ink); background: var(--accent-soft); text-decoration: none;
}

/* ---------------------------------------------------------------- hero */
.hero { text-align: center; padding: 54px 22px 8px; }
.hero h1 {
	font-family: var(--serif); font-weight: 500;
	font-size: clamp(28px, 4.6vw, 44px); line-height: 1.2; margin: 0 0 10px;
}
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; font-size: 15.5px; }
.hero .mark { color: var(--accent); font-family: var(--serif); }

/* term chips (authors / topics) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 22px 0 6px; }
.chips a {
	padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
	background: var(--surface); color: var(--muted);
	font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
}
.chips a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- archive header */
.archive-head { text-align: center; padding: 46px 22px 6px; }
.archive-head .kicker {
	color: var(--accent); font-size: 12px; font-weight: 600;
	letter-spacing: .18em; text-transform: uppercase;
}
.archive-head h1 {
	font-family: var(--serif); font-weight: 500;
	font-size: clamp(26px, 4vw, 40px); margin: 8px 0 10px;
}
.archive-head .term-description { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 15px; }

/* ---------------------------------------------------------------- card grid */
.card-grid { columns: 4 250px; column-gap: 22px; padding: 30px 0 10px; }
.card {
	break-inside: avoid; margin: 0 0 22px; background: var(--surface);
	border-radius: var(--radius); box-shadow: var(--shadow);
	overflow: hidden; transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); }
.card > a { display: block; color: inherit; }
.card > a:hover { text-decoration: none; }
.card img { display: block; width: 100%; }
.card .card-meta { padding: 13px 16px 15px; }
.card .card-q {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	overflow: hidden; font-size: 14px; line-height: 1.5; color: var(--ink);
}
.card .card-a {
	display: block; margin-top: 6px; color: var(--accent);
	font-size: 11.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
}
/* text-only tile for posts without a card image */
.card .card-text-tile {
	padding: 34px 26px; font-family: var(--serif); font-size: 19px; line-height: 1.45;
	background: linear-gradient(160deg, #1c2340, #0d101d); color: #f5f0e6;
}
@media (prefers-color-scheme: dark) {
	.card .card-text-tile { background: linear-gradient(160deg, #242c4e, #131725); }
}

/* ---------------------------------------------------------------- pagination */
.pagination { padding: 18px 0 46px; text-align: center; }
.pagination .nav-links { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers {
	display: inline-block; min-width: 40px; padding: 9px 13px;
	border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
	color: var(--muted); font-weight: 600; font-size: 14px;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination a.page-numbers:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- single quote */
.single-main { max-width: 780px; margin: 0 auto; padding: 44px 22px 30px; }
.single-quote .quote-mark {
	display: block; text-align: center; color: var(--accent);
	font-family: var(--serif); font-style: italic;
	font-size: 84px; line-height: .4; margin: 26px 0 2px;
}
.single-quote h1.entry-title {
	font-family: var(--serif); font-weight: 500; text-align: center;
	font-size: clamp(26px, 4.4vw, 42px); line-height: 1.32; margin: 18px 0 8px;
}
.single-quote .byline { text-align: center; margin: 16px 0 4px; }
.single-quote .byline a {
	color: var(--accent); font-size: 13px; font-weight: 600;
	letter-spacing: .16em; text-transform: uppercase;
}
.single-quote .byline .rule {
	display: block; width: 64px; height: 2px; margin: 0 auto 14px;
	background: var(--accent); border-radius: 2px;
}
.quote-card { margin: 30px auto 6px; max-width: 500px; }
.quote-card img {
	display: block; width: 100%;
	border-radius: var(--radius); box-shadow: var(--shadow);
}
.entry-content { font-size: 16.5px; }
.entry-content .qce-citation { text-align: center; color: var(--muted); font-size: 14.5px; }
.qce-context {
	margin: 34px 0; padding: 26px 28px; background: var(--surface);
	border: 1px solid var(--line); border-left: 3px solid var(--accent);
	border-radius: var(--radius);
}
.qce-context h2 {
	margin: 0 0 10px; font-family: var(--serif); font-weight: 500; font-size: 21px;
}
.qce-context p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.qce-context em { color: var(--ink); }
.qce-share { border-top: 1px solid var(--line); padding-top: 20px; }

/* related */
.related { max-width: var(--maxw); margin: 0 auto; padding: 8px 22px 50px; }
.related h2 {
	font-family: var(--serif); font-weight: 500; font-size: 24px;
	text-align: center; margin: 20px 0 4px;
}
.related .card-grid { columns: 4 230px; }

/* ---------------------------------------------------------------- pages */
.page-main { max-width: 860px; margin: 0 auto; padding: 44px 22px 50px; }
.page-main h1.entry-title {
	font-family: var(--serif); font-weight: 500; text-align: center;
	font-size: clamp(26px, 4vw, 38px); margin: 0 0 20px;
}
.page-main .entry-content > p:first-of-type { color: var(--muted); font-size: 17px; text-align: center; }
.qce-collection-grid a:hover { text-decoration: none; }

/* ---------------------------------------------------------------- widgets / ads */
.ad-slot { text-align: center; padding: 10px 22px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 30px; background: var(--surface); }
.site-footer .cols {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 28px; padding: 40px 0 26px;
}
.site-footer h2, .site-footer h3 {
	font-family: var(--serif); font-weight: 500; font-size: 17px; margin: 0 0 10px;
}
.site-footer, .site-footer a { color: var(--muted); font-size: 14px; }
.site-footer a:hover { color: var(--accent); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; }
.site-footer .credit {
	border-top: 1px solid var(--line); padding: 18px 0 22px;
	text-align: center; font-size: 12.5px;
}

/* ---------------------------------------------------------------- endless scroll */
.has-infinite-scroll .pagination { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.infinite-loader { text-align: center; padding: 8px 0 40px; visibility: hidden; }
.infinite-loader.is-loading { visibility: visible; }
.infinite-loader span {
	display: inline-block; width: 9px; height: 9px; margin: 0 4px;
	border-radius: 50%; background: var(--accent); opacity: .3;
	animation: ic-pulse 1s infinite ease-in-out;
}
.infinite-loader span:nth-child(2) { animation-delay: .16s; }
.infinite-loader span:nth-child(3) { animation-delay: .32s; }
@keyframes ic-pulse { 0%, 100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

/* ---------------------------------------------------------------- misc */
.error-404 { text-align: center; padding: 90px 22px; }
.error-404 h1 { font-family: var(--serif); font-weight: 500; font-size: 42px; }
@media (max-width: 640px) {
	.card-grid { columns: 2 150px; column-gap: 14px; }
	.card { margin-bottom: 14px; }
	.card .card-meta { padding: 10px 12px 12px; }
	.card .card-q { font-size: 12.5px; }
	.site-header .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
}
