/* Tianjue Awaken — clean spiritual reading theme (S&P-inspired structure) */
:root {
  --ink: #1c2421;
  --muted: #5c6b64;
  --line: #e4ebe6;
  --bg: #f7f8f5;
  --paper: #ffffff;
  --brand: #2f5d4a;
  --brand-dark: #1b3d30;
  --accent: #c4a35a;
  --soft: #e8f0eb;
  --hero: #203a32;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(27, 61, 48, 0.08);
  --max: 1400px;
  --read: 1100px;
  --font: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", "Segoe UI", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "Microsoft JhengHei", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  font-size: 19px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.wrap { width: min(var(--max), calc(100% - 2rem)); margin: 0 auto; }

/* Top utility bar */
.topbar {
  background: var(--brand-dark);
  color: #dfe9e3;
  font-size: 0.88rem;
}
.topbar .wrap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 0.45rem 0; flex-wrap: wrap;
}
.topbar a { color: #eef6f1; text-decoration: none; margin-left: 0.9rem; }
.topbar a:hover { color: var(--accent); }

/* Header */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.header-main {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0;
}
.brand {
  display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit;
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(145deg, var(--brand), var(--brand-dark));
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem;
}
.brand-text strong { display: block; font-size: 1.25rem; color: var(--brand-dark); letter-spacing: 0.04em; }
.brand-text span { display: block; font-size: 0.78rem; color: var(--muted); }

.nav-toggle {
  display: none; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; padding: 0.5rem 0.75rem; font: inherit; cursor: pointer;
}

/* ===== Site search (header + home + every page) ===== */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.header-search-wrap {
  padding: 0 0 0.85rem;
}
.site-search {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: 720px;
}
.site-search-header {
  max-width: 100%;
}
.site-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #c5e0f5;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.site-search-input:focus {
  border-color: #5b9bd5;
  box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.2);
}
.site-search-btn {
  flex: 0 0 auto;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1.2rem;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: #3d7eb5;
  cursor: pointer;
  white-space: nowrap;
}
.site-search-btn:hover {
  background: #2f6a9a;
}
.site-search-hero {
  max-width: 100%;
  margin: 0 0 1.25rem;
}
.site-search-hero .site-search-input {
  padding: 0.85rem 1.1rem;
  font-size: 1.12rem;
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.95);
}
.site-search-hero .site-search-btn {
  background: #c4a35a;
  color: #1b3d30;
  padding: 0.85rem 1.35rem;
}
.site-search-hero .site-search-btn:hover {
  background: #d4b56a;
}
.page-search-bar {
  margin: 0 auto 1rem;
  max-width: min(var(--read), calc(100% - 2.5rem));
}
.page-search-bar-top {
  margin-bottom: 1rem;
}
.site-search-page {
  max-width: 100%;
}
.site-search-page .site-search-input {
  border-color: #c5e0f5;
  background: #f8fcff;
}

/* Search results page */
.search-results-shell .search-query-line {
  color: #5b9bd5;
  font-size: 1.15rem;
  margin: 0 0 1rem;
}
.search-count {
  color: #3d7eb5;
  font-weight: 600;
  margin: 0.5rem 0 1rem;
}
.search-result-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.search-result-item {
  border: 1px solid #c5e0f5;
  border-radius: 12px;
  background: #f3f9fd;
  padding: 1rem 1.15rem;
  margin: 0 0 0.75rem;
}
.search-result-item a {
  text-decoration: none;
  color: #3d7eb5;
}
.search-result-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  color: #3d7eb5;
}
.search-result-cat {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: #7aa8cc;
  background: #e8f4fc;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.search-result-excerpt {
  margin: 0.55rem 0 0;
  color: #5b9bd5;
  font-size: 1.05rem;
  line-height: 1.7;
}
.search-empty {
  color: #5b9bd5;
  font-size: 1.15rem;
  line-height: 1.85;
}
.search-pagination {
  margin-top: 1.5rem;
}
.search-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.search-pagination a,
.search-pagination span {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #c5e0f5;
  color: #3d7eb5;
  text-decoration: none;
  background: #fff;
}
.search-pagination .current {
  background: #3d7eb5;
  color: #fff;
  border-color: #3d7eb5;
}

@media (max-width: 720px) {
  .site-search {
    flex-wrap: wrap;
  }
  .site-search-btn {
    width: 100%;
  }
}

