/*---------------------------------
  Phase 3d: category header, search results, 404, footer
-----------------------------------*/

/* Same content width as the header and homepage */
.imv-cat-head.container-fluid, .imv-search-page.container-fluid, .imv-404.container-fluid,
.imv-footer .container-fluid { max-width: 1300px; }

/* ===== Category header ===== */
.imv-cat-head { margin-bottom: var(--space-4); }
/* one line: Ahabanza › parent › Title · 39 inkuru */
.imv-cat-head-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--space-3);
  row-gap: 4px;
  padding: 4px 0 4px var(--space-4);
  border-left: 4px solid var(--green-600);
}
.imv-cat-head .imv-crumbs { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.imv-cat-head .imv-crumbs:after { content: "›"; }
.imv-cat-head .imv-crumbs a { color: var(--muted); }
.imv-cat-head .imv-crumbs a:hover { color: var(--green-700); }
.imv-cat-title {
  margin: 0;
  font-family: var(--secondaryFont);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--ink);
}
.imv-cat-desc { margin-top: var(--space-2); max-width: 720px; font-size: 15px; color: var(--text); }
.imv-cat-desc p { margin: 0; }
.imv-cat-count { margin: 0; padding: 3px 10px; border-radius: 999px; background: var(--green-50); font-size: 12px; font-weight: 600; color: var(--green-800); }

/* ===== Shared search field (search page, 404) ===== */
.imv-search-page-form {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 640px;
  padding: 5px 5px 5px 46px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.imv-search-page-form:focus-within { border-color: var(--green-600); box-shadow: 0 0 0 5px rgba(21, 171, 123, .12); }
.imv-search-page-form i { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--green-700); font-size: 17px; line-height: 1; }
.imv-search-page-form input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: var(--secondaryFont);
  font-size: 16px;
  color: var(--ink);
}
.imv-search-page-form input::-webkit-search-cancel-button { -webkit-appearance: none; }
.imv-search-page-form button {
  height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: var(--green-700);
  color: #fff;
  font-family: var(--secondaryFont);
  font-size: 14px;
  font-weight: 600;
}
.imv-search-page-form button:hover { background: var(--green-800); }

/* ===== Search results ===== */
.imv-search-page { padding-top: var(--space-2); padding-bottom: var(--space-7); }
.imv-search-head { padding-bottom: var(--space-5); margin-bottom: var(--space-2); border-bottom: 1px solid var(--line); }
.imv-search-head-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-2);
  font-family: var(--secondaryFont);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--green-700);
}
.imv-search-head-kicker:before { content: ""; width: 24px; height: 3px; border-radius: 2px; background: var(--green-600); }
.imv-search-head-title {
  margin: 0 0 var(--space-4);
  font-family: var(--secondaryFont);
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
}
.imv-search-head-count { margin: var(--space-3) 0 0; font-size: 14px; color: var(--muted); }

.imv-result {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-5);
  align-items: start;
  margin: 0;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
}
.imv-result-body > :last-child { margin-bottom: 0; }
.imv-result-img { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius); background: #EEF2F0; }
.imv-result-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.imv-result:hover .imv-result-img img { transform: scale(1.04); }
.imv-result-cat {
  display: inline-block;
  margin-bottom: 6px;
  font-family: var(--secondaryFont);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green-700);
}
.imv-result-title { margin: 0 0 var(--space-2); font-family: var(--secondaryFont); font-size: 19px; font-weight: 600; line-height: 1.35; }
.imv-result-title a { color: var(--ink); }
.imv-result-title a:hover { color: var(--green-700); }
.imv-result-excerpt { margin: 0 0 var(--space-2); font-size: 15px; line-height: 1.6; color: var(--text); }
.imv-result-date { margin: 0; font-size: 12px; color: var(--muted); }
.imv-search-pages { margin-top: var(--space-6); }
.imv-search-pages ul.page-numbers { display: flex; justify-content: center; gap: 6px; padding: 0; margin: 0; list-style: none; }

