/*
Theme Name: Juwa Lite Magazine
Author: Elric
Author URI: https://juwa2games.com
Description: A lightweight custom WordPress magazine-style theme built for blog-heavy sites that need strong mobile responsiveness, native comments, related articles, archive layouts, and compatibility with SEO plugins such as Yoast SEO and All in One SEO.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: juwa-lite
Tags: blog, news, one-column, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --jl-bg: #0f1115;
  --jl-bg-soft: #171a21;
  --jl-surface: #ffffff;
  --jl-surface-muted: #f5f6f8;
  --jl-text: #111827;
  --jl-text-soft: #4b5563;
  --jl-line: #e5e7eb;
  --jl-line-strong: #d1d5db;
  --jl-accent: #c9a227;
  --jl-accent-dark: #9a7b14;
  --jl-success: #117a65;
  --jl-shadow: 0 18px 40px rgba(17, 24, 39, 0.08);
  --jl-radius: 22px;
  --jl-radius-sm: 14px;
  --jl-content: 1180px;
  --jl-reading: 760px;
  --jl-header-height: 76px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--jl-surface-muted);
  color: var(--jl-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--jl-accent-dark);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

figure {
  margin: 0;
}

ul,
ol {
  padding-left: 1.25rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

button,
.button,
.wp-element-button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--jl-accent);
  color: #111;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover,
.button:hover,
.wp-element-button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover {
  background: var(--jl-accent-dark);
  color: #fff;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container,
.alignwide {
  width: min(calc(100% - 2rem), var(--jl-content));
  margin-inline: auto;
}

.alignfull {
  width: 100%;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  background: #fff;
  color: #111;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  box-shadow: var(--jl-shadow);
  z-index: 1000;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  color: var(--jl-text);
  border-bottom: 1px solid var(--jl-line);
}

.site-header__inner {
  min-height: var(--jl-header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.site-logo img,
.custom-logo {
  width: auto;
  max-height: 48px;
}

.site-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-title a,
.site-description {
  color: var(--jl-text);
}

.site-description {
  margin: 0.15rem 0 0;
  color: var(--jl-text-soft);
  font-size: 0.92rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 14px;
  background: var(--jl-surface-muted);
  border: 1px solid var(--jl-line);
  color: var(--jl-text);
}

.site-nav__toggle-icon,
.site-nav__toggle-icon::before,
.site-nav__toggle-icon::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: 0.2s ease;
  content: "";
}

.site-nav__toggle-icon {
  position: relative;
}

.site-nav__toggle-icon::before {
  position: absolute;
  top: -6px;
  left: 0;
}

.site-nav__toggle-icon::after {
  position: absolute;
  top: 6px;
  left: 0;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: var(--jl-text-soft);
  font-weight: 600;
  transition: color 0.15s ease;
}

.main-navigation .current-menu-item>a,
.main-navigation a:hover,
.main-navigation a:focus {
  color: var(--jl-text);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.header-search {
  display: none;
}

.header-search .search-form {
  margin: 0;
}

.main-content {
  flex: 1 0 auto;
  padding: 1.35rem 0 4rem;
}

.archive-hero,
.page-hero,
.front-hero,
.not-found,
.search-hero {
  background: linear-gradient(135deg, #12151d 0%, #1b212c 100%);
  color: #fff;
  border-radius: calc(var(--jl-radius) + 6px);
  padding: clamp(1.6rem, 3vw, 2.7rem);
  box-shadow: var(--jl-shadow);
  margin-bottom: 2rem;
}

.front-hero {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 1.3rem;
  align-items: stretch;
}

.front-hero__content,
.front-hero__media {
  min-width: 0;
}

.eyebrow,
.archive-badge,
.card-badge,
.entry-badge,
.related-label,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #111;
  background: var(--jl-accent);
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
}

.front-hero__title,
.archive-title,
.page-title,
.search-title,
.not-found__title {
  margin: 0.85rem 0 0.8rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.front-hero__text,
.archive-description,
.page-subtitle,
.search-subtitle,
.not-found__text {
  margin: 0;
  font-size: 1.04rem;
  color: rgba(255, 255, 255, 0.83);
  max-width: 62ch;
}

.front-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.front-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1rem;
}

.stat-card__value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.stat-card__label {
  display: block;
  margin-top: 0.45rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.hero-card,
.panel,
.card,
.sidebar-block,
.author-box,
.comments-area,
.related-posts,
.post-navigation,
.site-footer__grid>section,
.entry-content table {
  background: var(--jl-surface);
  border: 1px solid var(--jl-line);
  border-radius: var(--jl-radius);
  box-shadow: var(--jl-shadow);
}

.hero-card {
  overflow: hidden;
  height: 100%;
}

.hero-card__image img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
}

.hero-card__content {
  padding: 1.1rem 1.15rem 1.3rem;
  color: var(--jl-text);
}

.hero-card__title {
  margin: 0.65rem 0 0.5rem;
  font-size: clamp(1.3rem, 2vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-card__excerpt,
.entry-summary,
.latest-list__excerpt,
.card__excerpt,
.meta-list,
.entry-meta,
.comment-metadata,
.archive-meta,
.card__meta {
  color: var(--jl-text-soft);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1.2rem;
}

.section-title {
  margin: 0.3rem 0 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.section-copy {
  margin: 0;
  max-width: 55ch;
  color: var(--jl-text-soft);
}

.home-magazine {
  display: grid;
  gap: 1.5rem;
}

.home-magazine__lead,
.archive-layout,
.search-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
  align-items: start;
}

.latest-list,
.simple-list,
.footer-menu,
.post-taxonomies,
.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.latest-list {
  display: grid;
  gap: 1rem;
}

.latest-list__item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.95rem;
  align-items: start;
}

.latest-list__thumb img,
.related-grid .card img,
.archive-grid .card img,
.feature-grid .card img,
.search-grid .card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
}

.latest-list__title,
.card__title,
.entry-title,
.related-card__title {
  margin: 0.45rem 0 0.35rem;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.latest-list__title {
  font-size: 1.02rem;
}

.latest-list__meta,
.card__meta,
.archive-meta,
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  align-items: center;
  font-size: 0.92rem;
}

.feature-grid,
.archive-grid,
.related-grid,
.search-grid,
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.card {
  overflow: hidden;
  height: 100%;
}

.card__content {
  padding: 1rem 1rem 1.1rem;
}

.card__title {
  font-size: 1.2rem;
}

.panel {
  padding: 1.15rem;
}

.archive-layout__main,
.search-layout__main,
.single-layout__main {
  min-width: 0;
}

.sidebar-stack {
  display: grid;
  gap: 1.2rem;
  position: sticky;
  top: calc(var(--jl-header-height) + 1rem);
}

.sidebar-block {
  padding: 1.15rem;
}

.sidebar-title {
  margin: 0 0 0.85rem;
  font-size: 1.1rem;
}

.simple-list {
  display: grid;
  gap: 0.8rem;
}

.simple-list a {
  display: inline-flex;
  gap: 0.4rem;
  color: var(--jl-text);
  font-weight: 600;
}

.simple-list small {
  display: block;
  margin-top: 0.15rem;
  color: var(--jl-text-soft);
}

.archive-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.8rem 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.entry-card,
.card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.entry-card:hover,
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 48px rgba(17, 24, 39, 0.12);
}

.single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
  gap: 1.5rem;
  align-items: start;
}

.entry-single {
  background: var(--jl-surface);
  border: 1px solid var(--jl-line);
  border-radius: calc(var(--jl-radius) + 4px);
  box-shadow: var(--jl-shadow);
  overflow: hidden;
}

.entry-header {
  padding: clamp(1.3rem, 3vw, 2rem);
  border-bottom: 1px solid var(--jl-line);
}

.entry-title {
  margin: 0.8rem 0 0.8rem;
  font-size: clamp(2rem, 5vw, 3rem);
}

.entry-featured {
  padding: 0 clamp(1.3rem, 3vw, 2rem);
}

.entry-featured img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px;
}

.entry-content-wrap {
  padding: clamp(1.3rem, 3vw, 2rem);
}

.entry-content {
  max-width: var(--jl-reading);
}

.entry-content>*:first-child {
  margin-top: 0;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin-top: 1.75em;
  margin-bottom: 0.65em;
}

.entry-content h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.entry-content h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
}

.entry-content h4 {
  font-size: 1.1rem;
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote,
.entry-content table,
.entry-content pre,
.entry-content figure {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

.entry-content blockquote {
  border-left: 4px solid var(--jl-accent);
  padding: 0.4rem 0 0.4rem 1rem;
  color: var(--jl-text-soft);
  font-size: 1.08rem;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.entry-content th,
.entry-content td {
  padding: 0.8rem 0.95rem;
  border-bottom: 1px solid var(--jl-line);
  text-align: left;
}

.entry-content code,
.entry-content pre {
  background: #111827;
  color: #f9fafb;
  border-radius: 14px;
}

.entry-content code {
  padding: 0.15rem 0.4rem;
}

.entry-content pre {
  padding: 1rem;
  overflow: auto;
}

.entry-content .wp-block-image img,
.entry-content .wp-block-post-featured-image img {
  border-radius: 20px;
}

.entry-footer {
  display: grid;
  gap: 1rem;
  padding: 0 clamp(1.3rem, 3vw, 2rem) clamp(1.3rem, 3vw, 2rem);
}

.post-taxonomies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tax-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--jl-line-strong);
  background: var(--jl-surface);
  color: var(--jl-text-soft);
  font-size: 0.92rem;
  font-weight: 600;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-bottom: 0.7rem;
  color: var(--jl-text-soft);
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: var(--jl-text-soft);
}

.breadcrumbs .separator {
  opacity: 0.55;
}

.author-box,
.related-posts,
.post-navigation,
.comments-area {
  padding: clamp(1.15rem, 3vw, 1.5rem);
}

.author-box {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.author-avatar img {
  border-radius: 50%;
}

.author-box__name {
  margin: 0;
  font-size: 1.15rem;
}

.author-box__bio {
  margin: 0.4rem 0 0;
  color: var(--jl-text-soft);
}

.related-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.related-title,
.comments-title,
.comment-reply-title {
  margin: 0.3rem 0 0;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-card__content {
  padding: 1rem;
}

.related-card__title {
  font-size: 1.05rem;
}

.post-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.post-nav-link {
  display: block;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: var(--jl-surface-muted);
  border: 1px solid var(--jl-line);
  min-height: 100%;
}

.post-nav-link__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--jl-text-soft);
}

.post-nav-link__title {
  display: block;
  margin-top: 0.4rem;
  font-weight: 700;
  line-height: 1.3;
}

.comment-list,
.children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.comment-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}

.comment-body {
  padding: 1rem;
  border: 1px solid var(--jl-line);
  border-radius: 18px;
  background: var(--jl-surface-muted);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
}

.comment-author img {
  border-radius: 50%;
}

.comment-meta {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: var(--jl-text-soft);
}

.comment-content {
  margin-top: 0.75rem;
}

.comment-reply-link {
  display: inline-flex;
  margin-top: 0.7rem;
  font-weight: 700;
}

.comment-respond {
  margin-top: 1.5rem;
}

.comment-form {
  display: grid;
  gap: 1rem;
}

.comment-form p {
  margin: 0;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form input[type="search"],
.comment-form textarea,
.search-field,
.wpcf7-form-control,
input[type="password"] {
  width: 100%;
  border: 1px solid var(--jl-line-strong);
  border-radius: 16px;
  background: #fff;
  color: var(--jl-text);
  padding: 0.85rem 1rem;
}

.comment-form textarea {
  min-height: 180px;
  resize: vertical;
}

.search-form {
  display: flex;
  gap: 0.6rem;
}

.pagination,
.posts-navigation,
.post-navigation .nav-links,
.comment-navigation {
  margin-top: 1.4rem;
}

.pagination .nav-links,
.posts-navigation .nav-links,
.comment-navigation .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.page-numbers,
.posts-navigation a,
.comment-navigation a,
.posts-navigation span,
.comment-navigation span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--jl-line-strong);
  background: #fff;
  font-weight: 700;
}

.page-numbers.current {
  background: var(--jl-accent);
  color: #111;
  border-color: transparent;
}

/* Front page content — no card boxing, content flows naturally */
.front-page-content {
  padding: 0;
  margin-bottom: 2rem;
}

