/*
Theme Name: AI Tools Pro
Theme URI: https://example.com
Author: You
Description: High-converting AI tools blog theme with built-in SEO defaults and conversion-focused layouts.
Version: 1.1.0
Text Domain: ai-tools-pro
*/

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #101727;
  --muted: #5b6374;
  --brand: #300039;
  --brand-dark: #220028;
  --accent: #f4b740;
  --line: #d9dde6;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 32px rgba(16, 23, 39, 0.08);
  --shadow-hover: 0 20px 56px rgba(16, 23, 39, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background: #f6f7f9;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ─── Header ─── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.container {
  width: min(1200px, 94%);
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 1.5rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
  transition: opacity 0.18s;
}

.logo:hover {
  opacity: 0.8;
}

.logo-image {
  width: auto;
  max-width: 90px;
  height: auto;
  max-height: 110px;
  display: block;
  object-fit: contain;
}

.logo-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
}

.logo span {
  color: var(--brand);
}

/* ─── Nav Menu ─── */

.menu {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.menu a {
  display: block;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--muted);
  transition: background 0.18s, color 0.18s;
}

.menu a:hover,
.menu .current-menu-item > a,
.menu .current_page_item > a {
  background: #f2ebf4;
  color: var(--brand);
}

.fallback-nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.fallback-nav a {
  display: block;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--muted);
  transition: background 0.18s, color 0.18s;
}

.fallback-nav a:hover {
  background: #f2ebf4;
  color: var(--brand);
}

/* ─── Main ─── */

main.container {
  min-height: 60vh;
  padding-top: 2.4rem;
  padding-bottom: 3.5rem;
}

/* ─── Category Badge ─── */

.post-cat {
  display: inline-block;
  background: #f2ebf4;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.26rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
  transition: background 0.2s;
}

.post-cat:hover {
  background: var(--brand);
  color: #fff;
}

.post-cat--sm {
  font-size: 0.72rem;
  padding: 0.22rem 0.6rem;
}

/* ─── Post meta row ─── */

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 1.1rem;
}

.post-meta-row--sm {
  font-size: 0.82rem;
  margin-bottom: 0;
}

/* ─── Featured Post ─── */

.featured-post {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 0;
  position: relative;
  background: var(--surface);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  margin-bottom: 2.8rem;
  border: 1px solid var(--line);
}

.featured-post__image {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 380px;
  background: #efe4f2;
}

.featured-post__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-post__image:hover img {
  transform: scale(1.04);
}

