/*!
Theme Name: Portal Update
Description: Fast, mobile-first white-label multi-category update portal theme. Features a blue portal header, clean category navigation bar, centered pill search, responsive 3x3 category boxes grid on the homepage, 2-column category archives and single post reading layout, dark mode, sticky sidebar, and dynamic site branding. Leaves your database untouched with zero demo categories or pages created automatically.
Version: 1.0.7
Requires at least: 6.0
Tested up to: 7.2
Requires PHP: 8.0
Author: Site Publisher
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: portal-update
Tags: news, blog, two-columns, right-sidebar, full-width-template, custom-logo, custom-menu, featured-images, responsive, threaded-comments
*/

/* ===== DESIGN TOKENS ===== */
:root {
  --portal-blue-start: #1877f2;
  --portal-blue-end: #0d5cb6;
  --portal-box-blue: #0d6efd;
  --portal-btn-blue: #2563eb;
  --portal-btn-blue-hover: #1d4ed8;
  --portal-footer-blue: #0066ff;
  --portal-footer-bottom: #004fe5;
  --portal-accent: #ff9900;
  --portal-yellow: #ffeb3b;
  --portal-nav-active-bg: #eaf0fb;
  --portal-bg: #f7f8f9;
  --portal-surface: #ffffff;
  --portal-surface-soft: #f8fafc;
  --portal-border: #d0d7de;
  --portal-row-divider: #eaeaea;
  --portal-ink: #1a1a1a;
  --portal-heading: #111827;
  --portal-body: #222222;
  --portal-muted: #656c76;
  --portal-base-font-size: 16px;
  --portal-logo-size: 52px;
  --portal-container-width: 1300px;
  --portal-radius: 6px;
  --portal-shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.05);
  --portal-shadow-card: 0 2px 7px rgba(15, 97, 193, 0.08);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--portal-base-font-size);
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", "Noto Sans Devanagari", "Inter", Tahoma, Geneva, Verdana, system-ui, -apple-system, sans-serif;
  background: var(--portal-bg);
  color: var(--portal-body);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--portal-blue-end);
  text-decoration: none;
}

a:hover {
  color: var(--portal-box-blue);
}

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

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

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

/* ===== READING PROGRESS BAR ===== */
.portal-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 9999;
  background: linear-gradient(90deg, var(--portal-accent), var(--portal-yellow));
  transition: width 0.08s linear;
}

body:not(.single-post) .portal-progress {
  display: none;
}

