/* ASM-TMC Chapter — custom styles */

/* ── Brand colours ───────────────────────────────────────────────────────── */
:root {
  --asm-blue:        #003087;   /* ASM primary blue */
  --asm-blue-mid:    #0054a6;   /* medium blue */
  --asm-blue-light:  #e8f0fb;   /* light blue tint */
  --asm-orange:      #e8740c;   /* accent orange */
  --asm-orange-light:#fff3e8;
  --blog-thumb-size: 120px;     /* blog listing thumbnail size */
}

/* ── Navbar accent ───────────────────────────────────────────────────────── */
.navbar {
  border-bottom: 3px solid var(--asm-orange);
}

/* ── Hero banner on the home page ────────────────────────────────────────── */
.hero-banner {
  background: linear-gradient(135deg, var(--asm-blue) 0%, var(--asm-blue-mid) 100%);
  color: #fff;
  padding: 4rem 2rem 3rem;
  text-align: center;
  border-radius: 8px;
  width: 50%;
  margin: 0 auto 2rem;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: #fff;
  border: none;
}

.hero-subtitle {
  font-size: 1.15rem;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.hero-banner .btn-primary {
  background-color: var(--asm-orange);
  border-color: var(--asm-orange);
  color: #fff;
  font-weight: 600;
}

.hero-banner .btn-primary:hover {
  background-color: #c9620a;
  border-color: #c9620a;
}

/* ── Stats / metric cards ────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.stat-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--bs-secondary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bs-emphasis-color);
  font-variant-numeric: tabular-nums;
}

/* ── Feature cards (home page grid) ─────────────────────────────────────── */
.feature-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-top: 3px solid var(--asm-blue);
  border-radius: 8px;
  padding: 1.5rem;
  height: 100%;
  transition: box-shadow 0.2s ease, border-top-color 0.2s ease;
}

.feature-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  border-top-color: var(--asm-orange);
}

/* ── Resource cards (resources page) ────────────────────────────────────── */
.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.resource-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  transition: box-shadow 0.2s ease;
}

.resource-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.resource-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}

.resource-name {
  font-weight: 600;
  color: var(--asm-blue);
  text-decoration: none;
  font-size: 1rem;
}

.resource-name:hover {
  color: var(--asm-orange);
  text-decoration: underline;
}

.resource-desc {
  font-size: 0.875rem;
  color: var(--bs-secondary-color, #6c757d);
  margin: 0;
}

.resource-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}

