/* ════════════════════════════════════════════
   A3 Digital Tools — Components
════════════════════════════════════════════ */

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  line-height: 1;
  padding: 13px 26px;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.btn--primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  box-shadow: var(--shadow-blue);
}
.btn--primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 12px 36px rgba(41,82,227,0.38);
}

.btn--ghost {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-200);
}
.btn--ghost:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  color: var(--gray-900);
}

.btn--dark {
  background: var(--gray-900);
  color: var(--white);
  border-color: var(--gray-900);
}
.btn--dark:hover { background: var(--gray-700); border-color: var(--gray-700); color: var(--white); }

.btn--white {
  background: var(--white);
  color: var(--blue);
  border-color: var(--white);
}
.btn--white:hover { background: var(--blue-light); }

.btn--sm  { padding: 9px 18px; font-size: var(--text-sm); }
.btn--lg  { padding: 16px 34px; font-size: var(--text-md); }
.btn--xl  { padding: 18px 40px; font-size: var(--text-lg); }

/* ── SECTION HEADERS ── */
.section-eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: var(--sp-3);
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--sp-8);
  gap: var(--sp-4);
}
.section-header--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.section-title {
  font-size: var(--text-2xl);
  font-weight: var(--fw-xbold);
  color: var(--gray-900);
  line-height: var(--lh-tight);
}
.section-desc {
  font-size: var(--text-md);
  color: var(--gray-500);
  max-width: 520px;
  margin-top: var(--sp-3);
  line-height: var(--lh-normal);
}
.section-see-all {
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: var(--blue);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-see-all:hover { color: var(--blue-dark); }

/* ── TOOL CARDS ── */
.tools-grid {
  display: grid;
  gap: 16px;
}
.tools-grid--3col { grid-template-columns: repeat(3, 1fr); }
.tools-grid--4col { grid-template-columns: repeat(4, 1fr); }
.tools-grid--2col { grid-template-columns: repeat(2, 1fr); }

.tool-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: var(--transition);
  overflow: hidden;
}
.tool-card:hover {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tool-card--inactive { opacity: 0.7; }

.tool-card__link {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.tool-card__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: var(--sp-4);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.tool-card:hover .tool-card__icon { transform: scale(1.08); }

.tool-card__icon--sm { width: 38px; height: 38px; font-size: 18px; margin-bottom: var(--sp-3); }

.tool-card__body { flex: 1; }
.tool-card__title-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.tool-card__title {
  font-size: var(--text-base);
  font-weight: var(--fw-xbold);
  color: var(--gray-900);
  line-height: var(--lh-snug);
}
.tool-card--sm .tool-card__title { font-size: var(--text-sm); }

.tool-card__desc {
  font-size: var(--text-sm);
  color: var(--gray-500);
  line-height: var(--lh-normal);
  margin: 0;
}
.tool-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--gray-100);
}
.tool-card__cat {
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tool-card__files {
  font-size: var(--text-xs);
  color: var(--gray-400);
  font-weight: var(--fw-semi);
}
.tool-card__arrow {
  font-size: var(--text-base);
  color: var(--gray-300);
  transition: transform 0.2s, color 0.2s;
}
.tool-card:hover .tool-card__arrow {
  transform: translateX(3px);
  color: var(--blue);
}

/* ── CATEGORY CARDS ── */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.categories-grid--compact { grid-template-columns: repeat(5, 1fr); }

.cat-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.cat-card:hover {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.cat-card__icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  margin-bottom: var(--sp-3);
}
.cat-card__name {
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: var(--gray-800);
  line-height: var(--lh-snug);
}
.cat-card__count {
  font-size: var(--text-xs);
  color: var(--gray-400);
  font-weight: var(--fw-semi);
  margin-top: var(--sp-1);
}

/* ── BREADCRUMB ── */
.breadcrumb { margin-bottom: var(--sp-5); }
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: var(--sp-1);
  padding: 0;
}
.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: var(--text-sm);
  color: var(--gray-400);
}
.breadcrumb__item a { color: var(--gray-500); }
.breadcrumb__item a:hover { color: var(--blue); }
.breadcrumb__item--active span { color: var(--gray-700); font-weight: var(--fw-semi); }
.breadcrumb__sep { color: var(--gray-300); margin: 0 2px; }

