/*
Theme Name: TipsWeb
Theme URI: https://tipsweb.in
Author: TipsWeb
Author URI: https://tipsweb.in
Description: A clean, fast, no-sidebar WordPress theme for government notification sites. Features a Google-style big search hero, full-width layout, responsive design, live colour Theme Panel, sticky header, notice ticker, department tiles, post cards, footer widgets, and built-in customizer options.
Version: 1.0.3
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tipsweb
Tags: blog, news, government, no-sidebar, full-width-template, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.
*/

/* ─────────────────────────────────────────
   CSS CUSTOM PROPERTIES (Theme Panel driven)
   ───────────────────────────────────────── */
:root {
  --tw-primary:        #1a3c5e;
  --tw-primary-dark:   #122b45;
  --tw-primary-light:  #2a5a8f;
  --tw-accent:         #e8832a;
  --tw-accent-light:   #f4a255;
  --tw-bg:             #f5f7fa;
  --tw-surface:        #ffffff;
  --tw-surface2:       #eef1f6;
  --tw-text:           #1c2b3a;
  --tw-text-muted:     #5a6a7a;
  --tw-text-light:     #8a9ab0;
  --tw-border:         #dde3ec;
  --tw-radius:         10px;
  --tw-shadow:         0 4px 24px rgba(26,60,94,0.10);
  --tw-shadow-hover:   0 8px 40px rgba(26,60,94,0.18);
  --tw-transition:     0.22s cubic-bezier(.4,0,.2,1);
  --tw-font-heading:   'Playfair Display', Georgia, serif;
  --tw-font-body:      'DM Sans', system-ui, sans-serif;
  --tw-font-mono:      'JetBrains Mono', monospace;
  --tw-footer-bg:      #111e2d;
}

/* ─── RESET & BASE ──────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--tw-font-body);
  background: var(--tw-bg);
  color: var(--tw-text);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--tw-primary); text-decoration: none; transition: color var(--tw-transition); }
a:hover { color: var(--tw-accent); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background: #f1f1f1;
  clip: auto !important;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-weight: 700;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* ─── LAYOUT ────────────────────────────── */
.tw-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.tw-container--wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}
#page { display: flex; flex-direction: column; min-height: 100vh; }
#content { flex: 1; }

/* No sidebar — full width always */
.site-main { width: 100%; }

/* ─── TOP BAR ───────────────────────────── */
#top-bar {
  background: var(--tw-primary-dark);
  color: #a8c0d8;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