/* Mega-style dropdown nav */
.nav-menu {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap;
}
.nav-menu > .menu-item { position: relative; }
.nav-menu > .menu-item > a {
  display: block; padding: 0.65rem 0.85rem; color: var(--ink);
  font-weight: 600; font-size: 0.95rem; border-radius: 8px; text-decoration: none;
}
.nav-menu > .menu-item > a:hover,
.nav-menu > .menu-item:hover > a,
.nav-menu > .current-menu-item > a {
  background: var(--soft); color: var(--brand-dark); text-decoration: none;
}
.nav-menu .sub-menu {
  display: none; position: absolute; top: 100%; left: 0; min-width: 240px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 0.45rem; list-style: none; margin: 0;
  z-index: 120;
}
.nav-menu .menu-item-has-children:hover > .sub-menu,
.nav-menu .menu-item-has-children:focus-within > .sub-menu,
.nav-menu .menu-item-has-children.open > .sub-menu { display: block; }
.nav-menu .sub-menu a {
  display: block; padding: 0.65rem 0.85rem; border-radius: 8px;
  color: var(--ink); font-size: 0.92rem; text-decoration: none;
}
.nav-menu .sub-menu a:hover { background: var(--soft); color: var(--brand-dark); }

/* Hero */
.hero {
  background:
    radial-gradient(circle at 85% 15%, rgba(196,163,90,0.18), transparent 35%),
    linear-gradient(145deg, #1b3d30 0%, #2f5d4a 55%, #355f52 100%);
  color: #f4faf6; padding: 3.2rem 0 3.5rem;
}
.hero-grid {
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 2rem; align-items: center;
}
.hero h1 {
  margin: 0 0 1rem; font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1.25; font-weight: 800; letter-spacing: 0.02em;
}
.hero p { margin: 0 0 1.25rem; font-size: 1.08rem; color: #d7e6de; max-width: 38rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.25rem; border-radius: 999px; font-weight: 700;
  text-decoration: none !important; border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #1b2a1a !important; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: #fff !important; border-color: rgba(255,255,255,0.35); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }
.hero-panel {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 18px; padding: 1.25rem 1.35rem; backdrop-filter: blur(6px);
}
.hero-panel h2 { margin: 0 0 0.75rem; font-size: 1.05rem; color: var(--accent); }
.hero-panel ul { margin: 0; padding-left: 1.1rem; color: #e7f1eb; }
.hero-panel li { margin: 0.4rem 0; }

/* Sections */
.section { padding: 2.5rem 0; }
.section-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 1.55rem; color: var(--brand-dark); }
.section-head p { margin: 0; color: var(--muted); }

.cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.15rem 1.2rem; transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column; min-height: 180px;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(27,61,48,0.12); }
.card .tag {
  align-self: flex-start; background: var(--soft); color: var(--brand-dark);
  font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px; margin-bottom: 0.7rem;
}
.card h3 { margin: 0 0 0.45rem; font-size: 1.12rem; color: var(--ink); }
.card p { margin: 0 0 0.9rem; color: var(--muted); font-size: 0.95rem; flex: 1; }
.card .more { font-weight: 700; color: var(--brand); font-size: 0.92rem; }

.two-col {
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.25rem;
}
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem 1.4rem; box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 0.75rem; color: var(--brand-dark); }
.list-links { list-style: none; margin: 0; padding: 0; }
.list-links li { border-bottom: 1px solid var(--line); }
.list-links a {
  display: block; padding: 0.75rem 0.15rem; color: var(--ink); text-decoration: none; font-weight: 600;
}
.list-links a:hover { color: var(--brand); }

