/* Kacamatabeta — black and white journal theme */

/* ---------- Fonts (bundled, no outside requests) ---------- */
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-semibold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/literata.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("../fonts/literata-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
	--ink: #000;
	--paper: #fff;
	--soft: #2b2b2b;
	--grey: #666;
	--rule: #e2e2e2;
	--wash: #f3f3f3;

	--sans: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--serif: "Literata", Georgia, "Times New Roman", serif;

	--wrap: 1160px;
	--read: 680px;
	--wide: 1080px;
	--gutter: clamp(20px, 4vw, 40px);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
img, video, iframe, svg { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--paper); }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.skip-link:focus {
	clip: auto; clip-path: none; width: auto; height: auto; margin: 0; z-index: 100;
	top: 12px; left: 12px; padding: 10px 16px; background: var(--ink); color: var(--paper);
	text-decoration: none; border-radius: 999px;
}

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

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--paper); position: relative; z-index: 20; }
.site-header__inner {
	max-width: var(--wrap); margin: 0 auto; padding: 18px var(--gutter);
	display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand, .custom-logo-link { display: inline-flex; line-height: 0; }
.brand svg { height: 30px; width: auto; }
.custom-logo { max-height: 40px; width: auto; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.site-nav a { font-size: 15px; font-weight: 500; text-decoration: none; padding: 6px 0; }
.site-nav a:hover, .site-nav .current-menu-item > a { text-decoration: underline; }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; margin: -8px; cursor: pointer; line-height: 0; }
.nav-toggle svg { width: 24px; height: 24px; }
.nav-toggle__close { display: none; }

@media (max-width: 760px) {
	.brand svg { height: 24px; }
	.nav-toggle { display: block; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 100%;
		background: var(--paper); border-bottom: 1px solid var(--ink);
	}
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; }
	.site-nav a { display: block; font-size: 18px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
	.site-nav li:last-child a { border-bottom: 0; }
	.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
	.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: inline; }
}

