/*
Theme Name: maxsan
Theme URI: https://maxsan.com
Description: A modern, professional WordPress blog theme perfect for news websites, multi-blog platforms, niche blogs, and personal blogs. Features responsive design, dark mode, customizable layouts, and SEO optimization. Ideal for all types of blog websites.
Author: maxsan
Author URI: https://maxsan.com
Version: 5.23.7
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: maxsan
Tags: blog, news, magazine, two-columns, responsive-layout, dark-mode, custom-colors, custom-menu, featured-images, translation-ready, professional, seo-friendly, multi-purpose
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
*/

/* Critical layout styles to prevent layout shift */
.category-post-image {
  width: 100%;
  aspect-ratio: 16 / 8;
  overflow: visible;
  position: relative;
  border: 1px solid #d4d4d4;
  border-radius: 12px;
}
.category-post-image-media,
.category-post-image-link {
  position: absolute;
  inset: 0;
  border-radius: 12px;
}
.category-post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}
.category-link {
  border-radius: 999px !important;
  overflow: hidden;
}

/* Base Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* Hide scrollbars visually while preserving scrolling
   - Applies to html and body to cover all scrolling contexts
   - Keeps scrolling functional but removes visible scrollbar UI */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  max-width: 100%;
  /* clip keeps sticky sidebar working; hidden can break position:sticky */
  overflow-x: clip;
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE and Edge */
}

/* Remove scrollbar bar for WebKit browsers */
html::-webkit-scrollbar, body::-webkit-scrollbar {
  width: 0px !important;
  height: 0px !important;
  display: none !important;
}

body { 
  margin: 0; 
  font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Arial, sans-serif; 
  color: #0b0b0c; 
  background: #FCFCF9; 
  overflow-x: clip; 
  overflow-y: auto; /* allow scrolling but don't force persistent scrollbar */
  transition: background-color var(--duration-medium) ease, color var(--duration-medium) ease;
  /* Prevent layout shift on refresh */
  min-height: 100vh;
  position: relative;
}

/* Ensure any overflow containers also hide scrollbars visually */
* { scrollbar-width: none !important; -ms-overflow-style: none !important; }
*::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
a { text-decoration: none; }

/* Accessibility: Skip to content link */
.skip-link {
  position: absolute;
  top: -9999px;
  left: 0;
  z-index: 999999;
  padding: 12px 16px;
  background: #0b0b0c;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 4px;
}
.skip-link:focus,
.skip-link:focus-visible,
.skip-link.screen-reader-text:focus,
.skip-link.screen-reader-text:focus-visible {
  top: 0;
  left: 0;
  position: fixed;
  width: auto;
  height: auto;
  margin: 0;
  padding: 12px 16px;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: normal;
  outline: 3px solid #ffffff;
  outline-offset: 2px;
  z-index: 999999;
}

/* Accessibility: Focus indicators for keyboard navigation */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #0b0b0c;
  outline-offset: 2px;
  border-radius: 2px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
  outline: none;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #0b0b0c;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Dark theme focus indicators */
html.dark-theme a:focus-visible,
html.dark-theme button:focus-visible,
html.dark-theme input:focus-visible,
html.dark-theme textarea:focus-visible,
html.dark-theme select:focus-visible {
  outline-color: #ffffff;
}

/* Fix: Dark theme circular buttons focus states */
html.dark-theme .social-btn:focus,
html.dark-theme .social-btn:active,
html.dark-theme .social-btn:focus-visible,
html.dark-theme .theme-toggle-btn:focus,
html.dark-theme .theme-toggle-btn:active,
html.dark-theme .theme-toggle-btn:focus-visible,
html.dark-theme .channel-btn:focus,
html.dark-theme .channel-btn:active,
html.dark-theme .channel-btn:focus-visible,
html.dark-theme .site-logo-link:focus,
html.dark-theme .site-logo-link:active,
html.dark-theme .site-logo-link:focus-visible {
  outline-color: #ffffff;
  border-radius: 999px;
}

html.dark-theme .nav-link:focus:not(:focus-visible),
html.dark-theme .site-nav .nav-list li a:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
html.dark-theme .nav-link:focus-visible,
html.dark-theme .site-nav .nav-list li a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Screen reader only text */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
:root {
  --container-max: 1200px;
  --g-1: 4px;
  --g-2: 8px;
  --g-3: 12px;
  --g-4: 16px;
  --g-6: 24px;
  --g-8: 32px;
  --g-10: 40px;
  --border: 1px solid #d4d4d4;
  --shadow-1: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.1);
  --shadow-soft: 0 2px 8px rgba(11, 11, 12, 0.04);
  --ease-premium: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration-fast: 0.2s;
  --duration-medium: 0.35s;
  --duration-slow: 0.5s;
  --text-dim: #5d6679;
}

.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--g-4); }

/* Header */
.site-header {
  position: relative;
  z-index: 100;
  background: #FCFCF9;
  border-bottom: none;
}
/* Nav bar borders inside the header */
.site-header .header-inner { 
  border-bottom: var(--border);
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--g-4);
}
.site-header > .container + .container { 
  padding-block: var(--g-3);
  padding-inline: var(--g-4);
  max-width: var(--container-max);
  margin-inline: auto;
  width: 100%;
  box-sizing: border-box;
}
.site-nav { 
  border-bottom: var(--border); 
  padding-top: 0px;
  padding-bottom: 10px;
  margin-top: -1.5px;
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--g-4);
  box-sizing: border-box;
}
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--g-3); padding: var(--g-6) 0; }
.brand { display: inline-flex; align-items: center; gap: var(--g-3); text-decoration: none; color: inherit; }
.brand:hover,
.brand:focus,
.brand:visited,
.brand:active {
  color: inherit;
  text-decoration: none;
}
.brand-name { font-family: 'Righteous', 'Roboto', system-ui, -apple-system, Segoe UI, Arial, sans-serif; font-weight: 400; font-size: 32px; letter-spacing: .2px; margin: 0; padding: 0; line-height: 1.1; color: #0b0b0c; }
.brand:hover .brand-name,
.brand:focus .brand-name,
.brand:visited .brand-name,
.brand:active .brand-name {
  color: #0b0b0c;
}
html.dark-theme .brand-name,
html.dark-theme .brand:hover .brand-name,
html.dark-theme .brand:focus .brand-name,
html.dark-theme .brand:visited .brand-name,
html.dark-theme .brand:active .brand-name {
  color: #ffffff;
}

.social-buttons { display: flex; gap: var(--g-2); justify-self: start; }
.social-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: #F0F1F5; color: #0b0b0c; text-decoration: none; border: var(--border); border-radius: 999px; transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease; }
/* Fix: Keep circular border on focus/active states */
.social-btn:focus,
.social-btn:active,
.social-btn:focus-visible {
  outline: 2px solid #0b0b0c;
  outline-offset: 2px;
  border-radius: 999px;
}

.social-icon { flex-shrink: 0; }

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #F0F1F5;
  color: #0b0b0c;
  border: var(--border);
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 2;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
}
/* Fix: Keep circular border on focus/active states */
.theme-toggle-btn:focus,
.theme-toggle-btn:active,
.theme-toggle-btn:focus-visible {
  outline: 2px solid #0b0b0c;
  outline-offset: 2px;
  border-radius: 999px;
}

