/* HQM archive (category/tag/search/date) + single article — ACF/PHP rebuild of
   the Elementor "Archive" + "Single Post" Theme Builder templates. Self-contained
   (home.css is not loaded on these views): defines its own tokens + .hqm-wrap.
   Matched to the live Elementor rendering. */

.hqm-arch, .hqm-single {
  --hqm-blue: #004b8b;
  --hqm-ink: #1a1a1a;
  --hqm-grey: #5a5a5a;
  --hqm-line: #e6e6e6;
  --hqm-title: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --hqm-sans: "Barlow", system-ui, sans-serif;
  color: var(--hqm-ink);
  font-family: var(--hqm-sans);
}
.hqm-wrap { max-width: 1200px; margin: 0 auto; padding: 0 15px; }  /* usable 1170 = live */

/* The live theme forces headings + gold link colour with !important, so this
   rebuild has to override with !important + its own token values to match. */
.hqm-arch :is(h1,h2,h3,h4),
.hqm-single :is(h1,h2,h3,h4) { font-family: var(--hqm-sans); line-height: 1.2; margin: 0; }
.hqm-arch a, .hqm-single a { color: inherit; }

/* two-column body shared by archive + single: fluid main + fixed sidebar
   (live sidebar column ≈ 360px). */
.hqm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 371px;
  gap: 40px;
  align-items: start;
  padding: 46px 0 60px;
}

/* ============================ ARCHIVE ============================ */

.hqm-arch { padding-bottom: 10px; }

/* Blue title banner spanning the content container (live: ~70px bar, 35px/600). */
.hqm-arch__banner {
  background: var(--hqm-blue);
  margin: 24px 0 0;
  padding: 14px 20px;
  text-align: center;
}
.hqm-arch__banner h1 {
  color: #fff !important;
  font-family: var(--hqm-sans) !important;
  font-weight: 600 !important;
  font-size: 35px !important;
  line-height: 1.2;
}

/* Post cards */
.hqm-cards { display: flex; flex-direction: column; gap: 40px; }
.hqm-postcard {
  background: #fff;
  border: 1px solid var(--hqm-line);
  border-radius: 2px;
  overflow: hidden;
}
/* Uniform landscape crop like the old Elementor archive — natural-height images
   ballooned tall/portrait covers. */
