/* ============================================================
   PixaPDF Tools – Main Stylesheet  v1.8.0
   Light mode ONLY.
   HEADER: White background, Black text (per site requirement).
   ============================================================ */

/* ── 1. CSS Custom Properties ──────────────────────────── */
:root {
  --color-navy:        #0d1b4b;
  --color-navy-dark:   #090f2e;
  --color-accent:      #2563eb;
  --color-accent-lt:   #3b82f6;
  --color-accent-hover:#1d4ed8;
  --color-white:       #ffffff;
  --color-bg:          #f5f7fa;
  --color-surface:     #ffffff;
  --color-border:      #e2e8f0;
  --color-text:        #1e293b;
  --color-muted:       #64748b;
  --color-shadow:      rgba(0,0,0,.07);
  --color-shadow-md:   rgba(0,0,0,.13);

  /* Header – WHITE bg, BLACK text per requirement */
  --header-bg:         #ffffff;
  --header-text:       #1e293b;
  --header-border:     #e2e8f0;
  --header-link:       #1e293b;
  --header-link-hover: #2563eb;

  /* Top bar – dark navy */
  --topbar-bg:         #090f2e;
  --topbar-text:       #ffffff;

  /* Hero – navy */
  --hero-bg:           #0d1b4b;
  --hero-text:         #ffffff;

  /* Footer – dark navy */
  --footer-bg:         #090f2e;
  --footer-text:       rgba(255,255,255,.8);

  --font-body:   'Inter', system-ui, -apple-system, sans-serif;
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --space-xs:    .5rem;
  --space-sm:    1rem;
  --space-md:    1.5rem;
  --space-lg:    2.5rem;
  --space-xl:    4rem;
  --transition:  .2s ease;
  --container:   1200px;
}

/* ── 2. Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ── 3. Container ───────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

/* ── 4. Skip Link ───────────────────────────────────────── */
.skip-link {
  position: absolute; top: -999px; left: 0;
  background: var(--color-accent); color: var(--color-white);
  padding: .5rem 1rem; z-index: 9999;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { top: 0; }

/* ── 5. Top Bar ─────────────────────────────────────────── */
.top-bar {
  background: var(--topbar-bg);
  padding: .35rem 0;
  font-size: .8125rem;
}
.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
}
.topbar-menu { display: flex; gap: var(--space-sm); }
.topbar-menu a { color: rgba(255,255,255,.8); transition: color var(--transition); }
.topbar-menu a:hover { color: #fff; text-decoration: none; }

/* ── 6. Site Header (WHITE BG / BLACK TEXT) ─────────────── */
.site-header {
  background: var(--header-bg);           /* WHITE */
  border-bottom: 1px solid var(--header-border);
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 1px 4px var(--color-shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 64px;
}

/* Logo */
.site-branding a,
.site-branding .site-title {
  display: flex; align-items: center; gap: .5rem; text-decoration: none;
}
.site-branding .brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--header-text);   /* BLACK */
  letter-spacing: -.02em;
}
.site-branding img,
.site-branding svg { height: 36px; width: auto; }

/* ── 7. Navigation ──────────────────────────────────────── */
.main-navigation { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: .15rem; }
.nav-menu li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: .5rem .85rem;
  color: var(--header-link);    /* BLACK */
  font-size: .9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.nav-menu > li > a:hover,
.nav-menu .current-menu-item > a {
  background: var(--color-bg);
  color: var(--header-link-hover);  /* Blue on hover */
  text-decoration: none;
}

/* Dropdown */
.nav-menu .sub-menu {
  position: absolute; top: 100%; left: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px var(--color-shadow-md);
  min-width: 200px;
  padding: .5rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 600;
}
.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
  opacity: 1; pointer-events: auto; transform: translateY(0);
}
.nav-menu .sub-menu a {
  color: var(--color-text);
  padding: .45rem .75rem;
  font-size: .875rem;
  border-radius: var(--radius-sm);
  display: block;
}
.nav-menu .sub-menu a:hover { background: var(--color-bg); color: var(--color-accent); text-decoration: none; }

