/* Guides hub and All Articles.
   From design/source/Main.dc.html, AllArticles.dc.html, M-Hub and M-AllArticles.
   Mobile-first; the sidebar and multi-column layouts arrive at 1024px. */

/* The templates own the full width of the page. */
.amg-full-width .rishi-container { width: 100%; max-width: none; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
.amg-full-width .main-content-wrapper { width: 100%; max-width: none; margin: 0 !important; }
.amg-full-width .site-content { padding-top: 0; }

.amg-hub, .amg-all { background: var(--amg-bg); }

/* ===================================================================== HUB */

.amg-hub__hero { position: relative; }
.amg-hub__hero .amg-container { position: relative; }
.amg-hero__body { display: flex; flex-direction: column; gap: 14px; color: var(--amg-on-dark); }

.amg-hub__crumbs { margin: 0; font-size: 13px; color: var(--amg-on-dark-muted); }
.amg-hub__crumbs a { color: var(--amg-on-dark-muted); }

h1.amg-hub__title { margin: 0; font-weight: 700; font-size: clamp(28px, 7vw, 50px); line-height: 1.1; color: #fff; letter-spacing: -0.01em; }
h1.amg-hub__title span { color: var(--amg-gold); }
.amg-hub__lede { margin: 0; font-size: 15px; color: var(--amg-topbar-text); }
@media (min-width: 768px) { .amg-hub__lede { font-size: 17px; } }

.amg-hub__search { position: relative; margin: 0; }
.amg-hub__search-label { display: block; font-size: 14px; font-weight: 500; color: #fff; margin-bottom: 6px; }
.amg-hub__search-field { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--amg-radius-lg); padding: 5px 5px 5px 14px; color: var(--amg-muted); }
.amg-hub__search-field svg { flex: 0 0 auto; width: 20px; height: 20px; }
.amg-hub__search-field input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 16px; color: var(--amg-green); padding: 11px 0; background: transparent; }
.amg-hub__search-field .amg-btn { padding: 11px 16px; flex: 0 0 auto; }

.amg-hub__suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  background: #fff; border-radius: var(--amg-radius-lg);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .3); padding: 6px;
  display: flex; flex-direction: column;
}
.amg-hub__suggest[hidden] { display: none; }
.amg-hub__suggest a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: var(--amg-radius); color: var(--amg-green); text-decoration: none; min-height: var(--amg-tap); }
.amg-hub__suggest a:hover { background: var(--amg-cream); color: var(--amg-green); }
.amg-hub__suggest img { width: 64px; height: 42px; object-fit: cover; border-radius: var(--amg-radius-sm); flex: 0 0 auto; background: var(--amg-cream); }
.amg-hub__suggest-text { display: flex; flex-direction: column; min-width: 0; }
.amg-hub__suggest-title { font-size: 15px; font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amg-hub__suggest-meta { font-size: 12px; color: var(--amg-muted); }
.amg-hub__suggest-all { font-size: 14px; font-weight: 600; border-top: 1px solid #f1ede4; margin-top: 4px; padding: 10px 8px 6px; }

.amg-hub__situations { display: flex; flex-direction: column; gap: 8px; }
.amg-hub__situations-label { font-size: 14px; color: var(--amg-on-dark-muted); }
.amg-hub__situations-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.amg-hub__situations-row::-webkit-scrollbar { display: none; }
.amg-hub__situation {
  flex: 0 0 auto; border: 1px solid #3c5c57; color: #fff; background: rgba(255,255,255,.04);
  padding: 10px 13px; border-radius: var(--amg-radius); font-size: 14px; text-decoration: none;
  white-space: nowrap; min-height: var(--amg-tap); display: flex; align-items: center;
}
.amg-hub__situation:hover { color: #fff; background: rgba(255,255,255,.12); text-decoration: none; }

@media (min-width: 768px) {
  .amg-hub__situations-row { flex-wrap: wrap; overflow: visible; }
  .amg-hub__situation { white-space: normal; }
}

/* Trust strip */
.amg-hub__trust { background: var(--amg-surface); border-bottom: 1px solid var(--amg-line); }
.amg-hub__trust-row { display: flex; flex-wrap: wrap; gap: 12px 36px; align-items: center; padding-top: 14px; padding-bottom: 14px; }
.amg-hub__editor { display: flex; align-items: center; gap: 12px; color: var(--amg-green); text-decoration: none; }
.amg-hub__editor img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top; }
.amg-hub__editor strong { display: block; font-weight: 600; }
.amg-hub__editor-role { font-size: 13px; color: var(--amg-muted); }
.amg-hub__trust-point { font-size: 14px; display: none; }
.amg-hub__trust-link { font-size: 14px; font-weight: 500; }
@media (min-width: 1024px) { .amg-hub__trust-point { display: block; } }

/* Sections */
.amg-hub__main { display: flex; flex-direction: column; }
.amg-hub__section { display: flex; flex-direction: column; gap: 16px; padding: 32px 0 4px; }
@media (min-width: 768px) { .amg-hub__section { gap: 20px; padding: 48px 0 12px; } }
.amg-section-head h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--amg-green); }
@media (min-width: 768px) { .amg-section-head h2 { font-size: 26px; } }