.front-page-content>*:first-child {
  margin-top: 0;
}

.front-page-content>*:last-child {
  margin-bottom: 0;
}

/* Let Gutenberg blocks on front page use full container width */
.front-page-content .wp-block-group,
.front-page-content .wp-block-cover,
.front-page-content .wp-block-columns,
.front-page-content .wp-block-media-text {
  margin-bottom: 1.5rem;
}

.front-page-content .wp-block-group.alignfull,
.front-page-content .wp-block-cover.alignfull {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  border-radius: 0;
}

.empty-state {
  padding: 2rem;
  text-align: center;
}

.site-footer {
  background: #111827;
  color: #fff;
  margin-top: auto;
  padding: 3rem 0 1.5rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 2.5rem;
}

.site-footer__brand {
  min-width: 0;
}

.footer-logo img,
.footer-logo .custom-logo {
  max-height: 40px;
  width: auto;
  margin-bottom: 0.8rem;
}

.site-footer__site-name {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.site-footer__heading {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
}

.site-footer__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  line-height: 1.6;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.15s ease;
}

.site-footer a:hover,
.site-footer a:focus {
  color: #fff;
}

.footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.footer-menu a {
  font-size: 0.95rem;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.88rem;
}

.toc-container,
.ez-toc-container,
.lwptoc,
.rank-math-toc-block,
.wp-block-table-of-contents {
  padding: 1rem 1rem 0.7rem;
  border: 1px solid var(--jl-line);
  border-radius: 20px;
  background: var(--jl-surface-muted);
  margin-bottom: 1.2rem;
}