.imv-empty { padding: var(--space-6) 0; }
.imv-empty-title { margin: 0 0 var(--space-2); font-family: var(--secondaryFont); font-size: 20px; font-weight: 700; color: var(--ink); }
.imv-empty p { color: var(--text); }
.imv-empty .imv-search-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--space-3); }
.imv-empty .imv-search-topics a { padding: 6px 14px; border-radius: 999px; background: var(--green-50); color: var(--green-800); font-size: 13px; font-weight: 600; }
.imv-empty .imv-search-topics a:hover { background: var(--green-700); color: #fff; }

/* ===== 404 ===== */
.imv-404 { padding-top: var(--space-5); padding-bottom: var(--space-7); }
.imv-404-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-7) var(--space-5);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(21, 171, 123, .12), transparent 60%),
    #F7FAF8;
}
.imv-404-code {
  margin: 0;
  font-family: var(--secondaryFont);
  font-size: clamp(90px, 14vw, 160px);
  font-weight: 800;
  line-height: .9;
  letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.imv-404-title { margin: var(--space-4) 0 var(--space-2); font-family: var(--secondaryFont); font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; color: var(--ink); }
.imv-404-lead { max-width: 520px; margin: 0 0 var(--space-5); font-size: 16px; line-height: 1.6; color: var(--text); }
.imv-404-hero .imv-search-page-form { width: 100%; }
.imv-404-home { margin-top: var(--space-4); font-family: var(--secondaryFont); font-size: 14px; font-weight: 600; color: var(--green-700); }
.imv-404-home:hover { color: var(--green-800); }
.imv-404-recent { margin-top: var(--space-7); }
.imv-404-grid { grid-template-columns: repeat(4, 1fr) !important; }
.imv-404-grid .news-card-img { display: block; }
.imv-404-grid .news-card-img img { aspect-ratio: 16 / 10; }
.imv-404-grid h3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-size: 15px !important; }
.imv-related-grid { display: grid; gap: var(--space-5); }

/* ===== Footer ===== */
.imv-footer { margin-top: var(--space-7); padding: 0; background: #0B2A20; color: rgba(255, 255, 255, .78); }
.imv-footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: var(--space-7);
  padding: var(--space-7) 0 var(--space-6);
}
.imv-footer-logo img { height: 44px; width: auto; filter: brightness(0) invert(1); }
.imv-footer-about { margin: var(--space-4) 0 var(--space-4); max-width: 320px; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, .7); }
.imv-footer-social { display: flex; gap: 8px; }
.imv-footer-social a {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 16px;
  transition: background-color .2s, transform .2s;
}
.imv-footer-social a:hover { background: var(--green-600); color: #fff; transform: translateY(-2px); }
.imv-footer-col h4 {
  margin: 0 0 var(--space-4);
  font-family: var(--secondaryFont);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
}
.imv-footer-col ul { margin: 0; padding: 0; list-style: none; }
.imv-footer-col li { margin: 0 0 2px; padding: 0; font-size: 14px; line-height: 1.4; }   /* the old theme's list styles added ~30px per link */
.imv-footer-col a { display: inline-block; padding: 5px 0; }
.imv-footer-col a { color: rgba(255, 255, 255, .78); transition: color .2s; }
.imv-footer-col a:hover { color: #6EE0B5; transform: translateX(2px); }
.imv-footer-col a { transition: color .2s, transform .2s; }
.imv-footer-contact li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; }
.imv-footer-contact li i { color: var(--green-600); font-size: 16px; line-height: 1.4; }
.imv-footer-rpc { display: inline-block; margin-top: var(--space-3); opacity: .85; transition: opacity .2s; }
.imv-footer-rpc:hover { opacity: 1; }
.imv-footer-rpc img { height: 42px; width: auto; }
.imv-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); background: #081F18; }
.imv-footer-bottom p { margin: 0; padding: var(--space-4) 0; font-size: 13px; color: rgba(255, 255, 255, .55); text-align: center; }

