.dynamic-article-loading {
  min-height: 300px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
}

.dynamic-loader {
  width: 42px;
  height: 42px;
  display: block;
  border: 3px solid rgba(116, 239, 211, 0.2);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: dynamic-spin 900ms linear infinite;
}

@keyframes dynamic-spin {
  to {
    transform: rotate(360deg);
  }
}

.dynamic-article-error {
  padding: 55px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-muted);
}

.dynamic-article-cover {
  margin: -20px 0 65px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.dynamic-article-cover img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
}

.dynamic-article-content blockquote {
  margin: 42px 0;
  padding: 25px 30px;
  color: var(--ink);
  border-left: 4px solid var(--mint-dark);
  background: #eff8f6;
  font-size: 1.18rem;
  font-style: italic;
}

.dynamic-article-content h2 {
  margin-top: 60px;
}

.dynamic-article-content h3 {
  margin-top: 45px;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.article-impact-section,
.article-sources-section {
  margin-top: 80px;
  padding-top: 55px;
  border-top: 1px solid var(--line);
}

.impact-list {
  display: grid;
  gap: 18px;
}

.impact-row {
  display: grid;
  grid-template-columns: 145px 1fr 42px;
  align-items: center;
  gap: 18px;
}

.impact-row > span {
  color: var(--ink);
  font-weight: 800;
}

.impact-row > div {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe9e7;
}

.impact-row i {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    var(--mint-dark),
    var(--blue)
  );
}

.impact-row strong {
  text-align: right;
}

.article-sources-section ol {
  padding-left: 24px;
}

.article-sources-section li {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.dynamic-article-author {
  margin-top: 75px;
}

.dynamic-insight-visual {
  background-position: center;
  background-size: cover;
}

.dynamic-card-footer {
  margin-top: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.dynamic-card-footer > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.community-insights-empty {
  padding: 45px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  text-align: center;
}

@media (max-width: 650px) {
  .dynamic-article-error {
    padding: 32px 24px;
  }

  .impact-row {
    grid-template-columns: 1fr 45px;
  }

  .impact-row > div {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .dynamic-card-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Ensure native hidden state always wins */
.dynamic-article-loading[hidden],
#article-hero-content[hidden],
#article-content-wrapper[hidden],
#article-error[hidden] {
  display: none !important;
}

/* =========================================
   FULLY DYNAMIC INSIGHTS PAGE
========================================= */

#latest-insight-grid {
  margin-top: 48px;
}

#dynamic-insight-filters {
  margin-top: 72px;
  margin-bottom: 30px;
}

#dynamic-insight-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#dynamic-insight-grid .insight-card {
  display: flex;
  flex-direction: column;
}

#dynamic-insight-grid .insight-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#dynamic-insight-grid .dynamic-card-footer {
  margin-top: auto;
  padding-top: 24px;
}

#dynamic-insight-grid .insight-visual {
  min-height: 250px;
}