.toc-container ul,
.ez-toc-container ul,
.lwptoc_items,
.rank-math-toc-block ul,
.wp-block-table-of-contents ul {
  list-style: none;
  padding-left: 0;
  margin: 0.75rem 0 0;
  display: grid;
  gap: 0.45rem;
}

.archive-description p:last-child,
.page-content>*:last-child,
.entry-summary p:last-child,
.card__excerpt p:last-child,
.author-box__bio:last-child,
.not-found__text:last-child {
  margin-bottom: 0;
}

@media (max-width: 1040px) {

  .front-hero,
  .home-magazine__lead,
  .archive-layout,
  .search-layout,
  .single-layout,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .archive-grid,
  .related-grid,
  .search-grid,
  .footer-widgets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-stack {
    position: static;
  }
}

@media (max-width: 820px) {
  .site-nav__toggle {
    display: inline-flex;
  }

  .main-navigation {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 1rem;
    right: 1rem;
    padding: 0.9rem;
    background: var(--jl-surface);
    border: 1px solid var(--jl-line);
    border-radius: 20px;
    box-shadow: var(--jl-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: 0.2s ease;
  }

  .main-navigation.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .main-navigation ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .header-search {
    display: none;
  }

  .feature-grid,
  .related-grid,
  .search-grid,
  .archive-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {

  .container,
  .alignwide {
    width: min(calc(100% - 1.2rem), var(--jl-content));
  }

  .main-content {
    padding-top: 1rem;
  }

  .front-hero,
  .archive-hero,
  .page-hero,
  .not-found,
  .search-hero,
  .entry-header,
  .entry-content-wrap,
  .entry-footer,
  .comments-area,
  .related-posts,
  .post-navigation,
  .sidebar-block,
  .author-box,
  .panel {
    border-radius: 20px;
  }

  .front-hero__stats,
  .feature-grid,
  .related-grid,
  .search-grid,
  .site-footer__grid {
    grid-template-columns: 1fr;
  }

  .latest-list__item,
  .author-box,
  .post-navigation {
    grid-template-columns: 1fr;
  }

  .search-form {
    flex-direction: column;
  }
}

/* ==========================================================================
   SCROLL OFFSET — fixes anchor jumps behind sticky header
   ========================================================================== */

html {
  scroll-padding-top: calc(var(--jl-header-height) + 1.5rem);
}

[id] {
  scroll-margin-top: calc(var(--jl-header-height) + 1.5rem);
}

/* ==========================================================================
   READING PROGRESS BAR
   ========================================================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--jl-accent) 0%, #e8d44d 100%);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ==========================================================================
   THEME TOGGLE BUTTON (dark / light)
   ========================================================================== */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-height: unset;
  padding: 0;
  border-radius: 50%;
  background: var(--jl-surface-muted);
  border: 1px solid var(--jl-line);
  color: var(--jl-text);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--jl-line);
  transform: rotate(20deg);
  color: var(--jl-text);
}

