/*
Theme Name: SadatHub Blocks
Theme URI: https://sadathub.com
Author: SadatHub
Description: Block theme (Site Editor) version of the SadatHub theme. Edit every section from Appearance > Editor. Includes Home, Blog, Contact Us, sidebar, comments, night mode and a loading circle.
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.8
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: sadathub-blocks
*/


/* ============ Design tokens ============ */
:root {
	color-scheme: light;
	--bg: #f4f7f6;
	--surface: #ffffff;
	--surface-2: #eaf1f0;
	--ink: #11252c;
	--muted: #52666d;
	--line: #d8e2e2;
	--accent: #0b7a85;
	--accent-hover: #095e67;
	--accent-ink: #ffffff;
	--mark: #f3b93e;
	--shadow: 0 1px 2px rgba(17, 37, 44, .06), 0 8px 24px rgba(17, 37, 44, .06);
	--radius: 14px;
	--font-head: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
	--font-body: 'Public Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0c1418;
	--surface: #142026;
	--surface-2: #1a2a31;
	--ink: #e6eeee;
	--muted: #97aab0;
	--line: #243339;
	--accent: #52c4cd;
	--accent-hover: #7bd6dd;
	--accent-ink: #06191c;
	--mark: #e8b04a;
	--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
}

/* Topic colours (mid-tones that work on both modes) */
.tag-announcements, .topic-announcements { --t: #e0576b; }
.tag-ai-artificial-intelligence, .topic-ai-artificial-intelligence { --t: #8274f2; }
.tag-current-affairs, .topic-current-affairs { --t: #2fa36b; }
.tag-tips-tricks, .topic-tips-tricks { --t: #d99a1e; }
.tag-health-wellness, .topic-health-wellness { --t: #1fa3b0; }

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1.0625rem;
	line-height: 1.65;
	transition: background-color .25s ease, color .25s ease;
}
img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 {
	font-family: var(--font-head);
	line-height: 1.12;
	letter-spacing: -.02em;
	margin: 0 0 .5em;
	font-weight: 700;
}
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--bg); padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.wrap-wide { width: min(1000px, 100% - 2.5rem); margin-inline: auto; }
.wrap-narrow { width: min(720px, 100% - 2.5rem); margin-inline: auto; }

/* ============ Buttons ============ */
.btn, .wp-block-button__link, .comment-form .submit, .search button {
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--accent); color: var(--accent-ink);
	border: 2px solid var(--accent); border-radius: 999px;
	padding: .75rem 1.5rem; font: 600 1rem/1 var(--font-body);
	text-decoration: none; cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}
.btn:hover, .comment-form .submit:hover, .search button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }
.btn-small { padding: .6rem 1.1rem; font-size: .9rem; }

.read-more { font-weight: 600; text-decoration: none; }
.read-more::after { content: ' \2192'; }
.read-more:hover { text-decoration: underline; }

/* ============ Header ============ */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: var(--bg);
	background: color-mix(in srgb, var(--bg) 90%, transparent);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand-link { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-link:hover { color: var(--ink); }
.brand-mark {
	display: grid; place-items: center; width: 34px; height: 34px;
	background: var(--mark); color: #11252c; border-radius: 10px;
	font: 800 1.1rem/1 var(--font-head);
}
.brand-name { font: 800 1.3rem/1 var(--font-head); letter-spacing: -.02em; }
.custom-logo { max-height: 44px; width: auto; }

.primary-nav { margin-left: auto; }
.menu, .menu ul { list-style: none; margin: 0; padding: 0; }
.menu { display: flex; align-items: center; gap: .25rem; }
.menu > li { position: relative; }
.menu a { display: block; padding: .55rem .9rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .98rem; border-radius: 8px; }
.menu a:hover, .menu .current-menu-item > a, .menu .current_page_item > a { background: var(--surface-2); color: var(--ink); }
.menu-item-has-children > a::after { content: ''; display: inline-block; width: .42em; height: .42em; margin-left: .5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-.2em) rotate(45deg); }
.sub-menu {
	position: absolute; left: 0; top: 100%; min-width: 230px; padding: .4rem;
	background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.menu li:hover > .sub-menu, .menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }

.bar-actions { display: flex; align-items: center; gap: .6rem; }
.mode-btn {
	display: inline-flex; align-items: center; gap: .5rem;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line); border-radius: 999px;
	padding: .5rem .9rem; font: 600 .88rem/1 var(--font-body); cursor: pointer;
	transition: background-color .2s ease, border-color .2s ease;
}
.mode-btn:hover { border-color: var(--muted); }
.mode-btn .icon-sun, .mode-label-day { display: none; }
html[data-theme="dark"] .mode-btn .icon-sun, html[data-theme="dark"] .mode-label-day { display: inline-block; }
html[data-theme="dark"] .mode-btn .icon-moon, html[data-theme="dark"] .mode-label-night { display: none; }

