/* Homepage free legal templates gallery (under Features). */
#lai-templates.lai-tg-section {
  --lai-tg-ink: #171720;
  --lai-tg-muted: #676573;
  --lai-tg-accent: #7853e5;
  --lai-tg-accent-light: #f4f0ff;
  --lai-tg-card-border: #e6e3f0;
  --lai-tg-card-hover: #d3c4fc;
  --lai-tg-ease: cubic-bezier(.2, .75, .2, 1);
  padding-top: 72px;
  padding-bottom: 88px;
  background: #fff;
}


/* Match top nav content container width (header-inner). */
#lawyerai-home #lai-templates > .lai-container {
  width: min(1400px, calc(100% - 64px));
  max-width: none;
}

#lai-templates .lai-tg-header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 36px;
}

#lai-templates .lai-tg-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--lai-tg-accent-light);
  border: 1px solid #d9cbfa;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--lai-tg-accent);
  margin-bottom: 18px;
}

#lai-templates .lai-tg-badge svg {
  width: 13px;
  height: 13px;
}

#lai-templates .lai-tg-header .lai-body {
  margin-top: 14px;
}

#lai-templates .lai-tg-cats {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 auto 40px;
  max-width: 920px;
}

#lai-templates .lai-tg-pill {
  padding: 8px 16px;
  border-radius: 99px;
  background: #f7f6fa;
  border: 1px solid #e8e5ef;
  font-size: 13.5px;
  font-weight: 600;
  color: #4a4656;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}

#lai-templates .lai-tg-pill:hover,
#lai-templates .lai-tg-pill[aria-pressed="true"] {
  background: var(--lai-tg-accent);
  border-color: var(--lai-tg-accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(120, 83, 229, 0.22);
}

#lai-templates .lai-tg-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

#lai-templates .lai-tg-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--lai-tg-card-border);
  border-radius: 24px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 30px rgba(28, 22, 45, 0.04);
  transition: transform .25s var(--lai-tg-ease), border-color .25s ease, box-shadow .25s ease;
}

#lai-templates .lai-tg-card:hover {
  transform: translateY(-4px);
  border-color: var(--lai-tg-card-hover);
  box-shadow: 0 16px 40px rgba(120, 83, 229, 0.09);
}

#lai-templates .lai-tg-preview {
  position: relative;
  height: 270px;
  background: var(--lai-tg-accent);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#lai-templates .lai-tg-paper-back2 {
  position: absolute;
  top: 18px;
  width: 64%;
  height: 100px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px 12px 0 0;
}

#lai-templates .lai-tg-paper-back1 {
  position: absolute;
  top: 26px;
  width: 72%;
  height: 100px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px 14px 0 0;
}

#lai-templates .lai-tg-paper {
  position: absolute;
  top: 36px;
  width: 80%;
  height: 250px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 24px 22px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  user-select: text;
  cursor: text;
  overflow: hidden;
}

#lai-templates .lai-tg-doc-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 750;
  color: #1a1721;
  text-align: center;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

#lai-templates .lai-tg-doc-p {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.5;
  color: #4a4656;
}

#lai-templates .lai-tg-doc-field {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1.5;
  color: #4a4656;
  display: flex;
  flex-wrap: wrap;
}

#lai-templates .lai-tg-doc-label {
  font-weight: 650;
  margin-right: 6px;
  color: #2b2836;
}

#lai-templates .lai-tg-ph {
  color: #6d697a;
  background: #f4f3f7;
  padding: 0 4px;
  border-radius: 3px;
}

#lai-templates .lai-tg-external {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
  color: #fff;
  transition: background .2s ease;
  z-index: 10;
  pointer-events: none;
}

#lai-templates .lai-tg-card:hover .lai-tg-external {
  background: rgba(255, 255, 255, 0.35);
}

#lai-templates .lai-tg-external svg {
  width: 14px;
  height: 14px;
}

#lai-templates .lai-tg-content {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

#lai-templates .lai-tg-cat {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--lai-tg-accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#lai-templates .lai-tg-content h3 {
  margin: 0 0 8px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--lai-tg-ink);
}

#lai-templates .lai-tg-content p {
  margin: 0 0 20px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--lai-tg-muted);
  flex: 1;
}

#lai-templates .lai-tg-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  font-weight: 600;
  color: #8c8999;
  border-top: 1px solid #f2f0f7;
  padding-top: 14px;
}

#lai-templates .lai-tg-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#lai-templates .lai-tg-meta svg {
  width: 14px;
  height: 14px;
  color: #d1c169;
}

#lai-templates .lai-tg-footer {
  text-align: center;
  margin-top: 48px;
}

#lai-templates .lai-tg-explore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 14px;
  background: #f7f6fa;
  border: 1px solid #e4e1ed;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--lai-tg-ink);
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

#lai-templates .lai-tg-explore:hover {
  background: var(--lai-tg-accent-light);
  border-color: #d1bfff;
  color: var(--lai-tg-accent);
}

#lai-templates .lai-tg-explore svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 960px) {
  #lai-templates .lai-tg-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  #lai-templates.lai-tg-section {
    padding-top: 56px;
    padding-bottom: 64px;
  }
  #lai-templates .lai-tg-pill {
    font-size: 12.5px;
    padding: 7px 12px;
  }
}
