/*
Theme Name: WayToLegal
Theme URI: https://www.waytolegal.com/
Author: WayToLegal
Description: A clean editorial theme for WayToLegal, a plain-English legal information site. Magazine-style homepage with featured stories and a topic grid, topic archive pages with sub-topic chips, and a reading-first article layout with author/reviewer byline, auto-generated table of contents, legal notice and related guides. Built-in light/dark mode.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: waytolegal
*/

/* ==========================================================================
   Design tokens
   Dark-mode values are set on <html> (not <body>) so the root element, the
   body and every descendant all resolve the same variables.
   ========================================================================== */
:root {
  --wl-bg: #f4f6fa;
  --wl-paper: #ffffff;
  --wl-ink: #0f172a;
  --wl-muted: #56627a;
  --wl-border: #dde3ee;
  --wl-primary: #0a2a5b;
  --wl-primary-hover: #123b7d;
  --wl-on-primary: #ffffff;
  --wl-link: #0a2a5b;
  --wl-soft: #e8eef9;
  --wl-gold: #9a6b12;
  --wl-gold-soft: #fbf3df;
  --wl-footer: #0a1a35;
  --wl-footer-ink: #c9d4e8;
  --wl-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(15, 23, 42, .06);
  --wl-shadow-hover: 0 2px 4px rgba(15, 23, 42, .06), 0 14px 30px rgba(15, 23, 42, .12);
  --wl-radius: 14px;
  --wl-max: 1200px;
  --wl-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --wl-sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wl-header-h: 68px;
}

:root.dark-mode {
  color-scheme: dark;
  --wl-bg: #0a1020;
  --wl-paper: #111a2e;
  --wl-ink: #e9eef7;
  --wl-muted: #a0aec5;
  --wl-border: #243250;
  --wl-primary: #2f6fd6;
  --wl-primary-hover: #4682e6;
  --wl-link: #8db4f2;
  --wl-soft: #172342;
  --wl-gold: #e3b657;
  --wl-gold-soft: #2a2313;
  --wl-footer: #060c18;
  --wl-footer-ink: #a9b7d0;
  --wl-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --wl-shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 14px 30px rgba(0, 0, 0, .45);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--wl-bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wl-bg);
  color: var(--wl-ink);
  font-family: var(--wl-sans);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--wl-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--wl-serif); line-height: 1.25; color: var(--wl-ink); margin: 0 0 .5em; }
p { margin: 0 0 1em; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--wl-primary); outline-offset: 2px; border-radius: 4px; }
:root.dark-mode :focus-visible { outline-color: var(--wl-link); }

.container { width: min(calc(100% - 40px), var(--wl-max)); margin-inline: auto; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px;
  background: var(--wl-primary); color: var(--wl-on-primary); border-radius: 8px; transition: top .15s;
}
.skip-link:focus { top: 12px; text-decoration: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 11px 20px; border: 0; border-radius: 10px; background: var(--wl-primary); color: var(--wl-on-primary);
  font-weight: 650; font-size: 15px; line-height: 1.2; transition: background .15s, transform .15s;
}
.btn:hover { background: var(--wl-primary-hover); color: var(--wl-on-primary); text-decoration: none; }

.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--wl-gold); margin-bottom: 10px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--wl-paper); border-bottom: 1px solid var(--wl-border); }
.header-inner { min-height: var(--wl-header-h); display: flex; align-items: center; gap: 28px; }
.site-brand { display: inline-flex; align-items: center; flex: none; }
.site-brand:hover { text-decoration: none; }
.site-logo, .site-brand img { width: auto; height: 30px; max-width: 220px; }
.site-brand-logo img.custom-logo { max-height: 36px; max-width: 220px; width: auto; height: auto; }
:root.dark-mode .site-header .site-brand img { filter: invert(1) hue-rotate(180deg) brightness(1.25); }

