/* Post listing styles (Phase 3) — atomic naming convention */

/* === ATOMS === */

/* Cover image — square (Flutter: width = screen width, height = width) */
.a-cover-img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  display: block;
}

.a-cover-placeholder {
  aspect-ratio: 1 / 1;
  background-color: #f0f0f0;
}

/* Category badge */
.a-category-badge {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 12px;
  font-weight: 200;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #000;
}

/* Date */
.a-date-published {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 12px;
  font-weight: 200;
  color: #000;
}

/* === MOLECULES === */

/* Post card — Flutter: grey divider between cards, 8px, Colors.grey.withOpacity(.25) */
.m-post-card {
  border-bottom: 8px solid rgba(128, 128, 128, 0.25);
}

.m-post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.m-post-card-link:hover {
  text-decoration: none;
  color: inherit;
}

.m-post-card-body {
  padding: 0;
}

/* Title — Flutter: BasicGothicPro 23px w200 black, padding 16/16/16/4 */
.m-post-card-title {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 23px;
  font-weight: 200;
  line-height: 1.3;
  display: block;
  color: #000;
  padding: 1rem 1rem 0.25rem;
}

/* Meta row (date + category) */
.m-post-card-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0 1rem;
}

/* Actions row — Flutter: spaceBetween, stats left, buttons right */
.m-post-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
}

/* Stats (likes + views) — Flutter: horizontal Row, 12px w200 black, 48px height */
.m-post-card-stats {
  display: flex;
  align-items: center;
  height: 48px;
  padding-left: 0.5rem;
}

.m-post-card-stat {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 12px;
  font-weight: 200;
  color: #000;
  white-space: nowrap;
}

.m-post-card-stat-sep {
  width: 1rem;
}

/* Like button — Flutter: 48x48 */
.m-post-card-like-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #000;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
}
.m-post-card-like-btn--active {
  color: var(--kon-brand-color, #cf0015);
}

/* More button — Flutter: 48x48 horizontal ellipsis */
.m-post-card-more-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #000;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
}

.m-post-card-buttons {
  display: flex;
  align-items: center;
}

/* Post card "more" bottom sheet — matches CEWL more modal styling */

/* === RESPONSIVE === */

/* Mobile: cover images edge-to-edge, divider edge-to-edge */
@media (max-width: 767.98px) {
  .m-post-card {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }

  .m-post-card-title {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .m-post-card-meta {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .m-post-card-actions {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .o-cat-header {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
}

/* === ORGANISMS === */

/* Category header (Flutter: ArticlePageCategoryHeader + ArticlePageCategoryHeaderArea) */
/* Image as container background (BoxFit.cover), text left-aligned on top with solid brand-color boxes */
.o-cat-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
}

/* Cover image fills the container, establishes height via natural aspect ratio */
.o-cat-header-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Text overlay: positioned over image, left-aligned */
/* Flutter: 48pt top spacer, 32pt bottom spacer, ~8% left offset (1/12 grid) */
.o-cat-header-meta {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 3rem 1rem 2rem 8%;
}

/* Parent category line — Flutter: 11px w400 white, 0.6 opacity, brand-color bg box */
.o-cat-header-parent {
  margin-bottom: 4px;
  opacity: 0.6;
}
.o-cat-header-parent span {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 11px;
  font-weight: 400;
  color: #fff;
  background-color: var(--kon-brand-color, #cf0015);
  padding: 4px 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Category name — Flutter: 23px w200 white, brand-color bg box */
.o-cat-header-name span {
  font-family: 'BasicGothicWebPro', sans-serif;
  font-size: 23px;
  font-weight: 200;
  color: #fff;
  background-color: var(--kon-brand-color, #cf0015);
  padding: 4px 8px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* No-image variant — Flutter: brand-color bg, black text, 24px w400, min 96pt height */
.o-cat-header--no-img {
  background-color: var(--kon-brand-color, #cf0015);
  min-height: 96px;
}
.o-cat-header--no-img .o-cat-header-meta {
  position: static;
  padding: 3rem 1rem 2rem 8%;
}
.o-cat-header--no-img .o-cat-header-parent span,
.o-cat-header--no-img .o-cat-header-name span {
  background: none;
  color: #000;
}
.o-cat-header--no-img .o-cat-header-name span {
  font-size: 24px;
  font-weight: 400;
}

/* Posts list loader */
.o-posts-loader .spinner-border {
  width: 2rem;
  height: 2rem;
  color: #888;
}