#top-bar .tw-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.top-bar-links,
.top-bar-social { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.top-bar-links a,
.top-bar-social a { color: #a8c0d8; font-size: 12px; transition: color var(--tw-transition); }
.top-bar-links a:hover,
.top-bar-social a:hover { color: var(--tw-accent-light); }

/* ─── HEADER ────────────────────────────── */
#masthead {
  background: var(--tw-primary);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 20px rgba(0,0,0,0.18);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}
/* Logo */
.site-branding { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.site-logo-icon {
  width: 42px; height: 42px;
  background: var(--tw-accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tw-font-heading);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 2px 10px rgba(232,131,42,0.45);
  text-decoration: none;
  flex-shrink: 0;
}
.site-branding a { text-decoration: none; }
.site-title {
  font-family: var(--tw-font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #fff !important;
  letter-spacing: -0.3px;
  line-height: 1.2;
  margin: 0;
}
.site-description {
  font-size: 11px;
  color: #a8c0d8;
  letter-spacing: 0.4px;
  margin: 0;
}

/* Primary Navigation */
#site-navigation { display: flex; align-items: center; }

/* Top-level menu list */
.main-navigation .primary-menu,
.main-navigation > ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none !important;
  margin: 0; padding: 0;
}
.main-navigation li {
  position: relative;
  list-style: none;
}
.main-navigation a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  transition: background var(--tw-transition), color var(--tw-transition);
  text-decoration: none;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current-menu-parent > a {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* Dropdown sub-menus */
.main-navigation ul ul {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--tw-surface);
  border-radius: var(--tw-radius);
  box-shadow: var(--tw-shadow-hover);
  min-width: 210px;
  padding: 6px 0;
  border: 1px solid var(--tw-border);
  z-index: 300;
  flex-direction: column;
  gap: 0;
  list-style: none;
}
.main-navigation li:hover > ul,
.main-navigation li:focus-within > ul {
  display: flex;
  animation: tw-fadeDown 0.18s ease;
}
.main-navigation ul ul a {
  color: var(--tw-text);
  padding: 9px 18px;
  border-radius: 0;
  font-size: 13.5px;
  width: 100%;
}
.main-navigation ul ul a:hover {
  background: var(--tw-bg);
  color: var(--tw-primary);
}
/* Third-level offset */
.main-navigation ul ul ul {
  top: 0;
  left: 100%;
}

@keyframes tw-fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile nav open state */
.main-navigation.mobile-open {
  display: block;
}
.main-navigation.mobile-open .primary-menu,
.main-navigation.mobile-open > ul {
  flex-direction: column;
  align-items: stretch;
  padding: 12px 0;
}
.main-navigation.mobile-open ul ul {
  position: static;
  box-shadow: none;
  border: none;
  border-left: 3px solid var(--tw-accent);
  border-radius: 0;
  padding: 0;
  background: rgba(255,255,255,0.06);
}
.main-navigation.mobile-open li:hover > ul,
.main-navigation.mobile-open li:focus-within > ul {
  display: flex;
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-search-toggle {
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.18);
  color: #fff;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--tw-font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--tw-transition);
}
.header-search-toggle:hover { background: rgba(255,255,255,0.2); }
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
}
.menu-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all var(--tw-transition);
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── NOTICE TICKER ─────────────────────── */
#notice-ticker {
  background: var(--tw-primary-light);
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  height: 38px;
}
.ticker-label {
  background: var(--tw-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 18px;
  white-space: nowrap;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.ticker-track { overflow: hidden; flex: 1; }
.ticker-inner {
  display: flex;
  gap: 60px;
  animation: tw-ticker 35s linear infinite;
  white-space: nowrap;
}
.ticker-inner:hover { animation-play-state: paused; }
.ticker-inner a {
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  transition: color var(--tw-transition);
}
.ticker-inner a:hover { color: var(--tw-accent-light); }
.ticker-badge {
  background: var(--tw-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 6px;
  letter-spacing: 0.5px;
}
@keyframes tw-ticker { from { transform:translateX(0); } to { transform:translateX(-50%); } }

/* ─── HERO SEARCH ───────────────────────── */
#hero-search {
  background: linear-gradient(135deg, var(--tw-primary) 0%, var(--tw-primary-light) 60%, var(--tw-accent) 100%);
  padding: 72px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
#hero-search::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
  font-size: 11.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2);
}
.hero-title {
  font-family: var(--tw-font-heading);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.hero-subtitle {
  color: rgba(255,255,255,0.72);
  font-size: 16px;
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto; margin-right: auto;
}

/* Big Search Box */
.hero-search-form {
  max-width: 700px;
  margin: 0 auto 24px;
}
.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 50px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.22);
  overflow: hidden;
  transition: box-shadow var(--tw-transition);
}
.search-box:focus-within { box-shadow: 0 12px 60px rgba(0,0,0,0.30); }
.search-box .search-icon {
  padding: 0 18px;
  font-size: 20px;
  color: var(--tw-text-muted);
  flex-shrink: 0;
  pointer-events: none;
}
.search-box input[type="search"] {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--tw-font-body);
  font-size: 16px;
  color: var(--tw-text);
  padding: 18px 0;
  background: transparent;
  -webkit-appearance: none;
}
.search-box input[type="search"]::placeholder { color: var(--tw-text-light); }
.search-box button[type="submit"] {
  background: var(--tw-accent);
  color: #fff;
  border: none;
  padding: 12px 32px;
  font-family: var(--tw-font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin: 6px;
  border-radius: 50px;
  transition: background var(--tw-transition), transform var(--tw-transition);
  white-space: nowrap;
}
.search-box button[type="submit"]:hover { background: var(--tw-primary); transform: scale(1.03); }

/* Search Quick Tags */
.search-quick-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0;
}
.search-quick-tag {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.88);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  transition: background var(--tw-transition);
  font-weight: 500;
}
.search-quick-tag:hover { background: rgba(255,255,255,0.28); color: #fff; }

/* Hero Stats */
.hero-stats {
  display: flex;
  gap: 0;
  justify-content: center;
  margin-top: 40px;
  flex-wrap: wrap;
  background: rgba(0,0,0,0.15);
  border-radius: 14px;
  max-width: 600px;
  margin-left: auto; margin-right: auto;
  overflow: hidden;
}
.hero-stat {
  flex: 1;
  padding: 18px 20px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.12);
  min-width: 120px;
}
.hero-stat:last-child { border-right: none; }
.hero-stat-num {
  font-family: var(--tw-font-heading);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  display: block;
  line-height: 1;
}
.hero-stat-label {
  font-size: 11.5px;
  color: rgba(255,255,255,0.62);
  margin-top: 5px;
  letter-spacing: 0.3px;
}

