/**
 * Blog module (site): list, post page and comments. Prefix "bf-". The accent follows the theme through
 * --bf-accent: the brand color of the React "cliente" themes, the Bootstrap 5 primary or the Bootstrap 4 one.
 * The React themes import a copy of this file (src/legacy/modules/blog-front.css).
 */
.bf {
  --bf-accent: var(--cl-primary-700, var(--bs-primary, var(--primary, #1f6feb)));
  --bf-text: var(--bs-body-color, #1d2330);
  --bf-muted: var(--bs-secondary-color, #667085);
  --bf-line: var(--bs-border-color, #e4e7ec);
  --bf-soft: var(--bs-tertiary-bg, #f5f6f8);
  --bf-radius: 14px;
  padding-top: 2rem;
  padding-bottom: 3rem;
  color: var(--bf-text);
}

/* 1. Header, search and chips ---------------------------------------------- */

.bf-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.bf-eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bf-accent);
}

.bf-hero-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
}

.bf-hero-lead {
  margin: .4rem 0 0;
  max-width: 40rem;
  color: var(--bf-muted);
  font-size: 1.05rem;
}

.bf-search {
  display: flex;
  align-items: center;
  width: min(100%, 20rem);
  border: 1px solid var(--bf-line);
  border-radius: 999px;
  background: var(--bs-body-bg, #fff);
  overflow: hidden;
}

.bf-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: .6rem 0 .6rem 1rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
}

.bf-search button {
  display: inline-flex;
  padding: .55rem .9rem;
  border: 0;
  background: transparent;
  color: var(--bf-muted);
}

.bf-chips {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.75rem;
  padding-bottom: .25rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.bf-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .8rem;
  border: 1px solid var(--bf-line);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--bf-text);
  text-decoration: none;
  background: var(--bs-body-bg, #fff);
}

.bf-chip small {
  color: var(--bf-muted);
  font-weight: 500;
}

.bf-chip:hover,
.bf-chip.is-active {
  border-color: var(--bf-accent);
  color: var(--bf-accent);
  text-decoration: none;
}

.bf-chip-accent {
  border-color: transparent;
  background: var(--bf-accent);
  color: #fff;
}

/* 2. Cards ------------------------------------------------------------------- */

.bf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1.5rem;
}

.bf-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  background: var(--bs-body-bg, #fff);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.bf-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(16, 24, 40, .1);
}

.bf-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--bf-soft);
  overflow: hidden;
}

.bf-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.bf-card:hover .bf-card-media img {
  transform: scale(1.04);
}

.bf-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 3rem;
  font-weight: 800;
  color: var(--bf-accent);
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--bf-accent) 22%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--bf-accent) 10%, var(--bf-soft)), var(--bf-soft));
}

.bf-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: .5rem;
  padding: 1.1rem 1.25rem 1.25rem;
}

.bf-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.bf-meta:empty {
  display: none;
}

.bf-card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.bf-card-title a {
  color: var(--bf-text);
  text-decoration: none;
}

.bf-card-title a:hover {
  color: var(--bf-accent);
}

.bf-card-excerpt {
  margin: 0;
  color: var(--bf-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bf-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: auto;
  padding-top: .25rem;
  font-size: .85rem;
  color: var(--bf-muted);
}

/** Featured post: image beside the text on wide screens. */
.bf-card-featured {
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .bf-card-featured {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
  }

  .bf-card-featured .bf-card-media {
    aspect-ratio: auto;
    min-height: 20rem;
  }

  .bf-card-featured .bf-card-body {
    justify-content: center;
    padding: 2rem 2.25rem;
  }

  .bf-card-featured .bf-card-title {
    font-size: 1.75rem;
  }

  .bf-card-featured .bf-card-foot {
    margin-top: .5rem;
  }
}

/* 3. Empty state, pager and tags -------------------------------------------- */

.bf-empty {
  padding: 3rem 1rem;
  border: 1px dashed var(--bf-line);
  border-radius: var(--bf-radius);
  text-align: center;
  color: var(--bf-muted);
}

.bf-link {
  color: var(--bf-accent);
  font-weight: 600;
}

.bf-pager {
  margin-top: 2rem;
}

.bf-section-title {
  margin: 0 0 1rem;
  font-size: 1.35rem;
  font-weight: 800;
}

.bf-tags,
.bf-related,
.bf-comments {
  margin-top: 3rem;
}

.bf-tag-cloud,
.bf-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.bf-tag {
  padding: .25rem .7rem;
  border-radius: 6px;
  background: var(--bf-soft);
  font-size: .875rem;
  color: var(--bf-text);
  text-decoration: none;
}

.bf-tag:hover {
  color: var(--bf-accent);
  text-decoration: none;
}

/* 4. Post page --------------------------------------------------------------- */

.bf-preview {
  margin-bottom: 1.5rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  background: #fff4d6;
  color: #7a5200;
  font-weight: 600;
}

.bf-article,
.bf-comments {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

.bf-article-head {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.75rem;
}

.bf-article-title {
  margin: 0;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
}

.bf-article-lead {
  margin: 0;
  font-size: 1.2rem;
  color: var(--bf-muted);
}

.bf-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  color: var(--bf-muted);
}

.bf-byline-name {
  font-weight: 700;
  color: var(--bf-text);
}

.bf-updated {
  flex-basis: 100%;
  font-size: .8rem;
}

.bf-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--bf-soft);
  color: var(--bf-text);
  font-size: .8rem;
  font-weight: 700;
}

.bf-avatar.is-staff {
  background: var(--bf-accent);
  color: #fff;
}