/* ===== OPTIONAL TOP NOTICE BAR ===== */
.portal-topbar {
  background: #0b4fa1;
  color: #ffffff;
  font-size: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.portal-topbar-inner {
  max-width: var(--portal-container-width);
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== BLUE PORTAL HEADER ===== */
.portal-header-wrapper {
  position: relative;
  z-index: 60;
}

.has-sticky-header .portal-header-wrapper {
  position: sticky;
  top: 0;
}

.has-sticky-header.admin-bar .portal-header-wrapper {
  top: 32px;
}

@media (max-width: 782px) {
  .has-sticky-header.admin-bar .portal-header-wrapper {
    top: 46px;
  }
}

.portal-top-header {
  background: linear-gradient(135deg, var(--portal-blue-start) 0%, var(--portal-blue-end) 100%);
  border-bottom: 2px solid var(--portal-accent);
  color: #ffffff;
}

.portal-top-header-inner {
  max-width: var(--portal-container-width);
  margin: 0 auto;
  padding: 12px 15px;
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}

.portal-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-brand {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  min-width: 0;
  text-decoration: none;
}

.portal-brand:hover {
  color: #ffffff;
}

.portal-logo-box {
  flex: 0 0 var(--portal-logo-size);
  width: var(--portal-logo-size);
  height: var(--portal-logo-size);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid rgba(255, 255, 255, 0.35);
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-logo-box img.custom-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-logo-fallback {
  width: 100%;
  height: 100%;
  background: #ffffff;
  color: var(--portal-blue-end);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-brand-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-brand-tagline {
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--portal-yellow);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-header-actions {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.portal-social-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-social-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.portal-social-btn:hover {
  color: #ffffff;
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.portal-social-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  display: block;
}

.portal-social-fb { background: #1877f2; }
.portal-social-x { background: #111827; }
.portal-social-tg { background: #229ed9; }
.portal-social-wa { background: #16a34a; }
.portal-social-yt { background: #ef4444; }

.portal-dark-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, transform 0.18s ease;
}

.portal-dark-toggle:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.portal-dark-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

.portal-dark-toggle .icon-sun { display: none; }
.portal-dark-toggle .icon-moon { display: block; }
html.portal-dark .portal-dark-toggle .icon-sun { display: block; }
html.portal-dark .portal-dark-toggle .icon-moon { display: none; }

/* Hamburger Toggle (fixed vertical column alignment) */
.portal-mobile-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
}

.portal-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ===== PRIMARY NAVIGATION BAR ===== */
.portal-nav-bar {
  background: var(--portal-surface);
  border-bottom: 2px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.portal-nav-container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 12px;
}

.portal-nav-list {
  list-style: none;
  display: flex;
  align-items: stretch;
  justify-content: center;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.portal-nav-list::-webkit-scrollbar {
  display: none;
}

.portal-nav-list > li {
  flex: 1 1 auto;
  display: flex;
  border-right: 1px solid #eeeeee;
  position: relative;
}

.portal-nav-list > li:first-child {
  border-left: 1px solid #eeeeee;
}

.portal-nav-list > li > a {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #333333;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.portal-nav-list > li > a:hover,
.portal-nav-list > li.current-menu-item > a,
.portal-nav-list > li.current_page_item > a,
.portal-nav-list > li.current-category-ancestor > a,
.portal-nav-list > li > a.is-active {
  background: var(--portal-nav-active-bg);
  color: var(--portal-blue-end);
  border-bottom-color: var(--portal-blue-end);
}

/* Submenu support on desktop hover */
.portal-nav-list li.menu-item-has-children > .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  list-style: none;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  z-index: 80;
}

.portal-nav-list li.menu-item-has-children:hover > .sub-menu,
.portal-nav-list li.menu-item-has-children:focus-within > .sub-menu {
  display: block;
}

.portal-nav-list .sub-menu a {
  display: block;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #333333;
  border-bottom: 1px solid var(--portal-row-divider);
}

.portal-nav-list .sub-menu a:hover {
  background: var(--portal-nav-active-bg);
  color: var(--portal-blue-end);
}

/* ===== MOBILE OFFCANVAS DRAWER ===== */
.portal-offcanvas-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 18, 38, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 998;
}

.portal-offcanvas-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.portal-offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--portal-surface);
  box-shadow: -8px 0 30px rgba(11, 18, 38, 0.22);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  z-index: 999;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.portal-offcanvas.is-open {
  transform: translateX(0);
}

.portal-offcanvas-head {
  background: linear-gradient(135deg, var(--portal-blue-start) 0%, var(--portal-blue-end) 100%);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-offcanvas-title {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.portal-offcanvas-close {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-offcanvas-nav {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.portal-offcanvas-nav li a {
  display: block;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #222222;
  border-bottom: 1px solid var(--portal-row-divider);
}

.portal-offcanvas-nav li a:hover {
  background: var(--portal-nav-active-bg);
  color: var(--portal-blue-end);
}

.portal-offcanvas-social {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--portal-border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== TICKER (OPTIONAL, CLEAN & OVERLAP-FREE) ===== */
.portal-ticker-wrap {
  max-width: var(--portal-container-width);
  margin: 14px auto 0;
  padding: 0 15px;
}

.portal-ticker {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 6px;
  overflow: hidden;
}

.portal-ticker-badge {
  flex: 0 0 auto;
  background: var(--portal-accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.portal-ticker-viewport {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.portal-ticker-track {
  display: flex;
  width: max-content;
  animation: portal-marquee 26s linear infinite;
}

.portal-ticker:hover .portal-ticker-track {
  animation-play-state: paused;
}

.portal-ticker-group {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
}

.portal-ticker-item {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: #7c2d12;
}

@keyframes portal-marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

/* ===== PILL SEARCH BAR ===== */
.portal-search-section {
  max-width: 750px;
  margin: 22px auto 20px;
  padding: 0 15px;
}

.portal-search-form {
  display: flex;
  align-items: stretch;
  background: var(--portal-surface);
  border: 2px solid #dbeafe;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.portal-search-form:focus-within {
  border-color: var(--portal-btn-blue);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.16);
}

.portal-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 13px 20px;
  font-size: 15px;
  color: var(--portal-ink);
}

.portal-search-input::placeholder {
  color: var(--portal-muted);
}

.portal-search-btn {
  flex: 0 0 64px;
  border: 0;
  background: var(--portal-btn-blue);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease;
}

.portal-search-btn:hover {
  background: var(--portal-btn-blue-hover);
}

.portal-search-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

/* ===== HOMEPAGE 3x3 CATEGORY BOXES GRID ===== */
.portal-boxes-wrapper {
  max-width: var(--portal-container-width);
  margin: 0 auto 30px;
  padding: 0 15px;
}

.portal-grid-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.portal-box {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  overflow: hidden;
  box-shadow: var(--portal-shadow-sm);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portal-box-header {
  background: var(--portal-box-blue);
  color: #ffffff;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.portal-box-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.portal-box-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-box-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.portal-box-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-view-all {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  line-height: 1.3;
  white-space: nowrap;
}

.portal-view-all:hover {
  background: rgba(255, 255, 255, 0.34);
  color: #ffffff;
}

.portal-box-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
}

.portal-box-item {
  border-bottom: 1px solid var(--portal-row-divider);
}

.portal-box-item:last-child {
  border-bottom: 0;
}

.portal-box-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  transition: background-color 0.14s ease;
}

.portal-box-row:hover {
  background: var(--portal-surface-soft);
}

.portal-box-link-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.portal-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--portal-box-blue);
  margin-top: 6px;
}

.portal-box-link {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--portal-ink);
  overflow-wrap: anywhere;
}

.portal-box-link:hover {
  color: var(--portal-box-blue);
}

.portal-box-date {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--portal-muted);
  white-space: nowrap;
  margin-top: 2px;
}

.portal-box-date svg {
  width: 11px;
  height: 11px;
  opacity: 0.78;
}

.portal-box-empty {
  padding: 26px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--portal-muted);
}

/* ===== HOMEPAGE STATIC PAGE / SEO CONTENT BELOW GRID ===== */
.portal-home-seo {
  max-width: 1100px;
  margin: 0 auto 32px;
  padding: 0 15px;
}

.portal-home-seo-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 24px 28px;
  box-shadow: var(--portal-shadow-sm);
}

.portal-home-seo-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--portal-heading);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--portal-nav-active-bg);
  line-height: 1.35;
}

/* ===== INNER 2-COLUMN CONTAINER (ARCHIVE, SINGLE, PAGE, SEARCH) ===== */
.portal-container {
  max-width: 1200px;
  margin: 20px auto 34px;
  padding: 0 15px;
}

.portal-has-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.portal-full-width {
  display: block;
}

.portal-main-col {
  min-width: 0;
}

/* ===== BREADCRUMB ===== */
.portal-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  color: var(--portal-muted);
  margin: 0 0 14px;
}

.portal-breadcrumb a {
  color: var(--portal-blue-end);
  font-weight: 600;
}

.portal-breadcrumb a:hover {
  text-decoration: underline;
}

.portal-crumb-home {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.portal-crumb-home svg {
  width: 13px;
  height: 13px;
}

.portal-breadcrumb .crumb-sep {
  opacity: 0.6;
}

/* ===== CATEGORY / ARCHIVE / SEARCH LIST BOX ===== */
.portal-archive-box {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  overflow: hidden;
  box-shadow: var(--portal-shadow-sm);
}

.portal-archive-header {
  background: var(--portal-box-blue);
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.portal-archive-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.portal-archive-desc {
  padding: 12px 16px;
  background: var(--portal-nav-active-bg);
  border-bottom: 1px solid var(--portal-border);
  font-size: 13.5px;
  color: var(--portal-body);
}

.portal-archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-archive-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--portal-row-divider);
  transition: background-color 0.14s ease;
}

.portal-archive-item:hover {
  background: var(--portal-surface-soft);
}

.portal-archive-item:last-child {
  border-bottom: 0;
}

.portal-archive-thumb {
  flex: 0 0 160px;
  width: 160px;
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--portal-nav-active-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-archive-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e0edff 0%, #eff6ff 100%);
  color: var(--portal-blue-end);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 8px;
}

.portal-archive-body {
  min-width: 0;
  flex: 1 1 auto;
}

.portal-archive-item-title {
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
}

.portal-archive-item-title a {
  color: var(--portal-ink);
}

.portal-archive-item-title a:hover {
  color: var(--portal-box-blue);
}

.portal-archive-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--portal-muted);
  margin-bottom: 6px;
}

