/* ==========================================================================
   ABrandão 27a — single.css  (posts, pages, attachments)
   Centered reading column, article typography ("prose"), article footer,
   prev/next, related posts, share links, comments.
   ========================================================================== */

/* ---------- Reading column ---------- */
.page-wide { --a27-article-w: 1100px; }

.entry--single .article-header,
.entry--single .entry-content,
.entry--single .article-footer,
.layout--single .post-nav,
.layout--single .comments-area,
.layout--single .after-article {
	max-width: var(--a27-article-w);
	margin-inline: auto;
}

.article-header { margin-bottom: 28px; }
.article-kicker {
	margin: 0 0 .5em;
	font-family: var(--a27-font-meta); font-size: var(--a27-meta-size);
	font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
.article-kicker a { color: var(--a27-link); }
.article-kicker a:hover { color: var(--a27-link-hover); }
.article-title {
	margin: 0;
	font-size: clamp(34px, 6vw, calc(var(--a27-h1) * 1.3));
	line-height: 1.02;
	color: var(--a27-primary);
}
.article-dek { margin: .7em 0 0; font-size: 1.18em; line-height: 1.5; color: var(--a27-text-2); }
.article-header .entry-meta {
	display: flex; flex-wrap: wrap; align-items: center; gap: .3em 1.2em;
	margin-top: 1.1em;
	font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); color: var(--a27-muted);
}
.entry-meta .meta-item { display: inline-flex; align-items: center; gap: .4em; }
.entry-meta a { color: inherit; }
.entry-meta a:hover { color: var(--a27-link); }
.entry-updated { opacity: .85; }

.article-feature {
	max-width: calc(var(--a27-article-w) + 220px);
	margin: 0 auto 40px;
}
.article-feature img { display: block; width: auto; max-width: 100%; height: auto; max-height: min(72vh, 640px); margin-inline: auto; object-fit: contain; border-radius: var(--a27-radius); }
.layout--sidebar .article-feature { max-width: 100%; }

