/*
Theme Name: Chronicles of Creativity
Theme URI: https://digdesignstudio.com
Author: Digdesignstudio
Author URI: https://digdesignstudio.com
Description: Standalone fellowship blogging theme for Sri Aurobindo Kala Sangam's "Chronicles of Creativity" — built from scratch to match the approved design mockup. Every fellow gets their own page (WordPress's native author archive), the cross-fellow Stream, co-authored entries, @mentions, and native same-site pingbacks rendered as "Related to" cross-links, with only one plugin dependency (Co-Authors Plus, for genuine shared-byline credit).
Version: 0.3.12
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: chronicles-of-creativity
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
	--bg: #f4f1ea;
	--text: #131210;
	--muted: #4a4843;
	--muted-2: #8d8a82;
	--muted-3: #b3ada0;
	--border: #d8d3c7;
	--border-2: #c2bcae;
	--border-3: #ece8de;
	--do: #3c6e4a;
	--dont: #a3392a;
	--accent: #b4452e; /* overridden inline from the Customizer setting, see functions.php */
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "Archivo", system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.serif { font-family: "Newsreader", Georgia, serif; }
.mono { font-family: "Space Mono", ui-monospace, monospace; }
.do { color: var(--do); }
.dont { color: var(--dont); }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: clamp(20px, 5vw, 48px); padding-right: clamp(20px, 5vw, 48px); }
.wrap-narrow { max-width: 900px; margin: 0 auto; padding-left: clamp(20px, 5vw, 48px); padding-right: clamp(20px, 5vw, 48px); }
.wrap-entry { max-width: 760px; margin: 0 auto; padding-left: clamp(20px, 5vw, 32px); padding-right: clamp(20px, 5vw, 32px); }

/* ==========================================================================
   Nav
   ========================================================================== */

.site-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px clamp(20px, 5vw, 48px);
	border-bottom: 1px solid var(--border);
	flex-wrap: wrap;
	row-gap: 10px;
}

.site-nav__brand-group { display: flex; align-items: center; gap: 10px; }

.site-nav__brand {
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 12px;
	letter-spacing: .08em;
	color: var(--text);
	text-decoration: none;
}

.coc-saks-logo { display: inline-flex; align-items: center; line-height: 0; }
.site-nav__saks-logo img { height: 28px; width: auto; display: block; }

.site-nav__right { display: flex; align-items: center; gap: clamp(16px, 3vw, 32px); }

.site-nav__links {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(12px, 3vw, 28px);
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--muted-2);
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-nav__links a { text-decoration: none; color: inherit; }
.site-nav__links .current-menu-item a,
.site-nav__links a.is-current { color: var(--text); }

.acct { position: relative; }

.acct__trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 11px;
	color: var(--text);
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
}

.acct__avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #ebe7dd;
	border: 1px solid var(--border);
	flex: none;
	object-fit: cover;
}

.acct__menu {
	display: none;
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	min-width: 190px;
	background: #fff;
	border: 1px solid var(--border-2);
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(19, 18, 16, .12);
	padding: 6px;
	z-index: 30;
}

.acct.is-open .acct__menu { display: block; }

.acct-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 10px;
	border-radius: 2px;
	text-decoration: none;
	font-size: 12px;
	color: var(--muted);
	font-family: "Space Mono", ui-monospace, monospace;
}

.acct-item:hover { background: var(--bg); }
.acct-item--logout { color: var(--dont); }
.acct-divider { height: 1px; background: var(--border-3); margin: 6px 4px; }

/* ==========================================================================
   Who-row / avatars
   ========================================================================== */

.who-row { display: flex; align-items: center; gap: 8px; }

.avatar {
	border-radius: 50%;
	background: #ebe7dd;
	border: 1px solid var(--border);
	flex: none;
	object-fit: cover;
	display: inline-block;
}

.who-row a.who-row__name { text-decoration: none; color: var(--text); }

/* ==========================================================================
   Chips / pills / tags
   ========================================================================== */

.chip {
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: .04em;
	padding: 7px 14px;
	border-radius: 20px;
	border: 1px solid var(--border-2);
	color: var(--muted);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: none;
	cursor: pointer;
	line-height: 1.2;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.chip.is-active:hover { color: var(--bg); }
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }

.related-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 12px;
	font-size: 11px;
	letter-spacing: .03em;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: 20px;
	padding: 5px 12px 5px 6px;
	text-decoration: none;
	font-family: "Space Mono", ui-monospace, monospace;
}

.permalink-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 10px;
	letter-spacing: .04em;
	color: var(--muted-3);
	margin-top: 8px;
}