.main-nav { margin-left: auto; min-width: 0; }
.primary-menu, .primary-menu ul { list-style: none; margin: 0; padding: 0; }
.primary-menu { display: flex; align-items: center; gap: 2px; }
.primary-menu > li { position: relative; }
.primary-menu a {
  display: flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 9px;
  color: var(--wl-ink); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.primary-menu a:hover { background: var(--wl-soft); color: var(--wl-link); text-decoration: none; }
.primary-menu .current-menu-item > a,
.primary-menu .current-cat > a,
.primary-menu .current-menu-ancestor > a,
.primary-menu .current-cat-parent > a { background: var(--wl-soft); color: var(--wl-link); }
.primary-menu .menu-item-has-children > a::after {
  content: ""; width: 6px; height: 6px; margin-left: 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.primary-menu .sub-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 220px; padding: 6px; z-index: 60;
  background: var(--wl-paper); border: 1px solid var(--wl-border); border-radius: 12px; box-shadow: var(--wl-shadow-hover);
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.primary-menu li:hover > .sub-menu, .primary-menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-menu .sub-menu a { font-size: 14.5px; font-weight: 550; }

.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--wl-ink); cursor: pointer;
}
.icon-btn:hover { background: var(--wl-soft); color: var(--wl-link); }
.theme-toggle .icon-sun { display: none; }
:root.dark-mode .theme-toggle .icon-sun { display: block; }
:root.dark-mode .theme-toggle .icon-moon { display: none; }
.mobile-menu-toggle { display: none; flex-direction: column; gap: 5px; }
.mobile-menu-toggle span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }

.search-modal { display: none; position: absolute; left: 0; right: 0; z-index: 55; padding: 16px 0; background: var(--wl-paper); border-bottom: 1px solid var(--wl-border); box-shadow: var(--wl-shadow); }
.search-modal.is-open { display: block; }
.search-form { display: flex; gap: 10px; width: 100%; }
.search-field {
  flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--wl-border); border-radius: 10px;
  background: var(--wl-paper); color: var(--wl-ink);
}
.search-field::placeholder { color: var(--wl-muted); }

/* ==========================================================================
   Homepage
   ========================================================================== */
.home-hero { padding: 38px 0 14px; }
.home-intro { max-width: 760px; margin-bottom: 26px; }
.home-intro h1 { font-size: clamp(30px, 4.2vw, 46px); margin-bottom: 12px; }
.lede { font-size: 19px; color: var(--wl-muted); margin: 0; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; }
.hero-lead {
  position: relative; display: flex; align-items: flex-end; min-height: 470px; overflow: hidden;
  border-radius: 18px; color: #fff; background: linear-gradient(135deg, #0a2a5b, #153f86); box-shadow: var(--wl-shadow);
}
.hero-lead-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .6s ease; }
.hero-lead:hover .hero-lead-bg { transform: scale(1.03); }
.hero-lead.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 16, 38, 0) 22%, rgba(5, 16, 38, .9) 100%); }
.hero-lead-copy { position: relative; z-index: 2; padding: 32px; max-width: 760px; }
.hero-chip {
  display: inline-block; margin-bottom: 14px; padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; backdrop-filter: blur(4px);
}
.hero-lead h2 { color: #fff; font-size: clamp(24px, 3vw, 34px); margin-bottom: 12px; }
.hero-lead h2 a { color: inherit; }
.hero-lead h2 a:hover { text-decoration: none; }
.hero-lead h2 a::after { content: ""; position: absolute; inset: 0; z-index: 3; } /* whole card is the link */
.hero-lead p { color: rgba(255, 255, 255, .88); margin: 0 0 14px; font-size: 16.5px; }
.hero-meta { font-size: 13px; color: rgba(255, 255, 255, .8); }

.hero-side { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 14px; }
.side-card {
  position: relative; display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px;
  background: var(--wl-paper); border: 1px solid var(--wl-border); border-radius: var(--wl-radius); box-shadow: var(--wl-shadow); transition: box-shadow .2s, transform .2s;
}
.side-card:hover { box-shadow: var(--wl-shadow-hover); transform: translateY(-2px); }
.side-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: var(--wl-soft); }
.side-thumb img { width: 100%; height: 100%; object-fit: cover; }
.side-body { min-width: 0; }
.side-card h3 { font-size: 16px; line-height: 1.35; margin: 4px 0 6px; }
.side-card h3 a { color: var(--wl-ink); }
.side-card h3 a::after { content: ""; position: absolute; inset: 0; }
.side-card h3 a:hover { text-decoration: none; color: var(--wl-link); }