/* Content reading — wide on large screens, large readable type */
.site-main { padding: 2.4rem 0 3.5rem; }
.content-shell {
  width: min(var(--read), calc(100% - 2.5rem)); margin: 0 auto;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 2.6rem 2.75rem 3rem;
  font-family: DFKai-SB, "標楷體", "BiauKai", "Kaiti TC", "STKaiti", "KaiTi", serif;
  color: #5b9bd5;
}
.content-shell .entry-title {
  margin: 0 0 1.15rem; font-size: clamp(1.85rem, 3.2vw, 2.55rem);
  color: #3d7eb5; line-height: 1.3;
  font-family: DFKai-SB, "標楷體", "BiauKai", "Kaiti TC", "STKaiti", "KaiTi", serif;
}
.entry-content {
  font-size: 1.28rem; line-height: 2.05; color: #5b9bd5;
  font-family: DFKai-SB, "標楷體", "BiauKai", "Kaiti TC", "STKaiti", "KaiTi", serif;
}
.entry-content * {
  font-family: DFKai-SB, "標楷體", "BiauKai", "Kaiti TC", "STKaiti", "KaiTi", serif;
  color: #5b9bd5;
}
.entry-content p { margin: 0 0 1.25rem; color: #5b9bd5; font-size: 1.28rem; line-height: 2.05; }
.entry-content h2, .entry-content h3 {
  color: #3d7eb5; margin: 1.9rem 0 0.85rem; line-height: 1.35;
}

/* FB / 善書 imported pages (inline styles also set; CSS wins for consistency) */
.entry-content .ss-wrap,
.ss-wrap {
  max-width: 1100px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0.25rem 0 1rem !important;
  font-size: 1.28rem !important;
  line-height: 2.05 !important;
}
.entry-content .ss-wrap h2,
.ss-wrap h2 {
  font-size: clamp(1.75rem, 2.8vw, 2.35rem) !important;
  line-height: 1.35 !important;
  margin: 0 0 1.35rem !important;
}
.entry-content .ss-p,
.ss-p {
  font-size: 1.28rem !important;
  line-height: 2.05 !important;
  margin: 0 0 1.25rem !important;
}
.entry-content .ss-badge,
.ss-badge {
  display: inline-block !important;
  font-size: 1.05rem !important;
  padding: 0.4rem 1rem !important;
  margin-bottom: 1.15rem !important;
  background: #e8f4fc !important;
  color: #3d7eb5 !important;
  font-weight: 700 !important;
  border-radius: 999px !important;
}

/* Category hub list: small thumb + full chapter title */
.entry-content .ss-hub-grid,
.ss-hub-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.55rem !important;
  width: 100% !important;
  margin: 1.2rem 0 !important;
}
.entry-content .ss-hub-card,
.ss-hub-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 0.85rem !important;
  text-decoration: none !important;
  background: #f3f9fd !important;
  border: 1px solid #c5e0f5 !important;
  border-radius: 12px !important;
  padding: 0.55rem 0.85rem !important;
  color: #3d7eb5 !important;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  min-height: 0 !important;
}
.entry-content .ss-hub-card:hover,
.ss-hub-card:hover {
  border-color: #9ec9ea !important;
  background: #eaf5fc !important;
  box-shadow: 0 4px 12px rgba(61, 126, 181, 0.1);
}
.entry-content .ss-hub-thumb,
.ss-hub-thumb {
  flex: 0 0 56px !important;
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  max-width: 56px !important;
  margin: 0 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  background: #e8f2fa !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  aspect-ratio: auto !important;
}
.entry-content .ss-hub-thumb img,
.ss-hub-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  background: #f7fafc !important;
}
.entry-content .ss-hub-thumb-empty,
.ss-hub-thumb-empty {
  font-size: 0.75rem !important;
  color: #9bbbd4 !important;
  line-height: 1.2 !important;
  text-align: center !important;
}
.entry-content .ss-hub-title,
.ss-hub-title {
  flex: 1 1 auto !important;
  display: block !important;
  font-size: 1.12rem !important;
  font-weight: 700 !important;
  line-height: 1.5 !important;
  color: #3d7eb5 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: unset !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  margin: 0 !important;
}

