/* Main page (portal) styles. Enqueued only on the front page. */

.mtw-main { max-width: 1160px; margin: 0 auto; padding: 0 20px; }

/* ---------- Masthead ---------- */

.mtw-welcome {
  background: var(--mtw-surface);
  border: 1px solid var(--mtw-rule);
  padding: 26px 30px 24px;
  margin-bottom: var(--mtw-md);
}

.mtw-welcome__eyebrow {
  font-size: 12px;
  color: var(--mtw-ink-muted);
  margin: 0 0 8px;
}

.mtw-welcome h1 {
  font-family: var(--mtw-serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.15;
  color: var(--mtw-ink);
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  max-width: 700px;
}

.mtw-welcome__lede {
  font-size: 15px;
  line-height: 1.6;
  color: #475569;
  margin: 0 0 16px;
  max-width: 62ch;
}

.mtw-welcome .mtw-search { max-width: 520px; }

.mtw-welcome__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.mtw-btn {
  display: inline-block;
  border: 1px solid var(--mtw-accent);
  border-radius: 0;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.mtw-btn--primary { background: var(--mtw-accent); color: #FFFFFF; }
.mtw-btn--primary:visited { color: #FFFFFF; }
.mtw-btn--primary:hover { background: #1740B0; border-color: #1740B0; color: #FFFFFF; text-decoration: none; }

.mtw-btn--secondary { background: var(--mtw-surface); color: var(--mtw-accent); }
.mtw-btn--secondary:visited { color: var(--mtw-accent); }
.mtw-btn--secondary:hover { background: var(--mtw-bg); text-decoration: none; }

.mtw-welcome__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0 26px;
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--mtw-rule-faint);
  list-style: none;
}

.mtw-welcome__stats li { font-size: 13px; color: var(--mtw-ink-muted); white-space: nowrap; }
.mtw-welcome__stats b {
  display: block;
  font-family: var(--mtw-serif);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.1;
  color: var(--mtw-ink);
}

/* ---------- Panel grid ---------- */

.mtw-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--mtw-md);
  margin-bottom: var(--mtw-md);
  align-items: start;
}

.mtw-grid--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

.mtw-panel {
  background: var(--mtw-surface);
  border: 1px solid var(--mtw-rule);
  padding: 16px 20px 18px;
}

.mtw-panel__title {
  font-family: var(--mtw-serif);
  font-weight: 400;
  font-size: 1.22rem;
  line-height: 1.25;
  color: var(--mtw-ink);
  margin: 0 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--mtw-rule);
}

.mtw-panel p { font-size: 14px; margin: 0 0 .65em; }
.mtw-panel p:last-child { margin-bottom: 0; }

.mtw-panel__more { font-size: 13px; margin-top: 10px; }

/* ---------- Featured article ---------- */

.mtw-featured__kicker {
  font-size: 12px;
  color: var(--mtw-ink-muted);
  margin: 0 0 6px;
}

.mtw-featured h3 {
  font-family: var(--mtw-serif);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 0 0 8px;
}

.mtw-featured h3 a { color: var(--mtw-accent); }

.mtw-featured__thumb {
  float: right;
  width: 168px;
  margin: 0 0 12px 16px;
  border: 1px solid var(--mtw-rule-soft);
  background: var(--mtw-bg);
  padding: 4px;
}

.mtw-featured__thumb img { display: block; width: 100%; height: auto; border-radius: 0; }

/* ---------- Fact list ---------- */

.mtw-facts { margin: 0; padding-left: 1.15em; font-size: 14px; }
.mtw-facts li { margin-bottom: .5em; line-height: 1.55; }
.mtw-facts li:last-child { margin-bottom: 0; }

/* ---------- Category grid ---------- */

.mtw-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mtw-cat {
  background: var(--mtw-surface);
  border: 1px solid var(--mtw-rule-faint);
  padding: 12px 14px;
}

.mtw-cat a {
  font-family: var(--mtw-serif);
  font-size: 1.02rem;
  line-height: 1.25;
  display: block;
  margin-bottom: 3px;
}

.mtw-cat span { display: block; font-size: 12.5px; color: var(--mtw-ink-muted); line-height: 1.45; }

/* ---------- Updates list ---------- */