.section { padding: 44px 0 6px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-title { font-size: clamp(24px, 2.6vw, 30px); margin: 0 0 4px; }
.section-sub { margin: 0; color: var(--wl-muted); font-size: 15.5px; }
.read-more { font-size: 14.5px; font-weight: 650; white-space: nowrap; }

.topic-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.topic-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px 18px; color: var(--wl-ink);
  background: var(--wl-paper); border: 1px solid var(--wl-border); border-radius: var(--wl-radius); box-shadow: var(--wl-shadow);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.topic-card:hover { box-shadow: var(--wl-shadow-hover); transform: translateY(-3px); border-color: var(--wl-primary); text-decoration: none; }
.topic-icon { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 10px; border-radius: 12px; background: var(--wl-soft); color: var(--wl-link); }
.topic-card h3 { font-size: 17px; margin: 0; }
.topic-count { font-size: 13px; color: var(--wl-muted); }

/* ---- cards ---- */
.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.article-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  display: flex; flex-direction: column; overflow: hidden; min-width: 0; background: var(--wl-paper);
  border: 1px solid var(--wl-border); border-radius: var(--wl-radius); box-shadow: var(--wl-shadow); transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--wl-shadow-hover); transform: translateY(-3px); }
.card-image { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--wl-soft); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-image img { transform: scale(1.04); }
/* The fallback artwork is a light-blue <img>, so it cannot read the theme variables; dim it in dark mode. */
:root.dark-mode img[src$="fallback.svg"] { filter: brightness(.42) saturate(.85); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.post-cat { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--wl-gold); margin-bottom: 8px; }
.card h3 { font-size: 18.5px; line-height: 1.38; margin: 0 0 10px; }
.card h3 a { color: var(--wl-ink); }
.card h3 a:hover { color: var(--wl-link); text-decoration: none; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--wl-muted); margin-bottom: 10px; }
.card-body p { color: var(--wl-muted); font-size: 15px; margin: 0 0 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .read-more { margin-top: auto; }

.trust-band { margin-top: 56px; padding: 46px 0; background: var(--wl-primary); color: var(--wl-on-primary); }
:root.dark-mode .trust-band { background: var(--wl-paper); border-block: 1px solid var(--wl-border); }
.trust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.trust-item h3 { color: inherit; font-size: 19px; margin-bottom: 8px; }
.trust-item p { margin: 0; opacity: .88; font-size: 15.5px; }
.trust-item a { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

/* ==========================================================================
   Archive (category / tag / search / author)
   ========================================================================== */
.archive-hero { padding: 34px 0 26px; background: linear-gradient(180deg, var(--wl-soft), var(--wl-bg)); border-bottom: 1px solid var(--wl-border); }
.archive-hero h1 { font-size: clamp(28px, 3.6vw, 40px); margin-bottom: 10px; }
.archive-desc { max-width: 760px; color: var(--wl-muted); font-size: 17px; margin: 0; }
.archive-desc p:last-child { margin-bottom: 0; }
.archive-search { max-width: 560px; margin-top: 14px; }

.breadcrumbs { font-size: 12.5px; color: var(--wl-muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--wl-link); font-weight: 600; }
.breadcrumb-sep { margin: 0 3px; opacity: .55; }
.breadcrumbs:empty { display: none; }

.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.topic-chips.center { justify-content: center; }
.topic-chips a {
  padding: 7px 15px; border: 1px solid var(--wl-border); border-radius: 999px; background: var(--wl-paper);
  color: var(--wl-ink); font-size: 14px; font-weight: 600;
}
.topic-chips a:hover { border-color: var(--wl-primary); color: var(--wl-link); text-decoration: none; }
.topic-chips a.active { background: var(--wl-primary); border-color: var(--wl-primary); color: var(--wl-on-primary); }

.archive-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; padding: 34px 0 20px; align-items: start; }
.empty-state { padding: 34px; text-align: center; background: var(--wl-paper); border: 1px dashed var(--wl-border); border-radius: var(--wl-radius); }
.empty-state .topic-chips { justify-content: center; }

.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.page-numbers {
  min-width: 42px; padding: 9px 14px; text-align: center; border: 1px solid var(--wl-border); border-radius: 10px;
  background: var(--wl-paper); color: var(--wl-ink); font-weight: 600; font-size: 14.5px;
}
a.page-numbers:hover { border-color: var(--wl-primary); color: var(--wl-link); text-decoration: none; }
.page-numbers.current { background: var(--wl-primary); border-color: var(--wl-primary); color: var(--wl-on-primary); }
.page-numbers.dots { border: 0; background: transparent; }

/* ---- sidebar ---- */
.sidebar { display: grid; gap: 18px; align-content: start; min-width: 0; }
.sidebar-box { padding: 20px; background: var(--wl-paper); border: 1px solid var(--wl-border); border-radius: var(--wl-radius); box-shadow: var(--wl-shadow); }
.sidebar-box h3 { font-size: 17px; margin: 0 0 14px; }
.sidebar-list { display: grid; gap: 14px; }
.sidebar-item { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 12px; align-items: center; color: var(--wl-ink); }
.sidebar-item:hover { text-decoration: none; }
.sidebar-item:hover strong { color: var(--wl-link); }
.sidebar-thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: var(--wl-soft); }
.sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-item strong { font-family: var(--wl-serif); font-size: 14px; line-height: 1.4; font-weight: 700; }
.topic-list { list-style: none; margin: 0; padding: 0; }
.topic-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; color: var(--wl-ink); font-weight: 550; border-bottom: 1px solid var(--wl-border); }
.topic-list li:last-child a { border-bottom: 0; }
.topic-list a:hover, .topic-list a.active { color: var(--wl-link); text-decoration: none; }
.topic-list small { color: var(--wl-muted); font-size: 12.5px; padding: 2px 8px; border-radius: 999px; background: var(--wl-soft); }
.notice-box { background: var(--wl-gold-soft); border-color: transparent; box-shadow: none; }
.notice-box p { margin: 0; font-size: 14.5px; color: var(--wl-ink); }