/* ---------- Prose ---------- */
.prose { font-size: 1.04em; }
.prose > * { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose dl, .prose figure, .prose table, .prose pre, .prose blockquote { margin-bottom: 1.4em; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { margin: 1.9em 0 .55em; scroll-margin-top: 90px; }
.prose h2 { font-size: var(--a27-h2); }
.prose h3 { font-size: var(--a27-h3); }
.prose h2 + h3, .prose h3 + h4 { margin-top: .8em; }
.prose > :first-child { margin-top: 0; }

.prose a:not(.wp-block-button__link):not(.pill):not([class*="enlighter"]) {
	color: var(--a27-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-decoration-color: color-mix(in srgb, var(--a27-link) 40%, transparent);
	text-underline-offset: .2em;
}
.prose a:not(.wp-block-button__link):hover { text-decoration-color: currentColor; text-decoration-thickness: 2px; color: var(--a27-link-hover); }

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .45em; padding-left: .2em; }
.prose li > ul, .prose li > ol { margin: .45em 0 0; }
.prose ul > li::marker { color: var(--a27-primary); }
.prose ol > li::marker { color: var(--a27-primary); font-family: var(--a27-font-meta); font-weight: 600; font-size: .9em; }
.prose dt { font-weight: 600; }
.prose dd { margin: 0 0 .8em 1.2em; color: var(--a27-text-2); }
.prose strong, .prose b { font-weight: 650; color: color-mix(in srgb, var(--a27-text) 80%, var(--a27-secondary)); }

/* Blockquotes */
.prose blockquote, .prose .wp-block-quote {
	margin-inline: 0;
	padding: .2em 0 .2em 1.3em;
	border-left: 3px solid var(--a27-primary);
	color: var(--a27-text-2);
	font-size: 1.08em;
	font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite, .prose .wp-block-quote cite {
	display: block; margin-top: .7em;
	font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); font-style: normal; color: var(--a27-muted);
}
.prose blockquote cite::before { content: "— "; }
.prose .wp-block-pullquote {
	margin: 2.2em 0; padding: 1.4em 0;
	border-block: 2px solid var(--a27-primary);
	text-align: center;
}
.prose .wp-block-pullquote blockquote { border: 0; padding: 0; margin: 0; }
.prose .wp-block-pullquote p { font-family: var(--a27-font-heading); font-size: var(--a27-h3); font-style: normal; line-height: 1.2; color: var(--a27-secondary); }

/* Code */
.prose code, .prose kbd, .prose samp {
	font-family: var(--a27-font-mono);
	font-size: .86em;
	padding: .12em .4em;
	background: var(--a27-surface-alt);
	border: 1px solid var(--a27-border);
	border-radius: 4px;
	overflow-wrap: anywhere;
}
.prose pre {
	position: relative;
	overflow-x: auto;
	padding: 1.1em 1.3em;
	background: var(--a27-surface-alt);
	border: 1px solid var(--a27-border);
	border-left: 3px solid var(--a27-primary);
	border-radius: var(--a27-radius);
	font-family: var(--a27-font-mono);
	font-size: .86em;
	line-height: 1.6;
	tab-size: 4;
	-webkit-overflow-scrolling: touch;
}
.prose pre code { padding: 0; background: none; border: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.prose .wp-block-code code { white-space: pre; overflow-wrap: normal; }
/* Enlighter plugin blocks keep their own theme; just make them fit the column */
.prose .enlighter-default { max-width: 100%; margin-bottom: 1.4em; border-radius: var(--a27-radius); overflow: hidden; }

/* Images, figures, captions */
.prose img { border-radius: max(0px, calc(var(--a27-radius) - 2px)); }
.prose figure, .prose .wp-caption { margin-inline: 0; }
.prose .wp-caption { width: auto !important; } /* legacy inline widths */
.prose .wp-caption img { display: block; margin-inline: auto; }
.prose .alignleft, .prose .alignright { max-width: 50%; }
.prose .wp-block-image, .prose .wp-block-gallery { margin-block: 2em; }
.layout--full .prose .alignwide { margin-inline: calc(min(110px, (100vw - var(--a27-article-w)) / 2 - var(--a27-pad)) * -1); max-width: none; }
.layout--full .prose .alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
.layout--full .prose .alignfull img { border-radius: 0; width: 100%; }

/* Legacy [gallery] shortcode */
.prose .gallery { display: grid; gap: 10px; margin-bottom: 1.6em; }
.prose .gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.prose .gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.prose .gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.prose .gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.prose .gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.prose .gallery-item { margin: 0; }
.prose .gallery-item img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; }
.prose .gallery br { display: none; }
@media (max-width: 600px) { .prose .gallery { grid-template-columns: repeat(2, 1fr); } }

/* Tables */
.prose table { width: 100%; border-collapse: collapse; font-size: .92em; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: .6em .8em; border-bottom: 1px solid var(--a27-border); text-align: left; vertical-align: top; }
.prose th, .prose thead td { background: var(--a27-surface-alt); font-family: var(--a27-font-meta); font-weight: 600; font-size: .92em; }
.prose .wp-block-table { overflow-x: auto; }
.prose .wp-block-table table { margin-bottom: 0; }
@media (max-width: 700px) {
	.prose table:not(.wp-block-table table) { display: block; overflow-x: auto; }
	.prose .alignleft, .prose .alignright { float: none; max-width: 100%; margin: 0 0 1.2em; }
}

/* Embeds & video — responsive, never overflowing */
.prose iframe { max-width: 100%; border: 0; }
.prose iframe[src*="youtube"], .prose iframe[src*="youtu.be"], .prose iframe[src*="vimeo"],
.a27-embed iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; display: block; border-radius: var(--a27-radius); }
.a27-embed, .prose .wp-block-embed { margin-block: 1.8em; }
.prose video { width: 100%; border-radius: var(--a27-radius); }

/* Dividers */
.prose hr, .prose .wp-block-separator { border: 0; height: auto; margin: 2.6em auto; text-align: center; background: none; }
.prose hr::after, .prose .wp-block-separator:not(.is-style-wide)::after {
	content: "• • •"; color: var(--a27-primary); letter-spacing: .8em; font-size: .9em; padding-left: .8em;
}
.prose .wp-block-separator.is-style-wide { border-top: 1px solid var(--a27-border); }
.prose .wp-block-separator.is-style-wide::after { content: none; }

/* Buttons/details/misc blocks */
.prose details { margin-bottom: 1.2em; padding: .8em 1em; background: var(--a27-surface-alt); border-radius: var(--a27-radius); }
.prose summary { cursor: pointer; font-weight: 600; }
.prose .wp-block-button { margin-bottom: 1.2em; }
.prose .has-background { padding: 1.2em 1.4em; border-radius: var(--a27-radius); }
.prose abbr[title] { text-decoration: underline dotted; cursor: help; }

/* Drop cap option */
.has-drop-cap-first.single .entry-content > p:first-of-type::first-letter,
.prose .has-drop-cap:not(:focus)::first-letter {
	float: left;
	font-family: var(--a27-font-heading);
	font-size: 4.1em; line-height: .82;
	margin: .08em .1em 0 0;
	color: var(--a27-primary);
	font-weight: var(--a27-heading-weight);
}

/* Multi-page posts */
.page-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2em 0; font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); }
.page-links-title { margin-right: 6px; color: var(--a27-muted); }
.page-links .post-page-numbers { display: inline-flex; justify-content: center; min-width: 34px; padding: 4px 8px; border: 1px solid var(--a27-border); border-radius: var(--a27-radius); }
.page-links .current { background: var(--a27-btn-bg); color: var(--a27-btn-text); border-color: var(--a27-btn-bg); }