.theme-icon {
  flex-shrink: 0;
  pointer-events: none;
}

/* Site Logo Link */
.site-logo-link { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  width: 32px; 
  height: 32px; 
  background: #F0F1F5; 
  color: #0b0b0c; 
  border: var(--border); 
  border-radius: 999px; 
  cursor: default; 
  padding: 0;
  text-decoration: none;
  pointer-events: none;
}
/* Fix: Keep circular border on focus/active states */
.site-logo-link:focus,
.site-logo-link:active,
.site-logo-link:focus-visible {
  outline: 2px solid #0b0b0c;
  outline-offset: 2px;
  border-radius: 999px;
}

.site-logo-icon { 
  flex-shrink: 0; 
  width: 26px; 
  height: 26px;
  object-fit: contain;
  display: block;
}

.site-logo-light {
  display: block;
}

.site-logo-dark {
  display: none;
}

/* Dark theme - show white icon, hide black icon */
html.dark-theme .site-logo-light {
  display: none;
}

html.dark-theme .site-logo-dark {
  display: block;
}

/* Dark theme - match header controls background and border */
html.dark-theme .site-logo-link {
  background: #213243;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.channel-btn { display: inline-flex; align-items: center; gap: var(--g-2); padding: 8px 12px; background: #F0F1F5; color: #0b0b0c; text-decoration: none; border: var(--border); border-radius: 999px; font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Arial, sans-serif; font-weight: 600; font-size: 13px; letter-spacing: .2px; text-transform: uppercase; transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease; }
/* Fix: Keep circular border on focus/active states */
.channel-btn:focus,
.channel-btn:active,
.channel-btn:focus-visible {
  outline: 2px solid #0b0b0c;
  outline-offset: 2px;
  border-radius: 999px;
}

.whatsapp-icon { flex-shrink: 0; color: #0b0b0c; }

/* Theme Toggle - Right side buttons container */
.header-actions { display: flex; gap: 6px; justify-self: end; align-items: center; }

/* Dark Theme */
html.dark-theme,
html.dark-theme body {
  background: #1A2533;
  color: #ffffff;
  --text-dim: #cccccc;
  --border: 1px solid rgba(255, 255, 255, 0.22);
  --maxsan-dark-border: rgba(255, 255, 255, 0.22);
}

html.dark-theme .site-header,
html.dark-theme .site-footer {
  background: #1A2533;
  color: #ffffff;
}

/* Light theme - ensure header and footer have same background as body */
.site-header,
.site-footer {
  background: #FCFCF9;
}

html.dark-theme .pager,
html.dark-theme .pager-wrapper a,
html.dark-theme .nav-link,
html.dark-theme .site-nav .nav-list li a,
html.dark-theme .social-btn,
html.dark-theme .theme-toggle-btn,
html.dark-theme .channel-btn {
  background: #213243;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

html.dark-theme .nav-link.is-active,
html.dark-theme .site-nav .nav-list li.current-menu-item > a,
html.dark-theme .site-nav .nav-list li.current_page_item > a,
html.dark-theme .site-nav .nav-list li.current_page_ancestor > a,
html.dark-theme .site-nav .nav-list li.current-page-ancestor > a,
html.dark-theme .site-nav .nav-list li.current-cat > a,
html.dark-theme .site-nav .nav-list li a.current {
  background: #ffffff;
  color: #0b0b0c !important;
  border-color: #ffffff;
}

html.dark-theme .page-numbers .page-number.current,
html.dark-theme .page-numbers span.current {
  background: #ffffff;
  color: #0b0b0c !important;
  border-color: #ffffff;
  cursor: default;
}

html.dark-theme .page-numbers a,
html.dark-theme .page-numbers span.page-number:not(.current) {
  background: #213243;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

html.dark-theme .brand-name,
html.dark-theme .page-title,
html.dark-theme h1, 
html.dark-theme h2, 
html.dark-theme h3,
html.dark-theme p,
html.dark-theme li,
html.dark-theme strong {
  color: #ffffff;
}

html.dark-theme .page-header {
  border-color: rgba(255, 255, 255, 0.22);
}

html.dark-theme .page-content h2,
html.dark-theme .page-content h3 {
  color: #ffffff;
}

/* Static pages — body text dim like card meta; headings stay white */
html.dark-theme .page-content,
html.dark-theme .page-content p,
html.dark-theme .page-content li,
html.dark-theme .page-content ul,
html.dark-theme .page-content ol {
  color: #cccccc;
}

html.dark-theme .page-content strong {
  color: #ffffff;
}

/* Single post and static page content links — same smooth underline as card titles */
body.single .post-content a,
body.single .post-body a,
body.page .page-content a,
body.page .entry-content a {
  color: #0b66ff;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--duration-medium) var(--ease-premium), color var(--duration-fast) ease;
}

body.single .post-content a:hover,
body.single .post-content a:focus-visible,
body.single .post-body a:hover,
body.single .post-body a:focus-visible,
body.page .page-content a:hover,
body.page .page-content a:focus-visible,
body.page .entry-content a:hover,
body.page .entry-content a:focus-visible {
  color: #084ec0;
  text-decoration: none;
  background-size: 100% 2px;
}

/* Dark: articles + static pages share the same link color (body has .single/.page) */
html.dark-theme body.single .post-content a,
html.dark-theme body.single .post-body a,
html.dark-theme body.page .page-content a,
html.dark-theme body.page .entry-content a,
html.dark-theme body.single .post-content a:visited,
html.dark-theme body.single .post-body a:visited,
html.dark-theme body.page .page-content a:visited,
html.dark-theme body.page .entry-content a:visited {
  color: #7fbfff;
  text-decoration: none;
  background-size: 0% 2px;
}

html.dark-theme body.single .post-content a:hover,
html.dark-theme body.single .post-content a:focus-visible,
html.dark-theme body.single .post-body a:hover,
html.dark-theme body.single .post-body a:focus-visible,
html.dark-theme body.page .page-content a:hover,
html.dark-theme body.page .page-content a:focus-visible,
html.dark-theme body.page .entry-content a:hover,
html.dark-theme body.page .entry-content a:focus-visible,
html.dark-theme body.single .post-content a:active,
html.dark-theme body.single .post-body a:active,
html.dark-theme body.page .page-content a:active,
html.dark-theme body.page .entry-content a:active {
  color: #5aa8e6;
  text-decoration: none;
  background-size: 100% 2px;
}


html.dark-theme .footer-copy {
  color: #cccccc;
}

html.dark-theme .site-header .header-inner,
html.dark-theme .site-header > .container + .container,
html.dark-theme .site-nav {
  border-color: rgba(255, 255, 255, 0.22);
}

/* Dark theme for mobile header border line */
@media (max-width: 640px) {
  html.dark-theme .site-header .header-inner::after {
    border-bottom-color: rgba(255, 255, 255, 0.22);
  }
}

html.dark-theme .site-footer::before {
  background: rgba(255, 255, 255, 0.22);
}



html.dark-theme .whatsapp-icon,
html.dark-theme .social-icon,
html.dark-theme .theme-icon {
  color: #ffffff;
}

html.dark-theme a {
  color: #ffffff;
}

html.dark-theme .section-heading {
  color: #ffffff;
}

html.dark-theme .section-heading::after {
  background: #ffffff;
}

.site-nav { width: 100%; }
.site-nav .nav-list { display: flex; gap: var(--g-2); align-items: center; justify-content: center; list-style: none; padding: 0; margin: 0; }
.site-nav .nav-list li { margin: 0; padding: 0; }
.nav-link, .site-nav .nav-list li a { appearance: none; border: var(--border); background: #F0F1F5; color: #0b0b0c; padding: 8px 12px; border-radius: 999px; cursor: pointer; font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Arial, sans-serif; font-weight: 600; font-size: 13px; letter-spacing: .2px; text-transform: uppercase; text-decoration: none; display: inline-block; white-space: nowrap; transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease, border-color var(--duration-fast) ease; }
.nav-link:focus:not(:focus-visible),
.site-nav .nav-list li a:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}
.nav-link:focus-visible,
.site-nav .nav-list li a:focus-visible {
  outline: 2px solid #0b0b0c;
  outline-offset: 2px;
}

.nav-link.is-active, 
.site-nav .nav-list li.current-menu-item > a, 
.site-nav .nav-list li.current_page_item > a, 
.site-nav .nav-list li.current_page_ancestor > a,
.site-nav .nav-list li.current-page-ancestor > a,
.site-nav .nav-list li.current-cat > a,
.site-nav .nav-list li a.current { 
  background: #0b0b0c; 
  color: #fff !important; 
  border-color: #d4d4d4; 
}

/* Listing layout: cards+sidebar row (sticky scope), then full-width pagination */
.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--g-8);
  padding-top: var(--g-6);
  padding-bottom: var(--g-10);
  padding-inline: var(--g-4);
  box-sizing: border-box;
  width: 100%;
  max-width: var(--container-max);
  min-width: 0;
  margin-inline: auto;
}

/* Sticky sidebar only sticks within this row (not past cards into pagination) */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--g-8);
  align-items: start;
  width: 100%;
  min-width: 0;
}

