/* Category and tag pages (application/views/pages/category_page.php).
   --c / --cbg are the topic's colour and light background (helpers/topic_helper.php), used for the icon.
   Buttons, links and accents use the brand colours from the logo: leaf green and sand. */
:root { --g: #2e6b34; --g-dark: #1f4d26; --g-soft: #e7f1df; --sand: #c8a57c; }
body.light { background: #f6f7f9; }

/* Topic banner */
.ct-band { background: #fff; border-bottom: 1px solid #e6e8eb; padding: 20px 0 24px; }
.ct-crumb { font-size: 13px; color: #6b7280; margin-bottom: 14px; }
.ct-crumb a { color: var(--g); font-weight: 600; text-decoration: none; }
.ct-crumb span { color: #374151; }

.ct-top { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.ct-title { display: flex; align-items: center; gap: 16px; }
.ct-title i { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--cbg); color: var(--c); }
.ct-title i svg { width: 30px; height: 30px; }
.ct-title h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.01em; color: #1f2328; }
.ct-title p { margin: 4px 0 0; font-size: 14.5px; color: #4b5563; }

.ct-search { display: flex; align-items: center; width: 400px; max-width: 100%; padding: 4px; background: #fff; border: 1.5px solid #d1d5db; border-radius: 10px; }
.ct-search:focus-within { border-color: var(--g); box-shadow: 0 0 0 3px var(--g-soft); }
.ct-search svg { width: 18px; height: 18px; color: #9ca3af; margin: 0 2px 0 10px; flex: none; }
.ct-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 9px 8px; font-size: 15px; background: transparent; }
.ct-search button { border: 0; border-radius: 7px; padding: 9px 16px; font-size: 14px; font-weight: 700; color: #fff; background: var(--g); }
.ct-search button:hover { background: var(--g-dark); }

.ct-popular { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; color: #4b5563; }
.ct-popular a { padding: 5px 12px; border-radius: 999px; background: var(--g-soft); color: var(--g-dark); font-weight: 600; text-decoration: none; }
.ct-popular a:hover { filter: brightness(.95); }

/* Articles + sidebar */
.ct-main { padding-top: 24px; padding-bottom: 12px; }
.ct-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; }
.ct-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.ct-bar h2 { margin: 0; font-size: 19px; font-weight: 700; }
.ct-bar span { font-size: 13px; color: #6b7280; }
.ct-empty { color: #6b7280; }

/* Featured newest article (page 1) */
.ct-feat { position: relative; display: grid; grid-template-columns: 1.15fr 1fr; margin-bottom: 16px; background: #fff; border: 1px solid #eceef1; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: box-shadow .15s; }
.ct-feat:hover { box-shadow: 0 12px 28px rgba(16,24,40,.09); }
.ct-feat-art { position: relative; display: grid; place-items: center; min-height: 230px; background: linear-gradient(135deg, var(--cbg), #fff 140%); color: var(--c); }
.ct-feat-art svg { width: 96px; height: 96px; }
.ct-feat-art b { position: absolute; left: 16px; top: 14px; padding: 4px 10px; border-radius: 999px; background: #fff; color: #1f4d26; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ct-feat-body { display: flex; flex-direction: column; padding: 24px 26px; }
.ct-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; font-size: 12.5px; color: #6b7280; }
.ct-meta span, .ct-mins, .ct-chip { display: inline-flex; align-items: center; gap: 5px; }
.ct-meta svg, .ct-mins svg { width: 14px; height: 14px; }
.ct-feat h3 { margin: 0 0 10px; font-size: 22px; font-weight: 800; line-height: 1.3; }
.ct-feat h3 a, .ct-card h3 a { color: #1f2328; text-decoration: none; }
.ct-feat h3 a::after, .ct-card h3 a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link */
.ct-feat h3 a:focus-visible, .ct-card h3 a:focus-visible { outline: none; }
.ct-feat:focus-within, .ct-card:focus-within { outline: 3px solid rgba(46,107,52,.35); outline-offset: 2px; }
.ct-feat p { flex: 1; margin: 0 0 18px; font-size: 14.5px; line-height: 1.6; color: #4b5563; }
.ct-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 9px; background: var(--g); color: #fff; font-size: 14px; font-weight: 700; }
.ct-btn svg { width: 16px; height: 16px; }
.ct-feat:hover .ct-btn { background: var(--g-dark); }

/* Article cards: no coloured edge, soft shadow, topic chip + read time */
.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ct-card { position: relative; display: flex; flex-direction: column; padding: 18px; background: #fff; border: 1px solid #eceef1; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: box-shadow .15s, transform .15s; }
.ct-card:hover { box-shadow: 0 10px 24px rgba(16,24,40,.08); transform: translateY(-2px); }
.ct-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.ct-chip { padding: 4px 10px 4px 7px; border-radius: 999px; background: var(--cbg); color: var(--c); font-size: 12px; font-weight: 700; }
.ct-chip svg { width: 14px; height: 14px; }
.ct-mins { margin-left: auto; font-size: 12px; color: #6b7280; }
.ct-card h3 { margin: 0 0 8px; font-size: 16.5px; font-weight: 700; line-height: 1.38; }
.ct-card p { flex: 1; margin: 0 0 14px; font-size: 13.5px; line-height: 1.5; color: #4b5563; }
.ct-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px dashed #e6e8eb; font-size: 12.5px; color: #6b7280; }
.ct-read { font-size: 13px; font-weight: 700; color: var(--g); }

.ct-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 22px; }
.ct-pager a, .ct-pager span { min-width: 38px; padding: 8px 12px; text-align: center; font-size: 14px; font-weight: 600; color: #374151; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; text-decoration: none; }
.ct-pager a:hover { border-color: var(--g); color: var(--g); }
.ct-pager .on { background: var(--g); border-color: var(--g); color: #fff; }
.ct-pager i { font-style: normal; color: #9ca3af; padding: 0 2px; }

.ct-box { margin-bottom: 18px; padding: 16px 18px; background: #fff; border: 1px solid #e6e8eb; border-radius: 12px; }
.ct-box h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #6b7280; }
.ct-q, .ct-topic { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid #f0f1f3; font-size: 14.5px; font-weight: 600; color: #1f2328; text-decoration: none; }
.ct-box h4 + a { border-top: 0; }
.ct-q svg { width: 16px; height: 16px; color: var(--g); flex: none; }
.ct-q:hover, .ct-topic:hover { color: var(--g); }
.ct-topic i { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ct-topic i svg { width: 17px; height: 17px; }
.ct-topic small { margin-left: auto; font-size: 12px; font-weight: 500; color: #9ca3af; }

@media (max-width: 991px) {
  .ct-layout { grid-template-columns: 1fr; }
  .ct-side { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
}
@media (max-width: 767px) {
  .ct-search { width: 100%; }
  .ct-grid, .ct-feat { grid-template-columns: 1fr; }
  .ct-feat-art { min-height: 140px; }
  .ct-feat-art svg { width: 72px; height: 72px; }
  .ct-feat-body { padding: 20px; }
  .ct-feat h3 { font-size: 20px; }
  .ct-side { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .ct-title h1 { font-size: 24px; }
  .ct-title i { width: 48px; height: 48px; border-radius: 13px; }
  .ct-title i svg { width: 24px; height: 24px; }
  .ct-popular a:nth-of-type(n+4) { display: none; }
}