/* ---------- Article footer ---------- */
.article-footer { margin-top: 44px; display: grid; gap: 14px; }
.article-footer:empty { display: none; }
.article-footer-rule .article-footer { padding-top: 24px; border-top: 1px solid var(--a27-border); }
.article-footer-panel .article-footer { padding: 22px 24px; background: var(--a27-surface-alt); border-radius: var(--a27-radius); }
.article-footer .entry-meta { margin: 0; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: .4em; }
.share-label { display: inline-flex; align-items: center; gap: .4em; margin-right: .3em; font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); color: var(--a27-muted); }
.edit-link { margin: 0; font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); }

/* After-article widgets */
.after-article { margin-top: 44px; }
.after-article .widget + .widget { margin-top: 28px; }

/* ---------- Previous / next ---------- */
.post-nav { margin-top: 48px; }
.post-nav .nav-links { display: grid; gap: 14px; }
@media (min-width: 640px) { .post-nav .nav-links { grid-template-columns: 1fr 1fr; } }
.post-nav a {
	display: flex; flex-direction: column; gap: 6px; height: 100%;
	padding: 18px 20px;
	border: 1px solid var(--a27-border);
	border-radius: var(--a27-radius);
	color: var(--a27-text);
	transition: border-color .2s, background-color .2s;
}
.post-nav a:hover { border-color: var(--a27-primary); background: var(--a27-primary-tint); }
.post-nav .nav-next { grid-column: 2; text-align: right; }
.post-nav .nav-next:first-child { grid-column: 1 / -1; }
@media (max-width: 639px) { .post-nav .nav-next { grid-column: auto; } }
.post-nav .nav-kicker { display: inline-flex; align-items: center; gap: .3em; font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--a27-link); }
.post-nav .nav-next .nav-kicker { justify-content: flex-end; }
.post-nav .nav-title { font-family: var(--a27-font-heading); font-size: var(--a27-h4); line-height: 1.15; color: var(--a27-secondary); }

/* ---------- Related ---------- */
.section-title { font-size: var(--a27-h3); margin: 0 0 20px; }
.related {
	max-width: calc(var(--a27-article-w) + 220px);
	margin: 64px auto 0;
	padding-top: 36px;
	border-top: var(--a27-border-w) solid var(--a27-border);
}
.layout--sidebar .related { max-width: var(--a27-article-w); }
.related-grid { display: grid; gap: 28px 24px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.related-thumb { display: block; overflow: hidden; border-radius: var(--a27-radius); background: var(--a27-surface-alt); margin-bottom: 12px; }
.related-thumb img { display: block; width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; transition: transform .5s var(--a27-ease); }
.related-item:hover .related-thumb img { transform: scale(1.03); }
.related-thumb--empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 16/10; color: var(--a27-primary); background: var(--a27-primary-tint); }
.related-thumb--empty .a27-icon { width: 30px; height: 30px; stroke-width: 1.4; }
.related-title { margin: 0 0 4px; font-size: var(--a27-h5); line-height: 1.2; }
.related-title a { color: var(--a27-secondary); }
.related-title a:hover { color: var(--a27-primary); }
.related-date { margin: 0; font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); color: var(--a27-muted); }

/* ---------- Comments ---------- */
.comments-area { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--a27-border); }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-left: clamp(16px, 5vw, 44px); }
.comment-body { padding: 18px 0; border-bottom: 1px solid var(--a27-border); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); color: var(--a27-muted); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--a27-text); }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata a { color: inherit; }
.comment-content { margin-top: 10px; }
.reply { font-family: var(--a27-font-meta); font-size: var(--a27-meta-size); font-weight: 600; }
.comment-respond { margin-top: 32px; }
.comment-form { display: grid; gap: 14px; }
.comment-form p { margin: 0; }
.comment-form label { display: block; margin-bottom: 4px; font-weight: 600; }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }
.bypostauthor > .comment-body .fn::after { content: " ★"; color: var(--a27-primary); }

/* Sidebar on singular views */
.layout--single.layout--sidebar .entry--single .article-header,
.layout--single.layout--sidebar .entry--single .entry-content { max-width: min(var(--a27-article-w), 100%); }
