/* ================================================================
   TITLE HQ — Archive Styles
   Shared styles for Learning Center and Transactional Services
   archive/list pages: filter bars, card grids, filter states.
   ================================================================ */

/* ── FILTER BAR (Learning Center tag pills) ── */
.tag-bar {
  background: #fff;
  border-bottom: 1px solid var(--stone);
  position: sticky;
  top: 72px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.tag-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tag-bar-inner::-webkit-scrollbar { display: none; }
.tag-bar-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-gray);
  white-space: nowrap;
  padding-right: 8px;
  border-right: 1px solid var(--stone);
  margin-right: 4px;
  flex-shrink: 0;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--stone);
  background: var(--warm-white);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.tag-pill:hover { border-color: var(--teal); color: var(--teal); }
.tag-pill.active { background: var(--teal); border-color: var(--teal); color: #fff; }
.tag-pill .tag-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; opacity: 0.6; flex-shrink: 0;
}
.tag-pill.active .tag-dot { opacity: 1; }

/* ── FILTER BAR (Transactional Services pills) ── */
.filter-bar {
  background: #fff;
  border-bottom: 1px solid var(--stone);
  position: sticky;
  top: 72px;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.filter-bar-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}
.filter-bar-inner::-webkit-scrollbar { display: none; }
.filter-btn {
  padding: 7px 18px;
  border-radius: 100px;
  border: 1.5px solid var(--stone);
  background: var(--warm-white);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-body);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-btn:hover { border-color: var(--teal); color: var(--teal); }
.filter-btn.active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ── GRID SECTION (Learning Center) ── */
.grid-section { padding: 48px 0 0; }
.grid-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.grid-section-header h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--mid-gray);
  font-weight: 500;
  font-style: italic;
}
.show-more-count {
  font-size: 0.78rem;
  color: var(--mid-gray);
}

.no-results {
  display: none;
  text-align: center;
  padding: 64px 24px;
  color: var(--mid-gray);
}
.no-results.visible { display: block; }
.no-results svg { margin: 0 auto 16px; opacity: 0.4; }
.no-results h3 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-dark); }
.no-results p { font-size: 0.88rem; }

/* ── ARTICLE CARDS (Learning Center) ── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 64px;
}

.article-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stone);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--teal-light); }

.article-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background: var(--sand);
}
.article-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.article-card:hover .article-card-image img { transform: scale(1.05); }
.article-card-placeholder { width: 100%; height: 100%; background: var(--sand); }

.read-time-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(35,42,48,0.72);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.67rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }

.article-tag {
  display: inline-block;
  background: var(--teal-light);
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 10px;
  align-self: flex-start;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.74rem;
  color: var(--mid-gray);
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.article-card h3 { font-size: 1rem; color: var(--text-dark); line-height: 1.4; margin-bottom: 8px; font-weight: 600; }
.article-card p { font-size: 0.82rem; color: var(--text-body); line-height: 1.7; flex: 1; margin-bottom: 16px; }
.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--stone);
  padding-top: 14px;
  margin-top: auto;
}
.article-read-more { font-size: 0.82rem; font-weight: 600; color: var(--teal); }
.article-arrow { color: var(--teal); transition: transform 0.2s; }
.article-card:hover .article-arrow { transform: translateX(4px); }

/* ── FILTER STATES (shared) ── */
.article-card.hidden-card { display: none; }
.article-card.revealed { display: flex; animation: fadeUpIn 0.4s ease both; }

.txn-service-card.hidden { display: none; }

@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── TRANSACTIONAL SERVICE CARDS ── */
.txn-services-section { padding: 64px 0 88px; background: var(--warm-white); }

.txn-services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.txn-service-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--stone);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.txn-service-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.txn-service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--teal-light); }
.txn-service-card:hover::after { transform: scaleX(1); }


.txn-service-card-icon {
  width: 46px; height: 46px;
  background: var(--teal-light);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
  transition: var(--transition);
}
.txn-service-card:hover .txn-service-card-icon { background: var(--teal); color: #fff; }

.txn-service-card-tag {
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid-gray);
}
.txn-service-card h3 { font-size: 0.98rem; color: var(--text-dark); line-height: 1.3; }
.txn-service-card p { font-size: 0.83rem; color: var(--text-body); line-height: 1.7; flex: 1; }
.service-learn-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: 2px;
  transition: var(--transition);
}
.service-learn-more:hover { gap: 8px; color: var(--teal-dark); }

/* ── SERVICE MODALS ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(35,42,48,0.6);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(42,50,64,0.22);
  position: relative;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--stone);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: 20px 20px 0 0;
}
.modal-header-icon {
  width: 48px; height: 48px;
  background: var(--teal-light);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  flex-shrink: 0;
}
.modal-header-text { flex: 1; }
.modal-header-tag {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 4px;
  display: block;
}
.modal-header h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}
.modal-close {
  background: var(--sand);
  border: none;
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-body);
  flex-shrink: 0;
  transition: var(--transition);
}
.modal-close:hover { background: var(--stone); color: var(--text-dark); }

.modal-body { padding: 24px 28px 28px; }
.modal-body p {
  font-size: 0.935rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 16px;
}
.modal-body p:last-of-type { margin-bottom: 0; }

.modal-example {
  margin-top: 20px;
  background: var(--teal-light);
  border-left: 4px solid var(--teal);
  border-radius: 0 8px 8px 0;
  padding: 16px 18px;
}
.modal-example-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
  display: block;
}
.modal-example p {
  font-size: 0.88rem;
  color: var(--teal-dark);
  margin: 0;
  font-style: italic;
}

.modal-footer {
  padding: 16px 28px 24px;
  border-top: 1px solid var(--stone);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.modal-footer p { font-size: 0.82rem; color: var(--mid-gray); margin: 0; }
.modal-footer a { color: var(--teal); font-weight: 600; }

/* Update stretched-link to target buttons too */
.txn-service-card button.service-learn-more {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  cursor: pointer;
  text-align: left;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .modal-header { padding: 20px 18px 16px; }
  .modal-body { padding: 18px 18px 24px; }
  .modal-footer { padding: 14px 18px 20px; flex-direction: column; align-items: flex-start; }
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .txn-services-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .articles-grid { grid-template-columns: 1fr; }
  .txn-services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .txn-services-grid { grid-template-columns: 1fr; }
}