/* ── SEARCH BAR ── */
.hero-search-bar,
.page-search-bar {
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 7px 7px 7px 22px;
  gap: var(--sp-3);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  max-width: 560px;
  margin: 0 auto;
}
.hero-search-bar:focus-within,
.page-search-bar:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(41,82,227,0.12);
}
.hero-search-icon,
.search-bar-icon { color: var(--gray-400); flex-shrink: 0; }
.hero-search-input,
.page-search-input,
.search-bar-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font);
  font-size: var(--text-base);
  color: var(--gray-800);
  background: transparent;
  min-width: 0;
}
.hero-search-input::placeholder,
.page-search-input::placeholder,
.search-bar-input::placeholder { color: var(--gray-400); }

.hero-search-btn,
.wf-search-btn {
  background: var(--blue);
  color: var(--white);
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.hero-search-btn:hover { background: var(--blue-hover); }

/* ── SEARCH RESULTS DROPDOWN ── */
.hero-search-results,
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.hero__search { position: relative; margin-bottom: var(--sp-8); }

.search-result-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  border-bottom: 1px solid var(--gray-100);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--blue-light); }
.search-result-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.search-result-title { font-size: var(--text-sm); font-weight: var(--fw-bold); color: var(--gray-900); }
.search-result-cat { font-size: var(--text-xs); color: var(--gray-400); margin-top: 2px; }
.search-result-empty { padding: var(--sp-5); text-align: center; color: var(--gray-400); font-size: var(--text-sm); }

/* ── FAQ ── */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  background: var(--white);
}
.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: var(--sp-5) var(--sp-6);
  text-align: left;
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
  color: var(--gray-800);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  transition: var(--transition);
}
.faq-question:hover { background: var(--gray-50); color: var(--blue); }
.faq-question[aria-expanded="true"] { background: var(--blue-light); color: var(--blue-dark); }
.faq-chevron { flex-shrink: 0; transition: transform 0.2s; color: var(--gray-400); }
.faq-question[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); color: var(--blue); }
.faq-answer {
  padding: 0 var(--sp-6) var(--sp-5);
  font-size: var(--text-base);
  color: var(--gray-600);
  line-height: var(--lh-relaxed);
  background: var(--blue-light);
}
.faq-answer p { margin: 0; }

/* ── SIDEBAR BOXES ── */
.sidebar-box {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.sidebar-box__title {
  font-size: var(--text-sm);
  font-weight: var(--fw-xbold);
  color: var(--gray-900);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1.5px solid var(--gray-100);
}
.sidebar-facts { list-style: none; padding: 0; }
.sidebar-facts li {
  display: flex;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: var(--text-sm);
  color: var(--gray-500);
}
.sidebar-facts li:last-child { border-bottom: none; }
.sidebar-facts li strong { color: var(--gray-800); font-weight: var(--fw-semi); }
.sidebar-facts li a { color: var(--blue); font-weight: var(--fw-semi); }

.sidebar-related { list-style: none; padding: 0; }
.sidebar-related__link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.15s;
  margin-bottom: 2px;
}
.sidebar-related__link:hover { background: var(--blue-light); color: var(--blue); }
.sidebar-related__icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: var(--gray-100); border-radius: 6px; font-size: 14px; flex-shrink: 0; }
.sidebar-cat-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: var(--text-sm);
  color: var(--gray-700);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-cat-link:hover { color: var(--blue); }
.sidebar-cat-link:last-child { border-bottom: none; }

/* ── PAGE HERO ── */
.page-hero {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: var(--sp-12) 0 var(--sp-10);
}
.page-hero__title {
  font-size: var(--text-3xl);
  font-weight: var(--fw-black);
  color: var(--gray-900);
  margin-bottom: var(--sp-3);
}
.page-hero__desc {
  font-size: var(--text-md);
  color: var(--gray-500);
  max-width: 560px;
  margin-bottom: var(--sp-6);
}
.page-hero--simple { padding: var(--sp-10) 0; }
.page-hero--tools  { background: linear-gradient(to bottom, var(--blue-light) 0%, var(--white) 100%); }