.menu-btn { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; width: 44px; height: 44px; cursor: pointer; margin-left: auto; position: relative; }
.menu-btn-bars, .menu-btn-bars::before, .menu-btn-bars::after { position: absolute; left: 12px; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; content: ''; }
.menu-btn-bars { top: 21px; }
.menu-btn-bars::before { left: 0; top: -6px; }
.menu-btn-bars::after { left: 0; top: 6px; }

/* ============ Hero ============ */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; margin-bottom: .4em; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

.hero-feature { position: relative; isolation: isolate; }
.hero-feature::before {
	content: ''; position: absolute; inset: 1.4rem -1rem -1rem 1.6rem; z-index: -1;
	background: var(--mark); border-radius: 22px; opacity: .9;
}
.hero-feature-media { display: block; border-radius: 18px 18px 0 0; overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 9; }
.hero-feature-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-feature-body { background: var(--surface); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 18px 18px; padding: 1.3rem 1.5rem 1.5rem; }
.hero-feature-body h2 { font-size: 1.5rem; margin: .5rem 0 .5rem; }
.hero-feature-body h2 a { color: var(--ink); text-decoration: none; }
.hero-feature-body h2 a:hover { text-decoration: underline; }
.hero-feature-body p { color: var(--muted); font-size: 1rem; }

/* ============ Sections ============ */
.section { padding: clamp(2.2rem, 5vw, 4rem) 0; }
.section-tight { padding-top: 1.5rem; }
.section-head { margin-bottom: 1.6rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: .2em; }
.section-head p { color: var(--muted); margin: 0; }
.section-head-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.page-head { padding: clamp(2.2rem, 5vw, 4rem) 0 1rem; }
.page-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: .3em; }
.page-head .lede { margin-bottom: 1.4rem; }

