/* ==========================================================================
   Alhoussainy Glass — main stylesheet (RTL first)
   ========================================================================== */

:root {
	--gold: #d4a944;
	--green: #1fae7a;
	--radius: 22px;
	--radius-sm: 14px;
	--container: 1240px;
	--font-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
	--font-head: "Reem Kufi", "IBM Plex Sans Arabic", sans-serif;
	--ease: cubic-bezier(.2, .7, .2, 1);
	--header-h: 72px;
}

html[data-mode="dark"] {
	--bg: #0a0e0c;
	--bg-2: #101713;
	--text: #ecefe9;
	--muted: #9aa69f;
	--glass: rgba(255, 255, 255, .055);
	--glass-strong: rgba(18, 26, 22, .72);
	--glass-border: rgba(255, 255, 255, .11);
	--glass-shine: rgba(255, 255, 255, .07);
	--shadow: 0 10px 40px rgba(0, 0, 0, .45);
	--orb-opacity: .55;
	--accent-text: var(--gold);
	color-scheme: dark;
}

html[data-mode="light"] {
	--bg: #f3efe4;
	--bg-2: #e9e3d3;
	--text: #1c231f;
	--muted: #5f6b64;
	--glass: rgba(255, 255, 255, .55);
	--glass-strong: rgba(255, 255, 255, .82);
	--glass-border: rgba(255, 255, 255, .8);
	--glass-shine: rgba(255, 255, 255, .6);
	--shadow: 0 10px 34px rgba(60, 50, 20, .12);
	--orb-opacity: .38;
	--accent-text: color-mix(in srgb, var(--gold) 62%, #2a1d00);
	color-scheme: light;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.85;
	direction: rtl;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	transition: background-color .4s var(--ease), color .4s var(--ease);
}

img, video, iframe { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-text); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); line-height: 1.4; margin: 0 0 .6em; font-weight: 700; }
p { margin: 0 0 1.1em; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 999; top: 10px; right: 10px;
	background: var(--gold); color: #111; padding: 10px 16px; border-radius: 10px;
}

.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.container.narrow { width: min(100% - 32px, 880px); }

/* ---------- Background orbs ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-orbs span {
	position: absolute; border-radius: 50%; filter: blur(90px); opacity: var(--orb-opacity);
	animation: orb 22s ease-in-out infinite alternate;
}
.bg-orbs span:nth-child(1) { width: 46vw; height: 46vw; background: var(--gold); top: -14vw; right: -10vw; }
.bg-orbs span:nth-child(2) { width: 40vw; height: 40vw; background: var(--green); bottom: -12vw; left: -10vw; animation-delay: -7s; }
.bg-orbs span:nth-child(3) { width: 26vw; height: 26vw; background: color-mix(in srgb, var(--gold) 50%, var(--green)); top: 40%; left: 35%; opacity: calc(var(--orb-opacity) * .5); animation-delay: -12s; }
@keyframes orb { to { transform: translate3d(4vw, 3vw, 0) scale(1.12); } }

/* ---------- Glass ---------- */
.glass {
	background: linear-gradient(135deg, var(--glass-shine), transparent 40%) , var(--glass);
	border: 1px solid var(--glass-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	-webkit-backdrop-filter: blur(18px) saturate(150%);
	backdrop-filter: blur(18px) saturate(150%);
}

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; padding-top: 12px; }
.header-inner {
	display: flex; align-items: center; gap: 16px; min-height: var(--header-h);
	padding: 10px 18px; background: var(--glass-strong);
}
.brand { flex-shrink: 0; }
.brand img { max-height: 48px; width: auto; }
.site-title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; }
.logo-mark {
	display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
	background: linear-gradient(135deg, var(--gold), var(--green)); color: #0b0f0d; font-size: 1.25rem;
	box-shadow: 0 6px 20px color-mix(in srgb, var(--gold) 40%, transparent);
}