/* FB / 善書 article images — small Facebook list thumbnail size (~206px) */
.entry-content .ss-fig,
.ss-fig {
  display: block !important;
  margin: 0 auto 1.25rem !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  text-align: center !important;
  width: auto !important;
  max-width: min(100%, 206px) !important;
  overflow: visible !important;
}
.entry-content .ss-img,
.ss-img,
.entry-content img.ss-img,
.entry-content .ss-fig img,
.entry-content img[src*="/uploads/fb-saved/"] {
  display: block !important;
  max-width: min(100%, 206px) !important;
  width: auto !important;
  height: auto !important;
  max-height: 206px !important;
  margin: 0 auto !important;
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(27, 61, 48, 0.08) !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #f7fafc !important;
}
/* Never stretch FB thumbs to full card width */
.entry-content img[style*="height:160px"],
.entry-content img[style*="height: 160px"] {
  width: 56px !important;
  height: 56px !important;
  max-width: 56px !important;
  max-height: 56px !important;
  object-fit: cover !important;
}
/* Extra safety: parent shells must not clip images */
.entry-content,
.content-shell,
.entry-content .ss-wrap,
.ss-wrap {
  overflow: visible !important;
}
.entry-content .ss-nav a,
.ss-nav a {
  font-size: 1.15rem !important;
}
.entry-content .ss-list a,
.ss-list a {
  font-size: 1.22rem !important;
  line-height: 1.7 !important;
}
/* 善書目錄 category cards — layout in CSS (WP strips display:grid from post HTML) */
.entry-content .ss-cat-grid,
.ss-cat-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 1.15rem !important;
  width: 100% !important;
  margin: 0 0 1.75rem !important;
  align-items: stretch !important;
  box-sizing: border-box !important;
}
.entry-content .ss-cat-grid .ss-card,
.ss-cat-grid .ss-card {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
  min-height: 6.75rem !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 1.35rem 1.3rem !important;
  background: #f3f9fd !important;
  border: 1px solid #c5e0f5 !important;
  border-radius: 16px !important;
  color: #3d7eb5 !important;
  text-decoration: none !important;
  line-height: 1.45 !important;
  overflow: hidden !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.entry-content .ss-cat-grid .ss-card:hover,
.ss-cat-grid .ss-card:hover {
  background: #e8f4fc !important;
  border-color: #9ec9ea !important;
  box-shadow: 0 6px 18px rgba(61, 126, 181, 0.12);
  text-decoration: none !important;
}
.entry-content .ss-cat-grid .ss-card strong,
.ss-cat-grid .ss-card strong,
.entry-content .ss-card strong,
.ss-card strong {
  display: block !important;
  width: 100% !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: #3d7eb5 !important;
  margin: 0 0 0.45rem !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.entry-content .ss-cat-grid .ss-card span,
.ss-cat-grid .ss-card span,
.entry-content .ss-card span,
.ss-card span {
  display: block !important;
  font-size: 1.1rem !important;
  color: #5b9bd5 !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
}
@media (max-width: 900px) {
  .entry-content .ss-cat-grid,
  .ss-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 520px) {
  .entry-content .ss-cat-grid,
  .ss-cat-grid {
    grid-template-columns: 1fr !important;
  }
  .entry-content .ss-cat-grid .ss-card strong,
  .ss-cat-grid .ss-card strong {
    white-space: normal !important;
  }
}
@media (min-width: 1400px) {
  :root { --read: 1180px; --max: 1480px; }
  .content-shell { padding: 3rem 3.25rem 3.4rem; }
  .entry-content,
  .entry-content p,
  .entry-content .ss-p,
  .ss-p {
    font-size: 1.35rem !important;
    line-height: 2.1 !important;
  }
}
@media (max-width: 720px) {
  .content-shell { padding: 1.5rem 1.15rem 2rem; }
  .entry-content,
  .entry-content p,
  .entry-content .ss-p,
  .ss-p {
    font-size: 1.12rem !important;
    line-height: 1.95 !important;
  }
}

/* 天下一家 page — light blue + DFKai-SB (force) */
body.page-id-644 .content-shell,
body.page-id-644 .content-shell .entry-title,
body.page-id-644 .entry-content,
body.page-id-644 .entry-content p,
body.page-id-644 .entry-content h1,
body.page-id-644 .entry-content h2,
body.page-id-644 .entry-content h3,
body.page-id-644 .entry-content div,
body.page-id-644 .entry-content span,
body.page-id-644 .entry-content strong,
body.page-id-644 .entry-content * {
  font-family: DFKai-SB, "標楷體", "BiauKai", "Kaiti TC", "STKaiti", "KaiTi", serif !important;
  color: #5b9bd5 !important;
}
body.page-id-644 .content-shell .entry-title,
body.page-id-644 .entry-content h2,
body.page-id-644 .entry-content h3 {
  color: #3d7eb5 !important;
}
body.page-id-644 .tx-badge {
  display: inline-block; background: #e8f4fc; color: #3d7eb5 !important;
  font-weight: 700; padding: 0.4rem 1rem; border-radius: 999px;
  font-size: 1.05rem; margin-bottom: 1.15rem;
}
body.page-id-644 .tx-title {
  margin: 0 0 1.3rem; font-size: clamp(1.9rem, 3vw, 2.4rem); color: #3d7eb5 !important;
  letter-spacing: 0.06em; line-height: 1.35;
}
body.page-id-644 .tx-quote {
  background: linear-gradient(180deg, #f0f8ff, #fff);
  border: 1px solid #c5e0f5; border-left: 5px solid #5b9bd5;
  border-radius: 0 14px 14px 0; padding: 1.35rem 1.6rem;
  font-size: 1.5rem; font-weight: 700; color: #3d7eb5 !important;
  margin: 0 0 1.6rem; text-align: center; letter-spacing: 0.12em;
}
body.page-id-644 .tx-p {
  margin: 0 0 1.25rem; font-size: 1.28rem; color: #5b9bd5 !important; line-height: 2.05;
}
body.page-id-644 .tx-cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin: 1.5rem 0;
}
body.page-id-644 .tx-card {
  background: #f3f9fd; border: 1px solid #c5e0f5; border-radius: 12px; padding: 1.1rem 1.15rem;
}
body.page-id-644 .tx-card h3 {
  margin: 0 0 0.45rem; font-size: 1.1rem; color: #3d7eb5 !important;
}
body.page-id-644 .tx-card p {
  margin: 0; color: #7eb6d9 !important; font-size: 1rem;
}
@media (max-width: 640px) {
  body.page-id-644 .tx-cards { grid-template-columns: 1fr; }
}
.entry-content h2 { font-size: clamp(1.55rem, 2.5vw, 2rem); }
.entry-content h3 { font-size: clamp(1.3rem, 2vw, 1.55rem); }
.entry-content ul, .entry-content ol { margin: 0 0 1.1rem; padding-left: 1.35rem; }
.entry-content li { margin: 0.35rem 0; }
.entry-content blockquote {
  margin: 1.2rem 0; padding: 0.9rem 1.1rem; border-left: 4px solid var(--accent);
  background: #fbf8f0; color: #3a4038; border-radius: 0 12px 12px 0;
}
.entry-content a { text-decoration: underline; text-underline-offset: 2px; }

/* Footer */
.site-footer {
  background: var(--brand-dark); color: #d5e4dc; padding: 2.4rem 0 1.4rem; margin-top: 1rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem;
}
.site-footer h3 { margin: 0 0 0.7rem; color: var(--accent); font-size: 1rem; }
.site-footer a { color: #e8f2ec; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.4rem 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); padding-top: 1rem;
  font-size: 0.88rem; color: #a9bdb3; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}

/* Breadcrumb */
.breadcrumb {
  width: min(var(--max), calc(100% - 2rem)); margin: 1rem auto 0;
  color: var(--muted); font-size: 0.9rem;
}
.breadcrumb a { color: var(--muted); }

/* Phones + iPad (raise breakpoint so iPad landscape still gets usable tap nav) */
@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .topbar-links { display: none !important; }
  .nav-toggle { display: none !important; }
  .primary-nav {
    display: block !important;
    width: 100%;
    padding: 0.15rem 0 0.25rem;
    max-height: none;
    overflow: visible;
  }
  .header-main { flex-wrap: wrap; }
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.1rem;
  }
  .nav-menu > .menu-item { position: relative; }
  .nav-menu > .menu-item > a {
    display: block;
    padding: 0.45rem 0.55rem;
    min-height: 40px;
    font-size: 0.92rem;
  }
  .nav-menu .sub-menu {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 50;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    background: #fff;
    margin: 0;
    padding: 0.45rem;
    border-radius: 12px;
    min-width: 12rem;
  }
  .nav-menu .sub-menu a {
    display: block;
    padding: 0.65rem 0.85rem;
    min-height: 40px;
    font-size: 0.92rem;
  }
  .nav-menu .menu-item-has-children > a::after { content: " ▾"; color: var(--muted); }
}
/* Touch tablets (iPad) even if slightly wider */
@media (hover: none) and (pointer: coarse) and (min-width: 1181px) {
  .topbar-links { display: none !important; }
  .nav-toggle { display: none !important; }
  .primary-nav {
    display: block !important;
    width: 100%;
    padding: 0.15rem 0 0.25rem;
    max-height: none;
    overflow: visible;
  }
  .header-main { flex-wrap: wrap; }
  .nav-menu {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.1rem;
  }
  .nav-menu > .menu-item { position: relative; }
  .nav-menu .sub-menu {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 50;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    background: #fff;
    min-width: 12rem;
  }
  .nav-menu .menu-item-has-children > a::after { content: " ▾"; color: var(--muted); }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr; }
  .content-shell { padding: 1.25rem 0.95rem 1.7rem; }
  body { font-size: 16px; }
}