.featured-post__image--empty {
  background: linear-gradient(135deg, #f2e8f4 0%, #e0cde5 100%);
}

.featured-post__badge {
  position: absolute;
  top: 18px;
  left: 18px;
  background: var(--accent);
  color: #101727;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  z-index: 2;
}

.featured-post__body {
  padding: 2.4rem 2.2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-post__title {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  line-height: 1.18;
  margin: 0 0 1rem;
  font-weight: 800;

}

.aitools-share-block {
  margin-top: 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fafafb;
}

.aitools-share-title {
  margin: 0 0 0.6rem 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aitools-share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.aitools-share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.44rem 0.82rem;
  border-radius: 999px;
  border: 1px solid #d7dbe5;
  background: #fff;
  color: #1d2435;
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1;
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.aitools-share-button:hover {
  transform: translateY(-1px);
  border-color: #b8c0d4;
  box-shadow: 0 6px 14px rgba(18, 31, 57, 0.08);
}

@media (max-width: 700px) {
  .aitools-share-button {
    font-size: 0.82rem;
    padding: 0.4rem 0.72rem;
  }
}

.featured-post__title a {
  color: var(--text);
  transition: color 0.2s;
}

.featured-post__title a:hover {
  color: var(--brand);
}

.featured-post__excerpt {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0 0 1.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-post__cta {
  align-self: flex-start;
}

/* ─── Homepage Grid ─── */

.homepage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-bottom: 2.8rem;
}

/* ─── Grid Card (hcard) ─── */

.hcard {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
}

.hcard:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.hcard__thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #f2e8f4, #e0cde5);
}

.hcard__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.hcard:hover .hcard__thumb img {
  transform: scale(1.06);
}

.hcard__thumb--empty {
  aspect-ratio: 16 / 9;
  display: block;
}

.hcard__body {
  padding: 1.15rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.hcard__title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.55rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hcard__title a {
  color: var(--text);
  transition: color 0.18s;
}

.hcard__title a:hover {
  color: var(--brand);
}

.hcard__excerpt {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 0.75rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Homepage Pagination ─── */

.home-pagination {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.home-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  transition: background 0.18s, color 0.18s;
}

.home-pagination .page-numbers.current,
.home-pagination .page-numbers:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ─── No Posts ─── */

.no-posts {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

/* ─── Archive / Blog Post List ─── */

.post-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-bottom: 2rem;
}

.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  transition: box-shadow 0.25s, transform 0.25s;
}

.card-overlay-link {
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
}

.post-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.post-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover img {
  transform: scale(1.04);
}

.post-card-body {
  padding: 1.1rem 1.2rem 1.3rem;
}

.post-card-body h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  line-height: 1.3;
}

.post-card-body h2 a {
  color: var(--text);
}

.post-card-body h2 a:hover {
  color: var(--brand);
}

.post-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.blog-infinite-loader {
  max-width: 520px;
  margin: 0 auto 1.6rem;
  text-align: center;
}

.blog-infinite-loader p {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.blog-infinite-loader__track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #ece7ef;
  border: 1px solid #e0d4e4;
}

.blog-infinite-loader__bar {
  width: 36%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #300039 0%, #74328b 65%, #300039 100%);
  animation: blog-load-sweep 1.15s linear infinite;
}

@keyframes blog-load-sweep {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(360%);
  }
}

/* ─── Single / Page ─── */

.page-hero {
  padding: 2.4rem 0 1.2rem;
}

.page-hero h1 {
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

.entry-content,
.page-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem 2.2rem;
}

/* ─── Single Post ─── */

.single-post {
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 3rem;
}

.single-post__hero-img {
  width: 100%;
  max-height: 520px;
  overflow: hidden;
  border-radius: 24px 24px 0 0;
}

.single-post__hero-img img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  display: block;
}

.single-post__inner {
  padding: 2.4rem clamp(1.4rem, 5vw, 3.5rem) 3rem;
}

.single-post__title {
  font-size: clamp(1.7rem, 3.2vw, 2.8rem);
  line-height: 1.15;
  margin: 0.6rem 0 1rem;
  font-weight: 800;
}

.single-post__content {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text);
  margin-top: 1.8rem;
}

.single-post__content p {
  margin-bottom: 1.4rem;
}

.single-post__content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 2.2rem 0 0.8rem;
  color: var(--text);
}

.single-post__content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.8rem 0 0.6rem;
}

.single-post__content ul,
.single-post__content ol {
  padding-left: 1.4rem;
  margin-bottom: 1.4rem;
}

.single-post__content li {
  margin-bottom: 0.5rem;
}

.single-post__content a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.single-post__content a:hover {
  color: var(--brand-dark);
}

.single-post__content blockquote {
  border-left: 4px solid var(--brand);
  margin: 1.8rem 0;
  padding: 1rem 1.4rem;
  background: #f2ebf4;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
  font-style: italic;
}

.single-post__content img {
  border-radius: var(--radius-sm);
  margin: 1.2rem 0;
}

.single-post__tags {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}

.single-post__tags a {
  color: var(--brand);
}

/* ─── Buttons ─── */

.button,
.wp-element-button,
button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.78rem 1.25rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  background: var(--brand);
  color: #fff;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.button:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(48, 0, 57, 0.3);
  color: #fff;
}