.theme-toggle svg {
  display: block;
}

/* ==========================================================================
   DARK MODE — variable overrides
   ========================================================================== */

[data-theme="dark"] {
  --jl-bg: #0f1115;
  --jl-bg-soft: #171a21;
  --jl-surface: #1c1f28;
  --jl-surface-muted: #14161d;
  --jl-text: #e4e6eb;
  --jl-text-soft: #9ca3af;
  --jl-line: #2a2e3a;
  --jl-line-strong: #3b4050;
  --jl-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

[data-theme="dark"] body {
  background: var(--jl-bg-soft);
  color: var(--jl-text);
}

[data-theme="dark"] .site-header {
  background: rgba(15, 17, 21, 0.96);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .site-title a,
[data-theme="dark"] .site-description {
  color: #fff;
}

[data-theme="dark"] .main-navigation a {
  color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .main-navigation .current-menu-item>a,
[data-theme="dark"] .main-navigation a:hover,
[data-theme="dark"] .main-navigation a:focus {
  color: #fff;
}

[data-theme="dark"] .site-nav__toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  color: #fff;
}

[data-theme="dark"] .hero-card,
[data-theme="dark"] .panel,
[data-theme="dark"] .card,
[data-theme="dark"] .sidebar-block,
[data-theme="dark"] .author-box,
[data-theme="dark"] .comments-area,
[data-theme="dark"] .related-posts,
[data-theme="dark"] .post-navigation,
[data-theme="dark"] .entry-single {
  background: var(--jl-surface);
  border-color: var(--jl-line);
}

[data-theme="dark"] .comment-body {
  background: var(--jl-bg-soft);
  border-color: var(--jl-line);
}

[data-theme="dark"] .comment-form input[type="text"],
[data-theme="dark"] .comment-form input[type="email"],
[data-theme="dark"] .comment-form input[type="url"],
[data-theme="dark"] .comment-form textarea,
[data-theme="dark"] .search-field,
[data-theme="dark"] input[type="password"] {
  background: var(--jl-bg-soft);
  border-color: var(--jl-line-strong);
  color: var(--jl-text);
}

[data-theme="dark"] .page-numbers,
[data-theme="dark"] .posts-navigation a,
[data-theme="dark"] .comment-navigation a {
  background: var(--jl-surface);
  border-color: var(--jl-line-strong);
  color: var(--jl-text);
}

[data-theme="dark"] .page-numbers.current {
  background: var(--jl-accent);
  color: #111;
}

[data-theme="dark"] .tax-pill {
  background: var(--jl-bg-soft);
  border-color: var(--jl-line-strong);
  color: var(--jl-text-soft);
}

[data-theme="dark"] .post-nav-link {
  background: var(--jl-bg-soft);
  border-color: var(--jl-line);
}

[data-theme="dark"] .toc-container,
[data-theme="dark"] .ez-toc-container,
[data-theme="dark"] .lwptoc,
[data-theme="dark"] .rank-math-toc-block,
[data-theme="dark"] .wp-block-table-of-contents {
  background: var(--jl-surface);
  border-color: var(--jl-line);
}

[data-theme="dark"] .entry-content code,
[data-theme="dark"] .entry-content pre {
  background: #0d0f14;
}

/* Footer is already dark, no special dark-mode override needed */

[data-theme="dark"] a:hover,
[data-theme="dark"] a:focus {
  color: var(--jl-accent);
}

/* ==========================================================================
   STICKY TOC ON DESKTOP + COLLAPSIBLE ON MOBILE
   ========================================================================== */

@media (min-width: 821px) {

  .entry-content .toc-container,
  .entry-content .ez-toc-container,
  .entry-content .lwptoc,
  .entry-content .rank-math-toc-block,
  .entry-content .wp-block-table-of-contents {
    position: sticky;
    top: calc(var(--jl-header-height) + 1.5rem);
    z-index: 10;
  }
}

/* Collapsible TOC on mobile */
.jl-toc-collapsible {
  overflow: hidden;
}

.jl-toc-collapsible.jl-toc-collapsed ul,
.jl-toc-collapsible.jl-toc-collapsed ol,
.jl-toc-collapsible.jl-toc-collapsed .ez-toc-list,
.jl-toc-collapsible.jl-toc-collapsed .lwptoc_items {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.jl-toc-collapsible:not(.jl-toc-collapsed) ul,
.jl-toc-collapsible:not(.jl-toc-collapsed) ol,
.jl-toc-collapsible:not(.jl-toc-collapsed) .ez-toc-list,
.jl-toc-collapsible:not(.jl-toc-collapsed) .lwptoc_items {
  max-height: 600px;
  opacity: 1;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

/* ==========================================================================
   BLOCK PATTERN STYLES — premium look
   ========================================================================== */

.jl-pattern {
  padding: 1.5rem;
  border: 1px solid var(--jl-line);
  border-radius: var(--jl-radius);
  background: var(--jl-surface);
  margin-bottom: 1.5rem;
  box-shadow: var(--jl-shadow);
}

/* Review */
.jl-review .wp-block-columns {
  gap: 1.5rem;
}

.jl-review h3 {
  font-size: 1.1rem;
}

/* Pros / Cons */
.jl-pros {
  padding: 1.2rem;
  border-radius: 18px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.jl-cons {
  padding: 1.2rem;
  border-radius: 18px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .jl-pros {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
}

[data-theme="dark"] .jl-cons {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
}

/* CTA */
.jl-cta {
  background: linear-gradient(135deg, #12151d 0%, #1b212c 100%);
  color: #fff;
  text-align: center;
}

.jl-cta h2 {
  color: #fff;
}

.jl-cta p {
  color: rgba(255, 255, 255, 0.83);
}

/* FAQ details/summary */
.wp-block-details {
  border: 1px solid var(--jl-line);
  border-radius: 16px;
  padding: 1rem 1.15rem;
  margin-bottom: 0.7rem;
  background: var(--jl-surface-muted);
  transition: background 0.2s ease;
}

.wp-block-details[open] {
  background: var(--jl-surface);
}

.wp-block-details summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.wp-block-details summary::-webkit-details-marker {
  display: none;
}

.wp-block-details summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--jl-accent);
  color: #111;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.wp-block-details[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

.wp-block-details>p {
  margin-top: 0.8rem;
}

/* Disclaimer */
.jl-disclaimer {
  background: rgba(234, 179, 8, 0.06);
  border-color: rgba(234, 179, 8, 0.2);
}

[data-theme="dark"] .jl-disclaimer {
  background: rgba(234, 179, 8, 0.08);
  border-color: rgba(234, 179, 8, 0.18);
}

/* How-to tip */
.jl-tip {
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .jl-tip {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
}