.bf-cover {
  margin: 0 0 2rem;
}

.bf-cover img {
  width: 100%;
  max-height: 32rem;
  object-fit: cover;
  border-radius: var(--bf-radius);
}

/** Text of the post (editor HTML). */
.bf-content {
  font-size: 1.1rem;
  line-height: 1.8;
  overflow-wrap: break-word;
}

.bf-content h2,
.bf-content h3,
.bf-content h4 {
  margin: 2rem 0 .75rem;
  font-weight: 800;
  line-height: 1.25;
}

.bf-content h2 {
  font-size: 1.6rem;
}

.bf-content h3 {
  font-size: 1.3rem;
}

.bf-content p {
  margin: 0 0 1.2rem;
}

/** Blank line of the editor (<p><br></p>): one line of space, not a paragraph gap. */
.bf-content p:has(> br:only-child) {
  margin: 0;
}

.bf-content a {
  color: var(--bf-accent);
  text-decoration: underline;
}

.bf-content img {
  max-width: 100%;
  height: auto;
  margin: .5rem 0;
  border-radius: 10px;
}

.bf-content blockquote {
  margin: 1.5rem 0;
  padding: .5rem 0 .5rem 1.25rem;
  border-left: 4px solid var(--bf-accent);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--bf-muted);
}

.bf-content pre,
.bf-content .ql-syntax {
  padding: 1rem;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: .9rem;
  overflow-x: auto;
}

.bf-content iframe,
.bf-content .ql-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 1.5rem 0;
  border: 0;
  border-radius: 10px;
}

.bf-content .ql-align-center {
  text-align: center;
}

.bf-content .ql-align-right {
  text-align: right;
}

.bf-content .ql-align-justify {
  text-align: justify;
}

.bf-content .ql-indent-1 {
  padding-left: 2em;
}

.bf-content .ql-indent-2 {
  padding-left: 4em;
}

.bf-article-tags {
  margin-top: 2rem;
}

/* 5. Share and previous/next ------------------------------------------------- */

.bf-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--bf-line);
  border-bottom: 1px solid var(--bf-line);
}

.bf-share-label {
  margin-right: .25rem;
  font-weight: 700;
}

.bf-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--bf-line);
  border-radius: 50%;
  background: var(--bs-body-bg, #fff);
  color: var(--bf-text);
}

.bf-share-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.bf-share-btn:hover {
  border-color: var(--bf-accent);
  color: var(--bf-accent);
}

.bf-share-btn.is-whatsapp:hover {
  border-color: #25d366;
  color: #25d366;
}

.bf-share-btn.is-copied {
  border-color: #16a34a;
  color: #16a34a;
}

.bf-pn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.bf-pn-item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  color: var(--bf-text);
  text-decoration: none;
}

.bf-pn-item small {
  color: var(--bf-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.bf-pn-item span {
  font-weight: 700;
}

.bf-pn-item.is-next {
  grid-column: 2;
  text-align: right;
}

.bf-pn-item:hover {
  border-color: var(--bf-accent);
  text-decoration: none;
}

@media (max-width: 575.98px) {
  .bf-pn {
    grid-template-columns: 1fr;
  }

  .bf-pn-item.is-next {
    grid-column: 1;
  }
}

/* 6. Comments ------------------------------------------------------------------ */

.bf-comment {
  display: flex;
  gap: .85rem;
  padding: 1rem 0;
  border-top: 1px solid var(--bf-line);
}

.bf-comment.is-reply {
  margin-top: .75rem;
  padding: .75rem 0 0;
}

.bf-comment-body {
  flex: 1 1 auto;
  min-width: 0;
}

.bf-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.bf-comment-head time {
  font-size: .8rem;
  color: var(--bf-muted);
}

.bf-comment-text {
  margin-top: .25rem;
  overflow-wrap: break-word;
}

.bf-reply-btn,
.bf-replying button {
  padding: 0;
  border: 0;
  background: none;
  font-size: .85rem;
  font-weight: 600;
  color: var(--bf-accent);
}

.bf-comment-form {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--bf-radius);
  background: var(--bf-soft);
}

.bf-label {
  display: block;
  margin-bottom: .5rem;
  font-weight: 700;
}

.bf-comment-form textarea {
  display: block;
  width: 100%;
  padding: .75rem 1rem;
  border: 1px solid var(--bf-line);
  border-radius: 10px;
  background: var(--bs-body-bg, #fff);
  color: inherit;
  resize: vertical;
}

.bf-comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .75rem;
  color: var(--bf-muted);
}

.bf-btn {
  padding: .6rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--bf-accent);
  color: #fff;
  font-weight: 700;
}

.bf-btn:hover {
  filter: brightness(1.08);
}

.bf-replying {
  margin-bottom: .5rem;
  font-size: .9rem;
}

.bf-login {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--bf-radius);
  background: var(--bf-soft);
}

.bf-login a {
  color: var(--bf-accent);
  font-weight: 700;
}

.bf-notice {
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  border-radius: 10px;
  font-weight: 600;
}

.bf-notice.is-success {
  background: #e7f8ee;
  color: #146c3a;
}

.bf-notice.is-error {
  background: #fdecec;
  color: #a12020;
}

/** Breadcrumb above the post title (React themes, where the page has no header band). */
.bf-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
  font-size: .875rem;
  color: var(--bf-muted);
}

.bf-crumbs a {
  color: var(--bf-muted);
  font-weight: 600;
  text-decoration: none;
}

.bf-crumbs a:hover {
  color: var(--bf-accent);
}