.permalink-row a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* ==========================================================================
   Entries (shared by Stream, author archive, single)
   ========================================================================== */

.entry { margin-bottom: 56px; }
.entry__meta {
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: .02em;
	color: var(--muted-2);
	margin: 0 0 12px 30px;
}
.entry__meta a { color: inherit; text-decoration: none; }
.entry__body { color: var(--muted); font-size: 16px; line-height: 1.65; max-width: 68ch; }
.entry__body p:first-child { margin-top: 0; }

.entry__quote {
	border-left: 2px solid var(--accent);
	padding-left: clamp(16px, 4vw, 32px);
	max-width: 68ch;
}
.entry__quote p { font-family: "Newsreader", Georgia, serif; font-style: italic; font-size: clamp(20px, 4vw, 26px); line-height: 1.4; margin: 0 0 10px; color: var(--text); }

.entry__image { width: 100%; border-radius: 2px; background: #ebe7dd; border: 1px solid var(--border); }
.entry__image--full-bleed { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-radius: 0; border-left: none; border-right: none; }

.entry__gallery { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: clamp(12px, 3vw, 20px); }
@media (max-width: 720px) { .entry__gallery { grid-template-columns: 1fr 1fr; } }

.coauthor-badge {
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 9px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--accent);
	border: 1px solid var(--accent);
	border-radius: 20px;
	padding: 2px 9px;
	margin-left: 8px;
}

.stack-avatars { display: flex; }
.stack-avatars .avatar { width: 22px; height: 22px; border: 1.5px solid var(--bg); box-shadow: 0 0 0 1px var(--border); }
.stack-avatars .avatar + .avatar { margin-left: -8px; }

/* ==========================================================================
   Fellow cards / directory (Home)
   ========================================================================== */

.fellow-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(12px, 2vw, 22px); }
@media (max-width: 1080px) { .fellow-grid { grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 3vw, 28px); } }
@media (max-width: 600px) { .fellow-grid { grid-template-columns: repeat(2, 1fr); } }

.fellow-card { text-decoration: none; color: inherit; }
.fellow-card__img { width: 100%; aspect-ratio: 4/5; border-radius: 2px; background: #ebe7dd; border: 1px solid var(--border); object-fit: cover; display: block; }
.fellow-card__name { font-family: "Newsreader", Georgia, serif; font-size: 15px; font-weight: 600; margin-top: 10px; }
.fellow-card__role { font-family: "Space Mono", ui-monospace, monospace; font-size: 9px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted-2); margin-top: 6px; }

.topic-row {
	display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
	padding: 18px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
	text-decoration: none; color: inherit;
}
.topic-row:hover .topic-row__title { color: var(--accent); }
.topic-row__title { font-family: "Newsreader", Georgia, serif; font-size: clamp(16px, 2.4vw, 20px); }

/* ==========================================================================
   Guidelines page
   ========================================================================== */

.g-section { padding: 28px 0; border-bottom: 1px solid var(--border); max-width: 62ch; }
.g-section p { color: var(--muted); font-size: 15px; line-height: 1.65; }
.tag-def { display: grid; grid-template-columns: 140px 1fr; gap: 6px 18px; padding: 10px 0; border-bottom: 1px solid var(--border-3); max-width: 62ch; }
@media (max-width: 640px) { .tag-def { grid-template-columns: 1fr; gap: 2px; } }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	border-top: 1px solid var(--border);
	padding: clamp(24px, 4vw, 36px) clamp(20px, 5vw, 48px);
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: space-between;
	align-items: center;
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 11px;
	color: var(--muted-2);
}