/* ─── Footer ─── */

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-inner {
  width: min(1200px, 94%);
  margin: 0 auto;
  padding: 1.4rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-inner p {
  margin: 0;
  font-size: 0.72rem;
}

.footer-inner a {
  color: var(--brand);
}

/* ─── Responsive ─── */

@media (max-width: 1024px) {
  .homepage-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .featured-post {
    grid-template-columns: 1fr;
  }

  .featured-post__image {
    min-height: 240px;
  }

  .featured-post__body {
    padding: 1.6rem 1.4rem;
  }

  .homepage-grid {
    grid-template-columns: 1fr;
  }

  .post-list {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 0;
    min-height: auto;
  }
}

/* ─── AI Tools Hub ─── */

.tools-hero {
  background: linear-gradient(135deg, #300039 0%, #4a0a54 100%);
  color: #fff;
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.8rem);
  margin-bottom: 1.8rem;
  box-shadow: var(--shadow-hover);
}

.tools-hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.7rem, 3.5vw, 2.9rem);
  line-height: 1.14;
}

.tools-hero p {
  max-width: 920px;
  margin: 0;
  opacity: 0.95;
}

.tools-hero__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  opacity: 0.88;
}

.tools-section {
  margin-bottom: 2rem;
}

.tools-top-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.tools-top-card {
  background: #fbf8fc;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 0.9rem 0.9rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tools-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.tools-section__head h2 {
  margin: 0;
  font-size: clamp(0.82rem, 1.2vw, 0.96rem);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #efe4f2;
  border: 1px solid #e0cde5;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
}

.tools-top-card .tools-section__head {
  margin: 0 -0.9rem 0.9rem;
  display: block;
}

.tools-top-card .tools-section__head h2 {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  background: #300039;
  color: #ffffff;
  border: none;
  border-radius: 16px 16px 0 0;
  text-align: left;
  padding: 1rem 1rem;
  min-height: 62px;
}

.tools-section--directory .tools-section__head {
  margin: 0 0 0.9rem;
  display: block;
}

.tools-section--directory .tools-section__head h2 {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  background: #300039;
  color: #ffffff;
  border: none;
  border-radius: 16px 16px 0 0;
  text-align: left;
  padding: 1rem 1rem;
  min-height: 62px;
}

.tools-section__head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.tools-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tool-card--compact {
  position: relative;
}

.tools-name-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.tools-name-list li {
  color: var(--muted);
  border: 1px solid #e5d8e8;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
}

.tools-name-list__link {
  color: var(--text);
  display: block;
  padding: 0.78rem 0.85rem;
  transition: background 0.18s ease, color 0.18s ease;
}

.tools-name-list__link:hover {
  background: #f7f1f9;
  color: var(--brand);
}

.tools-name-list__title {
  display: block;
  font-weight: 600;
  margin: 0;
}

.tools-name-list__desc {
  display: block;
  margin-top: 0.34rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.tool-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
  line-height: 1.33;
}

.tool-card h3 a {
  color: var(--text);
}

.tool-card h3 a:hover {
  color: var(--brand);
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.tool-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.95rem;
}

.tool-card__alt {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.tool-card__alt:hover {
  color: #fff;
}

.tool-card--compact {
  padding: 0.9rem;
}

.tool-card--compact h3 {
  font-size: 0.95rem;
}

.tool-link-inline {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--brand);
}

.tool-link-inline:hover {
  color: var(--brand-dark);
}

.tools-empty {
  border: 1px dashed var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  color: var(--muted);
}

/* ─── Single AI Tool ─── */

.single-tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow: hidden;
}

.single-tool__hero-img {
  width: 100%;
  max-height: 440px;
  overflow: hidden;
}

.single-tool__hero-img img {
  width: 100%;
  height: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
}

.single-tool__inner {
  padding: clamp(1.2rem, 4vw, 2.6rem);
}

.single-tool__eyebrow {
  margin: 0;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.single-tool__title {
  margin: 0.45rem 0 0.8rem;
  font-size: clamp(1.6rem, 3.2vw, 2.7rem);
  line-height: 1.14;
}

.single-github-repo .single-tool__title {
  color: var(--brand);
}

.single-tool__excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.single-tool__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.2rem 0 1.5rem;
}