/* ---------- Home intro & listing heads ---------- */
.intro { padding: clamp(40px, 8vw, 88px) 0 clamp(32px, 5vw, 56px); }
.intro__text {
	margin: 0; max-width: 20ch;
	font-family: var(--serif); font-weight: 400; font-style: italic;
	font-size: clamp(30px, 5.2vw, 56px); line-height: 1.15; letter-spacing: -0.01em;
}
.listing-head { padding: clamp(36px, 6vw, 64px) 0 clamp(28px, 4vw, 44px); border-bottom: 1px solid var(--ink); margin-bottom: 40px; }
.listing-head__label { margin: 0 0 6px; color: var(--grey); font-size: 15px; }
.listing-head__title { margin: 0; font-weight: 600; font-size: clamp(30px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
.listing-head__desc { margin-top: 12px; max-width: 60ch; font-family: var(--serif); font-size: 18px; color: var(--soft); }
.listing-head__desc p { margin: 0; }

/* ---------- Post grid ---------- */
.grid {
	display: grid; grid-template-columns: 1fr;
	gap: 44px 32px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 56px 36px; } }

.card { margin: 0; min-width: 0; }
.card__link { display: block; text-decoration: none; }
.card__media {
	aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: var(--wash);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card__link:hover .card__media img { transform: scale(1.03); }

/* Posts without a featured image: the opening words on a black tile */
.card--note .card__media {
	background: var(--ink); color: var(--paper);
	display: flex; align-items: flex-end; padding: clamp(20px, 3vw, 28px);
}
.card__note {
	margin: 0;
	font-family: var(--serif); font-style: italic; font-weight: 400;
	font-size: clamp(19px, 2vw, 22px); line-height: 1.4;
	display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.card__note::before { content: "\201C"; }
.card__note::after { content: "\201D"; }

.card__title {
	margin: 16px 0 6px; font-size: 19px; font-weight: 600; line-height: 1.32; letter-spacing: -0.01em;
	text-wrap: pretty;
}
.card__link:hover .card__title { text-decoration: underline; text-decoration-thickness: 1.5px; }
.card__meta { margin: 0; font-size: 14px; color: var(--grey); }

/* ---------- Load more & buttons ---------- */
.more { text-align: center; padding: 56px 0 24px; }
.more__btn, .search-form button, .comment-form .submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 48px; padding: 0 30px;
	border: 1.5px solid var(--ink); border-radius: 999px;
	background: var(--paper); color: var(--ink);
	font-family: var(--sans); font-size: 15px; font-weight: 600; text-decoration: none;
	cursor: pointer; transition: background .2s, color .2s;
}
.more__btn:hover, .search-form button:hover, .comment-form .submit:hover { background: var(--ink); color: var(--paper); }
.more__btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.more__status { margin: 14px 0 0; font-size: 14px; color: var(--grey); min-height: 1.6em; }
.card.is-new { animation: kb-in .45s ease both; }
@keyframes kb-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.empty { padding: 40px 0 80px; font-family: var(--serif); font-size: 19px; }

/* ---------- Single article ---------- */
.article { padding-top: clamp(40px, 7vw, 80px); }
.article__head, .article__body, .article__foot {
	max-width: calc(var(--read) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter);
}
.kicker {
	display: inline-block; margin-bottom: 18px; font-size: 14px; font-weight: 500;
	text-decoration: none; border-bottom: 1.5px solid var(--ink); padding-bottom: 2px;
}
.article__title {
	margin: 0; font-weight: 600;
	font-size: clamp(32px, 5.4vw, 52px); line-height: 1.1; letter-spacing: -0.025em;
	text-wrap: balance;
}
.article__lede {
	margin: 22px 0 0;
	font-family: var(--serif); font-weight: 400;
	font-size: clamp(19px, 2.3vw, 23px); line-height: 1.55; color: var(--soft);
}
.meta { margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; color: var(--grey); }

.article__figure { margin: clamp(32px, 5vw, 56px) auto 0; max-width: var(--wide); padding: 0 var(--gutter); }
.article__figure img { width: 100%; border-radius: 3px; }
.article__figure figcaption, .entry-content figcaption {
	margin-top: 10px; font-size: 14px; color: var(--grey); line-height: 1.5;
}
@media (max-width: 640px) { .article__figure { padding: 0; } .article__figure img { border-radius: 0; } .article__figure figcaption { padding: 0 var(--gutter); } }

/* The reading column */
.article__body { margin-top: clamp(36px, 5vw, 56px); }
.entry-content {
	font-family: var(--serif); font-size: 19px; line-height: 1.78; color: var(--ink);
	font-optical-sizing: auto; hanging-punctuation: first; overflow-wrap: break-word;
}
@media (max-width: 640px) { .entry-content { font-size: 18px; line-height: 1.72; } }
.entry-content > * { margin-top: 0; margin-bottom: 1.4em; }
.entry-content h2, .entry-content h3, .entry-content h4 {
	font-family: var(--sans); font-weight: 600; letter-spacing: -0.015em; line-height: 1.25;
	margin-top: 2em; margin-bottom: 0.6em;
}
.entry-content h2 { font-size: 1.4em; }
.entry-content h3 { font-size: 1.18em; }
.entry-content h4 { font-size: 1em; }
.entry-content a { text-decoration-thickness: 1px; }
.entry-content a:hover { text-decoration-thickness: 2px; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li + li { margin-top: 0.4em; }
.entry-content hr, .wp-block-separator {
	border: 0; height: auto; margin: 2.6em auto; text-align: center; background: none;
}
.entry-content hr::before, .wp-block-separator::before { content: "\2022\2003\2022\2003\2022"; color: var(--grey); letter-spacing: .1em; }
.entry-content blockquote, .wp-block-quote {
	margin-left: 0; margin-right: 0; padding: 0 0 0 1.2em; border-left: 3px solid var(--ink);
	font-style: italic;
}
.entry-content blockquote cite, .wp-block-quote cite { display: block; margin-top: .6em; font-family: var(--sans); font-style: normal; font-size: 14px; color: var(--grey); }
.wp-block-pullquote { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); padding: 1.6em 0; text-align: left; }
.wp-block-pullquote blockquote { border: 0; padding: 0; font-size: 1.35em; line-height: 1.4; }
.entry-content img { border-radius: 3px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content .alignwide { max-width: var(--wide); width: calc(100vw - 2 * var(--gutter)); margin-left: 50%; transform: translateX(-50%); }
.entry-content .alignfull { max-width: none; width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.entry-content .alignfull img { border-radius: 0; }
.entry-content .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 50%; }
.entry-content .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 50%; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content pre, .entry-content code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85em; }
.entry-content pre { background: var(--wash); padding: 1em 1.2em; overflow-x: auto; border-radius: 3px; line-height: 1.55; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .9em; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--rule); padding: .6em .5em; text-align: left; }
.wp-block-gallery { gap: 8px; }
.wp-block-image figcaption, .wp-element-caption { font-family: var(--sans); }
.page-links { font-family: var(--sans); font-size: 15px; display: flex; gap: 12px; }

/* Tags */
.tags { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a {
	display: inline-block; padding: 5px 14px; border: 1px solid var(--rule); border-radius: 999px;
	font-size: 14px; text-decoration: none;
}
.tags a:hover { border-color: var(--ink); }

/* Share */
.article__foot { margin-top: 48px; }
.share { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--ink); }
.share__title { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.share__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.share__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-width: 44px; height: 44px; padding: 0 12px;
	border: 1.5px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink);
	font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
	transition: background .2s, color .2s;
}
.share__btn:hover { background: var(--ink); color: var(--paper); }
.share__btn--copy { padding: 0 18px 0 14px; }
.share__btn.is-done { background: var(--ink); color: var(--paper); }