/* ==========================================================================
   Single article / page
   ========================================================================== */
.single-wrap { padding: 28px 0 56px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 30px; align-items: start; }
.article-main {
  min-width: 0; padding: 38px 44px 40px; background: var(--wl-paper);
  border: 1px solid var(--wl-border); border-radius: 18px; box-shadow: var(--wl-shadow);
}
.article-main .breadcrumbs {
  font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 12px;
}
.article-main .breadcrumbs a { color: var(--wl-gold); }
.article-main .breadcrumb-sep { color: var(--wl-gold); }
.article-main h1 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.22; margin-bottom: 14px; }
.article-tagline { font-size: 19px; line-height: 1.55; color: var(--wl-muted); font-style: italic; margin-bottom: 22px; }
.page-main { max-width: 860px; margin-inline: auto; }

.contributors { margin: 0 0 20px; padding: 14px 16px; background: var(--wl-bg); border: 1px solid var(--wl-border); border-radius: 12px; }
.contributors-grid { display: flex; flex-wrap: wrap; gap: 14px 30px; }
.contributor { display: flex; align-items: center; gap: 11px; min-width: 0; }
.contributor-avatar {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--wl-primary); color: var(--wl-on-primary); font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.contributor.role-reviewed .contributor-avatar { background: var(--wl-gold); color: #fff; }
:root.dark-mode .contributor.role-reviewed .contributor-avatar { color: #1b1405; }
.contributor.role-edited .contributor-avatar, .contributor.role-factchecked .contributor-avatar { background: var(--wl-muted); color: var(--wl-paper); }
.contributor-body { min-width: 0; line-height: 1.3; }
.contributor-role { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wl-muted); }
.contributor-name { font-weight: 650; font-size: 15px; }
.contributor-name a { color: var(--wl-ink); }
.contributor-name a:hover { color: var(--wl-link); }
.contributor-credentials { font-size: 12.5px; color: var(--wl-muted); }

.article-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13.5px; color: var(--wl-muted); margin-bottom: 22px; }
.meta-updated { color: var(--wl-ink); font-weight: 600; }

.featured-large { margin: 0 0 24px; }
.featured-large img { width: 100%; border-radius: 14px; }
.featured-large figcaption { margin-top: 8px; font-size: 13px; color: var(--wl-muted); }