.portal-archive-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.portal-archive-meta-item svg {
  width: 12px;
  height: 12px;
  color: var(--portal-box-blue);
}

.portal-archive-excerpt {
  font-size: 13.5px;
  color: var(--portal-muted);
  line-height: 1.55;
  margin: 0;
}

/* Pagination */
.portal-pagination {
  padding: 16px;
  border-top: 1px solid var(--portal-row-divider);
  display: flex;
  justify-content: center;
}

.portal-pagination-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.portal-pagination-inner > * {
  min-width: 38px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--portal-border);
  border-radius: 5px;
  background: var(--portal-surface);
  color: var(--portal-blue-end);
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-pagination-inner .current {
  background: var(--portal-box-blue);
  border-color: var(--portal-box-blue);
  color: #ffffff;
}

.portal-pagination-inner a:hover {
  background: var(--portal-nav-active-bg);
}

.portal-pagination-inner .dots {
  border-color: transparent;
  background: transparent;
  color: var(--portal-muted);
}

/* ===== SINGLE POST & PAGE ARTICLE ===== */
.portal-article {
  background: var(--portal-surface);
  border: 1px solid #e2e7ed;
  border-radius: 8px;
  padding: 22px 26px;
  box-shadow: var(--portal-shadow-card);
  margin-bottom: 22px;
}

.portal-cat-badge {
  display: inline-block;
  background: var(--portal-nav-active-bg);
  color: var(--portal-blue-end);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.portal-entry-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.35;
  color: var(--portal-heading);
  overflow-wrap: anywhere;
}

.portal-entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: #6b7280;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid #eef0f3;
}

.portal-entry-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.portal-entry-meta-item svg {
  width: 13px;
  height: 13px;
  color: var(--portal-box-blue);
}

.portal-scheme-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.portal-meta-pill {
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 5px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}

.portal-status-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 5px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.portal-official-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 5px;
  background: var(--portal-box-blue);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.portal-official-btn:hover {
  background: var(--portal-btn-blue-hover);
  color: #ffffff;
}