/* Main */
.site-main { 
  display: flex;
  flex-direction: column;
  padding-block: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0; /* prevent grid child from forcing page wider than viewport */
  margin: 0;
  padding-inline: 0;
  box-sizing: border-box;
}

/* Ensure posts section width matches header exactly */
.site-main.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--g-4);
}

/* Home page specific - reduced top padding */
body.home .content-wrapper { 
  padding-top: var(--g-6);
  padding-bottom: var(--g-10);
}

/* Category Posts Grid */
.category-posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--g-8);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.category-post-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  border: none;
  overflow: visible;
  border-radius: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.category-post-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8;
  overflow: visible;
  border-radius: 12px;
  background: #F0F1F5;
  border: 1px solid #d4d4d4;
  box-sizing: border-box;
  transition: box-shadow var(--duration-medium) var(--ease-premium), transform var(--duration-medium) var(--ease-premium);
}

/* Clips hover zoom inside the border; labels stay outside this layer */
.category-post-image-link {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  border-radius: 12px;
}
.category-post-image-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 12px;
  z-index: 0;
}

.category-post-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: transform var(--duration-slow) var(--ease-premium), opacity var(--duration-medium) ease-in;
}

/* Image zoom only when cursor is on the image */
@media (hover: hover) and (pointer: fine) {
  .category-post-image:hover .category-post-thumbnail {
    transform: scale(1.04);
  }
}

.category-post-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* overlay must be visible so category badges and view count can appear
     (previously set to none which hid all elements inside regardless of
     customizer settings) */
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  border-radius: 8px;
  overflow: visible;
  z-index: 2;
}

.category-post-badges {
  position: absolute;
  top: 0;
  left: var(--g-3);
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: var(--g-2);
  align-items: center;
  justify-content: flex-start;
  pointer-events: auto;
}