/* Latest: one lead card plus compact rows */
.amg-hub__latest { display: grid; gap: 20px; }
@media (min-width: 1024px) { .amg-hub__latest { grid-template-columns: 1fr 1fr; gap: 28px; } }

.amg-hub__lead { display: flex; flex-direction: column; gap: 10px; color: inherit; text-decoration: none; }
.amg-hub__lead:hover { color: inherit; text-decoration: none; }
.amg-hub__lead:hover .amg-hub__lead-title { text-decoration: underline; }
.amg-hub__lead img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--amg-radius); display: block; }
.amg-hub__lead-title { font-family: var(--amg-font-heading); font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--amg-green); }
@media (min-width: 768px) { .amg-hub__lead-title { font-size: 28px; } }
.amg-hub__lead-excerpt { font-size: 15px; color: var(--amg-text); }
.amg-hub__lead-meta { font-size: 13px; color: var(--amg-muted); }

.amg-hub__side { display: flex; flex-direction: column; }
.amg-hub__side-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--amg-line); color: inherit; text-decoration: none; }
.amg-hub__side-row:hover { color: inherit; text-decoration: none; }
.amg-hub__side-row:hover .amg-hub__side-title { text-decoration: underline; }
.amg-hub__side-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.amg-hub__side-title { font-weight: 600; font-size: 15px; line-height: 1.33; color: var(--amg-green); }
.amg-hub__side-row img { flex: 0 0 104px; width: 104px; height: 74px; object-fit: cover; border-radius: var(--amg-radius-sm); }
@media (min-width: 768px) {
  .amg-hub__side-row { gap: 16px; padding: 16px 0; }
  .amg-hub__side-title { font-size: 17px; line-height: 1.35; }
  .amg-hub__side-row img { flex: 0 0 132px; width: 132px; height: 92px; }
}

/* Topic tiles: a swipe row on phones, a grid from 768 */
.amg-hub__tiles { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.amg-hub__tiles::-webkit-scrollbar { display: none; }
.amg-hub__tiles .amg-tile { flex: 0 0 150px; }
.amg-tile__count { font-size: 13px; color: var(--amg-on-dark-muted); white-space: nowrap; }
@media (min-width: 768px) {
  .amg-hub__tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; overflow: visible; }
  .amg-hub__tiles .amg-tile { flex: none; }
}

/* Editorial picks */
.amg-hub__picks { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.amg-hub__picks::-webkit-scrollbar { display: none; }
.amg-hub__pick { flex: 0 0 240px; text-decoration: none; }
.amg-hub__pick-title { font-weight: 600; font-size: 17px; line-height: 1.3; color: var(--amg-green); }
@media (min-width: 768px) {
  .amg-hub__picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; overflow: visible; }
  .amg-hub__pick { flex: none; }
  .amg-hub__pick-title { font-size: 19px; }
}

/* Explore */
.amg-hub__showing { font-size: 14px; color: var(--amg-muted); }
.amg-hub__tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.amg-hub__tabs::-webkit-scrollbar { display: none; }
.amg-hub__tabs .amg-chip span { opacity: .7; }

.amg-hub__explore-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 12px; }
.amg-hub__more {
  min-height: var(--amg-tap); background: #fff; border: 1.5px solid var(--amg-green);
  color: var(--amg-green); font: inherit; font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: var(--amg-radius); cursor: pointer;
}
.amg-hub__more[hidden] { display: none; }
.amg-hub__browse-all { background: var(--amg-green); color: #fff; border: 0; }
.amg-hub__browse-all:hover { color: #fff; }

/* Founder */
.amg-hub__founder-inner {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center;
  background: var(--amg-surface); border: 1px solid var(--amg-line);
  border-radius: var(--amg-radius); padding: clamp(18px, 4vw, 40px);
}
.amg-hub__founder-img { width: 120px; height: 144px; object-fit: cover; object-position: top; border-radius: var(--amg-radius); flex: 0 0 auto; }
@media (min-width: 768px) { .amg-hub__founder-img { width: 200px; height: 240px; } }
.amg-hub__founder-text { flex: 1 1 380px; display: flex; flex-direction: column; gap: 12px; }
.amg-hub__founder-text h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--amg-green); line-height: 1.25; }
@media (min-width: 768px) { .amg-hub__founder-text h2 { font-size: 26px; } }
.amg-hub__founder-text p { margin: 0; font-size: 15px; }
.amg-hub__founder-sig { font-size: 15px; color: var(--amg-green); }