.portal-featured-figure {
  margin: 0 0 20px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--portal-border);
}

.portal-featured-figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* Post Content Typography (Blue Header Callouts & Portal Tables) */
.portal-post-content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--portal-body);
  overflow-wrap: break-word;
}

.portal-post-content > div,
.portal-post-content figure {
  max-width: 100%;
  box-sizing: border-box;
}

.portal-post-content > * + * {
  margin-top: 16px;
}

.portal-post-content h2 {
  margin-top: 26px;
  font-size: 20px;
  font-weight: 700;
  color: var(--portal-heading);
  background: var(--portal-nav-active-bg);
  border-left: 5px solid var(--portal-box-blue);
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  line-height: 1.35;
}

.portal-post-content h3 {
  margin-top: 22px;
  font-size: 18px;
  font-weight: 700;
  color: var(--portal-heading);
  padding-bottom: 6px;
  border-bottom: 2px solid #e5edfb;
}

.portal-post-content ul,
.portal-post-content ol {
  padding-left: 22px;
}

.portal-post-content li + li {
  margin-top: 6px;
}

.portal-post-content a {
  color: var(--portal-blue-end);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 3px;
}

.portal-post-content a.wp-block-button__link,
.portal-post-content a.portal-cell-btn,
.portal-post-content table td > a:only-child {
  text-decoration: none;
  background: var(--portal-box-blue);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  display: inline-block;
}

.portal-post-content a.wp-block-button__link:hover,
.portal-post-content a.portal-cell-btn:hover,
.portal-post-content table td > a:only-child:hover {
  background: var(--portal-btn-blue-hover);
  color: #ffffff;
}

.portal-post-content .wp-block-table {
  width: 100%;
  margin: 16px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.portal-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

.portal-post-content table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface);
  font-size: 14.5px;
  display: table;
  table-layout: auto;
  margin: 16px 0;
  text-align: center;
}

.portal-post-content .portal-table-wrap > table,
.portal-post-content .wp-block-table > table,
.portal-post-content .wp-block-table .portal-table-wrap {
  margin: 0;
}

.portal-post-content th {
  background: var(--portal-box-blue);
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #0b5ed7;
}

.portal-post-content table:not(:has(thead)) tbody td:first-child {
  background: #f0f6ff;
  font-weight: 600;
  color: var(--portal-heading);
  width: 38%;
}

.portal-post-content td {
  padding: 9px 12px;
  border: 1px solid #e3e8ef;
  vertical-align: middle;
}

.portal-post-content tr:nth-child(even) td {
  background: var(--portal-surface-soft);
}

/* Share Bar */
.portal-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--portal-row-divider);
}

.portal-share-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--portal-heading);
  margin-right: 4px;
}

.portal-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface-soft);
  color: var(--portal-ink);
  cursor: pointer;
}

.portal-share-btn:hover,
.portal-share-copy.copied {
  background: var(--portal-box-blue);
  border-color: var(--portal-box-blue);
  color: #ffffff;
}

/* Post Prev / Next */
.portal-prev-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.portal-nav-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
}

.portal-nav-card:hover {
  border-color: var(--portal-box-blue);
  background: var(--portal-surface-soft);
}

.portal-nav-next {
  text-align: right;
}

.portal-nav-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--portal-box-blue);
}

.portal-nav-card strong {
  font-size: 14px;
  color: var(--portal-heading);
  line-height: 1.4;
}

/* Discover Article Modules: Read Also Box, Step Screenshots & Collapsible FAQ */
.portal-related-links {
  list-style: none !important;
  padding: 0 !important;
  margin: 12px 0 18px !important;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  background: var(--portal-surface);
  overflow: hidden;
}

.portal-related-links li {
  margin: 0 !important;
  border-bottom: 1px solid var(--portal-row-divider);
}

.portal-related-links li:last-child {
  border-bottom: 0;
}

.portal-related-links a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  text-decoration: none !important;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--portal-ink);
}

.portal-related-links a:hover {
  background: var(--portal-surface-soft);
  color: var(--portal-box-blue);
}

.portal-rl-arrow {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--portal-nav-active-bg);
  color: var(--portal-blue-end);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