/* Tools mega dropdown – 3 columns */
.tools-dropdown { min-width: 480px; columns: 3; column-gap: .5rem; }
.tools-dropdown li { break-inside: avoid; }

/* Mobile toggle */
.mobile-menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: .5rem; color: var(--header-text);
}
.hamburger,
.hamburger::before,
.hamburger::after {
  display: block; width: 24px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .3s ease;
}
.hamburger { position: relative; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; left: 0; }
.hamburger::before { top: -7px; }
.hamburger::after  { top:  7px; }
.mobile-menu-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.mobile-menu-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg) translate(5px,5px); }
.mobile-menu-toggle[aria-expanded="true"] .hamburger::after  { transform: rotate(-45deg) translate(5px,-5px); }

/* ── 8. Hero Section ────────────────────────────────────── */
.hero-section {
  background: var(--hero-bg);
  color: var(--hero-text);
  padding: var(--space-xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37,99,235,.22) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 1; }
.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
  letter-spacing: -.03em;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,.82);
  max-width: 600px;
  margin: 0 auto var(--space-md);
}
.hero-icons {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: .65rem;
  margin-top: var(--space-md);
}
.hero-icon-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: #ffffff;
  padding: .38rem .85rem;
  border-radius: 999px;
  font-size: .8125rem; font-weight: 500;
}

/* Hero search */
.hero-search {
  display: flex; align-items: center;
  max-width: 540px; margin: var(--space-md) auto 0;
  background: #ffffff; border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
}
.hero-search input {
  flex: 1; border: none; outline: none;
  padding: .8rem 1.2rem; font-size: 1rem;
  color: var(--color-text); background: transparent;
}
.hero-search button {
  background: var(--color-accent); border: none;
  color: #ffffff; padding: .8rem 1.4rem;
  cursor: pointer; font-size: .9rem; font-weight: 600;
  transition: background var(--transition); white-space: nowrap;
}
.hero-search button:hover { background: var(--color-accent-hover); }

/* ── 9. Tools Grid / Category Sections ─────────────────── */
.tools-section { padding: var(--space-lg) 0; }
.section-title {
  font-size: 1.5rem; font-weight: 700; color: var(--color-navy);
  margin-bottom: var(--space-md); text-align: center;
}
.category-section { margin-bottom: var(--space-lg); }
.category-title {
  font-size: 1rem; font-weight: 700; color: var(--color-navy);
  margin-bottom: .75rem; padding-bottom: .45rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: .9rem;
}

/* ── 10. Tool Card ──────────────────────────────────────── */
/* Icons ALWAYS centered. Titles ALWAYS centered. Mobile + Desktop. */
.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.2rem .9rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;      /* ← horizontal centre */
  justify-content: flex-start;
  text-align: center;       /* ← text centre */
  gap: .6rem;
  text-decoration: none;
  color: var(--color-text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  min-height: 120px;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px var(--color-shadow-md);
  border-color: var(--color-accent-lt);
  text-decoration: none;
  color: var(--color-text);
}
.tool-card-icon {
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: #eff6ff;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin: 0 auto;      /* ensure centred even without flex-parent */
}
.tool-card-icon svg,
.tool-card-icon img { width: 26px; height: 26px; color: var(--color-accent); }
.tool-card-title {
  font-size: .8125rem; font-weight: 600;
  line-height: 1.3; color: var(--color-text);
  text-align: center; width: 100%;
}
.tool-card-desc {
  font-size: .75rem; color: var(--color-muted);
  text-align: center; line-height: 1.4;
}