.main-nav { flex: 1; }
.main-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav .menu > li { position: relative; }
.main-nav .menu a { display: block; padding: 8px 14px; border-radius: 12px; font-weight: 500; font-size: .97rem; }
.main-nav .menu a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-cat > a { background: var(--glass); color: var(--accent-text); }
.main-nav .sub-menu, .main-nav .children {
	list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; right: 0; min-width: 200px;
	background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
	box-shadow: var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
	opacity: 0; visibility: hidden; transform: translateY(8px); transition: .25s var(--ease);
}
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }

.header-actions { display: flex; gap: 6px; margin-inline-start: auto; }
.icon-btn {
	display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
	border: 1px solid var(--glass-border); background: var(--glass); color: var(--text);
	transition: transform .2s var(--ease), background .2s, color .2s;
}
.icon-btn:hover { color: var(--gold); transform: translateY(-2px); }
.menu-toggle { display: none; }
html[data-mode="dark"] .when-light, html[data-mode="light"] .when-dark { display: none; }
.menu-toggle .when-open, .menu-open .menu-toggle .when-closed { display: none; }
.menu-open .menu-toggle .when-open { display: inline; }

/* ---------- Ticker ---------- */
.ticker { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 6px 6px 6px 0; overflow: hidden; border-radius: 14px; }
.ticker-label {
	flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; margin-inline-start: 6px;
	background: linear-gradient(135deg, var(--gold), color-mix(in srgb, var(--gold) 70%, #ff7a00));
	color: #15110a; font-weight: 700; border-radius: 10px; font-size: .9rem;
}
.ticker-label .icon { width: 16px; height: 16px; }
.ticker-track { overflow: hidden; flex: 1; mask-image: linear-gradient(to left, transparent, #000 6%, #000 94%, transparent); }
.ticker-items { display: flex; gap: 42px; width: max-content; animation: ticker 45s linear infinite; }
.ticker:hover .ticker-items { animation-play-state: paused; }
.ticker-items a { white-space: nowrap; font-size: .93rem; position: relative; }
.ticker-items a::after { content: "◆"; position: absolute; left: -26px; color: var(--green); font-size: .6rem; top: 50%; transform: translateY(-50%); }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ---------- Reading progress ---------- */
.read-progress { position: fixed; top: 0; right: 0; left: 0; height: 4px; z-index: 100; }
.read-progress span {
	display: block; height: 100%; width: 0; margin-inline-start: 0;
	background: linear-gradient(90deg, var(--green), var(--gold));
	box-shadow: 0 0 14px var(--gold); transition: width .1s linear;
}

/* ---------- Main ---------- */
.site-main { padding-block: 28px 60px; }

/* ---------- Hero slider ---------- */
.hero { position: relative; border-radius: calc(var(--radius) + 6px); overflow: hidden; margin-bottom: 42px; aspect-ratio: 21 / 9; min-height: 380px; box-shadow: var(--shadow); }
.hero-track { position: absolute; inset: 0; touch-action: pan-y; }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .8s var(--ease), visibility .8s; }
.hero-slide.is-active { opacity: 1; visibility: visible; }
.hero-media { position: absolute; inset: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--green) 60%, #000), color-mix(in srgb, var(--gold) 50%, #000)); }
.hero-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: transform 8s linear; }
.hero-slide.is-active .hero-media img { transform: scale(1); }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,.05) 60%); }
.hero-content {
	position: absolute; right: 84px; bottom: 28px; max-width: min(640px, calc(100% - 56px)); padding: 24px 28px;
	color: #fff; background: rgba(10, 14, 12, .38); border-color: rgba(255,255,255,.18);
	transform: translateY(20px); opacity: 0; transition: .7s .2s var(--ease);
}
.hero-slide.is-active .hero-content { transform: none; opacity: 1; }
.hero-title { font-size: clamp(1.4rem, 2.6vw, 2.3rem); margin: 10px 0 8px; }
.hero-title a:hover { color: var(--accent-text); }
.hero-excerpt { color: rgba(255,255,255,.82); margin-bottom: 10px; }
.hero-content .post-meta { color: rgba(255,255,255,.75); }
.hero-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; color: #fff; background: rgba(0,0,0,.25); border-color: rgba(255,255,255,.2); }
.hero-nav:hover { transform: translateY(-50%) scale(1.08); }
.hero-prev { right: 16px; }
.hero-next { left: 16px; }
.hero-dots { position: absolute; left: 28px; bottom: 28px; display: flex; gap: 8px; z-index: 3; }
.hero-dots button { width: 10px; height: 10px; border-radius: 10px; border: 0; background: rgba(255,255,255,.45); padding: 0; transition: width .35s var(--ease), background .35s; }
.hero-dots button.is-active { width: 30px; background: var(--gold); }