/* Auto In-Post Read Also Box ([portal_read_also] / Auto Inject) */
.portal-ar-box {
  position: relative;
  margin: 28px 0 22px;
  padding: 20px 14px 12px;
  background: var(--ar-bg, #f0f6ff);
  border-style: var(--ar-bstyle, dashed);
  border-width: var(--ar-bwidth, 2px);
  border-color: var(--ar-border, #93c5fd);
  border-radius: var(--ar-bradius, 8px);
  box-shadow: 0 2px 8px rgba(15, 97, 193, 0.06);
  box-sizing: border-box;
}

.portal-ar-badge {
  position: absolute;
  top: 0;
  transform: translateY(-50%);
  background: var(--ar-accent, #0d6efd);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

.portal-ar-badge.pos-top_left {
  left: 14px;
}

.portal-ar-badge.pos-center {
  left: 50%;
  transform: translate(-50%, -50%);
}

.portal-ar-badge.pos-top_right {
  right: 14px;
}

.portal-ar-style-minimal {
  background: var(--portal-surface);
}

.portal-ar-style-minimal .portal-ar-badge {
  background: var(--portal-surface);
  color: var(--ar-accent, #0d6efd);
  border: 1px solid var(--ar-border, #93c5fd);
  box-shadow: none;
}

.portal-ar-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-ar-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  text-decoration: none !important;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.portal-ar-item:hover {
  border-color: var(--ar-accent, #0d6efd);
  box-shadow: 0 3px 10px rgba(13, 110, 253, 0.1);
  transform: translateY(-1px);
}

.portal-ar-thumb {
  flex: 0 0 84px;
  width: 84px;
  height: 58px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--portal-surface-soft);
  border: 1px solid var(--portal-border);
}

.portal-ar-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portal-ar-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.portal-ar-item-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ar-title, #0f172a);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.portal-ar-item:hover .portal-ar-item-title {
  color: var(--ar-accent, #0d6efd);
}

.portal-ar-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--portal-muted);
}

.portal-ar-cat {
  color: var(--ar-accent, #0d6efd);
}

.portal-ar-arrow {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--portal-nav-active-bg);
  color: var(--ar-accent, #0d6efd);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .portal-ar-box {
    padding: 18px 10px 10px;
  }

  .portal-ar-item {
    gap: 10px;
    padding: 8px 9px;
  }

  .portal-ar-thumb {
    flex: 0 0 68px;
    width: 68px;
    height: 50px;
  }

  .portal-ar-item-title {
    font-size: 13.5px;
  }
}

.portal-step-figure {
  margin: 14px auto 18px;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--portal-surface);
  box-shadow: var(--portal-shadow-sm);
}

.portal-step-figure img {
  width: 100%;
  height: auto;
  display: block;
}

.portal-step-figure figcaption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--portal-muted);
  background: var(--portal-surface-soft);
  border-top: 1px solid var(--portal-row-divider);
  text-align: center;
}

.portal-faq {
  margin-top: 24px;
}

.portal-faq-item {
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  background: var(--portal-surface);
  margin-bottom: 10px;
  overflow: hidden;
}

.portal-faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 15px;
  color: var(--portal-blue-end);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.portal-faq-item summary::-webkit-details-marker {
  display: none;
}

.portal-faq-item summary::after {
  content: "+";
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--portal-box-blue);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.portal-faq-item[open] summary {
  background: var(--portal-nav-active-bg);
  border-bottom: 1px solid var(--portal-border);
}

.portal-faq-item[open] summary::after {
  content: "\2212";
}

.portal-faq-answer {
  padding: 12px 16px;
  font-size: 14.5px;
  color: var(--portal-body);
}

/* Related Posts & Author Box */
.portal-related-box {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--portal-shadow-sm);
  margin-bottom: 22px;
}

.portal-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.portal-related-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--portal-surface);
}

.portal-related-card:hover {
  border-color: var(--portal-box-blue);
}

.portal-related-thumb {
  aspect-ratio: 16 / 9;
  background: var(--portal-nav-active-bg);
  overflow: hidden;
}

.portal-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-related-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-related-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--portal-ink);
  line-height: 1.4;
}

.portal-related-date {
  font-size: 11.5px;
  color: var(--portal-muted);
}

.portal-authors-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.portal-authors-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--portal-heading);
  margin: 0;
}

.portal-author-box {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 18px;
}

.portal-author-avatar {
  flex: 0 0 64px;
}

.portal-author-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.portal-author-info {
  min-width: 0;
  flex: 1 1 auto;
}

.portal-author-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.portal-author-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--portal-heading);
}

.portal-author-name:hover {
  color: var(--portal-box-blue);
}

.portal-author-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--portal-nav-active-bg);
  color: var(--portal-blue-end);
  font-size: 11px;
  font-weight: 700;
}

.portal-entry-author-link {
  color: var(--portal-blue-end);
  font-weight: 600;
}

.portal-entry-author-link:hover {
  text-decoration: underline;
}

.portal-author-desc {
  font-size: 13.5px;
  color: #4b5563;
}

/* Comments */
.portal-comments-box {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 22px 24px;
}

.portal-comments-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--portal-heading);
  margin-bottom: 14px;
}

.portal-comment-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.portal-comment-card {
  padding: 14px;
  border: 1px solid var(--portal-row-divider);
  border-radius: 6px;
  background: var(--portal-surface-soft);
  margin-bottom: 10px;
}

.portal-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.portal-comment-date {
  font-size: 11.5px;
  color: var(--portal-muted);
}

.portal-comment-form label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 5px;
}

.portal-comment-form input[type="text"],
.portal-comment-form input[type="email"],
.portal-comment-form input[type="url"],
.portal-comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--portal-border);
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 12px;
  background: var(--portal-surface);
  color: var(--portal-ink);
}