/* ── 11. Page Content ───────────────────────────────────── */
.page-content { padding: var(--space-lg) 0; }
.page-header { margin-bottom: var(--space-md); }
.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800; color: var(--color-navy);
}
.entry-content {
  font-size: 1rem; line-height: 1.8; color: var(--color-text);
}
.entry-content h2, .entry-content h3 { color: var(--color-navy); margin: 1.5rem 0 .75rem; }
.entry-content p { margin-bottom: 1rem; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1rem; list-style: revert; }
.entry-content a { color: var(--color-accent); }
.entry-content img { border-radius: var(--radius-md); margin: 1rem 0; }
.content-article { max-width: 860px; }

/* ── 12. Single Tool Page ───────────────────────────────── */
.tool-page { padding: var(--space-md) 0 var(--space-xl); }
.tool-header {
  display: flex; align-items: flex-start; gap: var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}
.tool-header-icon {
  width: 60px; height: 60px; flex-shrink: 0;
  background: #eff6ff;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.tool-header-icon svg { width: 32px; height: 32px; color: var(--color-accent); }
.tool-title {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800; color: var(--color-navy); margin-bottom: .4rem;
}
.tool-excerpt { color: var(--color-muted); font-size: 1rem; }
.tool-workspace {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  min-height: 240px;
}
.related-tools { margin-top: var(--space-lg); }
.related-tools h2 { font-size: 1.2rem; font-weight: 700; color: var(--color-navy); margin-bottom: var(--space-sm); }
.tools-grid-compact { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* ── 13. Breadcrumbs ────────────────────────────────────── */
.breadcrumbs {
  display: flex; flex-wrap: wrap; gap: .35rem;
  align-items: center; font-size: .8125rem;
  color: var(--color-muted); margin-bottom: var(--space-sm);
}
.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-accent); text-decoration: none; }
.breadcrumbs .sep { color: var(--color-border); }

/* ── 14. FAQ ────────────────────────────────────────────── */
.faq-section { padding: var(--space-lg) 0; background: var(--color-surface); }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question {
  font-weight: 600; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  padding: .9rem 0; color: var(--color-text);
  background: none; border: none; width: 100%;
  text-align: left; font-size: .9375rem;
  font-family: inherit;
}
.faq-answer {
  display: none; color: var(--color-muted);
  padding: .25rem 0 1rem; line-height: 1.7; font-size: .9375rem;
}
.faq-item.open .faq-answer { display: block; }
.faq-icon { transition: transform .3s ease; font-style: normal; font-weight: 400; }
.faq-item.open .faq-question .faq-icon { transform: rotate(45deg); }