.hqm-postcard__media { display: block; aspect-ratio: 2.75 / 1; overflow: hidden; }
.hqm-postcard__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hqm-postcard__body { padding: 26px 30px 22px; }
.hqm-postcard__title { margin: 0 0 12px !important; font-size: 15px !important; font-weight: 500 !important; line-height: 1.3; }
.hqm-postcard__title a {
  color: #111 !important;
  font-weight: 500;
  text-decoration: none;
}
.hqm-postcard__title a:hover { color: var(--hqm-blue) !important; }
.hqm-postcard__excerpt { margin: 0 0 16px; color: var(--hqm-grey); font-size: 15.5px; line-height: 1.6; }
.hqm-readmore {
  display: inline-block;
  color: var(--hqm-blue) !important;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.hqm-readmore:hover { text-decoration: underline; }
.hqm-postcard__foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hqm-line);
  font-size: 15px;
  color: #23538c;   /* live meta blue */
}
.hqm-postcard__foot a { color: #23538c !important; text-decoration: none; }
.hqm-postcard__foot .hqm-dot { margin: 0 8px; color: #c3c3c3; }

/* Pagination */
.hqm-pagination { margin-top: 44px; display: flex; gap: 8px; flex-wrap: wrap; }
.hqm-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 10px;
  border: 1px solid var(--hqm-line); border-radius: 2px;
  color: var(--hqm-blue); text-decoration: none; font-weight: 600;
}
.hqm-pagination .page-numbers.current { background: var(--hqm-blue); border-color: var(--hqm-blue); color: #fff; }
.hqm-pagination .page-numbers:hover:not(.current) { background: #f2f6fb; }

/* =========================== SIDEBAR ============================ */
/* "Recent articles" — shared by archive + single */
.hqm-side__title {
  margin: 0 0 4px;
  font-family: var(--hqm-sans) !important;
  font-weight: 500 !important;
  font-size: 28px !important;
  color: #000 !important;
}
.hqm-side__rule { border: 0; border-top: 1px solid var(--hqm-line); margin: 12px 0 22px; }
.hqm-recent { display: flex; flex-direction: column; gap: 22px; }
.hqm-recent__item { display: flex; gap: 16px; align-items: flex-start; text-decoration: none; }
.hqm-recent__thumb {
  flex: 0 0 74px; width: 74px; height: 74px;
  background: #e9e9e9 center/cover no-repeat; border-radius: 2px;
}
.hqm-recent__body { display: flex; flex-direction: column; gap: 6px; }
.hqm-recent__title { color: var(--hqm-ink); font-weight: 700; font-size: 15px; line-height: 1.3; }
.hqm-recent__item:hover .hqm-recent__title { color: var(--hqm-blue); }
.hqm-recent__date { color: var(--hqm-blue); font-size: 13.5px; }

/* ============================ SINGLE ============================ */

.hqm-single__hero {
  margin-top: 24px;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #2a2a2a;
  background-size: cover;
  background-position: center;
  position: relative;
}
.hqm-single__hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(0,0,0,.42), rgba(0,0,0,.52));
}
.hqm-single__hero-inner { position: relative; z-index: 1; text-align: center; padding: 60px 20px; max-width: 900px; }
.hqm-single__title {
  margin: 0 0 18px;
  color: #fff !important;
  font-family: var(--hqm-title) !important;
  font-weight: 700 !important;
  font-size: 50px !important;
  line-height: 1.08;
}
.hqm-single__herometa { margin: 0; color: #fff; font-size: 15px; }
.hqm-single__herometa a { color: #fff !important; text-decoration: none; }
.hqm-single__herometa a:hover { text-decoration: underline; }

.hqm-single__meta { display: flex; align-items: center; gap: 8px; color: var(--hqm-grey); font-size: 15px; margin: 0 0 16px; }
.hqm-single__meta a { color: var(--hqm-grey) !important; text-decoration: none; }
.hqm-single__meta a:hover { color: var(--hqm-blue) !important; }
.hqm-single__sep { color: #c3c3c3; margin: 0 4px; }
.hqm-single__rule { border: 0; border-top: 1px solid var(--hqm-line); margin: 18px 0 24px; }

/* Share row */
.hqm-share { display: flex; gap: 14px; flex-wrap: wrap; margin: 0 0 26px; }
.hqm-share__btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 3px;
  color: #fff !important; font-size: 13px; font-weight: 600; text-decoration: none;
  flex: 1 1 0; justify-content: center; min-width: 120px;
}
.hqm-share--linkedin { background: #1178b3; }
.hqm-share--whatsapp { background: #25a95a; }
.hqm-share--email    { background: #e2542a; }
.hqm-share--x        { background: #111; }
.hqm-share__btn:hover { opacity: .92; }
.hqm-share__ico { display: inline-flex; width: 15px; height: 15px; }
.hqm-share__ico svg { width: 100%; height: 100%; fill: #fff; }

.hqm-single__content { font-size: 16.5px; line-height: 1.75; color: #2a2a2a; }
.hqm-single__content p { margin: 0 0 1.2em; }
.hqm-single__content h2, .hqm-single__content h3 { font-family: var(--hqm-sans); font-weight: 700; color: var(--hqm-ink); line-height: 1.25; margin: 1.4em 0 .5em; }
.hqm-single__content img { max-width: 100%; height: auto; }
.hqm-single__content a { color: var(--hqm-blue) !important; }

.hqm-single__comments { margin-top: 40px; }

/* meta icons (inline SVG, currentColor) */
.hqm-ico { display: inline-flex; width: 15px; height: 15px; vertical-align: -2px; }
.hqm-ico svg { width: 100%; height: 100%; fill: currentColor; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 900px) {
  /* minmax(0,1fr) so the column can't be forced wider than the viewport by
     floated content (was overflowing ~45px on articles with alignright images) */
  .hqm-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 32px 0 48px; }
  .hqm-arch__banner h1 { font-size: 32px; }
  .hqm-single__title { font-size: 33px; }
  .hqm-single__hero { min-height: 240px; }
  /* share buttons: clean 2-per-row, no overflow */
  .hqm-share { flex-wrap: wrap; gap: 10px; }
  .hqm-share__btn { flex: 1 1 calc(50% - 5px); min-width: 0; }
  /* in-content floated images go full-width on mobile */
  .hqm-single__content .wp-caption,
  .hqm-single__content .alignleft,
  .hqm-single__content .alignright,
  .hqm-single__content figure { float: none !important; width: auto !important; max-width: 100% !important; margin: 16px 0 !important; }
  .hqm-single__content img { height: auto; }
}
@media (max-width: 520px) {
  .hqm-postcard__body { padding: 20px; }
  .hqm-single__title { font-size: 28px; }
}
