/**
 * Shared styles: all tool pages (single + archive)
 * High-contrast heroes, light tool panels, unified FAQ.
 *
 * @package AllInOneTool
 */

/* --------------------------------------------------------------------------
   Page shell
   -------------------------------------------------------------------------- */
body.page-tool .site-content,
body.archive-tools .site-content {
  background-color: var(--color-bg-alt, #f8fafc);
}

body.page-tool .site-main > .container,
body.archive-tools .site-main > .container {
  max-width: var(--container-max, 1200px);
}

body.page-tool .site-main > .container {
  padding-bottom: var(--space-3xl, 4rem);
}

/* --------------------------------------------------------------------------
   SEO hero — readable on all tools (fixes gray-on-gradient bugs)
   Default gradient for VIN, maintenance, etc. OBD2 / Data Commons override in their CSS.
   -------------------------------------------------------------------------- */
body.page-tool .tool-seo-content {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  padding: clamp(2rem, 5vw, 3.5rem) 0;
  margin: 0 0 var(--space-xl, 2rem);
  border-radius: 0 0 var(--border-radius-xl, 16px) var(--border-radius-xl, 16px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(15, 23, 42, 0.12));
}

body.page-tool .tool-seo-content:not(.obd2-seo):not(.dce-seo) {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #2563eb 100%);
}

body.page-tool .tool-seo-content .container {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg, 1.5rem);
}

body.page-tool .tool-seo-content .tool-title {
  color: #ffffff !important;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 var(--space-md, 1rem);
  letter-spacing: -0.02em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

body.page-tool .tool-seo-content .tool-intro,
body.page-tool .tool-seo-content .tool-intro p {
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 1.0625rem;
  line-height: 1.7;
  max-width: 48rem;
  margin: 0;
}

body.page-tool .tool-seo-content .tool-intro strong {
  color: #fde68a !important;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Generic single tool article (non-custom tools)
   -------------------------------------------------------------------------- */
body.page-tool .tool-single {
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--border-radius-lg, 12px);
  padding: var(--space-xl, 2rem);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
}

body.page-tool .tool-single .tool-title {
  color: var(--color-text, #1e293b);
  font-size: clamp(1.5rem, 3vw, 2rem);
}

body.page-tool .tool-single .tool-excerpt {
  color: var(--color-text-muted, #64748b);
  font-size: 1.0625rem;
}

body.page-tool .tool-single .tool-content {
  color: var(--color-text, #1e293b);
}

body.page-tool .tool-single .tool-content p,
body.page-tool .tool-single .tool-content li {
  color: var(--color-text, #334155);
}

body.page-tool .tool-single .tool-footer {
  color: var(--color-text-muted, #64748b);
}

/* --------------------------------------------------------------------------
   FAQ — all custom tools (high contrast, no invisible text)
   -------------------------------------------------------------------------- */
.page-tool .tool-faq {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-3xl, 4rem) var(--space-lg, 1.5rem) var(--space-2xl, 3rem);
  background: var(--color-bg, #ffffff);
  border-top: 1px solid var(--color-border, #e2e8f0);
}

.page-tool .tool-faq .container {
  padding-left: 0;
  padding-right: 0;
}

.page-tool .tool-faq h2 {
  text-align: center;
  margin: 0 0 var(--space-xl, 2rem);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--color-text, #0f172a) !important;
  letter-spacing: -0.02em;
}

.page-tool .faq-container {
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--border-radius-lg, 12px);
  overflow: hidden;
  background: var(--color-bg, #fff);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}

.page-tool .faq-item {
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.page-tool .faq-item:last-child {
  border-bottom: none;
}

.page-tool .faq-question {
  width: 100%;
  padding: 1.125rem 1.25rem;
  background: #f8fafc;
  border: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a !important;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md, 1rem);
  transition: background 0.2s ease;
}

.page-tool .faq-question:hover {
  background: #f1f5f9;
}

.page-tool .faq-question[aria-expanded='true'] {
  background: #eff6ff;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
}

.page-tool .faq-question .faq-icon {
  flex-shrink: 0;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--color-primary, #2563eb);
  transition: transform 0.25s ease;
  line-height: 1;
}

.page-tool .faq-question[aria-expanded='true'] .faq-icon {
  transform: rotate(45deg);
}

.page-tool .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: #ffffff;
}

.page-tool .faq-answer-inner {
  padding: 1.25rem 1.25rem 1.5rem;
  background: #ffffff;
}

.page-tool .faq-answer p,
.page-tool .faq-answer li {
  margin: 0 0 0.75rem;
  line-height: 1.65;
  color: #334155 !important;
  font-size: 0.9875rem;
}

.page-tool .faq-answer p:last-child {
  margin-bottom: 0;
}

.page-tool .faq-question:focus-visible {
  outline: 2px solid var(--color-primary, #2563eb);
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   Tools archive polish
   -------------------------------------------------------------------------- */
body.archive-tools .archive-tools__intro {
  background: linear-gradient(180deg, #ffffff 0%, var(--color-bg-alt, #f8fafc) 100%);
}

body.archive-tools .archive-tools__title {
  color: var(--color-text, #0f172a);
}

body.archive-tools .tool-card__desc {
  color: #475569;
}