/* Tools band */
.amg-hub__tools-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.amg-hub__tools-list { flex: 1 1 380px; display: flex; flex-direction: column; gap: 12px; }
.amg-hub__tools-list h2 { margin: 0; font-size: 22px; font-weight: 700; color: var(--amg-green); }
.amg-hub__tools-list p { margin: 0; }
.amg-hub__tool-links { display: flex; flex-direction: column; border-top: 1px solid var(--amg-line); }
.amg-hub__tool-links a {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 13px 0; border-bottom: 1px solid var(--amg-line);
  color: var(--amg-green); font-weight: 500; text-decoration: none; min-height: var(--amg-tap);
}
.amg-hub__tool-links a span { color: var(--amg-gold-dark); }
.amg-hub__tool-all { color: var(--amg-gold-dark) !important; font-weight: 600 !important; }

.amg-hub__questions { flex: 1 1 320px; background: var(--amg-green); color: var(--amg-on-dark); border-radius: var(--amg-radius); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.amg-hub__questions-head { font-size: 18px; font-weight: 600; color: #fff; }
.amg-hub__question { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--amg-green-line); color: #fff; text-decoration: none; min-height: var(--amg-tap); }
.amg-hub__question:hover { color: #fff; }
.amg-hub__question-q { font-size: 15px; }
.amg-hub__question-a { font-size: 14px; color: var(--amg-gold); font-weight: 600; }

/* CTA */
.amg-hub__cta { padding-bottom: 48px; }
.amg-hub__cta-inner { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; border-top: 2px solid var(--amg-green); padding-top: 24px; }
.amg-hub__cta-inner h2 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: var(--amg-green); }
.amg-hub__cta-inner p { margin: 0; }
.amg-hub__cta-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.amg-hub__content { font-size: 15px; }

/* ============================================================ ALL ARTICLES */

.amg-all__head { background: var(--amg-surface); border-bottom: 1px solid var(--amg-line); }
.amg-all__head-row { display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: flex-end; justify-content: space-between; padding-top: 24px; padding-bottom: 20px; }
.amg-all__head-text { display: flex; flex-direction: column; gap: 8px; flex: 1 1 520px; }
.amg-all__crumbs { margin: 0; font-size: 14px; color: var(--amg-muted); }
.amg-all__head-text h1 { margin: 0; font-weight: 700; font-size: clamp(28px, 6vw, 46px); line-height: 1.1; color: var(--amg-green); }
.amg-all__lede { margin: 0; font-size: 15px; }
.amg-all__stats { display: flex; gap: 28px; flex-wrap: wrap; }
.amg-all__stat strong { display: block; font-size: 26px; font-weight: 700; color: var(--amg-green); line-height: 1.1; }
.amg-all__stat span { font-size: 13px; color: var(--amg-muted); }

.amg-all__body { display: flex; flex-direction: column; gap: 20px; padding-top: 20px; padding-bottom: 48px; }
@media (min-width: 1024px) {
  .amg-all__body { flex-direction: row; flex-wrap: wrap; gap: 32px; align-items: flex-start; padding-top: 28px; padding-bottom: 72px; }
  .amg-all__filters { flex: 1 1 250px; }
  .amg-all__main { flex: 999 1 620px; }
}

/* Filters: a panel on phones, always-open sidebar from 1024 */
.amg-all__filters { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.amg-all__filters[hidden] { display: none; }
.amg-all__filters-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--amg-green); padding-bottom: 8px; }
.amg-all__filters-title { font-weight: 700; font-size: 17px; color: var(--amg-green); }
.amg-all__clear { font-size: 14px; font-weight: 500; }

.amg-all__topics { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
@media (min-width: 1024px) { .amg-all__topics { grid-template-columns: 1fr; } }
.amg-all__topic { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: var(--amg-radius); cursor: pointer; min-height: var(--amg-tap); }
.amg-all__topic:hover { background: var(--amg-cream); }
.amg-all__topic input { width: 18px; height: 18px; accent-color: var(--amg-gold-dark); margin: 0; flex: 0 0 auto; }
.amg-all__topic img { display: none; width: 40px; height: 28px; object-fit: cover; border-radius: 3px; flex: 0 0 auto; }
@media (min-width: 1024px) { .amg-all__topic img { display: block; } }
.amg-all__topic-name { flex: 1; font-size: 14px; color: var(--amg-green); line-height: 1.3; }
.amg-all__topic-count { font-size: 13px; color: var(--amg-muted); }

.amg-all__published { display: flex; flex-direction: column; gap: 10px; }
.amg-all__published .amg-all__filters-title { border-bottom: 2px solid var(--amg-green); padding-bottom: 8px; }
.amg-all__published-row { display: flex; flex-wrap: wrap; gap: 6px; }
.amg-all__published-row .amg-chip { display: flex; align-items: center; gap: 6px; }
.amg-all__published-row .amg-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.amg-all__published-row .amg-chip.is-on { background: var(--amg-green); border-color: var(--amg-green); color: #fff; }

.amg-all__tools-card { display: flex; flex-direction: column; gap: 4px; background: var(--amg-green); color: #fff; border-radius: var(--amg-radius); padding: 18px; text-decoration: none; }
.amg-all__tools-card:hover { color: #fff; }
.amg-all__tools-card span { font-size: 14px; color: var(--amg-topbar-text); }

.amg-all__main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.amg-all__toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.amg-all__search { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--amg-border); border-radius: var(--amg-radius); padding: 0 12px; color: var(--amg-muted); }
.amg-all__search svg { flex: 0 0 auto; width: 18px; height: 18px; }
.amg-all__search input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 16px; padding: 12px 0; background: transparent; color: var(--amg-green); }
@media (min-width: 768px) { .amg-all__search { flex: 1 1 280px; } .amg-all__search input { font-size: 15px; } }

.amg-all__sort select,
.amg-all__apply,
.amg-all__filters-toggle {
  min-height: var(--amg-tap); padding: 0 12px; font: inherit; font-size: 14px;
  border: 1.5px solid var(--amg-border); border-radius: var(--amg-radius);
  background: #fff; color: var(--amg-green); cursor: pointer;
}
.amg .amg-all__apply { background: var(--amg-green); border-color: var(--amg-green); color: #fff; font-weight: 600; }
.amg-all__filters-toggle { font-weight: 600; }
.amg-all__filters-toggle[hidden] { display: none; }

.amg-all__showing { margin: 0; font-size: 14px; color: var(--amg-muted); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.amg-all__reset { font-weight: 600; }

.amg-all__empty { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; background: var(--amg-surface); border: 1px solid var(--amg-line); border-radius: var(--amg-radius); padding: 28px; }
.amg-all__empty strong { font-size: 18px; color: var(--amg-green); }
.amg-all__empty span { color: var(--amg-muted); }

.amg-all__more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; }
.amg-all__more .page-numbers { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; justify-content: center; }
.amg-all__more .page-numbers li { margin: 0; }
.amg-all__more .page-numbers a,
.amg-all__more .page-numbers span {
  display: flex; align-items: center; justify-content: center;
  min-width: var(--amg-tap); min-height: var(--amg-tap); padding: 0 12px;
  border: 1.5px solid var(--amg-border); border-radius: var(--amg-radius);
  background: #fff; color: var(--amg-green); text-decoration: none; font-weight: 500;
}
.amg-all__more .page-numbers .current { background: var(--amg-green); border-color: var(--amg-green); color: #fff; }

.amg-all__loadmore { width: 100%; min-height: 50px; border: 1.5px solid var(--amg-green); background: #fff; color: var(--amg-green); font: inherit; font-weight: 600; border-radius: var(--amg-radius); cursor: pointer; }
.amg-all__progress { width: 100%; height: 4px; border-radius: 2px; background: var(--amg-line); overflow: hidden; }
.amg-all__progress span { display: block; height: 100%; background: var(--amg-gold); }

/* Card body wrapper used by the grids on both pages */
.amg-card__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.amg-card__new { color: var(--amg-warm); }

/* ----------------------------------------------------------------- shared */

.amg-hub .screen-reader-text, .amg-all .screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.amg-hub :focus-visible, .amg-all :focus-visible { outline: 3px solid var(--amg-gold); outline-offset: 2px; }
.amg-hub.is-loading, .amg-all.is-loading { cursor: progress; }
