/*
Theme Name: aiandblog
Theme URI: https://aiandblog.com
Author: aiandblog
Description: Custom block theme for aiandblog.com. Every template, header, footer, color and font is editable from Appearance > Editor without touching code.
Version: 1.0.8
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: aiandblog
Update URI: false
WPVibe: yes
*/

/* ---------- Header ---------- */
.ab-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--base);
}
.admin-bar .ab-site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ab-site-header { top: 0; position: relative; } }
.ab-logo { margin: 0; flex-shrink: 0; }
.ab-logo img { display: block; height: auto; }
/* Logo figure must not stretch to full width, or the menu gets squeezed into a vertical stack. */
.ab-site-header .wp-block-image.ab-logo { width: auto !important; max-width: 160px; flex: 0 0 auto; }
.ab-site-header .ab-logo a { display: block; }
.ab-site-header .wp-block-navigation { flex: 1 1 auto; min-width: 0; }
.ab-site-header .wp-block-navigation__container { flex-wrap: nowrap; gap: 1.5rem; }
/* A plugin injects ".size-full { width:100%; height:100% }", which stretches logo figures in the
   header and footer. Restore normal image sizing. */
figure.wp-block-image.size-full { height: auto; }
.ab-footer .wp-block-image.ab-logo { width: auto !important; }
/* Safety net: nothing may push the page wider than the screen. clip keeps the sticky header working. */
.wp-site-blocks { overflow-x: clip; }
.ab-site-header .wp-block-navigation a:hover { color: var(--wp--preset--color--indigo); }
.ab-site-header .wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--line) !important;
	border-radius: 12px;
	padding: 0.5rem;
	box-shadow: 0 12px 32px rgba(18, 21, 27, 0.08);
	min-width: 220px;
}
.ab-site-header .wp-block-navigation .wp-block-navigation__submenu-container a { padding: 0.45rem 0.6rem; border-radius: 8px; }
.ab-site-header .wp-block-navigation .wp-block-navigation__submenu-container a:hover { background: var(--wp--preset--color--fog); }
.ab-site-header .wp-block-search__button { background: transparent; color: var(--wp--preset--color--graphite); border: 0; }
.ab-site-header .ab-cta .wp-block-button__link { white-space: nowrap; }
@media (max-width: 600px) {
	.ab-site-header .wp-block-buttons > .wp-block-button.ab-cta { display: none; }
	.ab-site-header .alignwide.is-layout-flex { justify-content: flex-start; gap: 0.75rem; }
	.ab-site-header .ab-logo { margin-right: auto; }
	.ab-site-header .wp-block-navigation { order: 3; }
}

/* ---------- Reading progress line (articles) ---------- */
.ab-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1000; pointer-events: none; }
.ab-progress span { display: block; width: 100%; height: 100%; background: var(--wp--preset--color--indigo); transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.12s linear; will-change: transform; }
.admin-bar .ab-progress { top: 32px; }
@media (max-width: 782px) { .admin-bar .ab-progress { top: 46px; } }
@media (max-width: 600px) { .admin-bar .ab-progress { top: 0; } }
@media (prefers-reduced-motion: reduce) { .ab-progress span { transition: none; } }

/* ---------- Kickers, meta, cards ---------- */
.ab-kicker {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--indigo);
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
}
.ab-kicker::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--wp--preset--color--lime);
	box-shadow: 0 0 0 3px var(--wp--preset--color--graphite);
}
.ab-section-head { border-bottom: 2px solid var(--wp--preset--color--graphite); padding-bottom: 0.6rem; }
.ab-section-head h2 { margin: 0; }
.ab-section-head .ab-viewall { margin: 0; font-size: var(--wp--preset--font-size--small); font-weight: 600; }
.ab-section-head .ab-viewall a { text-decoration: none; }

.ab-cards .wp-block-post { display: flex; flex-direction: column; gap: 0.55rem; }
.ab-cards .wp-block-post-featured-image { margin: 0 0 0.35rem; overflow: hidden; }
.ab-cards .wp-block-post-featured-image img { transition: transform 0.35s ease; }
.ab-cards .wp-block-post:hover .wp-block-post-featured-image img { transform: scale(1.03); }
.ab-cards .wp-block-post-title { margin: 0; }
.ab-cards .wp-block-post-terms a:not(:first-of-type),
.ab-cards .wp-block-post-terms .wp-block-post-terms__separator { display: none; }
.ab-meta { color: var(--wp--preset--color--steel); }
.ab-meta > * { margin: 0 !important; }
.ab-meta > * + *::before { content: "·"; margin-right: 0.5rem; color: var(--wp--preset--color--steel); }