/* ── FILTER TABS ── */
.tools-filter-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: var(--header-height);
  z-index: var(--z-sticky);
  padding: var(--sp-3) 0;
}
.filter-tabs {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  color: var(--gray-600);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-full);
  padding: 7px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.filter-tab:hover { border-color: var(--blue-mid); color: var(--blue); background: var(--blue-light); }
.filter-tab--active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}
.filter-tab__count {
  background: rgba(255,255,255,0.25);
  border-radius: var(--radius-full);
  padding: 2px 7px;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
}
.filter-tab:not(.filter-tab--active) .filter-tab__count {
  background: var(--gray-200);
  color: var(--gray-500);
}

/* ── RESULTS BAR ── */
.tools-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) 0 var(--sp-5);
  font-size: var(--text-sm);
  color: var(--gray-500);
}
.tools-sort select {
  font-family: var(--font);
  font-size: var(--text-sm);
  font-weight: var(--fw-semi);
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  background: var(--white);
  cursor: pointer;
  margin-left: var(--sp-2);
}

/* ── POST CTA BOX ── */
.post-cta-box {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--blue-light);
  border: 1.5px solid var(--blue-mid);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-8) 0;
}
.post-cta-box__icon { font-size: 28px; flex-shrink: 0; }
.post-cta-box strong { font-size: var(--text-md); font-weight: var(--fw-xbold); color: var(--gray-900); display: block; margin-bottom: 4px; }
.post-cta-box p { font-size: var(--text-sm); color: var(--gray-600); margin: 0; }

/* ── AUTHOR BOX ── */
.author-box {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-top: var(--sp-8);
}
.author-box__avatar img { border-radius: var(--radius-full); width: 60px; height: 60px; }
.author-box__name { font-size: var(--text-base); font-weight: var(--fw-xbold); color: var(--gray-900); }
.author-box__bio { font-size: var(--text-sm); color: var(--gray-500); margin-top: 4px; }

/* ── POST TAGS ── */
.post-tags {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  font-size: var(--text-sm); color: var(--gray-500);
  margin: var(--sp-6) 0; align-items: center;
}
.post-tags a {
  background: var(--gray-100);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  color: var(--gray-600);
  font-size: var(--text-xs);
  font-weight: var(--fw-semi);
  transition: background 0.15s;
}
.post-tags a:hover { background: var(--blue-light); color: var(--blue); }

/* ── EMOJI ICON FIX ──
   Ensure emoji render correctly inside icon boxes.
   The wrench/screwdriver SVG seen in screenshots was the WordPress
   featured image placeholder showing through. These rules prevent that.
── */
.tool-card__icon,
.cat-card__icon,
.cat-other-card__icon,
.cat-hero__icon,
.tool-hero__icon {
    /* Prevent WP featured image or any img tag bleeding in */
    overflow: hidden;
    position: relative;
    /* Ensure emoji render at correct size */
    font-style: normal;
    font-variant: normal;
    line-height: 1;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

/* Hide any img tag inside icon boxes (WP thumbnail bleeds in some themes) */
.tool-card__icon img,
.cat-card__icon img,
.tool-hero__icon img {
    display: none !important;
}

/* ── TOOL CARD: ensure emoji always visible ── */
.tool-card__icon {
    font-size: 22px;
    font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji",sans-serif;
}

.tool-card__icon--sm {
    font-size: 18px;
}

/* ── CATEGORY PAGE SECTION SPACING FIX ──
   Increase gap between tools grid and "Explore Other Categories" section
── */
.cat-tools-section {
    padding-bottom: var(--sp-16) !important;
}

.cat-other-section {
    padding-top: var(--sp-16) !important;
}

/* ── TOOL ICON: better empty state ── */
.tool-card__icon:empty::after {
    content: '🔧';
    font-size: 22px;
}

/* ── TOOL CARD: improve overall card appearance ── */
.tool-card {
    background: var(--white);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
}

/* Ensure all tool cards have minimum height for consistency */
.tool-card__link {
    min-height: 160px;
}
