/*
 * Utilities — Responsive breakpoints and helper classes.
 */

/* ── Responsive grid collapse ────────────────────────────── */
@media (max-width: 1024px) {
  .bc-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .bc-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bc-grid--4 { grid-template-columns: 1fr; }

  .bc-home-hero__body {
    padding: 1.5rem;
  }

  .bc-article-hero {
    padding: 1.5rem;
  }

  .bc-article-content {
    padding: 1.5rem;
  }

  .bc-author-box {
    grid-template-columns: 1fr;
  }

  .bc-author-box__avatar img {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 600px) {
  .bc-grid--2,
  .bc-grid--3 { grid-template-columns: 1fr; }

  .bc-article-hero__title {
    font-size: 1.6rem;
  }

  .bc-dl-hero {
    grid-template-columns: 1fr;
  }

  body.botcrawl-theme .main-navigation {
    display: none;
  }

  body.botcrawl-theme .main-navigation.toggled {
    display: flex;
    position: absolute;
    top: var(--bc-header-h);
    left: 0;
    right: 0;
    background: var(--bc-bg-card);
    border-bottom: 1px solid var(--bc-line);
    padding: 1rem;
    z-index: 999;
  }

  body.botcrawl-theme .main-navigation.toggled ul {
    flex-direction: column;
    width: 100%;
  }
}

/* ── Utility classes ─────────────────────────────────────── */
.bc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.bc-text-center { text-align: center; }
.bc-text-right  { text-align: right; }
.bc-text-muted  { color: var(--bc-text-dim); }
.bc-text-soft   { color: var(--bc-text-soft); }
.bc-text-cyan   { color: var(--bc-cyan); }
.bc-text-red    { color: var(--bc-red); }
.bc-text-green  { color: var(--bc-green); }
.bc-text-mono   { font-family: var(--bc-font-mono); }

.bc-mt-0  { margin-top: 0; }
.bc-mb-0  { margin-bottom: 0; }
.bc-mt-1  { margin-top: 1rem; }
.bc-mb-1  { margin-bottom: 1rem; }
.bc-mt-2  { margin-top: 2rem; }
.bc-mb-2  { margin-bottom: 2rem; }

.bc-hidden { display: none !important; }
.bc-flex   { display: flex; }
.bc-gap-1  { gap: 0.5rem; }
.bc-gap-2  { gap: 1rem; }
.bc-items-center { align-items: center; }
.bc-justify-between { justify-content: space-between; }

/* ── Editor style overrides ──────────────────────────────── */
body.botcrawl-theme .wp-block-image img {
  border-radius: var(--bc-radius);
}

body.botcrawl-theme .wp-block-quote {
  border-left: 4px solid var(--bc-red);
  background: var(--bc-bg-card);
  border-radius: 0 var(--bc-radius) var(--bc-radius) 0;
  padding: 1rem 1.5rem;
  color: var(--bc-text-soft);
}

body.botcrawl-theme .wp-block-code {
  background: var(--bc-bg);
  border: 1px solid var(--bc-line);
  border-radius: var(--bc-radius);
  color: var(--bc-cyan);
  font-family: var(--bc-font-mono);
}

body.botcrawl-theme .wp-block-table td,
body.botcrawl-theme .wp-block-table th {
  border-color: var(--bc-line);
  color: var(--bc-text-soft);
}

body.botcrawl-theme .wp-block-table thead th {
  background: var(--bc-bg-elevated);
  color: var(--bc-text-strong);
}

/* ── WP search form ──────────────────────────────────────── */
body.botcrawl-theme .search-form {
  display: flex;
  gap: 0.5rem;
}

body.botcrawl-theme .search-form .search-field {
  flex: 1;
}

body.botcrawl-theme .search-form .search-submit {
  background: var(--bc-red);
  color: #fff;
  border: none;
  border-radius: var(--bc-radius);
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: background var(--bc-ease);
}

body.botcrawl-theme .search-form .search-submit:hover {
  background: #dc2626;
}

/* ── 404 page ────────────────────────────────────────────── */
body.botcrawl-theme .error404 .page-content {
  text-align: center;
  padding: 4rem 1.5rem;
}

body.botcrawl-theme .error404 .page-title {
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--bc-red);
  margin-bottom: 1rem;
}