/* ── 15. Rating Section ─────────────────────────────────── */
.rating-section {
  background: var(--color-navy); color: #ffffff;
  padding: var(--space-lg) 0; text-align: center;
}
.rating-section h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.rating-section p { color: rgba(255,255,255,.75); margin-bottom: var(--space-sm); }
.star-rating { display: flex; justify-content: center; gap: .4rem; font-size: 2rem; cursor: default; }
.star-btn { background: none; border: none; cursor: pointer; color: rgba(255,255,255,.35); font-size: inherit; line-height: 1; transition: color .2s; padding: 0; }
.star-btn.active { color: #facc15; }
.star-rating:hover .star-btn { color: rgba(255,255,255,.35); }
.star-rating .star-btn:hover,
.star-rating .star-btn:hover ~ .star-btn { color: #facc15; }

/* ── 16. Ad Slots ───────────────────────────────────────── */
.ad-slot { text-align: center; padding: var(--space-sm) 0; }

/* ── 17. Site Footer ────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: var(--space-lg);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr;
  gap: var(--space-lg);
}
.footer-widget-title { color: #ffffff; font-size: 1rem; font-weight: 700; margin-bottom: .75rem; }
.footer-about p { font-size: .875rem; line-height: 1.7; }
.footer-logo { margin-bottom: .75rem; }
.footer-logo svg { height: 30px; width: auto; }
.footer-menu { display: flex; flex-direction: column; gap: .4rem; }
.footer-menu a { color: rgba(255,255,255,.7); font-size: .875rem; transition: color var(--transition); }
.footer-menu a:hover { color: #fff; text-decoration: none; }
.social-links { display: flex; flex-direction: column; gap: .4rem; }
.social-links a { color: rgba(255,255,255,.7); font-size: .875rem; transition: color var(--transition); }
.social-links a:hover { color: #fff; text-decoration: none; }
.copyright { font-size: .8125rem; margin-bottom: .4rem; }
.footer-email a { color: rgba(255,255,255,.7); font-size: .8125rem; }
.footer-email a:hover { color: #fff; }

/* ── 18. Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .65rem 1.4rem; border-radius: var(--radius-sm);
  font-size: .9375rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--color-accent); color: #ffffff; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.3); text-decoration: none; color: #ffffff; }
.btn-secondary { background: var(--color-bg); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover { background: var(--color-border); text-decoration: none; }

/* ── 19. Forms / Upload ─────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  background: var(--color-bg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--color-accent);
  background: rgba(37,99,235,.04);
}
.upload-area input[type="file"] { display: none; }
.upload-icon { font-size: 2.5rem; margin-bottom: .75rem; opacity: .5; }
.upload-label { font-size: .9375rem; color: var(--color-muted); }
.upload-label strong { color: var(--color-accent); cursor: pointer; }
.form-group { margin-bottom: var(--space-sm); }
.form-label { display: block; font-size: .875rem; font-weight: 600; color: var(--color-text); margin-bottom: .4rem; }
.form-control {
  width: 100%; padding: .6rem .9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .9375rem; color: var(--color-text);
  background: var(--color-surface); outline: none;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.progress-bar-wrap { height: 8px; background: var(--color-border); border-radius: 999px; overflow: hidden; margin-top: var(--space-sm); }
.progress-bar { height: 100%; background: var(--color-accent); border-radius: inherit; transition: width .4s ease; }

/* ── 20. Utility ────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--color-muted); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.hidden { display: none !important; }
.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;
}

/* ── 21. Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-md); }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tools-dropdown { min-width: 300px; columns: 2; }
}

@media (max-width: 768px) {
  :root { --space-lg: 2rem; --space-xl: 2.5rem; }

  .mobile-menu-toggle { display: flex; align-items: center; justify-content: center; }

  .main-navigation {
    position: absolute;
    top: 65px; left: 0; right: 0;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 8px 24px var(--color-shadow-md);
    padding: var(--space-sm);
    display: none; z-index: 490;
  }
  .main-navigation.is-open { display: block; }
  .nav-menu { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-menu > li > a {
    color: var(--color-text); padding: .7rem 1rem;
    border-bottom: 1px solid var(--color-border);
  }
  .nav-menu .sub-menu {
    position: static; opacity: 1; pointer-events: auto;
    transform: none; box-shadow: none; border: none;
    background: var(--color-bg); padding-left: 1rem;
    columns: 1; display: none; min-width: unset;
  }
  .nav-menu li.is-open > .sub-menu { display: block; }
  .nav-menu .sub-menu a { color: var(--color-text); border-bottom: 1px solid var(--color-border); }

  .footer-grid { grid-template-columns: 1fr; gap: var(--space-md); }
  .tool-header { flex-direction: column; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
  .hero-section { padding: var(--space-lg) 0; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
  .tool-card { padding: 1rem .7rem; min-height: 100px; }
  .tool-card-icon { width: 40px; height: 40px; }
  .tool-card-icon svg, .tool-card-icon img { width: 22px; height: 22px; }
  .tool-card-title { font-size: .75rem; }
  .hero-search { margin-top: var(--space-sm); }
  .tools-dropdown { columns: 1; }
}

@media print {
  .site-header, .site-footer, .top-bar, .hero-section, .ad-slot { display: none; }
  body { color: #000; background: #fff; }
}