/* Topics */
.topics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.topic a {
	display: flex; flex-direction: column; gap: .2rem; height: 100%;
	padding: 1rem 1.1rem; text-decoration: none; color: var(--ink);
	background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--t, var(--accent));
	border-radius: 6px 12px 12px 6px;
	transition: background-color .2s ease, border-color .2s ease;
}
.topic a:hover { background: var(--surface-2); color: var(--ink); }
.topic-name { font: 700 1.05rem/1.25 var(--font-head); }
.topic-note { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.topic-count { margin-top: auto; padding-top: .6rem; font-size: .85rem; font-weight: 600; color: var(--t, var(--accent)); }

/* Category tag */
.tag { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.tag::before { content: ''; width: .6rem; height: .6rem; border-radius: 50%; background: var(--t, var(--accent)); }
.tag:hover { color: var(--ink); }

.meta { color: var(--muted); font-size: .88rem; margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.meta-sep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }

/* ============ Post grid + cards ============ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-media { display: block; aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem 1.25rem 1.3rem; flex: 1; }
.card-title { font-size: 1.2rem; line-height: 1.25; margin: 0; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.card .meta { margin-top: auto; padding-top: .3rem; }

.lead-post { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center; margin-bottom: 2.4rem; padding-bottom: 2.4rem; border-bottom: 1px solid var(--line); }
.lead-post-media { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); }
.lead-post-media img { width: 100%; height: 100%; object-fit: cover; }
.lead-post-body h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin: .5rem 0; }
.lead-post-body h2 a { color: var(--ink); text-decoration: none; }
.lead-post-body h2 a:hover { text-decoration: underline; }
.lead-post-body p { color: var(--muted); }
.lead-post-body .meta { margin-top: .8rem; }

/* Filters + search */
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 600; }
.chip[class*="topic-"]::before { content: ''; width: .55rem; height: .55rem; border-radius: 50%; background: var(--t); }
.chip:hover { background: var(--surface-2); color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.search { display: flex; gap: .5rem; }
.search input[type="search"] { min-width: 220px; }
.search button { padding: .65rem 1.1rem; font-size: .92rem; }

/* Pagination */
.pagination { margin-top: 2.6rem; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.page-numbers { display: inline-flex; padding: .55rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; }
.page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
a.page-numbers:hover { background: var(--surface-2); color: var(--ink); }
.empty { color: var(--muted); font-size: 1.1rem; padding: 2rem 0; }

/* ============ Single post ============ */
.article-head { padding: clamp(2rem, 5vw, 3.5rem) 0 1.4rem; }
.article-head h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin: .5rem 0 .8rem; }
.article-image { margin-bottom: 2.2rem; }
.article-image img { width: 100%; border-radius: var(--radius); }
.entry-content { font-size: 1.125rem; line-height: 1.75; }
.entry-content > * { margin-top: 0; margin-bottom: 1.3em; }
.entry-content h2 { font-size: 1.8rem; margin-top: 2em; }
.entry-content h3 { font-size: 1.4rem; margin-top: 1.7em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content img { border-radius: 10px; }
.entry-content blockquote { margin-left: 0; padding: .4rem 0 .4rem 1.3rem; border-left: 4px solid var(--mark); font-size: 1.2rem; color: var(--muted); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .98rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: .6rem .8rem; text-align: left; }
.entry-content th { background: var(--surface-2); }
.entry-content pre { overflow: auto; padding: 1rem; background: var(--surface-2); border-radius: 10px; font-size: .92rem; }
.entry-content figure { margin-inline: 0; }
.entry-content figcaption, .wp-caption-text { color: var(--muted); font-size: .9rem; margin-top: .5rem; }
.alignwide { width: min(1000px, 100vw - 2.5rem); margin-left: 50%; transform: translateX(-50%); }
.post-tags a { display: inline-block; margin: 0 .4rem .4rem 0; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; color: var(--muted); text-decoration: none; }
.post-tags a:hover { background: var(--surface-2); }
.article-foot { margin-top: 2rem; }

/* Comments */
.comments-wrap { padding: 2rem 0 3rem; }
.comments-title, .comment-reply-title { font-size: 1.5rem; }
.comment-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.comment-list .children { list-style: none; padding-left: 1.5rem; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-meta { font-size: .9rem; color: var(--muted); }
.comment-author img { display: inline-block; border-radius: 50%; margin-right: .6rem; vertical-align: middle; }
.comment-form label { display: block; font-weight: 600; margin-bottom: .3rem; }

/* ============ Forms ============ */
input[type="text"], input[type="email"], input[type="search"], input[type="url"], select, textarea {
	width: 100%; padding: .75rem .95rem;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line); border-radius: 10px;
	font: inherit; font-size: 1rem;
	transition: border-color .2s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 0; }
::placeholder { color: var(--muted); opacity: .8; }

/* ============ Contact ============ */
.contact-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.3rem, 3vw, 2.2rem); }
.contact-intro { margin-bottom: 1.5rem; }
.field { margin-bottom: 1.2rem; }
.field label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .95rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.notice { padding: .9rem 1.1rem; border-radius: 10px; margin-bottom: 1.4rem; border: 1px solid; font-size: .98rem; }
.notice-ok { background: rgba(47, 163, 107, .12); border-color: #2fa36b; }
.notice-error { background: rgba(224, 87, 107, .12); border-color: #e0576b; }
.contact-side h2 { font-size: 1.4rem; }
.contact-links { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .7rem; }
.contact-links a { display: flex; flex-direction: column; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; }
.contact-links a:hover { background: var(--surface-2); color: var(--ink); }
.contact-links small { color: var(--muted); font-weight: 400; font-size: .85rem; word-break: break-all; }
.side-note { color: var(--muted); font-size: .95rem; }

/* ============ Newsletter ============ */
.newsletter-wrap { padding: 1rem 0 clamp(2.5rem, 5vw, 4rem); }
.newsletter { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 22px; padding: clamp(1.5rem, 4vw, 3rem); }
.newsletter h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: .3em; }
.newsletter p { color: var(--muted); margin: 0; }
.newsletter-form input[type="email"], .newsletter-form input[type="text"] { margin-bottom: .6rem; }
.newsletter-form button, .newsletter-form .wp-block-button__link { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); border-radius: 999px; padding: .75rem 1.5rem; font: 600 1rem/1 var(--font-body); cursor: pointer; }
.newsletter-form .wp-block-jetpack-subscriptions__container, .newsletter-form form { margin: 0; }

/* ============ Footer ============ */
.site-footer { border-top: 1px solid var(--line); padding-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2.5rem; padding-bottom: 2.5rem; }
.footer-about p { color: var(--muted); max-width: 34em; margin-top: 1rem; }
.footer-col h3 { font-size: 1.05rem; margin-bottom: .8rem; }
.footer-col ul, .social { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: .45rem; }
.footer-col a { color: var(--ink); text-decoration: none; }
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-links { margin-top: 1rem !important; }
.social { display: flex; flex-wrap: wrap; gap: .5rem; }
.social a { display: inline-block; padding: .4rem .9rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 600; background: var(--surface); }
.social a:hover { background: var(--surface-2); }
.footer-bottom { border-top: 1px solid var(--line); padding: 1.3rem 0 2rem; color: var(--muted); font-size: .92rem; }
.footer-bottom p { margin: 0; }

/* Dark mode image comfort */
html[data-theme="dark"] .card-media img,
html[data-theme="dark"] .hero-feature-media img,
html[data-theme="dark"] .lead-post-media img,
html[data-theme="dark"] .article-image img,
html[data-theme="dark"] .entry-content img { filter: brightness(.93); }

/* ============ Responsive ============ */
@media (max-width: 1020px) {
	.grid { grid-template-columns: repeat(2, 1fr); }
	.topics { grid-template-columns: repeat(3, 1fr); }
	.hero-grid { grid-template-columns: 1fr; }
	.hero-feature { max-width: 620px; }
	.lead-post { grid-template-columns: 1fr; }
	.newsletter { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
	.menu-btn { display: block; }
	.bar { flex-wrap: wrap; gap: .5rem 1rem; padding: .6rem 0; }
	.bar-actions { order: 2; margin-left: 0; }
	.bar .brand { margin-right: auto; }
	.menu-btn { margin-left: 0; }
	.primary-nav { order: 3; flex-basis: 100%; margin-left: 0; display: none; }
	.primary-nav.is-open { display: block; padding-bottom: .6rem; }
	.menu { flex-direction: column; align-items: stretch; }
	.sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; background: transparent; padding: 0 0 0 1rem; }
	.menu-item-has-children > a::after { display: none; }
	.contact-grid { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-about { grid-column: 1 / -1; }
	.mode-label { display: none !important; }
	.mode-btn { padding: .6rem; }
}
@media (max-width: 600px) {
	.grid { grid-template-columns: 1fr; }
	.topics { grid-template-columns: 1fr 1fr; }
	.field-row { grid-template-columns: 1fr; }
	.search { width: 100%; }
	.search input[type="search"] { min-width: 0; flex: 1; }
	.bar-actions .btn-small { display: none; }
	.hero-feature::before { inset: 1rem -.4rem -.6rem 1rem; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}

/* ============ Blog layout + sidebar ============ */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.grid.grid-two { grid-template-columns: repeat(2, 1fr); }
.layout .lead-post { grid-template-columns: 1fr; gap: 1.2rem; }

.sidebar { display: grid; gap: 1.5rem; position: sticky; top: 90px; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.25rem; }
.widget h2 { font-size: 1.1rem; margin-bottom: .9rem; }
.widget .search input[type="search"] { min-width: 0; flex: 1; }
.widget .search button { flex: none; }

.cat-list, .mini-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.cat-list li:last-child a { border-bottom: 0; }
.cat-list a::before { content: ''; width: .6rem; height: .6rem; border-radius: 50%; background: var(--t, var(--accent)); flex: none; }
.cat-list a:hover { color: var(--accent); }
.cat-list .count { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .88rem; }

.mini-list { display: grid; gap: 1rem; }
.mini-list a { display: grid; grid-template-columns: 76px 1fr; gap: .8rem; align-items: center; text-decoration: none; color: var(--ink); }
.mini-thumb { display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-text b { display: block; font: 700 .95rem/1.3 var(--font-head); }
.mini-text small { color: var(--muted); font-size: .82rem; }
.mini-list a:hover b { text-decoration: underline; }

@media (max-width: 1020px) {
	.layout { grid-template-columns: 1fr; }
	.sidebar { position: static; }
}
@media (max-width: 600px) {
	.grid.grid-two { grid-template-columns: 1fr; }
}

/* ============ Single post layout, sidebar extras, comments ============ */
.single-layout { padding-top: clamp(2rem, 5vw, 3rem); padding-bottom: 3rem; }
.single-layout .article-head { padding: 0 0 1.2rem; }
.single-layout .article-image { margin: 0 0 2rem; }
.meta-link { color: inherit; }
.widget-note { color: var(--muted); font-size: .9rem; margin: -.4rem 0 .9rem; }
.cat-list .is-current a { color: var(--accent); font-weight: 700; }
.comment-count { margin: 0 0 .8rem; color: var(--muted); }
.comment-count strong { color: var(--ink); }
.mini-comments { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .7rem; }
.mini-comments li { padding: .6rem .8rem; background: var(--surface-2); border-radius: 10px; font-size: .9rem; line-height: 1.4; }
.mini-comments b { display: block; font-size: .9rem; }
.mini-comments span { color: var(--muted); }

.comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.no-comments { color: var(--muted); }
.comment-respond { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.2rem, 3vw, 1.8rem); }
.comment-form p { margin-bottom: 1rem; }
.comment-form-cookies-consent { display: flex; gap: .5rem; align-items: center; }
.comment-form-cookies-consent input { width: auto; }
.comment-form-cookies-consent label { margin: 0 !important; font-weight: 400 !important; }
.comment-notes { color: var(--muted); font-size: .9rem; }

/* ============ Footer: only the copyright line is centred ============ */
.footer-bottom { text-align: center; }
.footer-grid-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ============ Home: small topic tags above the headline ============ */
.hero-tags { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
.hero-tags li + li::before { content: '\00b7'; margin-right: .5rem; opacity: .7; }

/* ============ Social icons ============ */
.social a { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.social a:hover { color: var(--bc, var(--accent)); border-color: var(--bc, var(--accent)); }
.social-facebook { --bc: #1877f2; }
.social-instagram { --bc: #e4405f; }
.social-whatsapp { --bc: #25d366; }

/* ============ Home: About inside the subscribe box (columns) ============ */
.newsletter-home { row-gap: 1rem; }
.newsletter-home .newsletter-about { grid-row: 1 / 3; }
.newsletter-home .newsletter-text { grid-column: 2; grid-row: 1; align-self: end; }
.newsletter-home .newsletter-form { grid-column: 2; grid-row: 2; align-self: start; }
.newsletter-about p { color: var(--muted); margin: .8rem 0 1rem; max-width: 34em; }
@media (max-width: 1020px) {
	.newsletter-home .newsletter-about, .newsletter-home .newsletter-text, .newsletter-home .newsletter-form { grid-column: auto; grid-row: auto; }
}

/* ============ Preloader (simple circle) ============ */
#preloader { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; background: var(--bg); transition: opacity .4s ease, visibility .4s ease; animation: sh-pl-out .4s ease 2.5s forwards; }
#preloader.is-done { opacity: 0; visibility: hidden; }
.preloader-ring { width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: sh-spin .8s linear infinite; }
@keyframes sh-spin { to { transform: rotate(360deg); } }
@keyframes sh-pl-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .preloader-ring { animation-duration: 2.4s; } }

/* ============ WordPress core helper class (hides "Posts pagination" etc.) ============ */
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }


/* Form coming from the page editor (Jetpack etc.) */
.contact-page-form > *:last-child { margin-bottom: 0; }
.contact-page-form label, .contact-page-form .grunion-field-label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.contact-page-form .grunion-field-wrap, .contact-page-form .wp-block-jetpack-contact-form > * { margin-bottom: 1.2rem; }
.contact-page-form input[type="submit"], .contact-page-form button[type="submit"] { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); border-radius: 999px; padding: .75rem 1.5rem; font: 600 1rem/1 var(--font-body); cursor: pointer; }
.contact-page-form .sharedaddy, .contact-page-form .sd-sharing-enabled { display: none; }


/* =====================================================================
   BLOCK THEME ADJUSTMENTS
   ===================================================================== */
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * { margin-block-start: 0; }
.wp-block-group { margin: 0; }
.site-main { display: block; }
:where(.wp-site-blocks) h1, :where(.wp-site-blocks) h2, :where(.wp-site-blocks) h3 { margin-top: 0; }

/* Night mode: flip the editor palette too, so blocks coloured in the editor follow */
html[data-theme="dark"], html[data-theme="dark"] body {
	--wp--preset--color--base: #0c1418;
	--wp--preset--color--surface: #142026;
	--wp--preset--color--surface-2: #1a2a31;
	--wp--preset--color--contrast: #e6eeee;
	--wp--preset--color--muted: #97aab0;
	--wp--preset--color--line: #243339;
	--wp--preset--color--accent: #52c4cd;
	--wp--preset--color--accent-ink: #06191c;
	--wp--preset--color--mark: #e8b04a;
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { display: flex; align-items: center; gap: .6rem; }
.brand .wp-block-site-title { margin: 0; font: 800 1.3rem/1 var(--font-head); letter-spacing: -.02em; }
.brand .wp-block-site-title a { color: var(--ink); text-decoration: none; }
.brand .wp-block-html, .brand p { margin: 0; }
.site-header .wp-block-navigation { margin-left: auto; }
.wp-block-navigation .wp-block-navigation-item__content { padding: .55rem .9rem; font-weight: 600; font-size: .98rem; color: var(--ink); border-radius: 8px; text-decoration: none; }
.wp-block-navigation .wp-block-navigation-item__content:hover { background: var(--surface-2); color: var(--ink); }
.wp-block-navigation .wp-block-navigation__submenu-container { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; border-radius: 12px; padding: .4rem; box-shadow: var(--shadow); min-width: 230px; }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--bg) !important; color: var(--ink) !important; }
.wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { color: var(--ink); }
.bar-actions { display: flex; align-items: center; gap: .6rem; }
.bar-actions .wp-block-buttons { margin: 0; }
.bar-actions .wp-block-button__link { padding: .6rem 1.1rem; font-size: .9rem; }
.bar-actions .wp-block-html { margin: 0; }

/* Buttons (core button block) */
.wp-block-button__link { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); padding: .75rem 1.5rem; font: 600 1rem/1 var(--font-body); text-decoration: none; }
.wp-block-button__link:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--ink); border-color: var(--line); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--surface-2); border-color: var(--muted); }
.wp-block-buttons.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.btn-small { padding: .6rem 1.1rem !important; font-size: .9rem !important; }

