/* Investing Winner theme: emerald + gold, serif headlines. */

:root {
  --iw-green-900: #063d2c;
  --iw-green-700: #0b6b4b;
  --iw-green-500: #19a06d;
  --iw-green-100: #e3f4ec;
  --iw-gold: #f2b632;
  --iw-heading-font: "Fraunces", Georgia, "Times New Roman", serif;
  --iw-radius: 14px;
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: var(--iw-green-700);
  --md-primary-fg-color--light: var(--iw-green-500);
  --md-primary-fg-color--dark: var(--iw-green-900);
  --md-accent-fg-color: #b97f00;
  --md-typeset-a-color: var(--iw-green-700);
  --iw-surface: #ffffff;
  --iw-surface-alt: #f5f8f6;
  --iw-border: #dfe7e2;
  --iw-muted: #5d6b64;
  --iw-chip-bg: var(--iw-green-100);
  --iw-chip-fg: var(--iw-green-900);
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #3ecf95;
  --md-primary-fg-color--light: #6fe0b3;
  --md-primary-fg-color--dark: var(--iw-green-700);
  --md-accent-fg-color: var(--iw-gold);
  --md-typeset-a-color: #3ecf95;
  --iw-surface: #18211d;
  --iw-surface-alt: #121815;
  --iw-border: #2a3731;
  --iw-muted: #9db0a6;
  --iw-chip-bg: #1f3329;
  --iw-chip-fg: #bfeeda;
}

/* Typography */

.md-typeset {
  font-size: 0.85rem;
  line-height: 1.75;
}

.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.iw-hero__title,
.iw-card__title,
.md-header__title {
  font-family: var(--iw-heading-font);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.md-typeset h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  color: var(--md-default-fg-color);
  text-wrap: balance;
}

.md-typeset h2 {
  font-size: 1.45rem;
  margin-top: 2em;
}

.md-typeset h3 {
  font-size: 1.15rem;
}

.md-typeset blockquote {
  border-left: 4px solid var(--iw-gold);
  color: var(--md-default-fg-color);
  font-family: var(--iw-heading-font);
  font-size: 1.05em;
  font-style: italic;
  padding: 0.2em 1.2em;
}

.md-typeset img {
  border-radius: var(--iw-radius);
}

/* Post pages: comfortable reading width */

.md-content--post .md-content__inner {
  max-width: 44rem;
}

/* Hero */

.iw-hero {
  background:
    radial-gradient(60rem 24rem at 85% -20%, rgba(242, 182, 50, 0.28), transparent 60%),
    linear-gradient(135deg, var(--iw-green-900), var(--iw-green-700) 60%, var(--iw-green-500));
  color: #fff;
}

.iw-hero__inner {
  padding: 3.2rem 1.2rem 3.6rem;
}

.iw-hero__eyebrow {
  color: var(--iw-gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  margin: 0 0 0.8rem;
  text-transform: uppercase;
}

.iw-hero__title {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
  margin: 0;
}

.iw-hero__title em {
  color: var(--iw-gold);
}

.iw-hero__lead {
  font-size: 1rem;
  margin: 1.2rem 0 1.6rem;
  max-width: 32rem;
  opacity: 0.9;
}

.iw-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
}

.iw-button {
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  transition: background-color 0.15s, transform 0.15s;
}

.iw-button:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.iw-button--primary {
  background: var(--iw-gold);
  border-color: var(--iw-gold);
  color: #2b2000;
}

.iw-button--primary:hover {
  background: #ffc94d;
}

/* Post cards */

.iw-listing__title,
.iw-listing__header h1 {
  font-family: var(--iw-heading-font);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0.4rem 0 1.2rem;
}

.iw-cards {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
}