/* ========== Mobile / iPhone / Android polish (v2.3) ========== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}
.wrap {
  width: min(var(--max), calc(100% - 1.25rem));
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
}
.site-header {
  padding-top: env(safe-area-inset-top, 0);
}
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}
/* Prevent wide tables / pre from breaking layout */
.entry-content table,
.entry-content .wp-block-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.entry-content pre,
.entry-content code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
}
.entry-content iframe {
  max-width: 100%;
}
/* iOS: inputs < 16px trigger zoom — keep readable & no zoom */
input, select, textarea, button, .site-search-input, .site-search-btn {
  font-size: 16px;
  touch-action: manipulation;
}
button, .btn, .site-search-btn, .nav-toggle, a.btn {
  min-height: 44px;
}

/* Shared phone + iPad refinements */
@media (max-width: 1180px) {
  .topbar .wrap {
    gap: 0.45rem;
    padding: 0.4rem 0;
  }
  .topbar-tagline {
    font-size: 0.85rem;
    line-height: 1.35;
  }
  .topbar-links {
    display: none !important;
  }
  .topbar a {
    margin-left: 0;
    padding: 0.4rem 0.55rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
  .header-search-wrap {
    padding-bottom: 0.65rem;
  }
  .site-search-input {
    font-size: 16px !important;
    min-height: 44px;
    padding: 0.7rem 0.85rem;
  }
  .site-search-btn {
    min-height: 44px;
    font-size: 16px !important;
  }
  .breadcrumb {
    width: min(var(--max), calc(100% - 1.25rem));
    font-size: 0.9rem;
    word-break: break-word;
  }
  .entry-title {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem) !important;
    line-height: 1.35 !important;
    word-break: break-word;
  }
  .entry-content .ss-hub-card,
  .ss-hub-card {
    padding: 0.75rem 0.85rem !important;
    gap: 0.8rem !important;
  }
  .entry-content .ss-hub-title,
  .ss-hub-title {
    font-size: 1.12rem !important;
    line-height: 1.5 !important;
  }
  .entry-content .ss-hub-thumb,
  .ss-hub-thumb {
    flex: 0 0 56px !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
  }
  .entry-content .ss-fig,
  .ss-fig {
    max-width: min(100%, 240px) !important;
  }
  .entry-content .ss-img,
  .ss-img,
  .entry-content img[src*="/uploads/fb-saved/"] {
    max-width: min(100%, 240px) !important;
    max-height: min(45vh, 280px) !important;
  }
  .entry-content .ss-wrap,
  .ss-wrap {
    max-width: 100% !important;
  }
  .content-shell {
    padding: 1.75rem 1.5rem 2.1rem;
  }
  .entry-content,
  .entry-content p,
  .entry-content .ss-p,
  .ss-p {
    font-size: 1.18rem !important;
    line-height: 2 !important;
  }
  .footer-bottom {
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .hero-actions, .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
  }
}