/* Hero */
.hero-copy .hero-tags { margin: 0 0 1rem; color: var(--muted); font-size: .85rem; font-weight: 600; }
.hero-copy h1 { font-size: clamp(2.4rem, 5.4vw, 4.4rem); font-weight: 800; letter-spacing: -.035em; margin: 0 0 .4em; }
.hero-copy .lede { margin: 0; }
.hero-feature .wp-block-post-template { list-style: none; margin: 0; padding: 0; }
.hero-feature .wp-block-post-template > li { margin: 0; }
.hero-feature .hero-feature-media { margin: 0; border-radius: 18px 18px 0 0; overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 9; }
.hero-feature .hero-feature-media a { display: block; height: 100%; }
.hero-feature .hero-feature-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-feature-body h2 { font-size: 1.5rem; margin: .5rem 0 .5rem; }
.hero-feature-body h2 a, .lead-post-body h2 a { color: var(--ink); text-decoration: none; }
.hero-feature-body .wp-block-post-excerpt { color: var(--muted); font-size: 1rem; }
.hero-feature-body .wp-block-post-excerpt__excerpt { margin: 0 0 1em; }

/* Sections */
.section-head h2 { margin-bottom: .2em; }
.section-head p { margin: 0; }
.section-head-row { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head-row p { margin: 0; }

/* Cards made with the Query Loop (home page) */
.cards.wp-block-post-template { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.cards.wp-block-post-template > li { margin: 0; display: flex; }
.cards .card { width: 100%; }
.card .card-media.wp-block-post-featured-image { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card .card-media a { display: block; height: 100%; }
.card .card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .card-title { font-size: 1.2rem; line-height: 1.25; margin: 0; }
.card .card-title a { color: var(--ink); text-decoration: none; }
.card .card-title a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.card .card-body .tag { align-self: flex-start; }

/* Page title blocks */
.page-head h1, .page-head .wp-block-query-title { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; margin: 0 0 .3em; }
.page-head .wp-block-term-description { color: var(--muted); font-size: 1.2rem; }

/* Sidebar widgets made with blocks */
.sidebar { display: grid; gap: 1.5rem; position: sticky; top: 90px; align-self: start; }
.widget .wp-block-search__inside-wrapper { display: flex; gap: .5rem; }
.widget .wp-block-search__input { flex: 1; min-width: 0; padding: .65rem .9rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: 1rem; }
.widget .wp-block-search__button { flex: none; margin: 0; background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); border-radius: 999px; padding: .6rem 1.1rem; font: 600 .92rem/1 var(--font-body); cursor: pointer; }
.widget .wp-block-search__button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.mini-posts.wp-block-latest-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.mini-posts li { display: grid; grid-template-columns: 76px 1fr; column-gap: .8rem; align-items: center; margin: 0; }
.mini-posts .wp-block-latest-posts__featured-image { grid-row: 1 / 3; margin: 0; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.mini-posts .wp-block-latest-posts__featured-image img { width: 100%; height: 100%; object-fit: cover; }
.mini-posts li > a { font: 700 .95rem/1.3 var(--font-head); color: var(--ink); text-decoration: none; align-self: end; }
.mini-posts li > a:hover { text-decoration: underline; }
.mini-posts .wp-block-latest-posts__post-date { color: var(--muted); font-size: .82rem; align-self: start; }

/* Single post */
.article .article-head h1, .article-head .wp-block-post-title { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; margin: .5rem 0 .8rem; }
.article .article-image { margin: 0 0 2rem; }
.article .article-image img { width: 100%; height: auto; border-radius: var(--radius); }
.article .post-tags a { display: inline-block; margin: 0 .4rem .4rem 0; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; color: var(--muted); text-decoration: none; }
.article .entry-content { max-width: none; }
.entry-content > * { margin-block-start: 0; margin-block-end: 1.3em; }

/* Comments (block version) */
.comments-wrap { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.wp-block-comments-title { font-size: 1.5rem; margin: 0 0 1rem; }
.comment-item { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-item .wp-block-comment-author-name { font-weight: 700; margin: 0; }
.comment-item .wp-block-comment-date { color: var(--muted); font-size: .88rem; margin: 0 0 .4rem; }
.wp-block-post-comments-form { margin-top: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.2rem, 3vw, 1.8rem); }
.wp-block-post-comments-form .comment-reply-title { font: 700 1.5rem/1.2 var(--font-head); margin: 0 0 1rem; }
.wp-block-post-comments-form label { display: block; font-weight: 600; margin-bottom: .3rem; }
.wp-block-post-comments-form p { margin-bottom: 1rem; }
.wp-block-post-comments-form .form-submit .wp-block-button__link, .wp-block-post-comments-form input[type="submit"] { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); border-radius: 999px; padding: .75rem 1.5rem; font: 600 1rem/1 var(--font-body); cursor: pointer; }
.wp-block-comments-pagination { display: flex; gap: .6rem; margin-bottom: 1.5rem; }

/* Contact page side list made of paragraphs */
.contact-link { margin: 0 0 .7rem; }
.contact-link a { display: block; padding: .9rem 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); font-weight: 700; text-decoration: none; }
.contact-link a:hover { background: var(--surface-2); }
.contact-side .side-note { color: var(--muted); font-size: .95rem; }

/* Footer built with blocks */
.site-footer { border-top: 1px solid var(--line); padding-top: 3rem; }
.footer-col .wp-block-navigation { margin: 0; }
.footer-col .wp-block-navigation__container { flex-direction: column; align-items: flex-start; gap: .45rem; }
.footer-col .wp-block-navigation .wp-block-navigation-item__content { padding: 0; font-weight: 400; font-size: 1.0625rem; }
.footer-col .wp-block-navigation .wp-block-navigation-item__content:hover { background: none; color: var(--accent); text-decoration: underline; }
.footer-archives { list-style: none; margin: 0; padding: 0; }
.footer-archives li { margin-bottom: .45rem; }
.footer-archives a, .footer-links a { color: var(--ink); text-decoration: none; }
.footer-archives a:hover, .footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-links { margin-top: 1rem; }
.footer-about p, .newsletter-about p { margin: .8rem 0 1rem; color: var(--muted); max-width: 34em; }
.footer-bottom p { margin: 0; text-align: center; }

/* Social icons (core social-links block) */
.social.wp-block-social-links { gap: .5rem; margin: 0; padding: 0; }
.social .wp-social-link { margin: 0; background: var(--surface) !important; border: 1px solid var(--line); border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; }
.social .wp-social-link a { padding: 0; display: grid; place-items: center; color: var(--ink); }
.social .wp-social-link svg { width: 20px; height: 20px; }
.social .wp-social-link-facebook:hover { color: #1877f2; border-color: #1877f2; }
.social .wp-social-link-instagram:hover { color: #e4405f; border-color: #e4405f; }
.social .wp-social-link-whatsapp:hover { color: #25d366; border-color: #25d366; }
.social .wp-social-link:hover a { color: inherit; }

/* Email box: Jetpack subscribe block look */
.newsletter-form .wp-block-jetpack-subscriptions__container, .newsletter-form form { margin: 0; }
.newsletter-form input[type="email"], .newsletter-form input[type="text"] { width: 100%; padding: .75rem .95rem; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; font: inherit; margin-bottom: .6rem; }
.newsletter-form button, .newsletter-form .wp-block-button__link { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--accent); border-radius: 999px; padding: .75rem 1.5rem; font: 600 1rem/1 var(--font-body); cursor: pointer; }
.newsletter-text h2 { margin: 0 0 .3em; }
.newsletter-text p { margin: 0; }

@media (max-width: 1020px) {
	.cards.wp-block-post-template { grid-template-columns: repeat(2, 1fr); }
	.sidebar { position: static; }
}
@media (max-width: 600px) {
	.cards.wp-block-post-template { grid-template-columns: 1fr; }
	.bar-actions .wp-block-buttons { display: none; }
}