/* Branded placeholder when a post has no featured image */
.ab-cards .wp-block-post:not(:has(.wp-block-post-featured-image img))::before {
	content: "";
	display: block;
	aspect-ratio: 16 / 10;
	border-radius: 14px;
	background:
		radial-gradient(circle at 72% 50%, var(--wp--preset--color--indigo) 0 22%, transparent 22.5%),
		radial-gradient(circle at 38% 62%, var(--wp--preset--color--lime) 0 11%, transparent 11.5%),
		var(--wp--preset--color--graphite);
	margin-bottom: 0.35rem;
}

.ab-latest-list .wp-block-post { padding: 0.9rem 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.ab-latest-list .wp-block-post:first-child { padding-top: 0; }
.ab-latest-list .wp-block-post-title { margin: 0.25rem 0; }
.ab-latest-list .wp-block-post-terms a:not(:first-of-type),
.ab-latest-list .wp-block-post-terms .wp-block-post-terms__separator { display: none; }

/* ---------- Topic cards ---------- */
.ab-topic-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	padding: 1.25rem 1.25rem 1.1rem;
	height: 100%;
	transition: border-color 0.2s ease, transform 0.2s ease;
}
.ab-topic-card:hover { border-color: var(--wp--preset--color--indigo); transform: translateY(-2px); }
.ab-topic-card h3 { margin: 0 0 0.35rem; font-size: var(--wp--preset--font-size--large); }
.ab-topic-card h3 a { color: var(--wp--preset--color--graphite); text-decoration: none; }
.ab-topic-card h3 a::after { content: " →"; color: var(--wp--preset--color--indigo); }
.ab-topic-card p { margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--steel); line-height: 1.55; }

/* ---------- Article ---------- */
.ab-article-meta { color: var(--wp--preset--color--steel); }
.ab-article-meta .wp-block-avatar img { border-radius: 50%; display: block; }
.ab-article-meta > * { margin: 0 !important; }
.ab-article .wp-block-post-content > * { max-width: 100%; }
.ab-article .wp-block-post-content h2 { margin-top: 2.25rem; }
.ab-article .wp-block-post-content h3 { margin-top: 1.75rem; }
.ab-article .wp-block-post-content a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ab-article .wp-block-post-content img { border-radius: 12px; }
.ab-post-kicker a { text-decoration: none; font-size: var(--wp--preset--font-size--x-small); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.ab-tags a { display: inline-block; background: var(--wp--preset--color--fog); color: var(--wp--preset--color--graphite); padding: 0.3rem 0.7rem; border-radius: 999px; text-decoration: none; font-size: var(--wp--preset--font-size--x-small); margin: 0 0.25rem 0.35rem 0; }
.ab-tags .wp-block-post-terms__separator { display: none; }
.ab-author-box { border: 1px solid var(--wp--preset--color--line); border-radius: 16px; padding: 1.25rem; }
.ab-author-box .wp-block-avatar img { border-radius: 50%; }
/* Author photos are portrait: fill the round avatar and keep the face in frame. */
img.avatar { aspect-ratio: 1 / 1; height: auto; object-fit: cover; object-position: 50% 15%; }
.wp-block-avatar { flex-shrink: 0; }
.ab-profile-photo img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; }
.ab-author-box .wp-block-post-author-biography { color: var(--wp--preset--color--steel); font-size: var(--wp--preset--font-size--small); margin-top: 0.25rem; }
.ab-author-box > .wp-block-group { flex: 1 1 auto; min-width: 0; }
.ab-author-box .ab-author-head { gap: 0.75rem; }
.ab-author-box .ab-author-social { margin: 0; }
.ab-sidebar { position: sticky; top: 96px; }
.ab-sidebar .wp-block-categories, .ab-sidebar .wp-block-latest-posts { padding-left: 0; list-style: none; margin: 0; }
.ab-sidebar .wp-block-categories li, .ab-sidebar .wp-block-latest-posts li { padding: 0.55rem 0; border-bottom: 1px solid var(--wp--preset--color--line); font-size: var(--wp--preset--font-size--small); }
.ab-sidebar a { text-decoration: none; color: var(--wp--preset--color--graphite); }
.ab-sidebar a:hover { color: var(--wp--preset--color--indigo); }
.ab-sidebar h2 { font-size: var(--wp--preset--font-size--small); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.5rem; }
@media (max-width: 781px) { .ab-sidebar { position: static; } }

