/*
Theme Name: ProToolHub
Theme URI: https://protoolhub.in
Author: ProToolHub
Author URI: https://protoolhub.in
Description: Clean, professional, AdSense-friendly WordPress theme for utility tools and calculators. Fully responsive, white background, optimized for Google AdSense and global (US) audience. Works perfectly with the ProToolHub Tools plugin.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: protoolhub
Tags: custom-menu, featured-images, threaded-comments, translation-ready, responsive-layout, accessibility-ready, blog, custom-logo, custom-colors, editor-style
*/

:root {
  --pth-bg: #ffffff;
  --pth-surface: #f8fafc;
  --pth-text: #0f172a;
  --pth-text-secondary: #475569;
  --pth-text-muted: #64748b;
  --pth-primary: #2563eb;
  --pth-primary-hover: #1d4ed8;
  --pth-primary-soft: rgba(37, 99, 235, 0.08);
  --pth-border: #e2e8f0;
  --pth-border-strong: #cbd5e1;
  --pth-card-bg: #ffffff;
  --pth-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --pth-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  --pth-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08);
  --pth-radius: 12px;
  --pth-radius-sm: 8px;
  --pth-radius-full: 9999px;
  --pth-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --pth-container: 1120px;
  --pth-header-h: 68px;
  --pth-transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--pth-font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--pth-text);
  background-color: var(--pth-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--pth-primary);
  text-decoration: none;
  transition: color var(--pth-transition);
}
a:hover { color: var(--pth-primary-hover); }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal !important;
}

.pth-container {
  width: 100%;
  max-width: var(--pth-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Header */
.pth-header {
  background: #fff;
  border-bottom: 1px solid var(--pth-border);
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--pth-header-h);
}

.pth-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--pth-header-h);
  gap: 24px;
}

.pth-logo {
  font-size: 1.3rem;
  font-weight: 750;
  color: var(--pth-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pth-logo:hover { text-decoration: none; color: var(--pth-text); }
.pth-logo span { color: var(--pth-primary); }

.pth-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 2px;
  align-items: center;
}

.pth-nav a {
  display: block;
  padding: 8px 14px;
  color: var(--pth-text-secondary);
  font-weight: 500;
  font-size: 0.925rem;
  border-radius: var(--pth-radius-sm);
  text-decoration: none;
  transition: all var(--pth-transition);
}
.pth-nav a:hover,
.pth-nav .current-menu-item > a {
  color: var(--pth-primary);
  background: var(--pth-primary-soft);
  text-decoration: none;
}

.pth-menu-toggle {
  display: none;
  background: #fff;
  border: 1px solid var(--pth-border);
  border-radius: var(--pth-radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--pth-text);
}

/* Hero */
.pth-hero {
  padding: 64px 0 56px;
  text-align: center;
  background: var(--pth-surface);
  border-bottom: 1px solid var(--pth-border);
}

.pth-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--pth-primary-soft);
  color: var(--pth-primary);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--pth-radius-full);
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.pth-hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--pth-text);
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.pth-hero p {
  font-size: 1.125rem;
  color: var(--pth-text-secondary);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.pth-hero-search {
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

.pth-hero-search svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pth-text-muted);
  pointer-events: none;
}

.pth-hero-search input {
  width: 100%;
  padding: 15px 20px 15px 48px;
  border: 1px solid var(--pth-border);
  border-radius: var(--pth-radius-full);
  font-size: 1rem;
  background: #fff;
  box-shadow: var(--pth-shadow-sm);
  outline: none;
  transition: border-color var(--pth-transition), box-shadow var(--pth-transition);
  color: var(--pth-text);
}
.pth-hero-search input::placeholder { color: var(--pth-text-muted); }
.pth-hero-search input:focus {
  border-color: var(--pth-primary);
  box-shadow: 0 0 0 3px var(--pth-primary-soft);
}

/* Sections */
.pth-section { padding: 56px 0; }

.pth-section-header {
  text-align: center;
  margin-bottom: 36px;
}

.pth-section-title {
  font-size: 1.6rem;
  font-weight: 750;
  margin: 0 0 8px;
  color: var(--pth-text);
  letter-spacing: -0.02em;
}

.pth-section-desc {
  color: var(--pth-text-secondary);
  margin: 0 auto;
  font-size: 1rem;
  max-width: 480px;
}