/* ===== Responsive ===== */
@media (max-width: 1199px) {
  .imv-footer-top { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .imv-404-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 767px) {
  .imv-result { grid-template-columns: 120px 1fr; gap: var(--space-3); }
  .imv-result-excerpt { display: none; }
  .imv-result-title { font-size: 16px; }
  .imv-footer-top { grid-template-columns: 1fr; }
}


/* ===== Category pages: feed labels, pagination, reading list ===== */
/* every card in a category feed is that category, so its label is dropped */
body:has(.imv-cat-head) .news-col-one .news-cat { display: none; }
.news-cat { font-family: var(--secondaryFont); font-size: 11px !important; font-weight: 700 !important; letter-spacing: .06em; text-transform: uppercase; color: var(--green-700) !important; }

nav.pagination { display: block; margin-top: var(--space-5); }
nav.pagination ul.page-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
nav.pagination ul.page-numbers li { margin: 0; border: 0; }
nav.pagination .page-numbers a,
nav.pagination .page-numbers span {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0 !important;
  border-radius: 999px;
  background: var(--green-50) !important;
  color: var(--green-800) !important;
  font-family: var(--secondaryFont);
  font-size: 13px !important;
  font-weight: 600;
  line-height: 1;
}
nav.pagination .page-numbers a:hover,
nav.pagination .page-numbers span.current { background: var(--green-700) !important; color: #fff !important; }
nav.pagination .page-numbers span.dots { background: none !important; }

.imv-reading-list { margin: 0; padding: 0; list-style: none; }
.imv-reading-list li {
  position: relative;
  padding: 12px 0 12px 34px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.45;
}
.imv-reading-list li:before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--green-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E7F5B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.imv-reading-list a { color: var(--ink); font-weight: 500; }
.imv-reading-list a:hover { color: var(--green-700); }

:root { --fe-line: linear-gradient(90deg, #0E7F5B, #15AB7B 40%, #6EE0B5); --fe-accent: #3FC89A; --fe-ink: #0B2A20; --fe-mast2: #15AB7B; --fe-photo1: #15AB7B; --fe-photo2: #0B6348; }
/* ===== Footer: brand line, heading accents, latest e-paper card, bottom bar ===== */
.imv-footer { position: relative; border-top: 3px solid transparent; border-image: var(--fe-line) 1; }
.imv-footer-col h4 { position: relative; padding-bottom: 10px; }
.imv-footer-col h4::after { content: ""; position: absolute; left: 0; bottom: 0; width: 22px; height: 2px; border-radius: 2px; background: var(--fe-accent); }

.imv-footer-ep {
  display: flex; gap: 14px; align-items: center;
  margin-top: var(--space-5); padding: 12px; max-width: 340px;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  background: rgba(255, 255, 255, .04); color: #fff;
  transition: background-color .2s, border-color .2s, transform .2s;
}
.imv-footer-ep:hover { background: rgba(255, 255, 255, .08); border-color: var(--fe-accent); color: #fff; transform: translateY(-2px); }
.imv-footer-ep-cover {
  flex: 0 0 64px; height: 88px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px; padding: 6px 6px 0;
  border-radius: 4px; background: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  transform: rotate(-3deg); transition: transform .25s;
}
.imv-footer-ep:hover .imv-footer-ep-cover { transform: rotate(0) scale(1.04); }
.imv-footer-ep-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.imv-fe-mast { font: 800 8.5px/1 var(--secondaryFont); letter-spacing: -.01em; color: var(--fe-ink); white-space: nowrap; border-bottom: 1.5px solid var(--fe-ink); padding-bottom: 3px; }
.imv-fe-mast b { color: var(--fe-mast2); font-weight: 800; }
.imv-fe-no { font: 700 6px/1 var(--secondaryFont); color: #5b6770; text-transform: uppercase; letter-spacing: .04em; }
.imv-fe-photo { height: 26px; border-radius: 2px; background: linear-gradient(135deg, var(--fe-photo1), var(--fe-photo2)); }
.imv-fe-lines { display: grid; gap: 3px; }
.imv-fe-lines i { display: block; height: 2px; border-radius: 1px; background: #d5dbe0; }
.imv-fe-lines i:nth-child(2n) { width: 70%; }
.imv-footer-ep-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imv-footer-ep-text small { font: 700 10.5px/1.3 var(--secondaryFont); letter-spacing: .1em; text-transform: uppercase; color: var(--fe-accent); }
.imv-footer-ep-text strong { font: 700 15px/1.3 var(--secondaryFont); color: #fff; }
.imv-footer-ep-date { font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.imv-footer-ep-cta { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--fe-accent); }
.imv-footer-ep-cta i { display: inline-block; vertical-align: -2px; transition: transform .2s; }
.imv-footer-ep:hover .imv-footer-ep-cta i { transform: translateX(4px); }

@media (max-width: 767px) {
  .imv-footer-ep { max-width: none; }
}

/* Brand column: the e-paper card sits at the bottom so it ends level with the link columns */
.imv-footer-brand { display: flex; flex-direction: column; align-items: flex-start; }
.imv-footer-brand .imv-footer-ep { margin-top: auto; }
.imv-footer-brand .imv-footer-about { margin-bottom: var(--space-5); }
.imv-footer-contact-end { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-3); }
.imv-footer-contact-end .imv-footer-rpc { margin-top: 0; }
.imv-footer-col .imv-footer-social a { display: grid; padding: 0; }   /* keep the icon centred (footer links get padding) */
.imv-footer-brand .imv-footer-ep { width: 100%; }
/* sized so the card's "Soma ubu" line ends level with the last footer link */
.imv-footer-brand .imv-footer-about { margin: var(--space-3) 0 var(--space-3); }
.imv-footer-ep { padding: 10px 12px; }
.imv-footer-ep-cover { flex-basis: 58px; height: 80px; }
.imv-footer-ep-text { gap: 1px; }
.imv-footer-ep-cta { margin-top: 2px; }

/* "Follow us on X" button in the contact column */
.imv-footer-contact-end { flex-wrap: wrap; gap: var(--space-3) var(--space-4); }
.imv-footer-col .imv-footer-social a.imv-follow-x {
  display: inline-flex; align-items: center; gap: 10px;
  width: auto; height: auto; padding: 6px 14px 6px 6px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05); color: #fff;
  transition: background-color .2s, border-color .2s, transform .2s;
}
.imv-follow-x-badge { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: #000; transition: transform .25s; }
.imv-follow-x-text { display: flex; flex-direction: column; line-height: 1.15; }
.imv-follow-x-text strong { font: 600 13px/1.2 var(--secondaryFont); color: #fff; }
.imv-follow-x-text small { font-size: 11.5px; color: rgba(255, 255, 255, .55); }
.imv-follow-x > i { font-size: 15px; color: var(--fe-accent); transition: transform .2s; }
.imv-footer-col .imv-footer-social a.imv-follow-x:hover { background: rgba(255, 255, 255, .1); border-color: var(--fe-accent); color: #fff; transform: translateY(-2px); }
.imv-follow-x:hover .imv-follow-x-badge { transform: rotate(-8deg) scale(1.06); }
.imv-follow-x:hover > i { transform: translate(2px, -2px); }
.imv-fe-mast { font-size: 7.4px; letter-spacing: -.02em; }
.imv-fe-mast { font-size: 6.6px; }
.imv-footer-ep-cover { padding: 6px 5px 0; }
.imv-footer-social:not(:has(a)) { display: none; }   /* no accounts set: no empty gap */

/* Bottom bar: RPC logo on the left (in line with the brand column), copyright centred */
.imv-footer-bottom-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-4); padding: var(--space-3) 0; }
.imv-footer-bottom .imv-footer-bottom-bar p { padding: 0; }
.imv-footer-bottom-bar .imv-footer-rpc { margin: 0; justify-self: start; }
.imv-footer-bottom-bar .imv-footer-rpc img { height: 36px; }
@media (max-width: 767px) {
  .imv-footer-bottom-bar { grid-template-columns: 1fr; justify-items: center; gap: var(--space-2); }
  .imv-footer-bottom-bar .imv-footer-rpc { justify-self: center; }
  .imv-footer-bottom-bar > span { display: none; }
}

/* Search, nothing found: latest stories below the suggestions */
.imv-empty-latest { margin-top: var(--space-6); }
.imv-empty-latest-title { margin: 0 0 var(--space-3); font: 800 20px/1.2 var(--secondaryFont); color: var(--ink); text-transform: uppercase; letter-spacing: .02em; }
.imv-empty-latest-title::after { content: ""; display: block; width: 36px; height: 3px; margin-top: 8px; border-radius: 2px; background: var(--green-600); }
.imv-empty-latest .imv-result-img img { width: 100%; height: 100%; object-fit: cover; }