/* ---------- Block style options (picked from the editor sidebar) ---------- */
.is-style-ab-card { background: var(--wp--preset--color--base); border: 1px solid var(--wp--preset--color--line); border-radius: 16px; padding: 1.5rem; }
.is-style-ab-callout { background: #EEF0FF; border-left: 4px solid var(--wp--preset--color--indigo); border-radius: 12px; padding: 1.25rem 1.5rem; }
.is-style-ab-highlight { background: #F3FBDF; border: 1px solid #DCEFAE; border-radius: 12px; padding: 1.25rem 1.5rem; }
.is-style-ab-dark { background: var(--wp--preset--color--graphite); color: var(--wp--preset--color--base); border-radius: 16px; padding: 1.75rem; }
.is-style-ab-dark a { color: var(--wp--preset--color--lime); }
.is-style-ab-dark h2, .is-style-ab-dark h3, .is-style-ab-dark h4 { color: var(--wp--preset--color--base); }
.is-style-ab-callout > *:first-child, .is-style-ab-highlight > *:first-child, .is-style-ab-card > *:first-child { margin-top: 0; }
.is-style-ab-callout > *:last-child, .is-style-ab-highlight > *:last-child, .is-style-ab-card > *:last-child { margin-bottom: 0; }
ul.is-style-ab-checklist { list-style: none; padding-left: 0; }
ul.is-style-ab-checklist li { position: relative; padding-left: 1.75rem; margin-bottom: 0.4rem; }
ul.is-style-ab-checklist li::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 1rem; height: 1rem; border-radius: 50%; background: var(--wp--preset--color--indigo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.is-style-ab-framed img { border: 1px solid var(--wp--preset--color--line); padding: 6px; background: var(--wp--preset--color--base); }

/* FAQ (details block) */
.wp-block-details summary { font-family: var(--wp--preset--font-family--heading); font-weight: 700; cursor: pointer; }
.wp-block-details[open] summary { margin-bottom: 0.5rem; }

/* Tables inside articles */
.wp-block-table table { border-collapse: collapse; }
.wp-block-table th { background: var(--wp--preset--color--fog); text-align: left; }
.wp-block-table td, .wp-block-table th { border: 1px solid var(--wp--preset--color--line); padding: 0.6rem 0.75rem; }
/* Phones: wide tables scroll sideways inside their own box instead of breaking words letter by letter. */
@media (max-width: 640px) {
	.wp-block-table { font-size: 0.9em; }
	.wp-block-table table { table-layout: auto !important; width: max-content !important; min-width: 100%; }
	.wp-block-table td, .wp-block-table th { min-width: 7.5rem; max-width: 15rem; word-break: normal; overflow-wrap: normal; }
}

/* ---------- Archive / search ---------- */
.ab-archive-hero .wp-block-term-description { color: var(--wp--preset--color--steel); max-width: 680px; }
.wp-block-query-pagination { font-weight: 600; }
.wp-block-query-pagination a { text-decoration: none; }
.wp-block-query-pagination-numbers .page-numbers { padding: 0.35rem 0.7rem; border-radius: 8px; }
.wp-block-query-pagination-numbers .current { background: var(--wp--preset--color--graphite); color: var(--wp--preset--color--base); }

/* ---------- Footer ---------- */
.ab-footer .ab-muted { color: #BFC6D2; font-size: var(--wp--preset--font-size--small); }
.ab-footer h2 { color: var(--wp--preset--color--base); font-size: var(--wp--preset--font-size--x-small); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 0.75rem; }
.ab-footer .wp-block-navigation { font-size: var(--wp--preset--font-size--small); font-weight: 400; gap: 0.55rem; }
.ab-footer .wp-block-navigation a:hover { color: var(--wp--preset--color--lime); }
.ab-footer .ab-bottom p { margin: 0; color: #BFC6D2; font-size: var(--wp--preset--font-size--x-small); }
.ab-footer .ab-bottom a { color: var(--wp--preset--color--base); }
.ab-footer hr { border-color: #2B303A; opacity: 1; }

/* ---------- Trust band ---------- */
.ab-trust h3 { color: var(--wp--preset--color--lime); font-size: var(--wp--preset--font-size--large); margin-bottom: 0.35rem; }
.ab-trust p { color: #CDD3DE; font-size: var(--wp--preset--font-size--small); }
.ab-trust a { color: var(--wp--preset--color--lime); }
.ab-trust h2 { color: var(--wp--preset--color--base); }
.ab-trust .ab-kicker { color: var(--wp--preset--color--lime); font-size: var(--wp--preset--font-size--x-small); }

.ab-empty { color: var(--wp--preset--color--steel); font-size: var(--wp--preset--font-size--small); }

/* ---------- Layout & responsive grid ---------- */
.wp-site-blocks > main, .wp-site-blocks > footer { margin-block-start: 0; }
.ab-hero-title { max-width: 18ch; margin-top: 0.5rem; }
.ab-hero-dek { color: var(--wp--preset--color--steel); max-width: 60ch; }
.ab-list-title { text-transform: uppercase; letter-spacing: 0.12em; border-bottom: 2px solid var(--wp--preset--color--graphite); padding-bottom: 0.5rem; }
.ab-lead .wp-block-post-title { margin-top: 0.25rem; }
@media (max-width: 1024px) {
	.ab-cards .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
	.ab-cards .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr !important; }
	.ab-hero-title { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
	.ab-cards .wp-block-post-featured-image img, .ab-topic-card { transition: none; }
}