.legal-notice {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 24px; padding: 14px 16px;
  background: var(--wl-gold-soft); border-left: 4px solid var(--wl-gold); border-radius: 0 10px 10px 0; color: var(--wl-ink);
}
.legal-notice svg { flex: none; margin-top: 2px; color: var(--wl-gold); }
.legal-notice p { margin: 0; font-size: 14.5px; line-height: 1.55; }

.article-toc { margin: 0 0 28px; background: var(--wl-bg); border: 1px solid var(--wl-border); border-radius: 12px; }
.article-toc-title {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; cursor: pointer; list-style: none; border-radius: 12px; user-select: none;
}
.article-toc-title::-webkit-details-marker { display: none; }
.toc-label { font-family: var(--wl-serif); font-weight: 700; font-size: 18px; }
.toc-toggle {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--wl-border); border-radius: 999px;
  background: var(--wl-paper); color: var(--wl-link); font-size: 13px; font-weight: 600; line-height: 1.2;
}
.toc-toggle svg { flex: none; transition: transform .2s; }
.article-toc-title:hover .toc-toggle { border-color: var(--wl-primary); }
.toc-when-open { display: none; }
.article-toc details[open] .toc-when-open { display: inline; }
.article-toc details[open] .toc-when-closed { display: none; }
.article-toc details[open] .toc-toggle svg { transform: rotate(180deg); }
.article-toc details[open] .article-toc-title { padding-bottom: 8px; }
.article-toc-list { margin: 0; padding: 4px 22px 18px 44px; display: grid; gap: 5px; }
.article-toc-list a { color: var(--wl-ink); font-size: 15.5px; font-weight: 500; }
.article-toc-list a:hover { color: var(--wl-link); }

/* ---- article body ---- */
.article-content { font-size: 18px; line-height: 1.78; overflow-wrap: break-word; word-break: break-word; }
.article-content > *:first-child { margin-top: 0; }
.article-content p { margin: 0 0 1.25em; }
.article-content h2, .article-content h3, .article-content h4 { scroll-margin-top: calc(var(--wl-header-h) + 24px); }
.article-content h2 { font-size: 27px; margin: 1.9em 0 .6em; padding-top: .2em; }
.article-content h3 { font-size: 22px; margin: 1.6em 0 .5em; }
.article-content h4 { font-size: 18px; margin: 1.4em 0 .4em; }
.article-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article-content ul, .article-content ol { margin: 0 0 1.25em; padding-left: 26px; }
.article-content li { margin-bottom: .45em; }
.article-content li > ul, .article-content li > ol { margin: .45em 0 0; }
.article-content blockquote {
  margin: 1.6em 0; padding: 14px 22px; border-left: 4px solid var(--wl-gold); background: var(--wl-gold-soft);
  border-radius: 0 10px 10px 0; font-family: var(--wl-serif); font-size: 18px;
}
.article-content blockquote p:last-child { margin-bottom: 0; }
.article-content img { border-radius: 10px; }
.article-content figure { margin: 1.6em 0; max-width: 100%; }
.article-content figcaption, .article-content .wp-caption-text { font-size: 13.5px; color: var(--wl-muted); margin-top: 8px; font-style: normal; }
.article-content .wp-caption { max-width: 100% !important; width: auto !important; }
.article-content .alignleft { float: left; margin: 6px 22px 12px 0; max-width: 45%; }
.article-content .alignright { float: right; margin: 6px 0 12px 22px; max-width: 45%; }
.article-content .aligncenter { margin-inline: auto; }
.article-content::after { content: ""; display: table; clear: both; }
.article-content table {
  display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-collapse: collapse; margin: 1.6em 0; font-size: 15.5px; line-height: 1.5;
}
.article-content th, .article-content td { padding: 10px 14px; border: 1px solid var(--wl-border); text-align: left; vertical-align: top; min-width: 110px; }
.article-content thead th, .article-content th { background: var(--wl-soft); font-weight: 700; }
.article-content iframe, .article-content embed, .article-content video { max-width: 100%; }
.article-content iframe[src*="youtube"], .article-content iframe[src*="youtu.be"], .article-content iframe[src*="vimeo"] { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }
.article-content pre, .article-content code { font-size: 15px; }
.article-content pre { overflow-x: auto; padding: 14px 16px; border-radius: 10px; background: var(--wl-bg); border: 1px solid var(--wl-border); }
.article-content hr { margin: 2em 0; border: 0; border-top: 1px solid var(--wl-border); }
/* Reference / source lists carry long unbroken URLs. */
.article-content cite, .article-content ol cite a, .article-content ol a[href^="http"] { overflow-wrap: anywhere; word-break: break-all; }
.article-content cite { font-style: normal; font-size: .92em; }