@media (max-width: 800px) {
  #dynamic-insight-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   ARTICLE AUTHOR PROFILE CARD
========================================= */

.dynamic-article-author {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.article-author-avatar-link {
  display: block;
  text-decoration: none;
}

.dynamic-article-author .team-avatar {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 50%;
}

.article-author-copy {
  min-width: 0;
}

.article-author-bio {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.article-author-socials {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-social-link {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  text-decoration: none;
  font-weight: 900;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.author-social-link:hover {
  transform: translateY(-2px);
  border-color: var(--mint-dark);
  background: #effaf7;
}

.author-social-link span {
  line-height: 1;
}

.author-social-link[hidden],
.article-author-socials[hidden],
.article-author-bio[hidden] {
  display: none !important;
}

@media (max-width: 720px) {
  .dynamic-article-author {
    grid-template-columns: 76px 1fr;
  }

  .dynamic-article-author .team-avatar {
    width: 76px;
    height: 76px;
  }

  .article-author-socials {
    grid-column: 1 / -1;
  }
}

/* =========================================
   DYNAMIC ARTICLE AUTHOR PROFILE
========================================= */

.dynamic-article-author {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.article-author-avatar-link {
  display: block;
  flex: 0 0 auto;
  text-decoration: none;
}

.dynamic-article-author .team-avatar {
  width: 96px;
  height: 96px;
  overflow: hidden;
  border-radius: 50%;
}

.article-author-photo {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
}

.article-author-copy {
  min-width: 0;
}

.article-author-link {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
}

.article-author-link:hover {
  color: var(--mint-dark);
}

.article-author-bio {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.65;
}

.article-author-socials {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.article-author-social {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  text-decoration: none;
  transition:
    transform 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.article-author-social svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.7;
}

.article-author-social:hover {
  transform: translateY(-2px);
  color: var(--mint-dark);
  border-color: var(--mint-dark);
  background: #effaf7;
}

.article-author-socials[hidden],
.article-author-bio[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .dynamic-article-author {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .dynamic-article-author .team-avatar {
    width: 76px;
    height: 76px;
  }

  .article-author-socials {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

/* Author text hierarchy */
.article-author-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.article-author-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.3;
}

.article-author-link {
  display: block;
  line-height: 1.2;
}

.article-author-link strong {
  display: block;
  font-size: 1.25rem;
  line-height: 1.2;
}

#article-author-role {
  margin: 8px 0 0;
}

/* =========================================
   AUTHOR SOCIAL LINKS — HORIZONTAL ALIGNMENT
========================================= */

.dynamic-article-author {
  grid-template-columns: 96px minmax(0, 1fr) max-content;
}

.article-author-socials {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: auto;
}

.article-author-social {
  flex: 0 0 42px;
}

@media (max-width: 760px) {
  .dynamic-article-author {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .article-author-socials {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: 8px;
  }
}

/* Final author social layout correction */

.dynamic-article-author {
  grid-template-columns: 96px minmax(0, 1fr) auto;
}

.article-author-socials {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  width: max-content;
  grid-column: auto;
}

.article-author-social {
  flex: 0 0 42px;
}

/* Only switch to stacked author layout on genuinely small screens */
@media (max-width: 560px) {
  .dynamic-article-author {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .article-author-socials {
    grid-column: 1 / -1;
    justify-content: flex-start;
    margin-top: 8px;
  }
}

/* Email icon must remain outlined, not solid */
.article-author-social .email-social-icon,
.article-author-social .email-social-icon rect,
.article-author-social .email-social-icon path {
  fill: none !important;
  stroke: currentColor !important;
}

.article-author-social .email-social-icon {
  width: 20px;
  height: 20px;
}

/* =========================================
   PUBLIC AUTHOR PROFILE SOCIAL ICONS
========================================= */

.author-profile-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.author-profile-social {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  color: var(--mint);
  border: 1px solid rgba(116, 240, 211, 0.32);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
  transition:
    transform 160ms ease,
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.author-profile-social svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: currentColor;
}

.author-profile-social-outline svg,
.author-profile-social-outline rect,
.author-profile-social-outline circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.author-profile-social-email svg,
.author-profile-social-email rect,
.author-profile-social-email path {
  fill: none;
  stroke: currentColor;
}

.author-profile-social:hover {
  transform: translateY(-2px);
  color: #07111f;
  border-color: var(--mint);
  background: var(--mint);
}

.author-profile-social[hidden] {
  display: none !important;
}

/* Rich article content generated by Quill */
#article-content.ql-container {
  border: 0;
  font-family: inherit;
}

#article-content .ql-editor {
  min-height: 0;
  padding: 0;
  overflow: visible;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

#article-content .ql-editor h2 {
  margin: 1.8em 0 0.65em;
}

#article-content .ql-editor h3 {
  margin: 1.5em 0 0.55em;
}

#article-content .ql-editor blockquote {
  margin: 30px 0;
  padding: 20px 24px;
  color: #29404e;
  border-left: 4px solid var(--mint-dark);
  background: #eff8f6;
}

#article-content .ql-editor img {
  max-width: 100%;
  height: auto;
  margin: 34px auto 14px;
  display: block;
  border-radius: 16px;
}

.article-cover-wrapper {
  margin: 0 0 42px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 20px;
  background: #e8eff1;
}

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

.article-updated-note {
  margin: 36px 0 14px;
  color: #84919c;
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.article-updated-note[hidden] {
  display: none !important;
}
