/* ============================================================
   style.css — shane.news
   ============================================================ */

/* --- Fonts ---
   Poppins via Google Fonts (body text)
   Josefin Sans via Google Fonts (site name)
   -------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@400;600&family=Poppins:wght@300;400;500;600&display=swap');


/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

img {
  max-width: 100%;
  display: block;
}


/* --- Base --- */
body {
  background-color: rgb(245, 245, 245);
  color: rgb(75, 56, 42);
  font-family: 'Poppins', 'futura-pt', 'Josefin Sans', 'Futura', 'Century Gothic', sans-serif;
  font-weight: 300;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  opacity: 0.72;
}


/* --- Header --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.5rem 4rem 3.5rem;
}

.site-name {
  font-family: 'futura-pt', 'Josefin Sans', 'Futura', 'Century Gothic', sans-serif;
  font-size: 3.38rem;
  font-weight: 400;
  color: rgb(168, 48, 76);
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1;
}

.site-name:hover {
  opacity: 0.82;
}

nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

nav a {
  font-size: 1.59rem;
  font-weight: 300;
  text-decoration: none;
  letter-spacing: 0.01em;
}

nav a.nav-articles {
  color: rgb(253, 142, 42);
  text-decoration: none;
}

nav a.nav-visualizations {
  color: rgb(132, 206, 2);
  text-decoration: none;
}

.nav-short { display: none; }
.nav-full  { display: inline; }

nav a:hover {
  color: rgb(132, 206, 2);
  opacity: 1;
}


/* --- Main content wrapper --- */
main {
  padding: 1.5rem 4rem 5rem;
}


/* ============================================================
   Homepage
   ============================================================ */
.bio {
  max-width: 100%;
}

.bio p {
  font-size: 1.44rem;
  font-weight: 200;
  line-height: 1.7;
  margin-bottom: 1.15rem;
}

.bio a {
  color: rgb(132, 206, 2);
}


/* ============================================================
   Article listing — card grid
   ============================================================ */
.articles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem 2.5rem;
}

.article-card {
  display: flex;
  flex-direction: column;
}

.article-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 0.85rem;
  background: rgb(230, 225, 220); /* placeholder while loading */
}

.article-card-date {
  font-size: 0.78rem;
  color: rgb(160, 140, 125);
  font-weight: 400;
  margin-bottom: 0.45rem;
  letter-spacing: 0.02em;
}

.article-card-title {
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  color: rgb(75, 56, 42);
  text-decoration: none;
}

.article-card-title:hover {
  opacity: 0.72;
}

.article-card-excerpt {
  font-size: 0.875rem;
  line-height: 1.65;
  color: rgb(100, 80, 65);
  margin-bottom: 0.8rem;
  flex: 1;
}

.article-card-read-more {
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: rgb(75, 56, 42);
  align-self: flex-start;
}

.article-card-read-more:hover {
  opacity: 0.72;
}


/* ============================================================
   Individual article pages
   ============================================================ */
.article-page {
  max-width: 720px;
}

.article-meta {
  font-size: 0.82rem;
  color: rgb(160, 140, 125);
  font-weight: 400;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.article-title {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.article-subtitle {
  font-size: 1rem;
  font-weight: 300;
  color: rgb(120, 100, 85);
  margin-bottom: 2.5rem;
  line-height: 1.5;
}

.article-body p {
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.article-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  line-height: 1.3;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

.article-body img {
  width: 100%;
  margin: 1.75rem 0;
}

.article-body a {
  color: rgb(132, 206, 2);
}

/* --- Responsive iframe embeds --- */
/* Usage: wrap any iframe in .embed-wrapper, set --aspect if needed */
.embed-wrapper {
  position: relative;
  width: 100%;
  margin: 2rem 0;
}

.embed-wrapper iframe {
  width: 100%;
  border: none;
  display: block;
}

/* Tall fixed-height embeds (maps, scrollytelling) */
.embed-wrapper.embed-tall iframe {
  height: 680px;
}

.embed-wrapper.embed-deel iframe {
  height: 800px;
}

/* Short chart embeds */
.embed-wrapper.embed-short iframe {
  height: 400px;
}

/* Datawrapper: height set dynamically via postMessage — no fixed height needed */
.embed-wrapper.embed-datawrapper iframe {
  min-height: 300px;
}


/* ============================================================
   Visualizations page
   ============================================================ */
.viz-grid {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.viz-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  line-height: 1.3;
}

.viz-attribution {
  font-size: 0.83rem;
  color: rgb(160, 140, 125);
  font-style: italic;
  margin-bottom: 0.65rem;
}

.viz-description {
  font-size: 0.93rem;
  line-height: 1.65;
  max-width: 640px;
  margin-bottom: 1.25rem;
  color: rgb(90, 72, 55);
}

.viz-image {
  width: 100%;
  border-radius: 8px;
  display: block;
}



/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 680px) {
  header {
    padding: 1.25rem 1rem;
  }

  .site-name {
    font-size: 1.75rem;
  }

  nav {
    gap: 0.9rem;
  }

  nav a {
    font-size: 0.85rem;
  }

  .nav-short { display: inline; }
  .nav-full  { display: none; }

  main {
    padding: 1.25rem 1rem 3.5rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .article-title {
    font-size: 1.65rem;
  }

  .embed-wrapper.embed-tall iframe {
    height: 65svh;
  }

  .embed-wrapper.embed-deel iframe {
    height: 55svh;
  }

  .embed-wrapper {
    border-radius: 6px;
    overflow: hidden;
  }

  .viz-grid {
    gap: 3rem;
  }

  .viz-title {
    font-size: 1.1rem;
  }

  .viz-attribution {
    font-size: 0.78rem;
  }

  .viz-description {
    font-size: 0.85rem;
    line-height: 1.55;
  }

  .viz-image {
    border-radius: 6px;
  }
}
