/* =========================================================
   TD Framework Tools CPT
   Borrowed component language from Ingredient template, kept modular.
========================================================= */

.tdfw-tool-actions-section,
.tdfw-tool-section,
.tdfw-tool-specs-section,
.tdfw-tool-about-section {
  margin-block: 0 28px;
}

.tdfw-tool-actions-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.tdfw-tool-actions-panel .tdfw-shopping-button-wrap,
.tdfw-tool-actions-panel .tdfw-button,
.tdfw-tool-actions-panel .tdfw-tool-member-button {
  flex: 0 1 auto;
}

.tdfw-tool-badge-row,
.tdfw-tool-meta-pills,
.tdfw-tool-use-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tdfw-tool-badge-row {
  margin-bottom: 14px;
}

.tdfw-tool-hero-card {
  background: var(--tdfw-section-card-bg, var(--tdfw-card-bg, #1b1b1b));
  border-radius: var(--tdfw-section-card-radius, var(--tdfw-card-radius, 24px));
  padding: clamp(20px, 4vw, 40px);
  color: var(--tdfw-card-text-color, #fffaf0);
  box-shadow: var(--tdfw-section-shadow, none);
}

.tdfw-tool-hero-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.tdfw-tool-hero-media:empty {
  display: none;
}

.tdfw-tool-hero-image-wrap {
  overflow: hidden;
  border-radius: var(--tdfw-image-radius, 22px);
}

.tdfw-tool-hero-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: inherit;
}

.tdfw-tool-hero-title {
  margin: 0 0 14px;
  color: var(--tdfw-card-text-color, #fffaf0);
  font-family: var(--tdfw-font-heading, inherit);
  font-size: var(--tdfw-hero-heading-size, clamp(2.4rem, 6vw, 5rem));
  line-height: 0.95;
  letter-spacing: var(--tdfw-letter-spacing-heading, -0.04em);
}

.tdfw-tool-short-definition,
.tdfw-tool-best-for,
.tdfw-tool-alt-names,
.tdfw-tool-about__content {
  color: var(--tdfw-card-text-color, #fffaf0);
  font-family: var(--tdfw-font-body, inherit);
  font-size: var(--tdfw-section-text-size, 1rem);
  line-height: 1.65;
}

.tdfw-tool-short-definition {
  margin-top: 18px;
}

.tdfw-tool-short-definition p,
.tdfw-tool-best-for p,
.tdfw-tool-about__content p {
  margin: 0 0 1em;
}

.tdfw-tool-short-definition p:last-child,
.tdfw-tool-best-for p:last-child,
.tdfw-tool-about__content p:last-child {
  margin-bottom: 0;
}

.tdfw-tool-alt-names,
.tdfw-tool-best-for {
  margin-top: 14px;
}

.tdfw-tool-alt-names strong,
.tdfw-tool-best-for strong {
  display: inline-block;
  margin-right: 0.45em;
  font-family: var(--tdfw-font-ui, inherit);
  font-size: var(--tdfw-ui-text-size, 0.8rem);
  line-height: 1;
  letter-spacing: var(--tdfw-letter-spacing-ui, 0.08em);
  text-transform: uppercase;
}

.tdfw-tool-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.tdfw-tool-spec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 16px;
  border-radius: var(--tdfw-section-inner-radius, 18px);
  background: var(--tdfw-section-inner-bg, rgba(255, 255, 255, 0.04));
  color: var(--tdfw-card-text-color, #fffaf0);
}

.tdfw-tool-spec-item.is-wide {
  grid-column: 1 / -1;
}

.tdfw-tool-spec-icon {
  width: var(--tdfw-icon-graphic-size, 28px);
  height: var(--tdfw-icon-graphic-size, 28px);
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask-image: var(--tdfw-icon-url);
  mask-image: var(--tdfw-icon-url);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.tdfw-tool-spec-copy {
  display: grid;
  gap: 4px;
}

.tdfw-tool-spec-label {
  font-family: var(--tdfw-font-ui, inherit);
  font-size: var(--tdfw-ui-text-size, 0.78rem);
  line-height: 1;
  letter-spacing: var(--tdfw-letter-spacing-ui, 0.08em);
  text-transform: uppercase;
}

.tdfw-tool-spec-value {
  font-family: var(--tdfw-font-body, inherit);
  font-size: var(--tdfw-section-text-small-size, 0.95rem);
  line-height: 1.35;
}

.tdfw-tool-list-wrap {
  position: relative;
}

.tdfw-tool-list-grid {
  margin-top: 18px;
}

.tdfw-tool-list-card .tdfw-member-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tdfw-view-list .tdfw-tool-list-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.tdfw-view-list .tdfw-tool-list-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.tdfw-view-list .tdfw-tool-list-card .tdfw-member-card-media img {
  width: 96px;
  height: 96px;
  object-fit: cover;
}

@media (max-width: 767px) {
  .tdfw-tool-hero-grid {
    grid-template-columns: 1fr;
  }

  .tdfw-tool-actions-panel,
  .tdfw-tool-actions-panel .tdfw-shopping-button-wrap,
  .tdfw-tool-actions-panel .tdfw-button,
  .tdfw-tool-actions-panel .tdfw-tool-member-button {
    width: 100%;
  }
}