.iw-card {
  min-width: 0;
  background: var(--iw-surface);
  border: 1px solid var(--iw-border);
  border-radius: var(--iw-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.iw-card:hover {
  border-color: var(--md-primary-fg-color);
  box-shadow: 0 14px 30px -18px rgba(6, 61, 44, 0.55);
  transform: translateY(-3px);
}

/* The newest post on the home page spans the full row. */
@media screen and (min-width: 60em) {
  .iw-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .iw-cards > .iw-card:first-child {
    flex-direction: row;
    grid-column: 1 / -1;
  }

  .iw-cards > .iw-card:first-child .iw-card__media {
    aspect-ratio: auto;
    flex: 0 0 45%;
    min-height: 16rem;
  }

  .iw-cards > .iw-card:first-child .iw-card__body {
    padding: 1.6rem 2rem;
  }

  .iw-cards > .iw-card:first-child .iw-card__title {
    font-size: 1.7rem;
  }
}

.iw-card__media {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--iw-green-900), var(--iw-green-500));
  display: block;
  overflow: hidden;
}

.iw-card__media img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.iw-card__placeholder {
  align-items: flex-end;
  background: radial-gradient(14rem 8rem at 100% 0, rgba(242, 182, 50, 0.4), transparent 70%);
  color: #fff;
  display: flex;
  font-family: var(--iw-heading-font);
  font-size: 1.2rem;
  font-style: italic;
  height: 100%;
  padding: 1rem 1.2rem;
}

.iw-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem 1.2rem 1.1rem;
}

.iw-card__meta {
  color: var(--iw-muted);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.4rem;
  text-transform: uppercase;
}

.iw-card__title {
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.iw-card__title a {
  color: var(--md-default-fg-color);
}

.iw-card__title a:hover {
  color: var(--md-primary-fg-color);
}

.iw-card__excerpt {
  color: var(--iw-muted);
  display: -webkit-box;
  font-size: 0.75rem;
  line-height: 1.6;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

/* The excerpt is the top of the post; show only its text. */
.iw-card__excerpt h1,
.iw-card__excerpt h2,
.iw-card__excerpt h3,
.iw-card__excerpt img,
.iw-card__excerpt .headerlink {
  display: none;
}

.iw-card__excerpt p {
  margin: 0;
}

.iw-card__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: auto 0 0;
  padding-top: 0.9rem;
}

/* Chips: categories, tags, topics page */

.iw-chips,
.iw-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.iw-tags {
  border-top: 1px solid var(--iw-border);
  margin-top: 2.4rem;
  padding-top: 1.2rem;
}

.md-typeset .iw-chip,
.iw-chip {
  background: var(--iw-chip-bg);
  border-radius: 999px;
  color: var(--iw-chip-fg);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.md-typeset .iw-chip:hover,
.iw-chip:hover {
  background: var(--md-primary-fg-color);
  color: var(--md-primary-bg-color, #fff);
}

.iw-chip span {
  opacity: 0.6;
}

.md-typeset .iw-chip--small,
.iw-chip--small {
  font-size: 0.62rem;
  padding: 0.18rem 0.6rem;
}

/* Pagination */

.md-pagination {
  margin-top: 2rem;
}

/* Header: the site name is a link home, like the logo */

.md-header__title .iw-header__home {
  color: inherit;
  display: block;
}

/* Categories page: featured post per category */

.iw-features {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
}

.iw-feature {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.iw-feature .iw-card {
  flex: 1;
}

.md-typeset .iw-feature__title {
  font-size: 1rem;
  margin: 0 0 0.6rem;
}

.md-typeset .iw-feature__title a,
.md-typeset .iw-card__title a {
  color: var(--md-default-fg-color);
  text-decoration: none;
}

.md-typeset .iw-feature__title a:hover,
.md-typeset .iw-card__title a:hover {
  color: var(--md-primary-fg-color);
}

.iw-feature__title span {
  color: var(--iw-muted);
  font-family: var(--md-text-font-family);
  font-size: 0.7rem;
  font-weight: 400;
  margin-left: 0.3rem;
  white-space: nowrap;
}

.md-typeset .iw-card__title {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.md-typeset .iw-card__media img {
  border-radius: 0;
}

/* No repository link, so drop its reserved slot and let search sit at the right edge. */
.md-header__source {
  display: none;
}