.category-post-badges .badge {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
}

/* Views Count Wrapper - Right Corner */
.category-post-views-wrapper {
  position: absolute;
  top: 0;
  right: var(--g-3);
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.category-post-views {
  color: #ffffff;
  text-shadow: none;
  font-weight: 700;
  margin: 0;
  font-size: 11px;
  letter-spacing: .2px;
  border: 1px solid #0b0b0c;
  padding: 5px 10px;
  border-radius: 999px;
  background: #0b0b0c;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  white-space: nowrap;
  display: inline-block;
}

/* Dark theme views count on featured images */
html.dark-theme .category-post-views {
  color: #0b0b0c;
  text-shadow: none;
  border: 1px solid #ffffff;
  background: #ffffff;
}

.category-post-content {
  padding: var(--g-4) 0 0 0;
}

/* Post cards without featured images — bordered text card (sidebar-matched) */
.category-post-card--panel {
  height: 100%;
}

.category-post-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  border: 1px solid #d4d4d4;
  border-radius: 12px;
  padding: var(--g-6);
  box-sizing: border-box;
  background: #F0F1F5;
  box-shadow: var(--shadow-soft);
  transition: transform var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
  .category-post-panel:hover {
    transform: translateY(-1px);
    background: #e8eaef;
    box-shadow: var(--shadow-soft);
  }
}

.category-post-panel-labels {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--g-2);
  margin-bottom: var(--g-4);
}

/* Labels stay in-flow inside the panel (not half-out like image mode) */
.category-post-panel .category-post-badges {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  flex: 1 1 auto;
  min-width: 0;
  pointer-events: auto;
}

.category-post-panel .category-post-views-wrapper {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  flex-shrink: 0;
  pointer-events: auto;
}

.category-post-panel .category-post-title {
  margin: 0 0 var(--g-3);
}

.category-post-panel .category-post-description {
  margin: 0 0 var(--g-4);
  flex: 1 1 auto;
}

.category-post-panel .category-post-meta {
  margin: 0;
  margin-top: auto;
}

html.dark-theme .category-post-panel {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #213243;
}

@media (hover: hover) and (pointer: fine) {
  html.dark-theme .category-post-panel:hover {
    transform: translateY(-1px);
    background: #2a3d52;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

.category-post-title {
  margin: 0 0 var(--g-3);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
}

.category-post-title a {
  color: #0b0b0c;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--duration-medium) var(--ease-premium), color var(--duration-fast) ease;
}

.category-post-title a:hover,
.category-post-title a:focus-visible {
  color: #0b0b0c;
  background-size: 100% 2px;
}

.category-post-description {
  margin: 0 0 var(--g-3);
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.category-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--g-3);
  margin-top: auto;
  min-width: 0;
  max-width: 100%;
}

.category-post-author {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  min-width: 0;
  flex: 1 1 auto;
}

.category-post-author strong {
  color: #0b0b0c;
  font-weight: 600;
  display: inline;
  line-height: 1.3;
  vertical-align: middle;
}

.category-post-author .site-name-link,
.category-post-author .site-name-link:visited,
.category-post-author .site-name-link:active {
  color: inherit;
  text-decoration: none;
  display: inline;
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--duration-medium) var(--ease-premium);
}

.category-post-author .site-name-link:hover,
.category-post-author .site-name-link:focus-visible {
  color: inherit;
  text-decoration: none;
  background-size: 100% 2px;
}

/* Verified Badge Icon - Light Theme */
.category-post-author .verified-badge {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: #000000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* Verified Badge - Dark Theme */
html.dark-theme .category-post-author .verified-badge {
  color: #ffffff;
}

.category-post-date {
  margin: 0;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Dark Theme for Category Posts */
html.dark-theme .category-post-title a {
  color: #ffffff;
}

html.dark-theme .category-post-title a:hover,
html.dark-theme .category-post-title a:focus-visible {
  color: #ffffff;
}

html.dark-theme .category-post-description {
  color: #cccccc;
}

html.dark-theme .category-post-author strong {
  color: #ffffff;
}

html.dark-theme .category-post-author .site-name-link,
html.dark-theme .category-post-author .site-name-link:visited,
html.dark-theme .category-post-author .site-name-link:active {
  color: #ffffff;
  text-decoration: none;
}

html.dark-theme .category-post-author .site-name-link:hover,
html.dark-theme .category-post-author .site-name-link:focus-visible {
  color: #ffffff;
  text-decoration: none;
}

html.dark-theme .category-post-author,
html.dark-theme .category-post-date {
  color: #cccccc;
}

html.dark-theme .category-post-image {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #213243;
  box-sizing: border-box;
  overflow: visible;
}

html.dark-theme .category-post-thumbnail {
  border: none;
  outline: none;
  box-shadow: none;
}

/* Responsive - Category Sections */
@media (max-width: 1024px) {
  .category-posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--g-6);
  }
}

@media (max-width: 640px) {
  .category-posts-grid {
    grid-template-columns: 1fr;
    gap: var(--g-6);
  }
  
  .category-post-title {
    font-size: 16px;
  }
}

/* Section Headings */
.section-heading {
  text-align: center;
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 var(--g-8);
  color: #0b0b0c;
  letter-spacing: 0.3px;
  position: relative;
  padding-bottom: var(--g-3);
  line-height: 1.25;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(1);
  transform-origin: center;
  width: 80px;
  height: 3px;
  background: #0b0b0c;
  border-radius: 2px;
  transition: width var(--duration-slow) var(--ease-premium);
}

.section-heading:hover::after {
  width: 100px;
}


/* Dark mode for author icons */
html.dark-theme .author-icon {
  border-color: rgba(255, 255, 255, 0.22);
  border-width: 1px;
  background: #213243;
  color: #9ca3af;
}

/* Single posts and static pages — full-width content layout */
body.single .content-wrapper,
body.page .content-wrapper {
  max-width: 1200px;
  padding-top: var(--g-3);
}

body.single .content-wrapper {
  padding-bottom: var(--g-10);
}