.mtw-updates { list-style: none; margin: 0; padding: 0; font-size: 14px; }

.mtw-updates li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--mtw-rule-faint);
}

.mtw-updates li:last-child { border-bottom: 0; padding-bottom: 0; }
.mtw-updates time { font-size: 12.5px; color: var(--mtw-ink-muted); white-space: nowrap; flex-shrink: 0; }

/* ---------- How it works ---------- */

.mtw-how { list-style: none; margin: 0; padding: 0; }

.mtw-how li {
  font-size: 14px;
  line-height: 1.55;
  padding: 9px 0;
  border-bottom: 1px solid var(--mtw-rule-faint);
}

.mtw-how li:last-child { border-bottom: 0; padding-bottom: 0; }
.mtw-how b { display: block; font-weight: 700; margin-bottom: 1px; }

/* ---------- Empty state ---------- */

.mtw-empty {
  border: 1px dashed var(--mtw-rule-soft);
  background: var(--mtw-bg);
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--mtw-ink-muted);
  line-height: 1.55;
}

/* ---------- Disclosure ---------- */

.mtw-disclosure {
  background: var(--mtw-surface);
  border: 1px solid var(--mtw-rule);
  border-left: 8px solid var(--mtw-citation);
  padding: 14px 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #475569;
  margin-bottom: var(--mtw-md);
}

.mtw-disclosure b { color: var(--mtw-ink); }

/* ---------- Mobile ---------- */

@media (max-width: 900px) {
  .mtw-grid, .mtw-grid--even { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .mtw-main { padding: 0 14px; }
  .mtw-welcome { padding: 20px 18px; }
  .mtw-panel { padding: 14px 16px 16px; }
  .mtw-featured__thumb { float: none; width: 100%; max-width: 220px; margin: 0 0 12px; }
  .mtw-welcome__stats { gap: 0 18px; }
  .mtw-cats { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Block editor markup ---------- */
/* The portal supplies its own panels, so the article container steps back. */

.home .separate-containers .inside-article {
  background: transparent;
  border: 0;
  padding: 0;
}

.home .entry-content > *:first-child { margin-top: 0; }

.entry-content .mtw-welcome { margin: 0 0 var(--mtw-md); }

.entry-content .mtw-row.wp-block-columns {
  gap: var(--mtw-md);
  margin-bottom: var(--mtw-md);
  align-items: flex-start;
}

.entry-content .wp-block-column > .mtw-panel { margin: 0; }

.entry-content .mtw-panel { margin: 0 0 var(--mtw-md); }

.entry-content h2.mtw-panel__title { margin-top: 0; }

/* Panel lists must not inherit the article text indent */
.entry-content ul.mtw-cats,
.entry-content ul.mtw-updates,
.entry-content ul.mtw-welcome__stats,
.entry-content ul.mtw-how {
  margin-left: 0;
  padding-left: 0;
  max-width: none;
}

.entry-content ul.mtw-facts { margin-left: 0; padding-left: 1.15em; max-width: none; }

.entry-content .mtw-welcome__lede { max-width: 62ch; }

/* Primary action, square and on palette */
.mtw-welcome .wp-block-buttons { margin: 0 0 4px; }

.mtw-welcome .wp-block-button__link {
  background: var(--mtw-accent);
  color: #FFFFFF;
  border: 1px solid var(--mtw-accent);
  border-radius: 0;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.mtw-welcome .wp-block-button__link:hover {
  background: var(--mtw-accent-hover, #1740B0);
  border-color: var(--mtw-accent-hover, #1740B0);
  color: #FFFFFF;
}

.entry-content .mtw-disclosure { max-width: none; }

@media (max-width: 900px) {
  .entry-content .mtw-row.wp-block-columns { gap: var(--mtw-md); }
}

/* Outranks the theme inline button rule, which scores 0,2,1 */

.entry-content .mtw-welcome a.wp-block-button__link {
  background: var(--mtw-accent);
  border: 1px solid var(--mtw-accent);
  color: #FFFFFF;
  border-radius: 0;
}

.entry-content .mtw-welcome a.wp-block-button__link:hover,
.entry-content .mtw-welcome a.wp-block-button__link:focus {
  background: #1740B0;
  border-color: #1740B0;
  color: #FFFFFF;
}