/* ─── BREADCRUMB ────────────────────────── */
#breadcrumbs-bar {
  background: var(--tw-surface);
  border-bottom: 1px solid var(--tw-border);
  padding: 10px 0;
}
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--tw-text-muted);
  flex-wrap: wrap;
}
.breadcrumb-nav a { color: var(--tw-primary); }
.breadcrumb-nav a:hover { color: var(--tw-accent); }
.breadcrumb-sep { color: var(--tw-text-light); }

/* ─── SECTION HEADERS ───────────────────── */
.tw-section { margin-bottom: 52px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--tw-font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--tw-text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px; height: 24px;
  background: var(--tw-accent);
  border-radius: 4px;
  flex-shrink: 0;
}
.section-view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--tw-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.section-view-all:hover { color: var(--tw-accent); }

/* ─── DEPARTMENT TILES ──────────────────── */
.dept-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.dept-tile {
  background: var(--tw-surface);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius);
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow var(--tw-transition), transform var(--tw-transition), border-color var(--tw-transition);
  box-shadow: var(--tw-shadow);
  text-decoration: none;
  display: block;
}
.dept-tile:hover {
  box-shadow: var(--tw-shadow-hover);
  border-color: var(--tw-primary);
  transform: translateY(-3px);
  color: var(--tw-primary);
}
.dept-tile-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.dept-tile-name { font-size: 12.5px; font-weight: 600; color: var(--tw-text); line-height: 1.3; }
.dept-tile-count { font-size: 11px; color: var(--tw-text-light); margin-top: 4px; font-family: var(--tw-font-mono); }

/* ─── POST CARDS GRID ───────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* default; overridden by inline style from Customizer */
  gap: 20px;
  align-items: start; /* prevents cards stretching vertically across rows */
}
.post-card {
  background: var(--tw-surface);
  border-radius: var(--tw-radius);
  box-shadow: var(--tw-shadow);
  border: 1px solid var(--tw-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--tw-transition), transform var(--tw-transition);
  height: 100%;
}
.post-card:hover { box-shadow: var(--tw-shadow-hover); transform: translateY(-3px); }