.single-tool__content {
  line-height: 1.75;
  font-size: 1.02rem;
}

.single-tool__content h2,
.single-tool__content h3 {
  line-height: 1.25;
}

@media (max-width: 1100px) {
  .tools-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tools-top-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tools-grid,
  .tools-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tools-top-cards {
    grid-template-columns: 1fr;
  }

  .tools-section__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .tools-grid,
  .tools-grid--compact {
    grid-template-columns: 1fr;
  }
}

/* ── Ad Placeholders ── */
.ad-banner-horizontal {
  width: 100%;
  min-height: 90px;
  background: #f9f5fb;
  border: 1.5px dashed #c9a8d8;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto;
  max-width: var(--max-w, 1200px);
  box-sizing: border-box;
}

.ad-banner-horizontal span,
.ad-card span {
  font-size: 0.78rem;
  font-style: italic;
  color: #a07ab5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

.ad-card {
  background: #f9f5fb;
  border: 1.5px dashed #c9a8d8;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  width: 100%;
  margin: 1.5rem 0;
  box-sizing: border-box;
}

.ad-banner-horizontal.ad--active,
.ad-card.ad--active {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

@media (max-width: 640px) {
  .ad-banner-horizontal {
    min-height: 70px;
  }
  .ad-card {
    min-height: 130px;
  }
}

.contact-form-wrap {
  margin-top: 1.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem;
}

.contact-form-wrap h2 {
  margin: 0 0 0.4rem;
  font-size: 1.35rem;
}

.contact-form-wrap p {
  margin: 0 0 1rem;
  color: var(--muted);
}

.contact-form {
  display: grid;
  gap: 0.72rem;
}

.contact-form label {
  font-weight: 700;
  font-size: 0.92rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.64rem 0.72rem;
  font: inherit;
  background: #fff;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.contact-form__notice {
  border-radius: 10px;
  padding: 0.68rem 0.8rem;
  margin: 0 0 0.9rem;
  font-weight: 600;
}

.contact-form__notice--success {
  background: #e7f7ee;
  border: 1px solid #a4d8b8;
  color: #165930;
}

.contact-form__notice--error {
  background: #fdeceb;
  border: 1px solid #efb4b0;
  color: #7c1e18;
}

/* Contact Form 7 styled to match the previous custom contact form card */
.page-content .wpcf7 {
  margin-top: 1.3rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem;
}

.page-content .wpcf7 form {
  display: grid;
  gap: 0.72rem;
}

.page-content .wpcf7 label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
}

.page-content .wpcf7 input[type="text"],
.page-content .wpcf7 input[type="email"],
.page-content .wpcf7 input[type="tel"],
.page-content .wpcf7 input[type="number"],
.page-content .wpcf7 textarea,
.page-content .wpcf7 select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.64rem 0.72rem;
  font: inherit;
  background: #fff;
  margin-top: 0.3rem;
}

.page-content .wpcf7 textarea {
  resize: vertical;
}

.page-content .wpcf7 .wpcf7-submit {
  justify-self: start;
}

.page-content .wpcf7 .wpcf7-response-output {
  border-radius: 10px;
  padding: 0.68rem 0.8rem;
  margin: 0.3rem 0 0;
  font-weight: 600;
}

.page-content .wpcf7 form.sent .wpcf7-response-output {
  background: #e7f7ee;
  border: 1px solid #a4d8b8;
  color: #165930;
}

.page-content .wpcf7 form.failed .wpcf7-response-output,
.page-content .wpcf7 form.invalid .wpcf7-response-output,
.page-content .wpcf7 form.unaccepted .wpcf7-response-output,
.page-content .wpcf7 form.aborted .wpcf7-response-output,
.page-content .wpcf7 form.spam .wpcf7-response-output {
  background: #fdeceb;
  border: 1px solid #efb4b0;
  color: #7c1e18;
}

.page-content .wpcf7 .wpcf7-not-valid-tip {
  font-size: 0.86rem;
  margin-top: 0.3rem;
}