.portal-comment-submit {
  background: var(--portal-box-blue);
  color: #ffffff;
  border: 0;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.portal-comment-submit:hover {
  background: var(--portal-btn-blue-hover);
}

/* ===== RIGHT STICKY SIDEBAR (INNER PAGES ONLY) ===== */
.portal-sidebar {
  position: sticky;
  top: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 0;
}

.portal-sidebar-card,
.portal-sidebar .widget {
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--portal-surface);
  border: 1px solid #e2e7ed;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 2px 7px rgba(15, 97, 193, 0.08);
}

.portal-sidebar-heading,
.portal-sidebar .widget-title,
.portal-sidebar .widget h2.wp-block-heading,
.portal-sidebar .widget .wp-block-search__label {
  width: 100%;
  margin: 0;
  padding: 11px 13px;
  background: #0f61c1;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 0;
}

.portal-sidebar-h-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.portal-sidebar-recent-list {
  width: 100%;
}

.portal-sidebar-recent-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-bottom: 1px solid #eeeeee;
  background: var(--portal-surface);
  color: #222222;
  text-decoration: none;
}

.portal-sidebar-recent-link:last-child {
  border-bottom: 0;
}

.portal-sidebar-recent-link:hover {
  background: #f3f8fd;
}

.portal-sidebar-thumb {
  flex: 0 0 78px;
  width: 78px;
  min-width: 78px;
  height: 58px;
  border-radius: 5px;
  overflow: hidden;
  background: #edf5fc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-sidebar-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.portal-sidebar-recent-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.portal-sidebar-recent-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: #171717;
}

.portal-sidebar-recent-date {
  display: block;
  font-size: 11px;
  line-height: 1.2;
  color: #888888;
  margin-top: 4px;
}

.portal-sidebar-arrow {
  flex-shrink: 0;
  font-size: 25px;
  line-height: 1;
  font-weight: 400;
  color: #0f61c1;
}

/* Sidebar Important Pages Card */
.portal-sidebar-pages {
  width: 100%;
}

.portal-sidebar-page-link {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #eeeeee;
  background: var(--portal-surface);
  color: #222222;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.portal-sidebar-page-link:last-child {
  border-bottom: 0;
}

.portal-sidebar-page-link:hover {
  background: #f3f8fd;
  color: #0f61c1;
}

.portal-sidebar-page-arrow {
  color: #0f61c1;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  margin-right: 7px;
  flex-shrink: 0;
}

.portal-sidebar-page-title {
  flex: 1 1 auto;
  min-width: 0;
}

.portal-sidebar-page-right {
  color: #0f61c1;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 6px;
}

/* Sidebar Social Follow Card */
.portal-sidebar-social {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 15px 12px;
}

.portal-sidebar-social-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.portal-sidebar-social-btn:hover {
  color: #ffffff;
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.portal-sidebar-social-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}

.portal-sb-social-fb { background: #1877f2; }
.portal-sb-social-x { background: #111111; }
.portal-sb-social-wa { background: #25d366; }
.portal-sb-social-yt { background: #ff0000; }
.portal-sb-social-tg { background: #229ed9; }

/* Standalone Website Brand Card */
.portal-sidebar-website {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0;
  padding: 14px;
  background: #0f61c1;
  color: #ffffff;
  border-radius: 7px;
  text-decoration: none;
  box-shadow: 0 2px 7px rgba(15, 97, 193, 0.16);
}

.portal-sidebar-website:hover {
  color: #ffffff;
  background: #0d54a8;
}

.portal-sidebar-globe {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
}

.portal-sidebar-website-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.portal-sidebar-website-small {
  font-size: 11px;
  opacity: 0.85;
  line-height: 1.3;
}

.portal-sidebar-website-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-word;
}

.portal-sidebar-website-tagline {
  font-size: 11px;
  margin-top: 2px;
  opacity: 0.9;
  line-height: 1.35;
}

/* Optional WordPress Widgets Inside Sidebar */
.portal-sidebar .widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-sidebar .widget li {
  padding: 9px 12px;
  border-bottom: 1px solid #eeeeee;
  font-size: 14px;
  line-height: 1.4;
}

.portal-sidebar .widget li:last-child {
  border-bottom: 0;
}

.portal-sidebar .widget .wp-block-search__inside-wrapper,
.portal-sidebar .widget > div:not(.wp-block-group),
.portal-sidebar .widget > p,
.portal-sidebar .widget > form {
  padding: 12px;
}

/* ===== 404 PAGE ===== */
.portal-404-card {
  background: var(--portal-surface);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  padding: 46px 24px;
  text-align: center;
  max-width: 680px;
  margin: 28px auto;
}

.portal-404-code {
  font-size: 56px;
  font-weight: 800;
  color: var(--portal-box-blue);
  line-height: 1.1;
}

.portal-404-btn {
  display: inline-block;
  margin-top: 16px;
  background: var(--portal-box-blue);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 700;
}

.portal-404-btn:hover {
  background: var(--portal-btn-blue-hover);
  color: #ffffff;
}

/* ===== BLUE 4-COLUMN FOOTER ===== */
.portal-footer {
  background: var(--portal-footer-blue);
  color: #ffffff;
  margin-top: 34px;
}

.portal-footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 16px 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 24px;
}

.portal-footer-col-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 14px;
  padding-bottom: 7px;
  position: relative;
}

.portal-footer-col-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 38px;
  height: 2px;
  background: var(--portal-yellow);
}

.portal-footer-brand {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 10px;
  color: #ffffff;
}

.portal-footer-bio {
  font-size: 13.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.92);
}