body.page .content-wrapper {
  padding-bottom: var(--g-4);
}

body.single .site-main,
body.page .site-main {
  max-width: 800px;
  margin-inline: auto;
  padding-inline: var(--g-4);
  padding-top: var(--g-3);
}

/* Page Article (same width as post article) */
.page-article {
  max-width: 800px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Static pages: modest space between content and footer */
body.page .page-article {
  margin-bottom: 0;
  padding-bottom: var(--g-2);
}

/* Page Headings (for static pages like About, Contact, etc.) */
.page-header {
  text-align: center;
  margin-bottom: var(--g-6);
  padding-bottom: var(--g-3);
  padding-top: 0;
  border-bottom: var(--border);
}

.page-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: #0b0b0c;
}

.page-content {
  margin-top: var(--g-4);
  color: var(--text-dim); /* matches card description/meta */
}

.page-content h2 {
  margin-top: var(--g-6);
  margin-bottom: var(--g-3);
  font-size: 24px;
  font-weight: 600;
  color: #0b0b0c;
}

.page-content h3 {
  margin-top: var(--g-4);
  margin-bottom: var(--g-2);
  font-size: 20px;
  font-weight: 600;
  color: #0b0b0c;
}

.page-content p {
  margin-bottom: var(--g-3);
  line-height: 1.75;
}

.page-content ul, .page-content ol {
  margin-bottom: var(--g-3);
  padding-left: var(--g-6);
  line-height: 1.6;
}

.page-content li {
  margin-bottom: var(--g-1);
}

.page-content strong {
  color: #0b0b0c;
}

/* Images in page content — keep natural size */
.page-content img,
.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  margin-bottom: var(--g-6);
  display: block;
}