.resource-badge-journal   { background: #dbeafe; color: #1e40af; }
.resource-badge-funding   { background: #dcfce7; color: #166534; }
.resource-badge-database  { background: #fef9c3; color: #854d0e; }
.resource-badge-career    { background: #fce7f3; color: #9d174d; }
.resource-badge-local     { background: #ede9fe; color: #5b21b6; }
.resource-badge-podcast   { background: #ffedd5; color: #9a3412; }
.resource-badge-audience  { background: var(--asm-orange-light); color: var(--asm-orange); }

/* ── Responsive images ───────────────────────────────────────────────────── */
img { max-width: 100%; }

/* ── Observable Plot charts ──────────────────────────────────────────────── */
.observablehq svg {
  max-width: 100%;
  height: auto;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table { font-size: 0.9rem; }

/* ── Code blocks ─────────────────────────────────────────────────────────── */
pre { border-radius: 6px; }

/* ── Callouts ────────────────────────────────────────────────────────────── */
.callout { border-radius: 6px; }

.home-next-event {
  margin: 0;
  padding: 1rem 1.25rem;
  border-left: 0.35rem solid #b22222;
  border-radius: 6px;
  background: #fdecea;
}

.home-events-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.home-events-stack {
  display: grid;
  gap: 1.5rem;
}

.home-next-event h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.home-next-event h3 a {
  color: #8b1e1e;
  text-decoration: none;
}

.home-next-event h3 a:hover,
.home-next-event h3 a:focus {
  text-decoration: underline;
}

.home-upcoming-events {
  padding-left: 1.25rem;
}

.home-upcoming-events li + li {
  margin-top: 0.35rem;
}

.home-calendar-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1rem;
}

.home-calendar-card #homepage-event-calendar {
  max-width: 100%;
}

.podcast-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.podcast-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 8px;
  padding: 1.25rem;
}

.podcast-card h3 {
  margin-top: 0;
}

.events-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
  align-items: start;
}

.events-calendar-column #event-calendar {
  max-width: 100%;
}

.events-upcoming-column {
  margin-top: 0.25rem;
}

/* ── ICS / calendar download button ─────────────────────────────────────── */
.ics-btn {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Blog listing page ───────────────────────────────────────────────────── */
.quarto-listing-category-title { font-weight: 700; }
.listing-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Thumbnail styling for right-aligned listing images */
.quarto-post.image-right .thumbnail img,
.quarto-post .thumbnail-image {
  object-fit: cover;
  border-radius: 6px;
  width: var(--blog-thumb-size);
  height: var(--blog-thumb-size);
}
.social-feeds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

@media (max-width: 1399.98px) {
  .podcast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  .hero-banner {
    width: 100%;
  }

  .resource-list,
  .home-events-grid,
  .podcast-grid,
  .events-layout {
    grid-template-columns: 1fr;
  }
}

.social-feed-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.social-feed-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--asm-blue-light);
  color: var(--asm-blue);
  border-bottom: 1px solid var(--bs-border-color);
}

.social-feed-header .bi {
  font-size: 1.1rem;
}

.twitter-feed-wrapper {
  padding: 0;
  min-height: 200px;
}

.twitter-feed-wrapper .twitter-timeline {
  display: block;
  width: 100% !important;
}

.social-follow-wrapper {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Keep legacy class working */
.instagram-feed-wrapper {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-feed-desc {
  font-size: 0.9rem;
  color: var(--bs-secondary-color, #6c757d);
  margin: 0;
}

.btn-instagram {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.btn-instagram:hover {
  color: #fff;
  opacity: 0.88;
  text-decoration: none;
}

.btn-facebook {
  display: inline-flex;
  align-items: center;
  background: #1877f2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn-facebook:hover {
  color: #fff;
  background: #0f5ecc;
  text-decoration: none;
}

.btn-linkedin {
  display: inline-flex;
  align-items: center;
  background: #0a66c2;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

.btn-linkedin:hover {
  color: #fff;
  background: #084f97;
  text-decoration: none;
}

.social-divider {
  margin: 0.25rem 0;
  border-color: var(--bs-border-color);
}

.social-feed-note {
  font-size: 0.82rem;
  color: var(--bs-secondary-color, #6c757d);
  margin: 0;
}

/* ── FullCalendar legend ─────────────────────────────────────────────────── */
.fc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.85rem;
  align-items: center;
}

.fc-legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}

/* ── Member profile cards ────────────────────────────────────────────────── */
.members-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0;
}

@media (min-width: 900px) {
  .members-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.member-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.member-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.member-card-former {
  opacity: 0.85;
  border-style: dashed;
}

.member-avatar {
  font-size: 4rem;
  line-height: 1;
  color: var(--asm-blue);
}

.member-avatar-former {
  color: var(--bs-secondary);
}

.member-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.member-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--bs-emphasis-color);
}

.member-role {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--asm-blue);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.member-institution {
  font-size: 0.85rem;
  color: var(--bs-secondary-color, #6c757d);
  margin: 0;
}

.member-bio {
  font-size: 0.875rem;
  color: var(--bs-body-color);
  margin: 0.25rem 0 0;
}

.member-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.member-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--asm-blue-light);
  color: var(--asm-blue);
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.member-link:hover {
  background: var(--asm-blue);
  color: #fff;
  text-decoration: none;
}

.member-link-linkedin:hover { background: #0a66c2; color: #fff; }
.member-link-x:hover        { background: #000;    color: #fff; }
.member-link-bluesky:hover  { background: #0085ff; color: #fff; }
.member-link-orcid          { background: #a6ce39; color: #fff; }
.member-link-orcid:hover    { background: #8ab62d; color: #fff; }
.member-link-email:hover    { background: var(--asm-orange); color: #fff; }
.orcid-icon-text            { font-size: 0.65rem; font-weight: 800; line-height: 1; }

#title-block-header .title .home-title-second-line {
  display: inline;
}

@media (min-width: 768px) {
  #title-block-header .title .home-title-second-line {
    display: block;
  }
}

@media (min-width: 768px) {
  #quarto-content.quarto-container.page-layout-article {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    grid-template-columns:
      [screen-start] 10vw
      [screen-start-inset page-start page-start-inset] 10vw
      [body-start-outset body-start body-content-start] 60vw
      [body-content-end] 10vw
      [body-end body-end-outset] 10vw
      [page-end-inset page-end screen-end-inset screen-end] !important;
  }

  #quarto-content.quarto-container.page-layout-article > main.content,
  #quarto-content.quarto-container.page-layout-article > #quarto-margin-sidebar,
  #quarto-sidebar,
  .sidebar:not(.margin-sidebar) {
    width: 100% !important;
    max-width: 100% !important;
  }

  #quarto-content.quarto-container.page-layout-article > #quarto-margin-sidebar {
    grid-column: body-end / page-end !important;
    justify-self: stretch !important;
  }

  #quarto-sidebar,
  .sidebar:not(.margin-sidebar) {
    grid-column: screen-start / page-start !important;
  }
}