/* Category pills */
.pth-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  justify-content: center;
}

.pth-cat-pill {
  padding: 8px 16px;
  border-radius: var(--pth-radius-full);
  background: var(--pth-surface);
  color: var(--pth-text-secondary);
  font-size: 0.875rem;
  font-weight: 550;
  text-decoration: none;
  border: 1px solid var(--pth-border);
  transition: all var(--pth-transition);
}
.pth-cat-pill:hover,
.pth-cat-pill.active {
  background: var(--pth-primary);
  color: #fff;
  border-color: var(--pth-primary);
  text-decoration: none;
}

/* Tool cards */
.pth-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
}

.pth-tool-card {
  background: var(--pth-card-bg);
  border: 1px solid var(--pth-border);
  border-radius: var(--pth-radius);
  padding: 24px;
  transition: box-shadow var(--pth-transition), border-color var(--pth-transition), transform 0.15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pth-tool-card:hover {
  box-shadow: var(--pth-shadow);
  border-color: var(--pth-border-strong);
  transform: translateY(-2px);
}

.pth-tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--pth-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  margin-bottom: 16px;
}

.pth-tool-card h3 {
  font-size: 1.1rem;
  font-weight: 650;
  margin: 0 0 8px;
  color: var(--pth-text);
  letter-spacing: -0.01em;
}
.pth-tool-card h3 a { color: inherit; text-decoration: none; }
.pth-tool-card h3 a:hover { color: var(--pth-primary); }

.pth-tool-card p {
  font-size: 0.9rem;
  color: var(--pth-text-secondary);
  margin: 0 0 18px;
  flex-grow: 1;
  line-height: 1.55;
}

/* Buttons */
.pth-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--pth-radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--pth-transition);
  text-decoration: none;
  line-height: 1.3;
}

.pth-btn-primary {
  background: var(--pth-primary);
  color: #fff;
}
.pth-btn-primary:hover {
  background: var(--pth-primary-hover);
  color: #fff;
  text-decoration: none;
}

.pth-btn-outline {
  background: transparent;
  color: var(--pth-primary);
  border: 1px solid var(--pth-primary);
}
.pth-btn-outline:hover {
  background: var(--pth-primary-soft);
  text-decoration: none;
}

.pth-btn-lg {
  padding: 13px 24px;
  font-size: 0.95rem;
}

/* Features */
.pth-features {
  background: var(--pth-surface);
  border-top: 1px solid var(--pth-border);
  border-bottom: 1px solid var(--pth-border);
}

.pth-feature-card { text-align: center; padding: 8px 12px; }

.pth-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--pth-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 14px;
  box-shadow: var(--pth-shadow-sm);
}

.pth-feature-card h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0 0 8px;
}

.pth-feature-card p {
  font-size: 0.9rem;
  color: var(--pth-text-secondary);
  margin: 0;
  line-height: 1.55;
}

/* Content */
.pth-content { padding: 48px 0 64px; }
.pth-content article { max-width: 740px; margin: 0 auto; }

.pth-content h1 {
  font-size: 2rem;
  font-weight: 750;
  margin: 0 0 12px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.pth-content .entry-meta {
  font-size: 0.875rem;
  color: var(--pth-text-muted);
  margin-bottom: 28px;
}

.pth-content .entry-content {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--pth-text);
}
.pth-content .entry-content p { margin: 0 0 1.3em; }
.pth-content .entry-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 1.9em 0 0.55em;
  letter-spacing: -0.015em;
}
.pth-content .entry-content h3 {
  font-size: 1.15rem;
  font-weight: 650;
  margin: 1.5em 0 0.45em;
}

.pth-calc-wrapper {
  background: #fff;
  border: 1px solid var(--pth-border);
  border-radius: var(--pth-radius);
  padding: 28px;
  margin: 28px 0;
  box-shadow: var(--pth-shadow-sm);
  max-width: 480px;
}

/* Footer */
.pth-footer {
  background: var(--pth-surface);
  border-top: 1px solid var(--pth-border);
  padding: 48px 0 28px;
  margin-top: 24px;
}

.pth-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 36px;
}