/* ---------- Sections & grids ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-title { position: relative; font-size: 1.45rem; padding-inline-start: 16px; margin-bottom: 18px; }
.section-head .section-title { margin: 0; }
.section-title::before {
	content: ""; position: absolute; right: 0; top: 18%; bottom: 18%; width: 5px; border-radius: 4px;
	background: linear-gradient(var(--gold), var(--green));
}
.more-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 500; font-size: .95rem; }
.more-link .icon { width: 16px; height: 16px; transition: transform .2s; }
.more-link:hover .icon { transform: translateX(-4px); }

.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.home-sections { display: grid; gap: 46px; margin-bottom: 50px; }
.cat-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; }
.cat-list { padding: 10px 18px; display: flex; flex-direction: column; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 32px; align-items: start; }
.no-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
.sidebar { display: grid; gap: 22px; position: sticky; top: calc(var(--header-h) + 80px); }

/* ---------- Cards ---------- */
.card { overflow: hidden; display: flex; flex-direction: column; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--gold) 45%, transparent); box-shadow: 0 18px 50px rgba(0,0,0,.35), 0 0 0 1px color-mix(in srgb, var(--gold) 25%, transparent); }
.card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; position: relative; background: var(--bg-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.thumb-placeholder {
	display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--font-head); font-size: 3rem; color: rgba(255,255,255,.9);
	background: linear-gradient(135deg, color-mix(in srgb, var(--green) 75%, #000), color-mix(in srgb, var(--gold) 70%, #000));
}
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 1.15rem; margin: 10px 0 6px; }
.card-excerpt { color: var(--muted); font-size: .95rem; margin-bottom: 12px; flex: 1; }

.badge {
	display: inline-block; align-self: flex-start; padding: 2px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700;
	color: var(--accent-text); background: color-mix(in srgb, var(--gold) 14%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
}
.hero .badge { color: #15110a; background: var(--gold); border-color: var(--gold); }
.badge:hover { color: #15110a; background: var(--gold); }

.post-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .84rem; }
.post-meta span { display: inline-flex; align-items: center; gap: 5px; }
.post-meta .icon { width: 15px; height: 15px; color: var(--green); }

.card-row { display: grid; grid-template-columns: 86px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--glass-border); }
.card-row:last-child { border-bottom: 0; }
.card-row-media { display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; }
.card-row-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card-row:hover img { transform: scale(1.08); }
.card-row-media .thumb-placeholder { font-size: 1.6rem; }
.card-row-title { font-size: 1rem; margin: 0 0 4px; line-height: 1.6; }

/* ---------- Page head ---------- */
.page-head { padding: 28px 30px; margin-bottom: 30px; }
.page-title { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 10px 0 6px; }
.archive-desc { color: var(--muted); }

/* ---------- Single ---------- */
.single-head { max-width: 900px; margin: 10px auto 26px; text-align: center; }
.single-head .badge { margin-bottom: 8px; }
.single-title { font-size: clamp(1.7rem, 4vw, 2.9rem); margin: 8px 0 14px; }
.single-head .post-meta { justify-content: center; }
.single-cover { overflow: hidden; margin: 0 0 30px; padding: 0; }
.single-cover img { width: 100%; max-height: 560px; object-fit: cover; border-radius: var(--radius); }
.single-cover figcaption { padding: 10px 18px; font-size: .85rem; color: var(--muted); }

.entry-content { padding: clamp(20px, 4vw, 42px); font-size: 1.08rem; line-height: 2; overflow-wrap: anywhere; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2 { font-size: 1.6rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.3rem; margin-top: 1.4em; }
.entry-content a { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.entry-content img { border-radius: var(--radius-sm); margin-inline: auto; }
.entry-content blockquote {
	margin: 1.6em 0; padding: 18px 24px; border-radius: var(--radius-sm); font-size: 1.12rem;
	background: color-mix(in srgb, var(--green) 10%, transparent); border-right: 4px solid var(--green);
}
.entry-content pre, .entry-content code { font-family: ui-monospace, Consolas, monospace; direction: ltr; text-align: left; }
.entry-content pre { background: rgba(0,0,0,.35); color: #e8e8e8; padding: 16px; border-radius: 12px; overflow: auto; }
.entry-content table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--glass-border); padding: 10px; }
.entry-content iframe { width: 100%; border-radius: var(--radius-sm); }
.alignwide { margin-inline: -4%; max-width: 108%; }
.alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; }

/* TOC */
.toc { padding: 16px 22px; margin: 0 0 1.8em; border-color: color-mix(in srgb, var(--gold) 35%, var(--glass-border)); }
.toc summary { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; cursor: pointer; list-style: none; color: var(--accent-text); }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "▾"; margin-inline-start: auto; transition: transform .3s; }
.toc:not([open]) summary::after { transform: rotate(90deg); }
.toc ol { margin: 12px 0 0; padding-inline-start: 22px; font-size: .97rem; line-height: 1.9; }
.toc .toc-l3 { margin-inline-start: 18px; list-style: circle; }
.entry-content .toc a { color: var(--text); text-decoration: none; }
.entry-content .toc a:hover, .entry-content .toc a.is-current { color: var(--gold); }

/* Tags, share, author, nav */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.tags a { padding: 4px 14px; border-radius: 999px; border: 1px solid var(--glass-border); background: var(--glass); font-size: .85rem; }
.tags a::before { content: "#"; color: var(--green); }

.share { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 16px 20px; margin: 22px 0; }
.share-label { font-weight: 700; font-family: var(--font-head); }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
	display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; color: #fff; border: 0;
	transition: transform .25s var(--ease), filter .25s;
}
.share-btn:hover { transform: translateY(-3px) scale(1.05); filter: brightness(1.12); color: #fff; }
.share-whatsapp { background: #25d366; }
.share-x { background: #111; }
.share-telegram { background: #2aa3df; }
.share-facebook { background: #1877f2; }
.share-copy { background: linear-gradient(135deg, var(--gold), var(--green)); color: #111; }
.share-copy.is-done { filter: hue-rotate(60deg); }

.author-box { display: flex; gap: 18px; align-items: center; padding: 20px 22px; margin: 22px 0; }
.author-box img { border-radius: 50%; border: 3px solid var(--gold); flex-shrink: 0; }
.author-box h3 { margin: 0 0 4px; font-size: 1.15rem; }
.author-box p { margin: 0; color: var(--muted); font-size: .93rem; }
.author-label { font-size: .8rem; color: var(--green); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0; }
.post-nav a { padding: 16px 20px; font-weight: 500; transition: transform .25s var(--ease); }
.post-nav a:hover { transform: translateY(-3px); }
.post-nav a span { display: block; font-size: .8rem; color: var(--accent-text); margin-bottom: 4px; }
.post-nav a.next { text-align: left; grid-column: 2; }

.related { margin-top: 46px; }

/* ---------- Comments ---------- */
.comments { padding: clamp(18px, 3vw, 32px); margin-top: 22px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .children { list-style: none; padding-inline-start: 26px; border-right: 2px solid var(--glass-border); margin-inline-start: 10px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--glass-border); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-metadata { font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.reply a { font-size: .85rem; color: var(--gold); }
.comment-form label { display: block; font-size: .9rem; margin-bottom: 4px; }
.comment-form p { margin-bottom: 14px; }

input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea, select {
	width: 100%; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--glass-border);
	background: var(--glass); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent); }

.btn, .comment-form .submit, button[type="submit"]:not(.search-submit) {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 26px; border: 0; border-radius: 14px;
	background: linear-gradient(135deg, var(--gold), var(--green)); color: #0d120f; font-weight: 700;
	box-shadow: 0 8px 24px color-mix(in srgb, var(--gold) 30%, transparent); transition: transform .25s var(--ease), filter .25s;
}
.btn:hover, .comment-form .submit:hover { transform: translateY(-2px); filter: brightness(1.08); color: #0d120f; }

/* ---------- Search form ---------- */
.search-form { position: relative; display: flex; }
.search-form .search-field { padding-inline-end: 52px; }
.search-submit {
	position: absolute; left: 5px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 11px; border: 0;
	background: linear-gradient(135deg, var(--gold), var(--green)); color: #111; display: grid; place-items: center;
}

/* Search modal */
.search-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: start center; padding: 12vh 16px 16px; background: rgba(5, 8, 6, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.search-modal[hidden] { display: none; }
.search-modal.is-open .search-box { animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-16px) scale(.97); } }
.search-box { width: min(720px, 100%); padding: 10px; background: var(--glass-strong); }
.search-modal-form { display: flex; align-items: center; gap: 10px; padding: 4px 10px; }
.search-modal-form > .icon { color: var(--gold); flex-shrink: 0; }
.search-modal-form input { border: 0; background: transparent; font-size: 1.15rem; padding: 12px 4px; box-shadow: none !important; }
.search-results { max-height: 56vh; overflow-y: auto; }
.search-results:not(:empty) { border-top: 1px solid var(--glass-border); margin-top: 6px; padding-top: 6px; }
.search-results a { display: block; padding: 12px 14px; border-radius: 12px; }
.search-results a:hover, .search-results a:focus { background: var(--glass); color: var(--gold); outline: none; }
.search-results .sr-type { font-size: .75rem; color: var(--green); display: block; }
.search-results .sr-all { text-align: center; color: var(--gold); font-weight: 700; }
.search-results .sr-msg { padding: 14px; color: var(--muted); text-align: center; }

/* ---------- Widgets ---------- */
.widget { padding: 20px 22px; }
.widget-title { font-size: 1.1rem; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid var(--glass-border); position: relative; }
.widget-title::after { content: ""; position: absolute; right: 0; bottom: -1px; width: 48px; height: 2px; background: linear-gradient(90deg, var(--green), var(--gold)); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px dashed var(--glass-border); }
.widget li:last-child { border-bottom: 0; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 34px; }
.pagination .page-numbers {
	display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 14px;
	border: 1px solid var(--glass-border); background: var(--glass); font-weight: 700;
}
.pagination .current { background: linear-gradient(135deg, var(--gold), var(--green)); color: #111; border-color: transparent; }
.pagination .dots { background: none; border: 0; }

/* ---------- Empty / 404 ---------- */
.empty { padding: 40px 30px; text-align: center; }
.empty .search-form { max-width: 460px; margin: 20px auto; }
.big-404 { font-family: var(--font-head); font-size: clamp(5rem, 16vw, 9rem); line-height: 1; background: linear-gradient(135deg, var(--gold), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Footer ---------- */
.site-footer { padding: 30px 0 90px; }
.footer-widgets { margin-bottom: 22px; }
.footer-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding: 22px 26px; }
.tagline { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.social { display: flex; gap: 8px; }
.social a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--glass-border); background: var(--glass); transition: transform .2s, color .2s; }
.social a:hover { transform: translateY(-3px); color: var(--gold); }
.copyright { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 18px; }

.to-top { position: fixed; left: 18px; bottom: 18px; z-index: 40; opacity: 0; visibility: hidden; transform: translateY(12px); transition: .3s var(--ease); }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ---------- Animations on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
	.layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; }
	.grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
	.menu-toggle { display: inline-grid; }
	.header-inner { -webkit-backdrop-filter: none; backdrop-filter: none; background: color-mix(in srgb, var(--bg) 88%, transparent); }
	.main-nav {
		position: fixed; inset: 0 0 0 auto; width: min(84vw, 340px); padding: 96px 20px 24px; z-index: -1;
		background: var(--glass-strong); border-left: 1px solid var(--glass-border);
		-webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px);
		transform: translateX(105%); transition: transform .45s var(--ease); overflow-y: auto;
	}
	.menu-open .main-nav { transform: none; }
	.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
	.site-header { z-index: 60; }
	.main-nav .menu { flex-direction: column; gap: 2px; }
	.main-nav .menu a { padding: 12px 14px; font-size: 1.05rem; }
	.main-nav .sub-menu, .main-nav .children { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; background: transparent; border: 0; padding: 0 14px 0 0; -webkit-backdrop-filter: none; backdrop-filter: none; }

	.layout { grid-template-columns: minmax(0, 1fr); }
	.sidebar { position: static; grid-template-columns: repeat(2, 1fr); }
	.cat-grid { grid-template-columns: 1fr; }
	.hero { aspect-ratio: 16 / 10; }
}

@media (max-width: 640px) {
	body { font-size: 16px; }
	.site-header { padding-top: 8px; }
	.header-inner { padding: 8px 12px; gap: 8px; min-height: 62px; border-radius: 18px; }
	.site-title { font-size: 1.1rem; }
	.logo-mark { width: 36px; height: 36px; }
	.icon-btn { width: 40px; height: 40px; }
	.grid-2, .grid-3, .sidebar { grid-template-columns: 1fr; }
	.hero { aspect-ratio: auto; min-height: 480px; border-radius: var(--radius); }
	.hero-content { right: 12px; left: 12px; bottom: 54px; max-width: none; padding: 18px; }
	.hero-excerpt { display: none; }
	.hero-nav { display: none; }
	.hero-dots { left: 50%; transform: translateX(-50%); bottom: 22px; }
	.entry-content { font-size: 1.02rem; border-radius: 18px; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav a.next { grid-column: auto; }
	.share { justify-content: center; }
	.footer-bar { flex-direction: column; text-align: center; }
	.section-title { font-size: 1.25rem; }
	.alignwide { margin-inline: 0; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
	.reveal { opacity: 1; transform: none; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.glass { background: var(--glass-strong); }
}

/* ---------- Footer columns: never overflow ---------- */
.footer-widgets > div, .layout-main, .sidebar, .grid > * { min-width: 0; }
.widget pre, .widget .wp-block-verse { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; margin: 0; background: none; padding: 0; }
.footer-widgets { align-items: start; }

/* ---------- Video inside widgets & content ---------- */
.widget iframe, .widget video, .widget .wp-block-embed, .widget .wp-video, .widget .mejs-container,
.widget embed, .widget object { width: 100% !important; max-width: 100% !important; }
.widget iframe, .widget .wp-block-embed iframe { height: auto !important; aspect-ratio: 16 / 9; border: 0; border-radius: 14px; display: block; }
.widget .wp-block-embed__wrapper::before { display: none; }
.widget .wp-block-embed { margin: 0; }
.widget video { height: auto !important; border-radius: 14px; }

.ahg-yt { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.ahg-yt img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), filter .3s; }
.ahg-yt:hover img { transform: scale(1.05); filter: brightness(.8); }
.ahg-yt-play { position: absolute; inset: 0; display: grid; place-items: center; }
.ahg-yt-play svg { transition: transform .25s var(--ease); filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)); }
.ahg-yt:hover .ahg-yt-play svg { transform: scale(1.12); }
.ahg-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ahg-yt-caption { margin: 10px 0 0; font-size: .9rem; color: var(--muted); }

/* Logo image inside the round mark (footer) */
.logo-mark.has-img { background: none; padding: 0; border-radius: 50%; width: 48px; height: 48px; box-shadow: 0 6px 20px color-mix(in srgb, var(--gold) 35%, transparent); }
.logo-mark.has-img img { width: 100%; height: 100%; border-radius: 50%; display: block; }
