/* =============================================================================
   WP Block Rendering Styles
   Targets Gutenberg/Kadence block classes from the WordPress migration.
   No brand colors — structural layout only. Brand layer goes on top in Astro.
   ============================================================================= */

/* ── Reset ──────────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #1a1a1a;
  margin: 0;
  padding: 0;
}

/* ── Sections (wp-block-group) ───────────────────────────────────────────────
   Each group is a visual section. Alternating backgrounds for separation.     */

.wp-block-group {
  width: 100%;
  padding: 4rem 1.5rem;
}

.wp-block-group__inner-container,
.wp-block-group-is-layout-constrained {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* Nested flex groups (e.g. "How it works" center-stacked layout) */
.wp-block-group.is-layout-flex.is-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* ── Typography ──────────────────────────────────────────────────────────────*/

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 1rem;
}

/* Strip the WP <br> that precedes headings */
.wp-block-heading br:first-child { display: none; }

.has-text-align-center { text-align: center; }
.has-text-align-left   { text-align: left; }
.has-text-align-right  { text-align: right; }

.has-large-font-size  { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.has-medium-font-size { font-size: clamp(1rem, 2vw, 1.125rem); }

p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }

ul, ol {
  margin: 0 0 1.25rem 1.5rem;
  padding: 0;
  line-height: 1.8;
}

ul { list-style: disc; }
ol { list-style: decimal; }

li { margin-bottom: 0.35rem; }
li:last-child { margin-bottom: 0; }

h2 { margin-top: 2rem; }
h3 { margin-top: 1.5rem; }

/* ── Content prose (scoped to <main> to avoid polluting nav/footer) ──────────*/

main a {
  color: #f97316;
  text-decoration: underline;
  text-underline-offset: 2px;
}

main a:hover { opacity: 0.8; }

main blockquote {
  border-left: 4px solid #f97316;
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: #fff8f3;
  color: #444;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

main blockquote p { margin-bottom: 0; }

main code {
  background: #f1f1f5;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'Menlo', 'Consolas', monospace;
  color: #d63384;
}

main pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

main pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

main hr {
  border: none;
  border-top: 1px solid #e0e0e6;
  margin: 2rem 0;
}

main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.95rem;
}

main th, main td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid #e0e0e6;
}

main thead th {
  background: #f4f4f7;
  font-weight: 600;
  color: #1a1a1a;
}

main tbody tr:nth-child(even) { background: #fafafa; }
main tbody tr:hover { background: #f0f0f5; }

/* ── Iframe embed ────────────────────────────────────────────────────────────
   Used for the blazehive app embeds on each page.                             */

iframe {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  margin: 2rem auto;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────*/

.wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 2rem 0;
}

.wp-block-button__link {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: opacity 0.15s, transform 0.15s;
  cursor: pointer;
}

.wp-block-button__link:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.has-luminous-vivid-orange-background-color {
  background-color: #ff6900 !important;
  color: #fff !important;
}

/* ── Images ──────────────────────────────────────────────────────────────────*/

/* Force all images responsive — !important overrides inline style="width:Xpx" attributes */
main img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
}

.wp-block-image {
  text-align: center;
  margin: 1.5rem 0;
}

.wp-block-image img,
.wp-block-image figure img {
  border-radius: 8px;
  margin: 0 auto;
}

figure { margin: 0; }

/* ── Feature grid (#block-group-custom) ──────────────────────────────────────
   The 4-card feature section present on all programmatic pages.               */

#block-group-custom {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

#block-group-custom > .wp-block-group {
  /* min-width: 0 prevents grid items overflowing their cell */
  min-width: 0;
  background: #f7f7f8;
  border: 1px solid #e8e8eb;
  border-radius: 14px;
  padding: 2rem;
  margin: 0;
  /* reset inherited section padding */
  width: auto;
}

/* reset inner constrained container inside cards */
#block-group-custom .wp-block-group__inner-container,
#block-group-custom .wp-block-group-is-layout-constrained {
  max-width: 100%;
  margin: 0;
}

#block-group-custom > .wp-block-group h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

#block-group-custom > .wp-block-group p {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.65;
}

#block-group-custom img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto 0;
}

/* ── Carousel ────────────────────────────────────────────────────────────────
   Related pages carousel at the end of seo-agency pages.                      */

.wp-carousel {
  position: relative;
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 3rem;
  overflow: hidden;
}

.wp-carousel-container {
  display: flex;
  gap: 1.25rem;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.wp-carousel-item {
  flex: 0 0 calc(33.333% - 0.875rem);
  background: #fff;
  border: 1px solid #e8e8eb;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.wp-carousel-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.4;
}

.wp-carousel-title a {
  text-decoration: none;
  color: inherit;
}

.wp-carousel-title a:hover {
  text-decoration: underline;
}

.wp-carousel-excerpt {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wp-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.15s, box-shadow 0.15s;
  padding: 0;
}

.wp-carousel-arrow:hover {
  background: #f4f4f6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wp-carousel-arrow.prev { left: 0; }
.wp-carousel-arrow.next { right: 0; }

.wp-carousel-arrow svg { pointer-events: none; }

/* ── Responsive ──────────────────────────────────────────────────────────────*/

@media (max-width: 900px) {
  #block-group-custom {
    grid-template-columns: 1fr;
  }

  .wp-carousel-item {
    flex: 0 0 calc(50% - 0.625rem);
  }
}

@media (max-width: 600px) {
  .wp-block-group { padding: 2.5rem 1rem; }

  #block-group-custom { padding: 2.5rem 1rem; }

  .wp-carousel { padding: 0 2.5rem; }

  .wp-carousel-item {
    flex: 0 0 calc(100% - 0rem);
  }

  .wp-carousel-arrow { width: 32px; height: 32px; }
}
