﻿/* ============================================================
   Category archive â€” layout-only CSS
   Card styles, typography, colors, shadows, borders come from
   the site's style.css via the existing classes:
     .section-heading  .category-title  .headline  .byline
     .list-chosen.list-card  .list-featured.list-heading-alt
     .pagination  .layout  .layout-thirds
   ============================================================ */

/* â”€â”€ Page header â€” matches .topic-template header.layout â”€â”€â”€â”€ */
.ttr-cat-header {
  padding-top: 1.5rem;
  padding-bottom: 1rem; 
  margin-bottom: 1.875rem;
}

.ttr-cat-header-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Matches .topic-template header.layout h2 exactly */
.ttr-cat-title {
  font-family: "Mulish", sans-serif;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--theme-color-navy);
  line-height: 1.25; 
  letter-spacing: 0.03em;
  margin: 0;
}

/* Matches existing .topic-rss: 1.875rem Ã— 1.875rem, border var(--theme-color-primary), radius .375rem */
.ttr-cat-rss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  border: 1px solid var(--theme-color-primary);
  border-radius: .375rem;
  flex-shrink: 0;
  transition: background .15s ease-out;
  text-decoration: none;
}
.ttr-cat-rss:hover { background: var(--theme-color-primary); }
.ttr-cat-rss:hover svg { fill: #fff; }
.ttr-cat-rss svg { display: block; transition: fill .15s ease-out; }

/* â”€â”€ Top row spacing â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€  */
.ttr-top-row {
  margin-bottom: 2.5rem;
}

/* â”€â”€ Highlights inner grid: single hero card full width */
.ttr-hl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .ttr-hl-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
  }
}

/* Hero card â€” show excerpt + larger headline; inherits list-chosen list-card box */
.ttr-hero-card .article-summary.abstract { display: block !important; }
.ttr-hero-card .headline a {
  font-size: 1.25rem !important;
  -webkit-line-clamp: 3 !important;
}
@media (min-width: 980px) {
  .ttr-hero-card .headline a { font-size: 1.6rem !important; }
}

/* Sub-cards â€” 2 items stack naturally via .list-chosen.list-card ul gap:20px */
.ttr-sub-cards { height: 100%; }

/* â”€â”€ Sidebar spacing and stacking â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ttr-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.875rem;
}

/* Newsletter box â€” border + shadow matching site card style */
.ttr-newsletter {
  border: 1px solid #e9e9e9;
  border-radius: .5rem;
  overflow: hidden;
  box-shadow: 0px 4px 8px 0px rgba(34, 34, 34, .12);
}

/* â”€â”€ All Articles section â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ttr-all-wrap { padding-top: .5rem; }

/* Flex container for the heading and the search bar */
.ttr-all-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  border-top: 2px solid #e6e4ec;
  padding-top: 1.875rem;
  margin-bottom: 0.5rem;
}

/* "All Developer Articles" label â€” same as .section-heading but with top border shifted to row */
.ttr-all-heading {
  border-top: none !important;
  padding-top: 0 !important;
  margin-bottom: 0 !important;
}

/* 3-column grid â€” ul reset + CSS grid */
.ttr-all-grid {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 640px) {
  .ttr-all-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .ttr-all-grid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
  }
}

/* Each list-chosen.list-card inside grid fills the cell fully */
.ttr-all-grid > li { display: flex; flex-direction: column; }
.ttr-all-grid > li > .list-chosen.list-card { flex: 1; }
.ttr-all-grid > li > .list-chosen.list-card > ul,
.ttr-all-grid > li > .list-chosen.list-card > ul > li { flex: 1; display: flex; flex-direction: column; }
.ttr-all-grid > li > .list-chosen.list-card > ul > li > article { flex: 1; }

/* â”€â”€ Pagination â€” reuse existing .pagination class â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ttr-pagination { margin-top: 1rem; }

/* Fallback no-posts text */
.ttr-no-posts {
  padding: 3rem 0;
  text-align: center;
  color: #778596;
  font-size: 1rem;
  font-family: "Mulish", sans-serif;
}

/* â”€â”€ Dropdown Filters â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ttr-archive-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.25rem;
  margin-bottom: 2rem;
}

.ttr-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 280px;
  max-width: 380px;
}

.ttr-filter-label {
  font-family: "Mulish", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--theme-color-navy);
}

.ttr-filter-select {
  font-family: "Mulish", sans-serif;
  font-size: 0.9rem;
  color: #334155;
  padding: 0.625rem 2.25rem 0.625rem 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.25rem;
}

.ttr-filter-select:hover {
  border-color: #94a3b8;
}

.ttr-filter-select:focus {
  border-color: var(--theme-color-primary);
  box-shadow: 0 0 0 3px rgba(8, 107, 219, 0.15);
}

@media (max-width: 640px) {
  .ttr-archive-filters {
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .ttr-filter-group {
    max-width: 100%;
    flex: 1 1 100%;
  }
}

/* â”€â”€ Search Container â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.ttr-search-container {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 2px 6px 2px 12px;
  width: 100%;
  max-width: 320px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.ttr-search-container:focus-within {
  border-color: var(--theme-color-primary);
  box-shadow: 0 0 0 3px rgba(8, 107, 219, 0.15);
}

#ttr-search-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: "Mulish", sans-serif;
  font-size: 0.9rem;
  color: #334155;
  flex: 1;
  padding: 6px 0;
  width: 100%;
  box-shadow: none !important;
}

#ttr-search-submit {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

#ttr-search-submit svg {
  transition: fill 0.2s ease;
}

#ttr-search-submit:hover svg {
  fill: var(--theme-color-primary);
}

#ttr-search-clear {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  outline: none;
}

#ttr-search-clear.is-visible {
  display: inline-flex;
}

#ttr-search-clear svg {
  transition: fill 0.2s ease;
}

#ttr-search-clear:hover svg {
  fill: #cf3a09;
}

@media (max-width: 640px) {
  .ttr-all-heading-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  .ttr-search-container {
    max-width: 100%;
  }
}

/* ============================================================
   Select2 customization to match premium design system
   ============================================================ */
.select2-container--default .select2-selection--single {
  font-family: "Mulish", sans-serif;
  font-size: 0.9rem;
  color: #334155;
  height: 45px;
  padding: 0.625rem 2.25rem 0.625rem 0.875rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #334155;
  padding-left: 0;
  padding-right: 0;
  line-height: normal;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 100%;
  right: 0.75rem;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border: none;
  width: 1.25rem;
  height: 1.25rem;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--theme-color-primary);
  box-shadow: 0 0 0 3px rgba(8, 107, 219, 0.15);
}

.select2-container--default .select2-selection--single:hover {
  border-color: #94a3b8;
}

.select2-dropdown {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  z-index: 9999;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.5rem;
  outline: none;
  font-family: "Mulish", sans-serif;
  font-size: 0.9rem;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: var(--theme-color-primary);
  box-shadow: 0 0 0 3px rgba(8, 107, 219, 0.15);
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background-color: var(--theme-color-primary);
  color: #ffffff;
}

.select2-container--default .select2-results__option {
  padding: 0.5rem 0.875rem;
  font-family: "Mulish", sans-serif;
  font-size: 0.9rem;
}
