/* PDF Tools hub — categorized index page. */
.pth-fit.pth-scope {
  max-width: 1400px; margin: 0 auto;
  padding: 90px 4vw 70px;
}

/* ── Dedicated mini nav, shared across every tool — a genuinely FIXED top
   bar (not sticky — sticky depends on every ancestor's overflow setting
   behaving, which isn't reliable across this many different tool layouts;
   fixed always stays put regardless). Blends fully into the page at the
   very top (no border/shadow); once the page scrolls even a little it
   solidifies into a distinct floating bar — same pattern as the main
   site's .dl-nav / .dl-nav-scrolled. Colors use the real theme variables
   (--brand/--txt/--surface/--border/--page-bg), so dark mode and every
   accent theme (violet/cyber/sunshine/aurora) are handled automatically —
   no separate per-theme override blocks needed. ── */
.pthnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200001;
  display: flex; align-items: center; flex-wrap: nowrap; gap: 28px;
  background: transparent; border-bottom: 1px solid transparent;
  padding: 12px 4vw;
  transition: background .35s ease, border-color .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
}
.pthnav.pthnav-scrolled,
.pthnav.pthnav-drawer-open-nav {
  background: var(--surface, #fff);
  border-bottom-color: var(--border, #e2e8f0);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.pthnav-brand { display: flex; align-items: center; flex-shrink: 0; }
/* IMPORTANT: no overflow-x here on desktop. Per the CSS overflow spec,
   setting overflow-x to anything but visible forces overflow-y to compute
   as 'auto' too — and the Convert PDF / All PDF Tools dropdown panels are
   position:absolute children of this exact element, popping open BELOW
   the row. overflow-y:auto here would clip them to invisible. Desktop
   instead relies on flex-shrink + the search box's small clamp() ceiling
   to avoid running out of room in the first place; only the mobile media
   query below gets the scrollable variant (its dropdown panels switch to
   position:fixed there, which escapes ancestor overflow clipping). */
.pthnav-links {
  display: flex; align-items: center; gap: 22px; flex: 1 1 auto; min-width: 0;
  flex-wrap: nowrap;
}
.pthnav-links > a {
  font-size: .82rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  color: var(--txt, #1d1d1f); text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.pthnav-links > a:hover { color: var(--brand, #4f46e5); }
.pthnav-home {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: .82rem; font-weight: 700; color: var(--page-bg, #fff);
  background: var(--txt, #1d1d1f); padding: 8px 16px; border-radius: 999px;
  text-decoration: none;
}
.pthnav-home:hover { background: var(--brand, #4f46e5); color: #fff; }
.pthnav-theme-btn { flex-shrink: 0; }

/* flex/min/max instead of a fixed basis — shrinks gracefully as the row
   gets tight instead of overflowing or breaking the layout. base.php's
   existing topbar-search script adds .ts-expanded on focus (it targets
   .topbar-search generically, no extra JS needed here) — the resting size
   is small, expanding wider only while actually focused/typing. */
.pthnav-search { flex: 1 1 160px; min-width: 110px; max-width: 230px; flex-shrink: 1; }
/* clamp(), not a fixed px value — grows on focus but always settles to
   whatever the row actually has room for, instead of forcing the rest of
   the nav to wrap or overflow. flex-shrink stays on so it backs off first
   if space is still tight. */
.pthnav-search.ts-expanded {
  flex: 1 1 clamp(160px, 18vw, 300px);
  max-width: clamp(160px, 18vw, 300px);
  flex-shrink: 1;
}
@media (max-width: 760px) {
  .pthnav-search { display: none; }
}

.pthnav-dropdown { position: relative; flex-shrink: 0; }
.pthnav-dropdown-trigger {
  background: none; border: none; cursor: pointer;
  font-size: .82rem; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  color: var(--txt, #1d1d1f);
  display: inline-flex; align-items: center; gap: 6px;
}
.pthnav-dropdown-trigger i { font-size: .65rem; transition: transform .2s ease; }
.pthnav-dropdown.pthnav-dropdown-open .pthnav-dropdown-trigger { color: var(--brand, #4f46e5); }
.pthnav-dropdown.pthnav-dropdown-open .pthnav-dropdown-trigger i { transform: rotate(180deg); }

.pthnav-dropdown-panel {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translateX(-50%) translateY(6px);
  background: var(--surface, #fff); border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0,0,0,.16);
  padding: 22px 26px;
  display: flex; gap: 36px;
  min-width: 460px;
  max-height: calc(100vh - 90px); overflow-y: auto;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 500;
}
/* All PDF Tools has 7 categories — taller than the viewport on most
   screens, so it needs to wrap AND scroll instead of running off the
   bottom with no way to reach the rest. */
.pthnav-dropdown-panel-wide {
  min-width: 760px; max-width: min(900px, 92vw);
  flex-wrap: wrap; align-content: flex-start; gap: 28px 36px;
}
.pthnav-dropdown.pthnav-dropdown-open .pthnav-dropdown-panel {
  opacity: 1; visibility: visible; pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.pthnav-dropdown-col { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 4px; }
.pthnav-dropdown-heading {
  font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--txt-2, #94a3b8); margin-bottom: 8px;
}
.pthnav-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 6px; border-radius: 10px;
  font-size: .85rem; font-weight: 600; color: var(--txt, #1d1d1f);
  text-decoration: none; white-space: nowrap;
  transition: background .15s ease;
}
.pthnav-dropdown-item:hover { background: var(--page-bg, #f1f5f9); }
.pthnav-dropdown-icon {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .68rem;
}
.pthnav-dropdown-soon { opacity: .55; cursor: default; }
.pthnav-dropdown-soon:hover { background: none; }
.pthnav-dropdown-soon em {
  margin-left: auto; font-style: normal; font-size: .62rem; font-weight: 700;
  color: var(--txt-2, #94a3b8); background: var(--page-bg, #f1f5f9); border: 1px solid var(--border, #e2e8f0);
  padding: 2px 7px; border-radius: 999px;
}
@media (max-width: 900px) {
  /* Safe to scroll horizontally here (unlike desktop, above) because the
     dropdown panels switch to position:fixed right below, which escapes
     this container's overflow clipping entirely. */
  .pthnav { gap: 14px; padding: 10px 3vw; }
  .pthnav-links {
    gap: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pthnav-links::-webkit-scrollbar { height: 0; }
  .pthnav-dropdown-trigger { white-space: nowrap; }
  .pthnav-dropdown-panel,
  .pthnav-dropdown-panel-wide {
    position: fixed; left: 12px; right: 12px; top: 60px;
    transform: translateY(6px); width: auto; min-width: 0;
    max-height: 70vh; overflow-y: auto;
    flex-direction: column; gap: 18px;
  }
  .pthnav-dropdown.pthnav-dropdown-open .pthnav-dropdown-panel,
  .pthnav-dropdown.pthnav-dropdown-open .pthnav-dropdown-panel-wide {
    transform: translateY(0);
  }
}

/* ── pthnav hamburger button ──────────────────────────────────── */
.pthnav-burger {
  display: none; width: 38px; height: 38px;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none; border-radius: 11px; cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(99,102,241,.35);
  transition: transform .18s, box-shadow .18s;
  flex-shrink: 0;
}
.pthnav-burger:hover { transform: scale(1.07); box-shadow: 0 5px 18px rgba(99,102,241,.45); }
.pthnav-burger:active { transform: scale(.93); }
.pthnav-burger-icon { display: flex; flex-direction: column; gap: 5px; width: 18px; }
.pthnav-burger-icon span { display: block; height: 2px; border-radius: 3px; background: #fff; transition: transform .36s cubic-bezier(.68,-.15,.265,1.35), opacity .22s, width .28s; }
.pthnav-burger-icon span:nth-child(1) { width: 18px; }
.pthnav-burger-icon span:nth-child(2) { width: 12px; }
.pthnav-burger-icon span:nth-child(3) { width: 18px; }
.pthnav-burger.pthnav-burger-open { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 3px 12px rgba(239,68,68,.35); }
.pthnav-burger.pthnav-burger-open .pthnav-burger-icon span:nth-child(1) { transform: translateY(7px) rotate(45deg); width: 18px; }
.pthnav-burger.pthnav-burger-open .pthnav-burger-icon span:nth-child(2) { opacity: 0; width: 0; }
.pthnav-burger.pthnav-burger-open .pthnav-burger-icon span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); width: 18px; }

/* ── pthnav mobile drawer ─────────────────────────────────────── */
.pthnav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 200000;
  width: min(86vw, 300px);
  background: var(--surface, #fff);
  display: flex; flex-direction: column;
  transform: translateX(-110%);
  transition: transform .38s cubic-bezier(.22,1,.36,1);
  overflow-y: auto; overflow-x: hidden;
  box-shadow: 8px 0 48px rgba(0,0,0,.16);
  border-radius: 20px 0 0 20px;
}
.pthnav-drawer.pthnav-drawer-open { transform: translateX(0); }

.pthnav-drawer-overlay {
  display: none; position: fixed; inset: 0; z-index: 199999;
  background: rgba(15,23,42,.5); backdrop-filter: blur(4px);
}
.pthnav-drawer-overlay.pthnav-drawer-overlay-open { display: block; }

.pthnav-drawer-header {
  display: flex; align-items: center; justify-content: flex-start;
  min-height: 62px; padding: 0 16px;
  border-bottom: 1px solid var(--border, #f0f4f8); flex-shrink: 0;
  visibility: hidden; /* hidden behind nav bar */
}
.pthnav-drawer-logo { display: flex; align-items: center; gap: 10px; }
.pthnav-drawer-logo-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg,#4f46e5,#7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .85rem;
}
.pthnav-drawer-logo-text { font-size: .95rem; font-weight: 700; color: var(--txt, #1d1d1f); }
.pthnav-drawer-close {
  width: 38px; height: 38px; border-radius: 11px; border: none;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: .9rem; box-shadow: 0 3px 12px rgba(239,68,68,.35);
  transition: transform .18s, box-shadow .18s; flex-shrink: 0;
}
.pthnav-drawer-close:hover { transform: scale(1.07); box-shadow: 0 5px 18px rgba(239,68,68,.45); }
.pthnav-drawer-close:active { transform: scale(.93); }

.pthnav-drawer-home-link {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 12px 0; padding: 11px 13px;
  background: linear-gradient(135deg,#4f46e5,#7c3aed); color: #fff;
  border-radius: 12px; text-decoration: none; font-size: .85rem; font-weight: 600;
  box-shadow: 0 4px 14px rgba(79,70,229,.3);
}
.pthnav-drawer-home-link .pthnav-drawer-arrow { margin-left: auto; opacity: .7; font-size: .75rem; }

.pthnav-drawer-section-label {
  font-size: .6rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--txt-2, #94a3b8);
  padding: 14px 16px 4px;
}
.pthnav-drawer-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 9px 9px 12px; margin: 1px 8px;
  border-radius: 10px; color: var(--txt, #374151);
  font-size: .88rem; font-weight: 500; text-decoration: none;
  transition: background .15s, color .15s;
}
.pthnav-drawer-link:hover { background: var(--page-bg, #f1f5f9); color: #4f46e5; }
.pthnav-drawer-link-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .75rem;
}

/* Show burger, hide desktop-only items at mobile */
@media (max-width: 640px) {
  .pthnav-burger { display: flex; }
  .pthnav-links { display: none; }
  .pthnav-home { display: none; }
  .pthnav-search { display: none; }
  .pthnav { gap: 10px; padding: 10px 16px; }
  #neonToggleBtn { display: none; }
}

.pth-hero { text-align: center; margin-bottom: 46px; }
.pth-hero h1 {
  font-size: 2rem !important; font-weight: 800 !important;
  color: var(--brand, #4f46e5) !important;
  margin: 0 0 8px !important;
}
#pthScope .pth-hero p {
  font-size: .95rem !important; color: var(--txt-2, #64748b) !important;
  margin: 0 !important;
}

.pth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 36px 28px;
}

.pth-category { display: flex; flex-direction: column; }
.pth-cat-label {
  font-size: .78rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--txt-2, #94a3b8);
  margin-bottom: 16px;
}

.pth-tool-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0;
  text-decoration: none;
  color: var(--txt, #0f172a);
  font-size: .92rem; font-weight: 600;
  transition: transform .15s ease, color .15s ease;
}
.pth-tool-row:hover { transform: translateX(3px); color: var(--brand, #4f46e5); }

.pth-tool-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .82rem;
}

.pth-tool-soon {
  cursor: default; opacity: .55;
}
.pth-tool-soon:hover { transform: none; color: var(--txt, #0f172a); }
.pth-soon-badge {
  margin-left: auto;
  font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  background: var(--page-bg, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  color: var(--txt-2, #64748b);
}

@media (max-width: 600px) {
  .pth-grid { grid-template-columns: 1fr 1fr; gap: 30px 18px; }
}