.site-footer__left { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.site-footer__legal { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.site-footer__legal a { color: inherit; text-decoration: none; }
.site-footer__legal a:hover { color: var(--text); }
.site-footer__saks-logo img { height: 18px; width: auto; display: block; }

.site-footer__credit { display: flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; }
.site-footer__logo { width: 22px; height: 18px; border-radius: 3px; background: var(--text); display: flex; align-items: center; justify-content: center; padding: 3px 4px; }
.site-footer__logo img { width: 100%; height: 100%; object-fit: contain; }

/* ==========================================================================
   Gutenberg block content (inside .entry__body / .page-content)
   — this is what makes an entry's own blocks (Paragraph, Image, Gallery,
   Quote) already match the mockup with no per-post styling needed.
   ========================================================================== */

.entry__body p, .page-content p { margin: 0 0 20px; }
.entry__body p:last-child, .page-content p:last-child { margin-bottom: 0; }

.entry__body .wp-block-image img,
.page-content .wp-block-image img { width: 100%; border-radius: 2px; background: #ebe7dd; border: 1px solid var(--border); }
.entry__body .wp-block-image figcaption,
.page-content .wp-block-image figcaption { font-family: "Space Mono", ui-monospace, monospace; font-size: 11px; color: var(--muted-2); margin-top: 8px; }
.entry__body .wp-block-image.alignfull img,
.entry__body .wp-block-image.alignwide img { border-radius: 0; border-left: none; border-right: none; width: 100vw; margin-left: calc(50% - 50vw); }

.entry__body .wp-block-gallery,
.page-content .wp-block-gallery { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: clamp(12px, 3vw, 20px); margin: 0 0 20px; }
@media (max-width: 720px) { .entry__body .wp-block-gallery, .page-content .wp-block-gallery { grid-template-columns: 1fr 1fr; } }
.entry__body .wp-block-gallery img,
.page-content .wp-block-gallery img { border-radius: 2px; border: 1px solid var(--border); aspect-ratio: 3/4; object-fit: cover; }

.entry__body blockquote, .entry__body .wp-block-quote,
.page-content blockquote, .page-content .wp-block-quote {
	border-left: 2px solid var(--accent);
	padding-left: clamp(16px, 4vw, 32px);
	max-width: 68ch;
	margin: 0 0 20px;
}
.entry__body blockquote p, .entry__body .wp-block-quote p,
.page-content blockquote p, .page-content .wp-block-quote p {
	font-family: "Newsreader", Georgia, serif; font-style: italic; font-size: clamp(20px, 4vw, 26px); line-height: 1.4; margin: 0 0 10px; color: var(--text);
}
.entry__body blockquote cite, .entry__body .wp-block-quote cite,
.page-content blockquote cite, .page-content .wp-block-quote cite {
	font-family: "Space Mono", ui-monospace, monospace; font-size: 11px; font-style: normal; color: var(--muted-2);
}

.entry__body a.mention, .page-content a.mention { color: var(--accent); font-weight: 600; text-decoration: none; }

.page-content { color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 62ch; }
.page-content h2 { font-size: 20px; margin: 40px 0 12px; padding-top: 28px; border-top: 1px solid var(--border); }
.page-content h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.page-content strong { color: var(--text); }
.page-content ul, .page-content ol { padding-left: 20px; margin: 0 0 20px; }
.page-content li { margin-bottom: 8px; }
.page-content em { color: var(--muted-2); }

/* ==========================================================================
   Forms — the front-end "New Entry" submission form
   ========================================================================== */

.field { margin-bottom: 26px; }
.field > label, .field-label {
	display: block;
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: 9px;
}
.field-hint { color: var(--muted-2); font-size: 12px; margin-top: 7px; line-height: 1.5; }

.field input[type="text"],
.field input[type="file"],
.field select,
.field textarea {
	width: 100%;
	font-family: "Archivo", system-ui, sans-serif;
	font-size: 15px;
	color: var(--text);
	background: #fff;
	border: 1px solid var(--border-2);
	border-radius: 2px;
	padding: 12px 14px;
}
.field input[type="text"]:focus,
.field select:focus,
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.checkbox-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.checkbox-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 12px;
	color: var(--text);
	border: 1px solid var(--border-2);
	border-radius: 20px;
	padding: 7px 14px;
	cursor: pointer;
}
.checkbox-pill input { margin: 0; }

.btn-primary {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	background: var(--accent);
	color: #fff;
	border: 1px solid var(--accent);
	border-radius: 2px;
	padding: 13px 26px;
	cursor: pointer;
}
.btn-primary:hover { opacity: .92; }

.form-notice {
	font-family: "Space Mono", ui-monospace, monospace;
	font-size: 12px;
	line-height: 1.5;
	border-radius: 2px;
	padding: 12px 16px;
	margin-bottom: 28px;
}
.form-notice--error { background: #f7e6e2; color: var(--dont); border: 1px solid var(--dont); }
.form-notice--success { background: #e9f1ea; color: var(--do); border: 1px solid var(--do); }

/* ==========================================================================
   Misc utility
   ========================================================================== */

h1, h2, h3 { font-family: "Newsreader", Georgia, serif; font-weight: 600; }
.eyebrow { font-family: "Space Mono", ui-monospace, monospace; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 16px; }
.private-badge {
	font-family: "Space Mono", ui-monospace, monospace; font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
	color: var(--muted-2); border: 1px solid var(--border); padding: 3px 9px; border-radius: 20px;
	display: inline-flex; align-items: center; gap: 5px;
}