.share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--wl-border); }
.share-label { font-weight: 700; font-size: 14px; }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--wl-border); border-radius: 999px;
  background: var(--wl-paper); color: var(--wl-ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.share-btn:hover { border-color: var(--wl-primary); color: var(--wl-link); text-decoration: none; }
.share-btn.is-copied { background: var(--wl-primary); border-color: var(--wl-primary); color: var(--wl-on-primary); }

.related-section { margin-top: 44px; }

/* reviewer / author profile heads */
.author-head { display: flex; align-items: center; gap: 22px; }
.author-avatar {
  flex: none; display: grid; place-items: center; width: 84px; height: 84px; overflow: hidden; border-radius: 50%;
  background: var(--wl-primary); color: var(--wl-on-primary); font-family: var(--wl-serif); font-size: 28px; font-weight: 700;
}
.author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.author-credit { color: var(--wl-muted); margin: 0 0 8px; }
.reviewed-title { font-size: 22px; margin-top: 1.8em; }
.reviewed-list { padding-left: 22px; }
.page-main .author-head { margin-bottom: 26px; }

/* ==========================================================================
   404
   ========================================================================== */
.error-404-wrap { padding: 56px 0 70px; }
.error-404-inner { text-align: center; max-width: 720px; }
.error-404-art { width: 220px; margin: 0 auto 18px; }
.error-404-inner h1 { font-size: clamp(28px, 4vw, 38px); }
.error-404-inner > p { color: var(--wl-muted); }
.error-404-search { max-width: 520px; margin: 24px auto 4px; }
.error-404-actions { margin-top: 26px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { margin-top: 64px; background: var(--wl-footer); color: var(--wl-footer-ink); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 44px; padding: 52px 0 38px; }
.footer-brand { min-width: 0; }
.site-footer .site-brand img { filter: invert(1) hue-rotate(180deg) brightness(1.5); height: 28px; }
.footer-brand p { max-width: 400px; margin: 16px 0 0; font-size: 14.5px; line-height: 1.7; }
.footer-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.footer-social a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; }
.footer-social a:hover { background: rgba(255, 255, 255, .2); }
.footer-col h3 { color: #fff; font-family: var(--wl-sans); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; margin: 4px 0 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--wl-footer-ink); font-size: 14.5px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 18px 0 24px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12.5px; color: #8fa0bf; }

/* ==========================================================================
   Static pages: About Us (page-aboutus-new.php) + Contact Us (template-contact-us.php)
   ========================================================================== */
.disp { font-family: var(--wl-serif); }
.dek { font-size: 19px; line-height: 1.6; color: var(--wl-muted); max-width: 760px; margin: 0; }

/* ---- About ---- */
.about-layout {
  width: min(calc(100% - 40px), var(--wl-max)); margin: 34px auto 56px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start;
}
.abt-toc { position: sticky; top: calc(var(--wl-header-h) + 24px); min-width: 0; }
.abt-toc nav {
  background: var(--wl-paper); border: 1px solid var(--wl-border); border-left: 4px solid var(--wl-gold);
  border-radius: 12px; box-shadow: var(--wl-shadow);
}
.abt-toc-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 6px;
  font-size: 17px; font-weight: 700; color: var(--wl-ink); list-style: none; cursor: default;
}
.abt-toc-heading::-webkit-details-marker { display: none; }
.abt-toc-arrow { display: none; flex: none; transition: transform .2s; }
.abt-toc details:not([open]) .abt-toc-heading { padding-bottom: 16px; }
.abt-toc ul { list-style: none; margin: 0; padding: 4px 10px 12px; }
.abt-toc li a {
  display: block; padding: 9px 10px; border-radius: 8px; color: var(--wl-ink); font-size: 15px; font-weight: 550; line-height: 1.35;
}
.abt-toc li a:hover { background: var(--wl-soft); color: var(--wl-link); text-decoration: none; }

.about-cont {
  min-width: 0; padding: 40px 44px 44px; background: var(--wl-paper);
  border: 1px solid var(--wl-border); border-radius: 18px; box-shadow: var(--wl-shadow);
}
.about-cont section { scroll-margin-top: calc(var(--wl-header-h) + 24px); }
.about-cont section + section { margin-top: 42px; padding-top: 34px; border-top: 1px solid var(--wl-border); }
.about-cont h1 { font-size: clamp(30px, 3.8vw, 42px); line-height: 1.2; margin-bottom: 22px; }
.about-cont h2 { font-size: 28px; margin-bottom: 18px; }
.about-cont p { font-size: 17.5px; line-height: 1.75; max-width: 72ch; }
.about-cont p a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.abt-policy {
  margin: 0 0 16px; padding: 20px 22px 22px; background: var(--wl-bg); border: 1px solid var(--wl-border); border-radius: 12px;
}
.abt-policy:last-child { margin-bottom: 0; }
.abt-policy p { margin: 0 0 16px; font-size: 16.5px; line-height: 1.7; }
.abt-us-btn { font-size: 14.5px; }
.abt-us-btn svg { flex: none; transition: transform .15s; }
.abt-us-btn:hover svg { transform: translateX(3px); }

/* ---- Contact ---- */
.contact-intro {
  padding: 40px max(20px, calc((100% - var(--wl-max)) / 2)) 30px;
  background: linear-gradient(180deg, var(--wl-soft), var(--wl-bg)); border-bottom: 1px solid var(--wl-border);
}
.contact-intro h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 12px; }
.contact-layout {
  width: min(calc(100% - 40px), var(--wl-max)); margin: 32px auto 56px;
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 30px; align-items: start;
}
.contact-main, .contact-address {
  min-width: 0; background: var(--wl-paper); border: 1px solid var(--wl-border); border-radius: 18px; box-shadow: var(--wl-shadow);
}
.contact-main { padding: 36px 40px 40px; }
.contact-main h2 { font-size: 24px; margin: 34px 0 14px; }
.contact-main h2:first-child { margin-top: 0; }
.contact-main p { line-height: 1.75; }
.contact-main p:last-child { margin-bottom: 0; }
.contact-main a, .contact-address a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.contact-icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--wl-soft); color: var(--wl-link);
}
.contact-email { display: flex; align-items: flex-start; gap: 16px; padding: 18px 20px; background: var(--wl-bg); border: 1px solid var(--wl-border); border-radius: 12px; }
.contact-email p { margin: 0; overflow-wrap: anywhere; }