/* iPad portrait / small tablet sweet spot */
@media (min-width: 700px) and (max-width: 1180px) {
  .wrap {
    width: min(var(--max), calc(100% - 2rem));
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
  .hero-actions .btn, .actions .btn {
    width: auto;
    min-width: 10rem;
  }
  .site-search {
    max-width: 100%;
  }
  .entry-content .ss-cat-grid,
  .ss-cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  /* Larger tap targets on tablet */
  .nav-menu > .menu-item > a,
  .nav-menu .sub-menu a {
    min-height: 48px;
    font-size: 1.12rem;
  }
}

/* Phone-only tightening */
@media (max-width: 699px) {
  .brand-text span {
    max-width: 42vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero-actions .btn, .actions .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .entry-content .ss-fig,
  .ss-fig {
    max-width: min(100%, 206px) !important;
  }
  .entry-content .ss-img,
  .ss-img,
  .entry-content img[src*="/uploads/fb-saved/"] {
    max-width: min(100%, 206px) !important;
    max-height: min(50vh, 206px) !important;
  }
  .entry-content .ss-hub-thumb,
  .ss-hub-thumb {
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(var(--max), calc(100% - 1rem));
  }
  .topbar-tagline {
    width: 100%;
  }
  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .brand-text strong {
    font-size: 1.12rem;
  }
  .content-shell {
    border-radius: 12px;
    margin-left: 0;
    margin-right: 0;
  }
  .entry-content,
  .entry-content p,
  .entry-content .ss-p,
  .ss-p {
    font-size: 1.08rem !important;
    line-height: 1.9 !important;
  }
  .page-search-bar {
    max-width: 100%;
  }
  /* Avoid 100vw scroll bugs on some Android browsers */
  .site-main, .content-shell, .entry-content {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

/* Landscape phones */
@media (max-height: 480px) and (orientation: landscape) {
  .site-header {
    position: relative;
  }
  .primary-nav.open {
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