.portal-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-footer-links li + li {
  margin-top: 8px;
}

.portal-footer-links a {
  color: rgba(255, 255, 255, 0.94);
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.portal-footer-links a::before {
  content: "\203A";
  color: var(--portal-yellow);
  font-weight: 800;
  font-size: 15px;
}

.portal-footer-links a:hover {
  color: var(--portal-yellow);
  transform: translateX(3px);
}

.portal-footer-social-note {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 12px;
}

.portal-footer-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.portal-footer-social-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--portal-footer-bottom);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.portal-footer-social-circle:hover {
  background: var(--portal-yellow);
  color: #0d3a8a;
}

.portal-footer-social-circle svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.portal-footer-bottom {
  background: var(--portal-footer-bottom);
  color: rgba(255, 255, 255, 0.94);
  text-align: center;
  padding: 13px 16px;
  font-size: 13px;
}

.portal-footer-bottom strong {
  color: var(--portal-yellow);
}

/* Back to Top Button */
.portal-totop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--portal-blue-end);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(13, 92, 182, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  z-index: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-totop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.portal-totop:hover {
  background: var(--portal-accent);
}

/* Ad Slots */
.portal-ad-slot {
  max-width: var(--portal-container-width);
  margin: 14px auto;
  padding: 0 15px;
  text-align: center;
}

.portal-sidebar .portal-ad-slot {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* ===== DARK MODE OVERRIDES (HIGH CONTRAST EVERYWHERE) ===== */
html.portal-dark {
  --portal-bg: #0b1120;
  --portal-surface: #111827;
  --portal-surface-soft: #1e293b;
  --portal-border: #26334d;
  --portal-row-divider: #1f2937;
  --portal-ink: #f1f5f9;
  --portal-heading: #f8fafc;
  --portal-body: #e2e8f0;
  --portal-muted: #94a3b8;
  --portal-nav-active-bg: #1e293b;
}

html.portal-dark body {
  background: #0b1120;
  color: #e2e8f0;
}

html.portal-dark .portal-top-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

html.portal-dark .portal-brand-title {
  color: #ffffff !important;
}

html.portal-dark .portal-nav-bar {
  background: #111827;
  border-bottom-color: #26334d;
}

html.portal-dark .portal-nav-list > li {
  border-color: #1f2937;
}

html.portal-dark .portal-nav-list > li > a {
  color: #e2e8f0;
}

html.portal-dark .portal-nav-list > li > a:hover,
html.portal-dark .portal-nav-list > li.current-menu-item > a,
html.portal-dark .portal-nav-list > li > a.is-active {
  background: #1e293b;
  color: #60a5fa;
  border-bottom-color: #3b82f6;
}

html.portal-dark .portal-search-form {
  background: #111827;
  border-color: #26334d;
}

html.portal-dark .portal-search-input {
  color: #f8fafc;
}

html.portal-dark .portal-box,
html.portal-dark .portal-archive-box,
html.portal-dark .portal-article,
html.portal-dark .portal-home-seo-card,
html.portal-dark .portal-related-box,
html.portal-dark .portal-related-card,
html.portal-dark .portal-author-box,
html.portal-dark .portal-comments-box,
html.portal-dark .portal-sidebar-card,
html.portal-dark .portal-sidebar .widget,
html.portal-dark .portal-nav-card,
html.portal-dark .portal-404-card,
html.portal-dark .portal-offcanvas {
  background: #111827;
  border-color: #26334d;
  color: #e2e8f0;
}

html.portal-dark .portal-offcanvas-nav li a {
  color: #e2e8f0;
}

html.portal-dark .portal-box-header,
html.portal-dark .portal-archive-header,
html.portal-dark .portal-post-content th {
  background: #1d4ed8;
}

html.portal-dark .portal-post-content h2 {
  background: #1e293b;
  color: #f8fafc;
}

html.portal-dark .portal-post-content table,
html.portal-dark .portal-post-content td {
  background: #111827;
  border-color: #26334d;
  color: #e2e8f0;
}

html.portal-dark .portal-post-content tr:nth-child(even) td {
  background: #172033;
}

html.portal-dark .portal-post-content table:not(:has(thead)) tbody td:first-child {
  background: #1e293b;
  color: #f8fafc;
}

html.portal-dark .portal-post-content table td > a:only-child {
  color: #ffffff;
}

html.portal-dark .portal-home-seo-card [style*="background:#fff"],
html.portal-dark .portal-home-seo-card [style*="background: #fff"],
html.portal-dark .portal-post-content [style*="background:#fff"] {
  background: #172033 !important;
  color: #e2e8f0 !important;
}

html.portal-dark .portal-entry-author-link,
html.portal-dark .portal-author-badge,
html.portal-dark .portal-faq-item summary,
html.portal-dark .portal-rl-arrow {
  color: #93c5fd;
}

html.portal-dark .portal-faq-item,
html.portal-dark .portal-related-links,
html.portal-dark .portal-step-figure {
  background: #111827;
  border-color: #26334d;
}

html.portal-dark .portal-ar-box {
  background: #172033;
  border-color: #26334d;
}

html.portal-dark .portal-ar-style-minimal .portal-ar-badge {
  background: #111827;
  color: #93c5fd;
  border-color: #26334d;
}

html.portal-dark .portal-ar-item {
  background: #111827;
  border-color: #26334d;
}

html.portal-dark .portal-ar-item-title {
  color: #f8fafc;
}

html.portal-dark .portal-ar-cat,
html.portal-dark .portal-ar-arrow {
  color: #93c5fd;
}

html.portal-dark .portal-sidebar-heading,
html.portal-dark .portal-sidebar .widget-title,
html.portal-dark .portal-sidebar .widget h2.wp-block-heading,
html.portal-dark .portal-sidebar-website {
  background: #1d4ed8;
}

html.portal-dark .portal-sidebar-recent-link,
html.portal-dark .portal-sidebar-page-link {
  background: #111827;
  border-bottom-color: #26334d;
  color: #e2e8f0;
}

html.portal-dark .portal-sidebar-recent-link:hover,
html.portal-dark .portal-sidebar-page-link:hover {
  background: #1e293b;
}

html.portal-dark .portal-sidebar-recent-title {
  color: #f8fafc;
}

html.portal-dark .portal-sidebar-arrow,
html.portal-dark .portal-sidebar-page-arrow,
html.portal-dark .portal-sidebar-page-right {
  color: #93c5fd;
}

html.portal-dark .portal-sidebar .widget li {
  border-bottom-color: #26334d;
}

.portal-archive-author-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

html.portal-dark .portal-footer {
  background: #0f2966;
}

html.portal-dark .portal-footer-bottom {
  background: #0a1c47;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 1024px) {
  .portal-grid-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .portal-has-sidebar {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: static;
  }

  .portal-footer-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .portal-nav-bar,
  .portal-social-icons {
    display: none;
  }

  .portal-mobile-toggle {
    display: flex;
  }

  .portal-top-header-inner {
    grid-template-columns: auto 1fr auto;
    min-height: 60px;
    padding: 10px 12px;
    gap: 10px;
  }

  .portal-brand {
    grid-column: 2;
    justify-content: flex-start;
  }

  .portal-logo-box {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .portal-logo-fallback {
    font-size: 16px;
  }

  .portal-brand-title {
    font-size: 17px;
  }

  .portal-brand-tagline {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .portal-grid-container {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .portal-related-grid,
  .portal-prev-next {
    grid-template-columns: 1fr;
  }

  .portal-nav-next {
    text-align: left;
  }

  .portal-article,
  .portal-home-seo-card {
    padding: 16px;
  }

  .portal-entry-title {
    font-size: 21px;
  }

  .portal-footer-container {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 26px 15px 22px;
  }
}

@media (max-width: 600px) {
  .portal-archive-thumb {
    flex: 0 0 100px;
    width: 100px;
    height: 70px;
  }

  .portal-archive-item-title {
    font-size: 14.5px;
  }

  .portal-archive-excerpt {
    display: none;
  }

  .portal-search-section {
    margin: 16px auto;
  }

  .portal-search-input {
    padding: 11px 14px;
    font-size: 14px;
  }

  .portal-search-btn {
    flex: 0 0 54px;
  }

  .portal-sidebar-heading,
  .portal-sidebar .widget-title,
  .portal-sidebar .widget h2.wp-block-heading {
    font-size: 17px;
  }

  .portal-sidebar-recent-link {
    padding: 9px;
  }

  .portal-sidebar-thumb {
    flex: 0 0 70px;
    width: 70px;
    min-width: 70px;
    height: 53px;
  }

  .portal-sidebar-recent-title {
    font-size: 13px;
  }
}

/* Safe Append Supplementary Block & Read Also Heading */
.portal-related-links-wrap {
  margin: 20px 0;
}

.portal-related-links-wrap h2 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 10px;
}

.portal-additional-update {
  margin: 26px 0 18px;
  padding: 18px 20px;
  border-radius: 10px;
  border: 2px solid #2563eb;
  border-left: 6px solid #16a34a;
  background: #f0fdf4;
  color: #0f172a;
}

.portal-additional-update > p:first-child {
  margin-top: 0;
  color: #166534;
  font-size: 16px;
}

html.portal-dark .portal-additional-update {
  background: #0f291e;
  border-color: #3b82f6;
  border-left-color: #22c55e;
  color: #e2e8f0;
}

html.portal-dark .portal-additional-update > p:first-child {
  color: #86efac;
}