.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.contact-list li {
  margin: 0; padding: 14px 18px; line-height: 1.65; font-size: 16.5px; background: var(--wl-bg);
  border: 1px solid var(--wl-border); border-left: 3px solid var(--wl-gold); border-radius: 10px;
}
.contact-list strong { color: var(--wl-ink); }

.contact-address { padding: 28px 28px 30px; background: var(--wl-soft); border-color: transparent; box-shadow: none; }
.contact-address .contact-icon { margin-bottom: 14px; background: var(--wl-paper); }
.contact-address h3 { font-size: 21px; margin-bottom: 12px; }
.contact-address address { font-style: normal; line-height: 1.75; margin-bottom: 14px; }
.contact-address p { margin: 0 0 6px; overflow-wrap: anywhere; }
.contact-address hr { margin: 18px 0; border: 0; border-top: 1px solid var(--wl-border); }

@media (max-width: 980px) {
  .about-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 24px; }
  .abt-toc { position: static; }
  .contact-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .about-layout, .contact-layout { width: min(calc(100% - 28px), var(--wl-max)); margin-bottom: 40px; }
  .about-cont { padding: 26px 20px 30px; border-radius: 14px; }
  .about-cont h2 { font-size: 24px; }
  .about-cont p { font-size: 16.5px; }
  .abt-policy { padding: 16px 16px 18px; }
  /* the page script collapses the TOC on phones, so it needs a visible toggle */
  .abt-toc-heading { cursor: pointer; padding-bottom: 16px; }
  .abt-toc-arrow { display: block; }
  .abt-toc details[open] .abt-toc-arrow { transform: rotate(180deg); }
  .abt-toc details[open] .abt-toc-heading { padding-bottom: 6px; }
  .contact-intro { padding: 30px 14px 22px; }
  .dek { font-size: 17px; }
  .contact-main { padding: 24px 18px 28px; border-radius: 14px; }
  .contact-main h2 { font-size: 21px; margin-top: 28px; }
  .contact-address { padding: 22px 20px 24px; border-radius: 14px; }
  .contact-email { padding: 14px; gap: 12px; }
  .contact-list li { padding: 12px 14px; font-size: 15.5px; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  .main-nav {
    position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); display: none; padding: 8px;
    background: var(--wl-paper); border: 1px solid var(--wl-border); border-radius: 14px; box-shadow: var(--wl-shadow-hover); z-index: 60;
  }
  .main-nav.is-open { display: block; }
  .primary-menu { display: block; }
  .primary-menu a { padding: 12px 14px; white-space: normal; }
  .primary-menu .sub-menu { position: static; display: none; opacity: 1; visibility: visible; transform: none; min-width: 0; border: 0; box-shadow: none; padding: 0 0 4px 14px; }
  .primary-menu li.submenu-open > .sub-menu { display: block; }
  .mobile-menu-toggle { display: inline-flex; }
  .header-actions { margin-left: auto; }

  .hero-grid, .archive-layout, .article-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-lead { min-height: 400px; }
  .hero-side { grid-template-rows: none; }
  .trust-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .article-main { padding: 28px 26px 30px; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .container { width: min(calc(100% - 28px), var(--wl-max)); }
  .header-inner { gap: 12px; }
  .site-logo, .site-brand img { height: 26px; }
  .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .topic-card { padding: 16px 14px; }
  .article-grid, .article-grid.cols-2 { grid-template-columns: minmax(0, 1fr); }
  .hero-lead { min-height: 360px; }
  .hero-lead-copy { padding: 22px 20px; }
  .hero-lead p { display: none; }
  .side-card { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .section { padding-top: 34px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .article-main { padding: 22px 18px 26px; border-radius: 14px; }
  .article-content { font-size: 17px; line-height: 1.72; }
  .article-content h2 { font-size: 23px; }
  .article-content .alignleft, .article-content .alignright { float: none; margin: 1em auto; max-width: 100%; }
  .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 30px 24px; padding-top: 40px; }
  .author-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .search-form { flex-direction: column; }
}

@media (max-width: 380px) {
  /* Very small phones: logo + search + theme + menu buttons must fit in ~290px. */
  .header-inner { gap: 8px; }
  .site-logo, .site-brand img { height: 22px; }
  .icon-btn { width: 36px; height: 36px; }
  .header-actions { gap: 2px; }
}

@media (max-width: 300px) {
  .site-logo, .site-brand img { height: 18px; }
  .icon-btn { width: 32px; height: 32px; }
}

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

.advert {
	position: relative;
	margin: 0;
	text-align: center !important;
}
.advert:before {
    content: "Advertisement";
    display: block;
    left: 0;
    height: 20px;
    font-size: 11px;
    line-height: 20px;
    letter-spacing: 1px;
    color: #6f7174;
    top: -20px;
}

.advert:before {
	text-align: center !important
}
div.advertinside:before {
	content: 'Advertisement - Continue Reading Below';
	display: block;
	top: -20px;
	left: 0;
	height: 20px;
	font-size: 11px;
	line-height: 20px;
	letter-spacing: 1px;
	color: #6f7174;
	text-align: center;
}

div.advertinside:after {
	content: 'Advertisement - Continue Reading Below';
	display: block;
	top: -20px;
	left: 0;
	height: 20px;
	font-size:11px;
	line-height: 20px;
	letter-spacing: 1px;
	color: #6f7174;
	text-align: center;
}
.mn-h-400 {
	min-height: 400px
}
div.advertinside {
	text-align: center;
	background: #f5f5f5;
}
@media (min-width: 1024px) {
	.advertmobile {
		display: none;
	}
}

@media screen and (max-width:720px) {

	.advert {
		position: relative;
		margin: 0;
		text-align: center !important;
	}

	.advert:before {
		text-align: center !important
	}

}