.post-pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: var(--g-6);
  padding-top: var(--g-4);
  border-top: 1px solid #d4d4d4;
  font-size: 14px;
  font-weight: 600;
}
.post-pages a,
.post-pages > span:not(.post-pages-label) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 6px 10px;
  border: 1px solid #d4d4d4;
  border-radius: 8px;
  color: #0b0b0c;
  text-decoration: none;
}
.post-pages a:hover,
.post-pages a:focus-visible {
  background: #F0F1F5;
}
html.dark-theme .post-pages {
  border-color: rgba(255, 255, 255, 0.22);
}
html.dark-theme .post-pages a,
html.dark-theme .post-pages > span:not(.post-pages-label) {
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* Links inside page content — smooth underline like card titles */
.page-content a,
.entry-content a {
  color: #0b0b0c;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size var(--duration-medium) var(--ease-premium), color var(--duration-fast) ease;
}

.page-content a:hover,
.page-content a:focus-visible,
.entry-content a:hover,
.entry-content a:focus-visible {
  text-decoration: none;
  background-size: 100% 2px;
}

/* Badge Styling */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
  color: #ffffff;
  background: #0b0b0c;
  border: 1px solid #0b0b0c;
  box-shadow: none;
  white-space: nowrap;
  text-decoration: none;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.badge:hover,
.badge:focus {
  text-decoration: none;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

/* Dark theme badges */
html.dark-theme .badge {
  color: #0b0b0c;
  background: #ffffff;
  border: 1px solid #ffffff;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Dark theme badge link - no hover effect */
html.dark-theme .badge:hover,
html.dark-theme .badge:focus {
  text-decoration: none;
  color: #0b0b0c;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Author Icon Styling */
.author-icon {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #E4E7E5;
  border-radius: 50%;
  flex-shrink: 0;
  background: #f9fafb;
  color: #6b7280;
  object-fit: cover;
  display: block;
  align-self: center;
}

.author-icon-light {
  display: block !important;
}

.author-icon-dark {
  display: none !important;
}

/* Dark theme - show white icon, hide black icon */
html.dark-theme .author-icon-light {
  display: none !important;
}

html.dark-theme .author-icon-dark {
  display: block !important;
}

/* Pagination — full width under cards + sidebar */
.pagination { 
  display: flex; 
  flex-wrap: wrap; 
  gap: var(--g-3); 
  align-items: center; 
  justify-content: center; 
  margin-top: 0;
  padding-top: 0;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.pager-wrapper {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

/* Prev/Next Buttons */
.pager,
.pager-wrapper a {
  appearance: none;
  border: var(--border);
  background: #F0F1F5;
  color: #0b0b0c;
  padding: 0 14px;
  height: 36px;
  min-height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease;
}

.pager.disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.nav-arrow-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  transition: transform var(--duration-fast) ease;
}

.pager--prev:hover .nav-arrow-icon { transform: translateX(-2px); }
.pager--next:hover .nav-arrow-icon { transform: translateX(2px); }
.pager:disabled, .pager.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* WordPress Pagination Numbers */
.page-numbers {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
}

.page-numbers li {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
}

.page-numbers a,
.page-numbers span.page-number {
  appearance: none;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: var(--border);
  background: #F0F1F5;
  color: #0b0b0c;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.page-numbers .page-number.current,
.page-numbers span.current {
  background: #0b0b0c;
  color: #fff;
  border-color: #0b0b0c;
  cursor: default;
}

/* Footer */
.site-footer { margin-top: 10px; border-top: none; background: #FCFCF9; position: relative; }
.site-footer::before { content: ""; display: block; height: 1px; background: #d4d4d4; width: calc(var(--container-max) - 32px); max-width: calc(100% - 32px); margin: 0 auto; }
.footer-inner { padding: 18px; text-align: center; }

.footer-copy { margin: 0; color: #4b5563; font-size: 13px; }

/* Sidebar — sticky: scrolls with posts, then holds until main column ends */
.sidebar {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--g-8);
  width: 100%;
  max-width: 320px;
  align-self: start;
  position: sticky;
  top: var(--g-4);
  min-height: 0;
  z-index: 2;
  height: fit-content;
}

.widget {
  margin-bottom: var(--g-8);
  padding: var(--g-6);
  background: #F0F1F5;
  border: 1px solid #d4d4d4;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  transition: transform var(--duration-fast) ease, background var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.sidebar .widget {
  margin-bottom: 0;
  flex: 0 0 auto;
}

.sidebar .widget:hover {
  transform: translateY(-1px);
  background: #e8eaef;
  box-shadow: var(--shadow-soft);
}

.widget-title {
  margin: 0 0 var(--g-4);
  font-size: 18px;
  font-weight: 700;
  color: #0b0b0c;
  padding-bottom: var(--g-2);
  border-bottom: 1px solid #d4d4d4;
  display: flex;
  align-items: center;
  gap: var(--g-2);
}

.trending-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* Sidebar Search */
.widget-search .sidebar-search-form {
  width: 100%;
}

.sidebar-search-wrapper {
  display: flex;
  align-items: center;
  gap: var(--g-2);
  background: #F0F1F5;
  border: 1px solid #d4d4d4;
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color .2s, box-shadow .2s;
}

.sidebar-search-wrapper:focus-within {
  border-color: #d4d4d4;
}

.sidebar-search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  font-size: 14px;
  color: #0b0b0c;
  padding: 4px 8px;
  border-radius: 6px;
  -webkit-appearance: none;
  appearance: none;
  transition: background .2s;
}

/* Input field active state - no background change, no border */
.sidebar-search-input:focus {
  outline: none;
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Style search cancel button (X icon) */
.sidebar-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  cursor: pointer;
  background-color: #0b0b0c;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-position: center;
}


.sidebar-search-input::placeholder {
  color: var(--text-dim);
}

.sidebar-search-submit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  color: #0b0b0c;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  padding: 0;
  transition: transform var(--duration-fast) ease, color var(--duration-fast) ease;
}

.sidebar-search-submit:hover {
  transform: scale(1.08);
}

.sidebar-search-submit svg {
  width: 18px;
  height: 18px;
}

/* Recent Posts Widget */
.top-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.top-post-item {
  margin-bottom: var(--g-4);
  padding-bottom: var(--g-4);
  border-bottom: 1px solid #d4d4d4;
}

.top-post-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.top-post-link {
  display: flex;
  align-items: flex-start;
  gap: var(--g-3);
  text-decoration: none;
  color: inherit;
  padding: var(--g-2);
  margin: calc(var(--g-2) * -1);
  border-radius: 8px;
  transition: transform var(--duration-fast) ease, background var(--duration-fast) ease;
}

.sidebar .top-post-link:hover {
  transform: translateX(4px);
  background: rgba(11, 11, 12, 0.04);
}

.top-post-link:hover .top-post-title {
  color: #0b0b0c;
}

.top-post-number {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: transparent;
  color: #0b0b0c;
  border-radius: 0;
  font-size: 24px;
  font-weight: 700;
  font-family: 'Roboto', system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  min-width: 32px;
}

.top-post-content {
  flex: 1;
  min-width: 0;
}

.top-post-title {
  margin: 0 0 var(--g-2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: #0b0b0c;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2; /* standard property for compatibility */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.top-post-meta {
  display: flex;
  align-items: center;
  gap: var(--g-2);
  font-size: 12px;
  color: var(--text-dim);
}

.top-post-date {
  color: var(--text-dim);
}

.no-top-posts {
  padding: var(--g-4);
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* Categories Widget */
.categories-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.categories-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--g-2);
}

.category-item {
  margin: 0;
  padding: 0;
  border: none;
}

.category-item:last-child {
  margin: 0;
  padding: 0;
  border: none;
}

.category-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #F0F1F5;
  border: 1px solid #d4d4d4;
  border-radius: 999px !important;
  text-decoration: none;
  color: #0b0b0c;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease, background var(--duration-fast) ease, border-color var(--duration-fast) ease;
}

.sidebar .category-link:hover:not(.category-link-active) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  background: #e8e9ed;
  border-color: #d4d4d4;
}

/* Active category link - light theme */
.category-link-active {
  background: #0b0b0c !important;
  border-color: #0b0b0c !important;
  color: #ffffff !important;
  border-radius: 999px !important;
}

.category-link-active .category-name {
  color: #ffffff !important;
}

.category-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: #0b0b0c;
}

.no-categories {
  padding: var(--g-4);
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

/* Dark Theme for Sidebar */
html.dark-theme .widget {
  background: #213243;
  border-color: rgba(255, 255, 255, 0.22);
}

html.dark-theme .sidebar .widget:hover {
  transform: translateY(-1px);
  background: #2a3d52;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

html.dark-theme .top-post-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

html.dark-theme .sidebar .top-post-link:hover {
  transform: translateX(4px);
}

html.dark-theme .top-post-link:hover .top-post-title {
  color: #ffffff;
}

html.dark-theme .sidebar .category-link:hover:not(.category-link-active) {
  background: #2d3f54 !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

html.dark-theme .widget-title {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.22);
}

html.dark-theme .sidebar-search-wrapper {
  background: #213243;
  border-color: rgba(255, 255, 255, 0.22);
}

html.dark-theme .sidebar-search-input {
  color: #ffffff;
  background: transparent;
}

html.dark-theme .sidebar-search-input:focus {
  background: transparent;
}

html.dark-theme .sidebar-search-input::-webkit-search-cancel-button {
  background-color: #ffffff;
}


html.dark-theme .sidebar-search-input::placeholder {
  color: #9ca3af;
}

html.dark-theme .sidebar-search-submit {
  background: transparent;
  color: #ffffff;
}

html.dark-theme .top-post-item {
  border-bottom-color: rgba(255, 255, 255, 0.22);
}

html.dark-theme .top-post-title {
  color: #ffffff;
}

html.dark-theme .top-post-number {
  background: transparent;
  color: #ffffff;
}

html.dark-theme .top-post-meta,
html.dark-theme .top-post-date {
  color: #cccccc;
}

html.dark-theme .no-top-posts {
  color: #9ca3af;
}

html.dark-theme .category-link {
  background: #213243 !important;
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  border-radius: 999px !important;
  overflow: hidden;
}

/* Active category link - dark theme */
html.dark-theme .category-link-active {
  background: #ffffff !important;
  border-color: #ffffff !important;
  color: #0b0b0c !important;
  border-radius: 999px !important;
}

html.dark-theme .category-link-active .category-name {
  color: #0b0b0c !important;
}

html.dark-theme .category-name {
  color: #ffffff;
}

html.dark-theme .no-categories {
  color: #9ca3af;
}

/* Responsive */
@media (max-width: 1024px) {
  /* Tablet: Ensure header has side padding */
  .container {
    padding-inline: var(--g-6);
  }
  
  /* Pagination centered properly on tablet/iPad */
  .pagination {
    justify-content: center;
  }
}

@media (max-width: 1024px) {
  /* Tablet/mobile: cards → pagination → sidebar (content-layout children join parent flex) */
  .content-wrapper {
    padding-bottom: var(--g-10);
  }

  .content-layout {
    display: contents;
  }

  .content-wrapper > .site-main,
  .content-layout > .site-main {
    order: 1;
    width: 100%;
  }

  .content-wrapper > .pagination {
    order: 2;
    width: 100%;
    margin-top: var(--g-2);
    margin-bottom: var(--g-2);
  }

  .content-wrapper > .sidebar,
  .content-layout > .sidebar {
    order: 3;
    position: static;
    max-width: 100%;
    width: 100%;
  }
  
  /* Tablet: Nav bar horizontally scrollable */
  .site-nav {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding-inline: 0;
    max-width: 100%;
    overscroll-behavior-x: contain;
  }
  
  .site-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  
  .site-nav .nav-list {
    flex-wrap: nowrap;
    width: max-content;
    padding: 0 var(--g-4);
  }
  
  .site-nav .nav-list li a {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  /* Mobile: Side spacing */
  .container {
    padding-inline: var(--g-4);
  }
  
  .content-wrapper {
    padding-inline: var(--g-4);
    padding-top: var(--g-4);
    padding-bottom: var(--g-10);
    gap: var(--g-6);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .widget {
    padding: var(--g-4);
  }
  
  .widget-title {
    font-size: 16px;
  }
  
  .top-post-title {
    font-size: 15px;
  }
  
  .top-post-date {
    font-size: 13px;
  }
  
  .category-link {
    padding: 5px 10px;
    font-size: 12px;
  }
  
  .category-name {
    font-size: 12px;
  }
  
  .top-post-number {
    width: auto;
    height: auto;
    font-size: 20px;
    min-width: 28px;
  }
  
  /* Mobile Header Layout - Left to Right */
  .header-inner { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--g-3);
    padding: var(--g-4); 
  }
  
  /* Make header-inner same width as site-main (post cards container) on mobile */
  .site-header .header-inner {
    max-width: var(--container-max) !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-inline: var(--g-4) !important;
    box-sizing: border-box;
    border-bottom: none !important;
    position: relative;
  }
  
  /* Ensure header-inner border-bottom has sides spacing on mobile - matches nav bar line */
  .site-header .header-inner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--g-4);
    right: var(--g-4);
    height: 1px;
    border-bottom: var(--border);
  }
  
  /* Extra side spacing for mobile header - ensure container wrapper has padding like site-main */
  .site-header > .container {
    max-width: var(--container-max) !important;
    width: 100% !important;
    padding-inline: var(--g-4) !important;
    margin: 0 auto !important;
    box-sizing: border-box;
  }
  
  /* Ensure nav bar container wrapper also has same padding as site-main */
  .site-header > .container + .container {
    max-width: var(--container-max) !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding-inline: var(--g-4) !important;
    box-sizing: border-box;
    overflow-x: hidden;
    min-width: 0;
  }
  
  /* Hide desktop social buttons on mobile */
  .social-buttons { 
    display: none !important; 
  }
  
  /* Brand on LEFT */
  .brand { 
    position: relative;
    order: 0;
  }
  
  .brand-name {
    font-size: 32px;
  }
  
  /* Section heading responsive */
  .section-heading {
    font-size: 24px;
    margin: 0 0 var(--g-6);
    padding-bottom: var(--g-2);
  }
  
  .section-heading::after {
    width: 60px;
    height: 2px;
  }
  
  /* Page title responsive */
  .page-title {
    font-size: 24px;
  }
  
  .page-header {
    margin-bottom: var(--g-4);
    padding-bottom: var(--g-2);
  }
  
  /* Smaller border radius for mobile images */
  .page-content img,
  .entry-content img {
    border-radius: 8px;
    margin-bottom: var(--g-4);
  }
  
  /* Buttons on RIGHT */
  .header-actions {
    display: flex;
    gap: var(--g-2);
    align-items: center;
    order: 1;
  }
  
  .header-actions .site-logo-link {
    display: flex !important;
    width: 40px !important;
    height: 40px !important;
  }
  
  .header-actions .site-logo-link .site-logo-icon {
    width: 28px;
    height: 28px;
  }
  
  /* Mobile - ensure site icons display correctly */
  .header-actions .site-logo-link .site-logo-light,
  .header-actions .site-logo-link .site-logo-dark {
    width: 28px;
    height: 28px;
  }
  
  .header-actions .theme-toggle-btn {
    display: flex !important;
    width: 40px !important;
    height: 40px !important;
  }
  
  .header-actions .theme-toggle-btn .theme-icon {
    width: 18px;
    height: 18px;
  }
  
  .header-actions .channel-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    gap: 0 !important;
  }
  
  .header-actions .channel-btn .whatsapp-icon {
    width: 18px;
    height: 18px;
  }
  
  /* Hide "Channel" text on mobile */
  .header-actions .channel-btn span {
    display: none !important;
  }
  
  /* Nav bar horizontally scrollable - must not widen the page */
  .site-nav {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding-top: 0px;
    padding-bottom: 10px;
    margin-top: -1.5px;
    border-bottom: var(--border);
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    box-sizing: border-box;
    overscroll-behavior-x: contain;
  }
  
  .site-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  
  .nav-list {
    flex-wrap: nowrap;
    width: max-content;
    max-width: none;
    min-width: 0;
    padding: 0;
    margin: 0;
  }
  
  .nav-link,
  .site-nav .nav-list li a {
    white-space: nowrap;
    flex-shrink: 0;
    border-width: 1px; /* Ensure all borders visible */
  }
  
  /* Mobile responsive styles */
  /* Smaller author icons on mobile */
  .author-icon {
    width: 18px;
    height: 18px;
    padding: 0;
    border-width: 1px;
  }
  
  .site-main { 
    padding-block: var(--g-8);
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: 0;
    box-sizing: border-box;
  }
  
  /* Single post and page content width same as homepage on mobile */
  body.single .site-main,
  body.page .site-main {
    max-width: var(--container-max);
    padding-inline: 0;
  }
  
  /* Single/post pages content-wrapper padding same as homepage on mobile */
  body.single .content-wrapper,
  body.page .content-wrapper {
    padding-inline: var(--g-4);
  }
  
  /* Remove padding from site-main when inside content-wrapper on mobile */
  .content-wrapper .site-main {
    padding-inline: 0;
  }

  /* Listing pages: less space between last card and pagination */
  body.home .content-wrapper .site-main,
  body.search .content-wrapper .site-main,
  body.category .content-wrapper .site-main,
  body.search-results .content-wrapper .site-main {
    padding-bottom: 0;
  }

  body.home .content-wrapper > .pagination,
  body.search .content-wrapper > .pagination,
  body.category .content-wrapper > .pagination,
  body.search-results .content-wrapper > .pagination {
    margin-top: 0;
    margin-bottom: 0;
  }
  
  /* Single/post pages site-main inside content-wrapper - no extra padding */
  body.single .content-wrapper .site-main,
  body.page .content-wrapper .site-main {
    padding-inline: 0;
  }
  
  /* Fix: Ensure category post cards stay within bounds on mobile */
  .category-post-card {
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    position: relative;
  }
  
  /* Fix: Image frame stays sized; media layer clips zoom */
  .category-post-image {
    overflow: visible;
    border-radius: 8px;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
  }

  .category-post-image-media {
    border-radius: 8px;
  }
  
  /* Fix: Ensure thumbnail doesn't overflow and maintains border radius */
  .category-post-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    max-width: 100%;
  }
  
  /* Half-out labels on mobile — keep inset from sides */
  .category-post-badges {
    left: var(--g-2);
    top: 0;
    transform: translateY(-50%);
    max-width: calc(100% - var(--g-6));
    z-index: 2;
    box-sizing: border-box;
  }
  
  .category-post-views-wrapper {
    right: var(--g-2);
    top: 0;
    transform: translateY(-50%);
    max-width: calc(100% - var(--g-6));
    z-index: 2;
    box-sizing: border-box;
  }

  /* Text-only cards: keep labels in-flow on mobile */
  .category-post-panel {
    padding: var(--g-4);
  }

  .category-post-panel .category-post-badges,
  .category-post-panel .category-post-views-wrapper {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    max-width: none;
  }
  
  .category-post-overlay {
    border-radius: 8px;
    overflow: visible;
  }
  
  /* Fix: Ensure category posts grid doesn't cause overflow */
  .category-posts-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  
  /* Home page, Search page, and Category page specific on mobile */
  body.home .content-wrapper,
  body.search .content-wrapper,
  body.category .content-wrapper,
  body.search-results .content-wrapper { 
    padding-top: 0;
    margin-top: -10px;
    padding-bottom: var(--g-10); 
  }
  
  /* Badge spacing on mobile */
  .badge {
    font-size: 9px;
    padding: 3px 6px;
  }
  
  .category-post-badges .badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 999px;
  }
  
  /* Category post views on mobile */
  .category-post-views {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 999px;
  }
  
  /* Pagination responsive */
  .pagination {
    gap: var(--g-3);
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  
  .pager,
  .pager-wrapper a,
  .pager.disabled {
    padding: 0 12px;
    font-size: 13px;
    height: 36px;
    min-height: 36px;
  }
  
  .page-numbers {
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0;
    flex: 0 0 auto;
    justify-content: center;
  }
  
  .page-numbers::-webkit-scrollbar {
    display: none;
  }

  /* Phones: JS keeps 3 numbers around the current page (see theme.js). */
  .page-numbers li.is-pagination-hidden {
    display: none;
  }

  /* Static pages: tighter footer gap on mobile */
  body.page .content-wrapper {
    padding-bottom: var(--g-4);
  }
}

/* No Posts Message */
.no-posts {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--g-10);
}

/* Shared action button (e.g. 404 back link) */
.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: #F0F1F5;
  border: var(--border);
  border-radius: 10px;
  color: #0b0b0c;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 11, 12, 0.1);
}