/* Recommended */
.recommended { margin-top: clamp(64px, 9vw, 104px); padding: clamp(48px, 7vw, 80px) 0; background: var(--wash); }
.recommended__title { margin: 0 0 32px; font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; }
.recommended .card__media { background: #e6e6e6; }
.recommended .card--note .card__media { background: var(--ink); }
@media (min-width: 640px) and (max-width: 1023px) { .grid--three .card:nth-child(3) { display: none; } }

/* Comments */
.comments-wrap { max-width: calc(var(--read) + 2 * var(--gutter)); margin: 64px auto 0; padding: 0 var(--gutter); }
.comments__title { font-size: 22px; font-weight: 600; margin: 0 0 20px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 40px; }
.comment-list .children { list-style: none; padding-left: 24px; border-left: 1px solid var(--rule); }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.comment-author img { border-radius: 50%; filter: grayscale(1); }
.comment-author .says { display: none; }
.comment-metadata { font-size: 13px; color: var(--grey); margin: 2px 0 8px; }
.comment-metadata a { text-decoration: none; }
.comment-content { font-family: var(--serif); font-size: 17px; line-height: 1.65; }
.reply a { font-size: 14px; font-weight: 500; }
.comment-form label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: 4px; background: var(--paper);
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--ink); outline: none; }
.comment-form-cookies-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ---------- 404 ---------- */
.notfound { max-width: 620px; padding-top: clamp(56px, 10vw, 120px); padding-bottom: 40px; text-align: center; }
.notfound__mark svg { width: 120px; height: auto; margin: 0 auto 28px; }
.notfound__title { font-size: clamp(28px, 4.5vw, 40px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 12px; }
.notfound p { font-family: var(--serif); font-size: 18px; color: var(--soft); }
.notfound .search-form { margin: 28px auto; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; max-width: 420px; width: 100%; }
.search-form input[type="search"] {
	flex: 1; min-width: 0; min-height: 48px; padding: 0 18px;
	border: 1.5px solid var(--rule); border-radius: 999px; background: var(--paper);
}
.search-form input[type="search"]:focus { border-color: var(--ink); outline: none; }
.search-form button { padding: 0 22px; }

/* ---------- Footer ---------- */
.footer-widgets { max-width: var(--wrap); margin: 80px auto 0; padding: 0 var(--gutter); display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.widget-title { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.widget a { text-decoration: none; }
.widget a:hover { text-decoration: underline; }
.site-footer { margin-top: 96px; border-top: 1px solid var(--ink); }
.site-main:has(> .recommended:last-child) + .site-footer { margin-top: 0; }
.site-footer__inner {
	max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter) 40px;
	display: flex; flex-direction: column; align-items: center; gap: 24px; text-align: center;
}
.site-footer__mark { line-height: 0; }
.site-footer__mark svg { width: 64px; height: auto; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.footer-nav a { font-size: 14px; font-weight: 500; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }
.site-footer__copy { margin: 0; font-size: 13px; color: var(--grey); }

/* ---------- Reading progress (articles only) ---------- */
.progress { display: none; }
.single .progress { display: block; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.admin-bar.single .progress { top: 32px; }
@media (max-width: 782px) { .admin-bar.single .progress { top: 46px; } }
.progress span { display: block; height: 100%; background: var(--ink); transform-origin: 0 50%; transform: scaleX(0); }

/* WordPress core classes */
.bypostauthor > .comment-body .fn::after { content: " \2713"; }
.gallery-caption, .wp-caption-text { font-size: 14px; color: var(--grey); }

@media print {
	.site-header, .site-footer, .share, .recommended, .comments-wrap, .progress, .more { display: none !important; }
	.entry-content { font-size: 12pt; }
}