/* Featured card spans all columns */
.post-card.is-featured {
  grid-column: 1 / -1;
  flex-direction: row;
  border-left: 4px solid var(--tw-accent);
  min-height: 180px;
}
.post-card.is-featured .card-body { padding: 26px 28px; }
.post-card.is-featured .card-title { font-size: 17px; line-height: 1.4; }
.featured-badge {
  display: inline-block;
  background: var(--tw-accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.card-body { padding: 18px 18px 14px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--tw-surface2);
  color: var(--tw-primary);
}
.card-tag.tag-finance   { background:#e8f4fd; color:#1a6fa8; }
.card-tag.tag-education { background:#e8f6f0; color:#1a7a48; }
.card-tag.tag-health    { background:#fdf0e8; color:#a84f1a; }
.card-tag.tag-police    { background:#f0e8fd; color:#6a1a9a; }
.card-tag.tag-new       { background:#fff3cd; color:#856404; }
.card-title {
  font-family: var(--tw-font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--tw-text);
  line-height: 1.45;
  margin: 0;
  transition: color var(--tw-transition);
}
.post-card:hover .card-title { color: var(--tw-primary); }
.card-title a { color: inherit; text-decoration: none; }
.card-excerpt {
  font-size: 13px;
  color: var(--tw-text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.card-footer {
  padding: 11px 18px;
  border-top: 1px solid var(--tw-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--tw-bg);
  gap: 8px;
}
.card-date { font-size: 12px; color: var(--tw-text-light); font-family: var(--tw-font-mono); }
.card-read-more {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tw-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: gap var(--tw-transition), color var(--tw-transition);
}
.post-card:hover .card-read-more { gap: 8px; color: var(--tw-accent); }

/* Thumbnail image in card */
.card-thumbnail { overflow: hidden; height: 160px; }
.card-thumbnail img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .card-thumbnail img { transform: scale(1.04); }

/* ─── TOOLS GRID ────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tool-card {
  background: var(--tw-surface);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: box-shadow var(--tw-transition), transform var(--tw-transition);
  box-shadow: var(--tw-shadow);
  text-decoration: none;
  color: var(--tw-text);
}
.tool-card:hover { box-shadow: var(--tw-shadow-hover); transform: translateY(-2px); color: var(--tw-primary); }
.tool-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--tw-surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.tool-card-title { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.tool-card-desc { font-size: 12px; color: var(--tw-text-muted); margin-top: 4px; }

/* ─── SUBJECT TAGS CLOUD ────────────────── */
.subjects-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-tag {
  background: var(--tw-surface);
  border: 1.5px solid var(--tw-border);
  color: var(--tw-text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tw-transition);
  text-decoration: none;
  display: inline-block;
}
.subject-tag:hover { background: var(--tw-primary); border-color: var(--tw-primary); color: #fff; }
.subject-tag.is-hot { background: #fff3e0; border-color: var(--tw-accent); color: var(--tw-accent); }
.subject-tag.is-hot:hover { background: var(--tw-accent); border-color: var(--tw-accent); color: #fff; }

/* ─── PAGINATION ────────────────────────── */
/* Wraps both paginate_links(type=list) and the_posts_pagination() output */
.page-numbers,
.tw-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none !important;
  margin: 40px 0 16px;
  padding: 0;
}

/* Every link and span inside — including <li> wrappers */
.page-numbers li { list-style: none; }

.page-numbers li > a,
.page-numbers li > span,
.page-numbers > a,
.page-numbers > span,
.tw-pagination a,
.tw-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--tw-border);
  background: var(--tw-surface);
  color: var(--tw-text);
  transition: background var(--tw-transition), border-color var(--tw-transition), color var(--tw-transition);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

/* Hover state */
.page-numbers li > a:hover,
.page-numbers > a:hover,
.tw-pagination a:hover {
  background: var(--tw-primary);
  border-color: var(--tw-primary);
  color: #fff;
}

/* Current / active page */
.page-numbers li > span.current,
.page-numbers > span.current,
.page-numbers .current,
.tw-pagination .current {
  background: var(--tw-primary);
  border-color: var(--tw-primary);
  color: #fff;
}

/* Dots / ellipsis */
.page-numbers .dots,
.page-numbers li > span.dots {
  background: transparent;
  border-color: transparent;
  color: var(--tw-text-muted);
  letter-spacing: 1px;
  cursor: default;
}

/* Prev / Next — wider pill */
.page-numbers .prev,
.page-numbers .next,
.page-numbers li > a.prev,
.page-numbers li > a.next {
  min-width: auto;
  padding: 0 16px;
  font-size: 13px;
  background: var(--tw-surface2);
  border-color: var(--tw-border);
  gap: 6px;
}
.page-numbers .prev:hover,
.page-numbers .next:hover {
  background: var(--tw-accent);
  border-color: var(--tw-accent);
  color: #fff;
}

/* Wrapper div (added by our PHP helper) */
.tw-pagination-wrap {
  text-align: center;
  padding: 8px 0 16px;
}

/* ─── SINGLE POST ───────────────────────── */
.single-post-wrap { max-width: 860px; margin: 0 auto; }
.single-post-header { margin-bottom: 32px; }
.single-post-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.single-post-title {
  font-family: var(--tw-font-heading);
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  color: var(--tw-text);
  line-height: 1.25;
  margin: 0 0 16px;
}
.single-post-meta { display: flex; gap: 16px; font-size: 13px; color: var(--tw-text-muted); flex-wrap: wrap; align-items: center; }
.post-content {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--tw-text);
}
.post-content h2,
.post-content h3 {
  font-family: var(--tw-font-heading);
  font-weight: 700;
  color: var(--tw-text);
  margin: 28px 0 12px;
}
.post-content p { margin-bottom: 18px; }
.post-content a { color: var(--tw-primary); text-decoration: underline; }
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 14px;
}
.post-content table th,
.post-content table td {
  padding: 10px 14px;
  border: 1px solid var(--tw-border);
  text-align: left;
}
.post-content table th { background: var(--tw-surface2); font-weight: 600; }
.post-content blockquote {
  border-left: 4px solid var(--tw-accent);
  padding: 14px 20px;
  background: var(--tw-surface2);
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-style: italic;
  color: var(--tw-text-muted);
}

/* ─── POST NAVIGATION ───────────────────── */
.post-nav {
  display: flex;
  gap: 16px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--tw-border);
}
.post-nav-link {
  flex: 1;
  padding: 14px;
  background: var(--tw-surface);
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius);
  display: block;
  transition: all 0.2s ease;
}
.post-nav-next {
  text-align: right;
}
.post-nav-link:hover {
  background: var(--tw-surface2);
  border-color: var(--tw-primary);
  transform: translateY(-2px);
}

/* ─── NOTICE BOX ────────────────────────── */
.tw-notice {
  background: #fff8e1;
  border: 1.5px solid #ffcc02;
  border-radius: var(--tw-radius);
  padding: 14px 18px;
  font-size: 13.5px;
  color: #6d4c00;
  margin-bottom: 24px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tw-notice strong { font-weight: 700; }

/* ─── FOOTER ────────────────────────────── */
#colophon {
  background: var(--tw-footer-bg);
  color: #b0c4d8;
}
.footer-widgets {
  padding: 60px 0 0;
}
.footer-widgets-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
/* Footer Brand */
.footer-brand-logo {
  font-family: var(--tw-font-heading);
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  display: block;
}
.footer-brand-desc {
  font-size: 13.5px;
  color: #7a96b0;
  line-height: 1.7;
  max-width: 280px;
  margin-bottom: 20px;
}
.footer-social { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-social-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.07);
  color: #b0c4d8;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--tw-transition), color var(--tw-transition);
  border: 1px solid rgba(255,255,255,0.1);
  text-decoration: none;
}
.footer-social-btn:hover { background: var(--tw-accent); color: #fff; border-color: var(--tw-accent); }

/* Footer widget column */
.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 18px;
  opacity: 0.88;
}
.footer-link-list { display: flex; flex-direction: column; gap: 10px; }
.footer-link-list a {
  color: #7a96b0;
  font-size: 13.5px;
  transition: color var(--tw-transition), padding-left var(--tw-transition);
  display: flex; align-items: center; gap: 5px;
}
.footer-link-list a::before { content: '›'; color: var(--tw-accent); opacity: 0; transition: opacity var(--tw-transition); }
.footer-link-list a:hover { color: #c8d8e8; padding-left: 4px; }
.footer-link-list a:hover::before { opacity: 1; }

/* Footer stats row */
.footer-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-stat { display: flex; align-items: center; gap: 14px; }
.footer-stat-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.footer-stat-num {
  font-family: var(--tw-font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.footer-stat-lbl { font-size: 12px; color: #7a96b0; margin-top: 3px; }

/* Footer bottom */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p { font-size: 12.5px; color: #506070; }
.footer-bottom-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom-nav a { color: #506070; font-size: 12.5px; transition: color var(--tw-transition); }
.footer-bottom-nav a:hover { color: var(--tw-accent-light); }

/* Disclaimer strip */
.footer-disclaimer {
  background: rgba(255,255,255,0.03);
  padding: 12px 24px;
  text-align: center;
  font-size: 12px;
  color: #485860;
  border-top: 1px solid rgba(255,255,255,0.05);
  line-height: 1.6;
}

/* ─── SCROLL TO TOP ─────────────────────── */
#scroll-to-top {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 44px; height: 44px;
  background: var(--tw-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  display: none;
  align-items: center; justify-content: center;
  transition: background var(--tw-transition), transform var(--tw-transition);
  z-index: 500;
}
#scroll-to-top.visible { display: flex; }
#scroll-to-top:hover { background: var(--tw-accent); transform: scale(1.1); }

/* ─── THEME PANEL ───────────────────────── */
#tw-theme-panel {
  position: fixed;
  right: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}
#tw-panel-tab {
  writing-mode: vertical-rl;
  background: var(--tw-accent);
  color: #fff;
  padding: 16px 10px;
  font-family: var(--tw-font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.5px;
  cursor: pointer;
  border: none;
  border-radius: 8px 0 0 8px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  transition: background var(--tw-transition);
  user-select: none;
  align-self: center;
}
#tw-panel-tab:hover { background: var(--tw-primary); }
#tw-panel-drawer {
  background: #fff;
  width: 0;
  max-height: 90vh;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(.4,0,.2,1);
  border-radius: 12px 0 0 12px;
  box-shadow: -8px 0 40px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
}
#tw-panel-drawer.open {
  width: 290px;
  overflow-y: auto;
}
.tw-panel-inner { padding: 20px 18px; min-width: 290px; }
.tw-panel-heading {
  font-family: var(--tw-font-heading);
  font-size: 15px;
  font-weight: 800;
  color: var(--tw-text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--tw-accent);
  display: flex; align-items: center; gap: 8px;
}
.tw-panel-section { margin-bottom: 0; padding: 14px 0; border-bottom: 1px solid var(--tw-border); }
.tw-panel-section:last-child { border-bottom: none; }
.tw-panel-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tw-text-muted);
  margin-bottom: 12px;
}
/* Colour swatches */
.tw-swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 12px; }
.tw-swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: border var(--tw-transition), transform var(--tw-transition);
}
.tw-swatch:hover, .tw-swatch.active { border-color: #333; transform: scale(1.14); }
/* Panel rows */
.tw-panel-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.tw-panel-label { font-size: 13px; font-weight: 500; color: var(--tw-text); flex: 1; }
.tw-panel-control {
  border: 1.5px solid var(--tw-border);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12.5px;
  font-family: var(--tw-font-body);
  color: var(--tw-text);
  background: var(--tw-bg);
  width: 120px;
  outline: none;
  transition: border var(--tw-transition);
}
.tw-panel-control:focus { border-color: var(--tw-accent); }
/* Toggle switch */
.tw-toggle { position: relative; width: 38px; height: 21px; flex-shrink: 0; }
.tw-toggle input { display: none; }
.tw-toggle-track {
  position: absolute; inset: 0;
  background: var(--tw-border);
  border-radius: 21px;
  cursor: pointer;
  transition: background var(--tw-transition);
}
.tw-toggle input:checked + .tw-toggle-track { background: var(--tw-accent); }
.tw-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--tw-transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.tw-toggle input:checked + .tw-toggle-track::after { transform: translateX(17px); }

/* ─── UTILITIES ─────────────────────────── */
.tw-pt-40 { padding-top: 40px; }
.tw-pb-40 { padding-bottom: 40px; }

/* ─── RESPONSIVE ────────────────────────── */
@media (max-width: 1024px) {
  .dept-grid { grid-template-columns: repeat(4, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-widgets-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .footer-stats-bar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .posts-grid { grid-template-columns: 1fr 1fr !important; }
  .dept-grid { grid-template-columns: repeat(3, 1fr); }

  /* Hide nav by default on mobile; show toggle */
  #site-navigation {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--tw-primary-dark);
    padding: 8px 0 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.28);
    z-index: 199;
  }
  /* Opened via JS — adds .mobile-open to #site-navigation */
  #site-navigation.mobile-open {
    display: block;
  }
  #site-navigation.mobile-open .primary-menu,
  #site-navigation.mobile-open > ul,
  #site-navigation.mobile-open .main-navigation > ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  #site-navigation.mobile-open .main-navigation a {
    border-radius: 0;
    padding: 12px 24px;
    color: rgba(255,255,255,0.9);
  }
  #site-navigation.mobile-open .main-navigation ul ul {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--tw-accent);
    border-radius: 0;
    padding: 0;
    background: rgba(0,0,0,0.12);
    display: flex; /* always show sub on mobile */
  }
  #site-navigation.mobile-open .main-navigation ul ul a {
    padding: 10px 24px 10px 36px;
    font-size: 13px;
  }
  /* Also cover class toggled on .main-navigation itself for safety */
  .main-navigation.mobile-open {
    display: block;
  }
  .menu-toggle { display: flex; }
  .post-card.is-featured { flex-direction: column; }
  /* Force masthead to be relative so absolute nav works */
  #masthead { position: sticky; }
}
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr !important; }
  .dept-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: 1fr; }
  .footer-widgets-grid { grid-template-columns: 1fr; }
  .footer-stats-bar { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .hero-stats { flex-direction: column; }
  .hero-stat { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.12); }
  .hero-stat:last-child { border-bottom: none; }
  #tw-theme-panel { display: none; }
  
  /* Post navigation - stack vertically on mobile */
  .post-nav {
    flex-direction: column;
    gap: 12px;
  }
  .post-nav-next {
    text-align: left;
  }
}
@media print {
  #top-bar, #masthead, #notice-ticker, #tw-theme-panel, #scroll-to-top, .footer-widgets { display: none !important; }
}
