/* ==========================================================================
   QUBIT.MK — archive.css
   Loaded on category, tag, author, explore/archive index, and 404 pages.
   ========================================================================== */

/* ==========================================================================
   404 — Search form
   ========================================================================== */
.error-404-search-input{
  max-width: 380px;
  border-radius: 0;
  border-color: #000;
}

.error-404-search-input:focus{
  box-shadow: none;
  border-color: #000;
  outline: 2px solid #000;
  outline-offset: 1px;
}

/* ==========================================================================
   9) CATEGORY + TAG ARCHIVE — same grid as Home
   ========================================================================== */
.category .home-post-section .row,
.tag .home-post-section .row{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
}

.category .home-post-section .row > [class*="col"],
.tag .home-post-section .row > [class*="col"]{
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
  flex: none !important;
}

@media (max-width: 991.98px){
  .category .home-post-section .row,
  .tag .home-post-section .row{
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 575.98px){
  .category .home-post-section .row,
  .tag .home-post-section .row{
    grid-template-columns: 1fr;
  }
}

.archive-header{ padding-top: 8px; }
.category-author-filter-wrap{ padding-bottom: 1.5rem; }

/* Title underline like Home */
.category .section-title,
.tag .section-title{
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}

.category .section-title::after,
.tag .section-title::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 110%;
  background: var(--section-accent, var(--qubit-1));
}

/* Same top spacing for both */
.category .category-title-head,
.tag .category-title-head{
  margin-top: 2rem;
}

/* ==========================================================================
   CATEGORY — Filter by Author buttons (menu-button feel)
   ========================================================================== */
.filter-by-author-label{
  font-size: 0.95rem;
  opacity: .85;
}

.author-filter-btn,
.author-filter-btn:visited{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .8rem;
  text-decoration: none;
  color: #111;
  background: #fff;
  transition: background .16s ease, color .16s ease;
  line-height: 1.1;
}

.author-filter-btn:hover,
.author-filter-btn.is-active{
  background: #111;
  color: #fff;
}

/* Ensure visited never overrides active/hover */
.author-filter-btn:hover:visited,
.author-filter-btn.is-active:visited{
  color: #fff;
}

.qubit-badge{
  display:inline-flex;
  align-items:center;
  transform: translateY(-1px);
}

.author-filter-btn .author-filter-text{
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

/* ==========================================================================
   11) AUTHOR ARCHIVE
   ========================================================================== */
.author-archive .author-container{
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 12px;
}

.author-archive .author-bio{
  max-width: 60ch;
  opacity: 0.9;
}

.author-cat-count{
  font-weight: 400;
  opacity: 0.65;
  margin-left: .25rem;
}

/* Category titles: underline + cycling colors */
.author-archive .section-title{
  position: relative;
  display: inline-block;
  padding-bottom: 10px;
}
.author-archive .section-title::after{
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 110%;
  background: var(--section-accent, var(--qubit-1));
}
.author-archive .section-title a{ color: inherit; text-decoration: none; }

.author-archive .home-post-section:nth-of-type(1) .section-title{ --section-accent: var(--qubit-1); }
.author-archive .home-post-section:nth-of-type(2) .section-title{ --section-accent: var(--qubit-2); }
.author-archive .home-post-section:nth-of-type(3) .section-title{ --section-accent: var(--qubit-3); }
.author-archive .home-post-section:nth-of-type(4) .section-title{ --section-accent: var(--qubit-4); }
.author-archive .home-post-section:nth-of-type(5) .section-title{ --section-accent: var(--qubit-1); }
.author-archive .home-post-section:nth-of-type(6) .section-title{ --section-accent: var(--qubit-2); }

.author-archive .home-post-section .row{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0;
}
.author-archive .home-post-section .row > [class*="col"]{
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
  flex: none !important;
}
@media (max-width: 991.98px){
  .author-archive .home-post-section .row{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px){
  .author-archive .home-post-section .row{ grid-template-columns: 1fr; }
}

.author-archive .section-title-link,
.author-archive .section-title-link:hover{
  color: inherit;
  text-decoration: none;
}

.author-archive .author-filter-subtitle{
  font-size: 1.1rem;
  opacity: .9;
}
.author-archive .author-filter-subtitle a{
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.author-archive .author-filter-subtitle a:hover{ opacity: 1; }

/* ==========================================================================
   ARCHIVE / EXPLORE PAGE (Categories / Tags / Authors)
   ========================================================================== */

.archive-index-page .page-title{
  margin-bottom: 1.2rem;
}

/* 3 blocks grid (Categories / Tags / Authors) */
.archive-index-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

@media (min-width: 992px){
  .archive-index-grid{
    grid-template-columns: repeat(3, 1fr);
    gap: 2.2rem;
  }
}

.archive-index-block{
  border-top: 1px solid #ccc;
  padding-top: 1.2rem;
}

.archive-index-title{
  font-size: 1.1rem;
  margin: 0 0 1rem 0;
}

/* Links inside each block: wrap based on available space (chip layout) */
.archive-index-links{
  display: flex;
  flex-wrap: wrap;
  gap: .6rem .8rem; /* row gap | column gap */
  width: 100%;
  align-items: center;
}

/* Explore "chip" buttons: width depends on text */
.archive-index-link{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  padding: .35rem .7rem;
  text-decoration: none;
  color: #000 !important;
  border: 1px solid #000;
  background: transparent;
  transition: background .18s ease, color .18s ease;
  white-space: nowrap;
}

.archive-index-link:visited{
  color: #000 !important;
}

.archive-index-link:hover,
.archive-index-link:focus{
  background: #000;
  color: #fff !important;
}

.archive-index-empty{
  margin: 0;
  opacity: .75;
}

/* Categories block spans full width so the card grid has room */
.archive-index-block--categories{
  grid-column: 1 / -1;
}

/* Tags block spans full width — 6-col card grid */
.archive-index-block--tags{
  grid-column: 1 / -1;
}

/* Authors block spans full width — chip list */
.archive-index-block--authors{
  grid-column: 1 / -1;
}

/* ---- Explore: Category Cards ---- */
.explore-cat-card{
  display: block;
  text-decoration: none;
  color: #000;
}

.explore-cat-card:hover,
.explore-cat-card:focus{
  color: #000;
  text-decoration: none;
}

.explore-cat-thumb{
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f0f0f0;
}

.explore-cat-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.explore-cat-card:hover .explore-cat-thumb img,
.explore-cat-card:focus .explore-cat-thumb img{
  transform: scale(1.04);
}

.explore-cat-label{
  margin-top: .6rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* ==========================================================================
   TAG/CATEGORY HEADER: title (left) + back link (right)
   ========================================================================== */

.archive-title-row{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.archive-title-row .section-title{
  margin: 0;
}

/* Tag/Category back link */
.tag-back-link{
  display: inline-block;
  padding: 0;
  white-space: nowrap;
  text-decoration: none;
  color: #000 !important;
  background: transparent !important;
  border: 0 !important;
}

.tag-back-link:visited{
  color: #000 !important;
}

.tag-back-link:hover,
.tag-back-link:focus{
  color: #000 !important;
  background: transparent !important;
  border: 0 !important;
}