.nav-button:active,
.nav-button:focus {
  border-radius: 10px;
  outline: none;
  box-shadow: var(--shadow-1);
}

html.dark-theme .nav-button {
  background: #213243;
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

html.dark-theme .nav-button:active,
html.dark-theme .nav-button:focus {
  border-radius: 10px;
  outline: none;
}

/* Moon Icon (hidden by default, shown in dark theme) */
.moon-icon {
  display: none;
}

html.dark-theme .moon-icon {
  display: block;
}

html.dark-theme .sun-icon {
  display: none;
}

/* Premium: interactive hover lift on header controls & nav */
.social-btn:hover,
.theme-toggle-btn:hover,
.channel-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.site-nav .nav-list li:not(.current-menu-item):not(.current_page_item):not(.current-cat) > a:hover,
.nav-link:hover:not(.is-active) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.sidebar .widget:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.sidebar .category-link:hover:not(.category-link-active) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.sidebar .top-post-link:hover {
  transform: translateX(4px);
}

.pager-wrapper a:hover,
.page-numbers a:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

html.dark-theme .social-btn:hover,
html.dark-theme .theme-toggle-btn:hover,
html.dark-theme .channel-btn:hover,
html.dark-theme .pager-wrapper a:hover,
html.dark-theme .page-numbers a:hover,
html.dark-theme .sidebar .widget:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* Scroll-reveal: only elements JS marks .maxsan-reveal (below-fold) */
.maxsan-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s var(--ease-premium), transform 0.6s var(--ease-premium);
}
.maxsan-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .maxsan-reveal {
    opacity: 1;
    transform: none;
  }
}

