/* ==========================================================================
   Fwocus — Tools Directory Stylesheet
   Zen Paper Aesthetic · Compact Grid Layout · Jump Navigation
   ========================================================================== */

/* Directory Page Specific Variables & Overrides */
:root {
  --dir-card-bg: rgba(253, 251, 247, 0.92);
  --dir-card-border: rgba(80, 72, 59, 0.18);
  --dir-card-hover-border: rgba(185, 65, 45, 0.45);
  --dir-card-hover-bg: #ffffff;
  --dir-shadow-sm: 0 2px 8px rgba(80, 72, 59, 0.05);
  --dir-shadow-md: 0 6px 18px rgba(80, 72, 59, 0.08);
}

/* Base Directory Wrap */
.directory-wrap {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

/* Active Nav State */
.site-header nav a.active-nav {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* Directory Hero Header */
.directory-hero {
  padding-top: 44px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 48px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background-color: rgba(185, 65, 45, 0.08);
  border: 1px solid rgba(185, 65, 45, 0.2);
  border-radius: 999px;
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.eyebrow-sep {
  color: var(--line);
}

.directory-title {
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.1;
  letter-spacing: -1.2px;
  color: var(--ink);
  margin-bottom: 16px;
  font-weight: 400;
}

.directory-lead {
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.55;
  color: #4a4740;
  max-width: 820px;
  margin-bottom: 32px;
}

/* Search Bar */
.search-container {
  margin-bottom: 32px;
  max-width: 680px;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

.tool-search-input {
  width: 100%;
  padding: 14px 44px 14px 46px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background-color: var(--dir-card-bg);
  border: 1px solid var(--dir-card-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  box-shadow: var(--dir-shadow-sm);
}

.tool-search-input:focus {
  border-color: var(--accent);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(185, 65, 45, 0.12);
}

.tool-search-input::placeholder {
  color: #948f86;
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  color: var(--muted);
  background: rgba(80, 72, 59, 0.08);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.search-clear-btn:hover {
  background-color: var(--accent);
  color: #ffffff;
}

.search-status {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
}

/* Jump Navigation / Table of Contents */
.jump-nav {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

.jump-nav-label {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 12px;
}

.jump-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.jump-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background-color: var(--dir-card-bg);
  border: 1px solid var(--dir-card-border);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  transition: all 0.18s ease;
}

.jump-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: #ffffff;
  transform: translateY(-1px);
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background-color: rgba(80, 72, 59, 0.1);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
}

.jump-chip:hover .chip-count {
  background-color: rgba(185, 65, 45, 0.12);
  color: var(--accent);
}

/* Category Sections */
.category-section {
  margin-bottom: 56px;
  scroll-margin-top: 32px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.category-info {
  max-width: 800px;
}

.category-tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.category-num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
}

.category-badge {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.category-title {
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.6px;
  color: var(--ink);
  margin-bottom: 6px;
}

.category-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}

.category-total {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 10px;
  background: rgba(80, 72, 59, 0.08);
  border-radius: 4px;
}

/* Compact Minimalist Grid */
.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 14px;
}

/* Compact Tool Card */
.compact-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background-color: var(--dir-card-bg);
  border: 1px solid var(--dir-card-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--dir-shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.compact-card:hover {
  transform: translateY(-2px);
  border-color: var(--dir-card-hover-border);
  background-color: var(--dir-card-hover-bg);
  box-shadow: var(--dir-shadow-md);
}

.card-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card-tag {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: -0.2px;
  color: var(--ink);
  font-weight: 500;
  margin: 0;
  transition: color 0.18s ease;
}

.compact-card:hover .card-title {
  color: var(--accent);
}

.card-arrow {
  font-family: var(--sans);
  font-size: 17px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.18s ease, color 0.18s ease;
}

.compact-card:hover .card-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* Hidden state during search */
.compact-card.is-hidden {
  display: none !important;
}

.category-section.is-hidden {
  display: none !important;
}

/* Philosophy / E-E-A-T Editorial Box */
.directory-editorial-box {
  margin-top: 64px;
  margin-bottom: 56px;
  padding: 36px 40px;
  background-color: var(--dir-card-bg);
  border: 1px solid var(--dir-card-border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--dir-shadow-sm);
}

.editorial-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.editorial-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--dir-card-border);
}

.editorial-meta h4 {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0;
  color: var(--ink);
}

.editorial-meta p {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.editorial-content h3 {
  font-size: 23px;
  letter-spacing: -0.4px;
  margin-bottom: 12px;
  color: var(--ink);
}

.editorial-content p {
  font-size: 16px;
  line-height: 1.6;
  color: #4a4740;
  margin-bottom: 14px;
}

.editorial-content p:last-child {
  margin-bottom: 0;
}

/* Bottom CTA Banner */
.directory-cta-banner {
  margin-bottom: 64px;
  padding: 44px;
  background: linear-gradient(135deg, rgba(253, 251, 247, 0.96) 0%, rgba(245, 240, 230, 0.9) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--dir-shadow-sm);
}

.directory-cta-banner h2 {
  font-size: clamp(26px, 2.8vw, 36px);
  margin-bottom: 12px;
  color: var(--ink);
}

.directory-cta-banner p {
  font-size: 17px;
  color: var(--muted);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 24px;
  line-height: 1.5;
}

.directory-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  background-color: var(--accent);
  color: #ffffff;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.directory-cta-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .directory-wrap {
    width: calc(100% - 32px);
  }

  .directory-hero {
    padding-top: 28px;
    padding-bottom: 36px;
    margin-bottom: 36px;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .category-total {
    align-self: flex-start;
  }

  .compact-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .directory-editorial-box {
    padding: 24px 20px;
  }

  .directory-cta-banner {
    padding: 32px 20px;
  }
}