.pth-footer h4 {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--pth-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pth-footer ul { list-style: none; margin: 0; padding: 0; }
.pth-footer li { margin-bottom: 9px; }
.pth-footer a {
  color: var(--pth-text-secondary);
  font-size: 0.9rem;
  text-decoration: none;
}
.pth-footer a:hover { color: var(--pth-primary); }

.pth-footer-about p {
  color: var(--pth-text-secondary);
  font-size: 0.9rem;
  margin: 0 0 12px;
  line-height: 1.6;
}

.pth-footer-bottom {
  border-top: 1px solid var(--pth-border);
  padding-top: 22px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--pth-text-muted);
}
.pth-footer-bottom p { margin: 0 0 6px; }

.pth-ad-slot {
  margin: 28px 0;
  text-align: center;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Responsive */
@media (max-width: 900px) {
  .pth-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 768px) {
  .pth-menu-toggle { display: block; }
  .pth-nav {
    display: none;
    position: absolute;
    top: var(--pth-header-h);
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--pth-border);
    padding: 12px 16px 16px;
    box-shadow: var(--pth-shadow);
  }
  .pth-nav.is-open { display: block; }
  .pth-nav ul { flex-direction: column; align-items: stretch; }
  .pth-nav a { padding: 12px 14px; }
  .pth-hero { padding: 44px 0 40px; }
  .pth-section { padding: 44px 0; }
  .pth-footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .pth-tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .pth-container { padding-left: 16px; padding-right: 16px; }
  .pth-tool-card { padding: 20px; }
  .pth-hero h1 { font-size: 1.7rem; }
}

@media print {
  .pth-header, .pth-footer, .pth-menu-toggle { display: none; }
}

/* ===== Homepage layout with ad rails (calculator.net style) ===== */
.pth-home-layout {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  align-items: start;
}
.pth-ad-rail {
  padding: 16px 8px;
  position: sticky;
  top: 80px;
  min-height: 200px;
}
.pth-ad-rail .pth-ad-slot,
.pth-ad-rail > div {
  margin-bottom: 16px;
}
.pth-home-main { min-width: 0; }
.pth-hero-compact {
  padding: 36px 0 28px;
}
.pth-hero-compact h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 8px;
}
.pth-hero-compact p {
  font-size: 1rem;
  margin-bottom: 0;
  max-width: 520px;
}

.pth-std-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  align-items: start;
}
.pth-mini-heading {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 12px;
  color: var(--pth-text-secondary);
}
.pth-quick-links {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}
.pth-quick-links li {
  margin-bottom: 6px;
}
.pth-quick-links a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--pth-text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.pth-quick-links a:hover {
  background: var(--pth-primary-soft);
  color: var(--pth-primary);
}

.pth-tool-card-sm {
  padding: 18px;
}
.pth-tool-card-sm .pth-tool-icon {
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  margin-bottom: 10px;
}
.pth-tool-card-sm h3 {
  font-size: 0.98rem;
  margin-bottom: 12px;
}

/* Standard calculator keypad */
.pth-std-calc {
  max-width: 360px;
  background: #1e293b;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(15,23,42,0.2);
}
.pth-std-display {
  background: #0f172a;
  color: #f8fafc;
  font-size: 2rem;
  font-weight: 600;
  text-align: right;
  padding: 18px 16px;
  border-radius: 10px;
  margin-bottom: 12px;
  min-height: 56px;
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}
.pth-std-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.pth-std-keys button {
  border: none;
  border-radius: 10px;
  padding: 16px 8px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  background: #334155;
  color: #f1f5f9;
  transition: background 0.12s, transform 0.08s;
}
.pth-std-keys button:hover { background: #475569; }
.pth-std-keys button:active { transform: scale(0.96); }
.pth-std-keys button.op { background: #2563eb; color: #fff; }
.pth-std-keys button.op:hover { background: #1d4ed8; }
.pth-std-keys button.eq { background: #16a34a; color: #fff; grid-column: span 1; }
.pth-std-keys button.eq:hover { background: #15803d; }
.pth-std-keys button.wide { grid-column: span 2; }
.pth-std-keys button.fn { background: #475569; font-size: 0.95rem; }

@media (max-width: 1100px) {
  .pth-home-layout {
    grid-template-columns: 1fr;
  }
  .pth-ad-rail { display: none; }
}
@media (max-width: 768px) {
  .pth-std-grid { grid-template-columns: 1fr; }
  .pth-std-calc { max-width: 100%; }
}
