@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@300;400;500;600;700&display=swap');

/* ============================================
   Software landing — page layout
   ============================================ */
#quarto-content { padding: 0; }
#title-block-header { display: none !important; }

/* quarto-nav.js sets body.style.paddingTop=0 because it looks for header.fixed-top
   but this site uses position:fixed via CSS — override with !important */
body { padding-top: 80px !important; }

.sw-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 3rem 4rem 6rem;
}

/* ============================================
   Entrance animations
   ============================================ */
@keyframes swIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

section.sw-page-title {
  animation: swIn 0.6s cubic-bezier(.22, 1, .36, 1) 0.05s both;
}
section#r-packages-section > h1 {
  animation: swIn 0.55s cubic-bezier(.22, 1, .36, 1) 0.22s both;
}
.quarto-listing-container-grid .g-col-1 {
  animation: swIn 0.65s cubic-bezier(.22, 1, .36, 1) both;
}
.quarto-listing-container-grid .g-col-1:nth-child(1) { animation-delay: 0.34s; }
.quarto-listing-container-grid .g-col-1:nth-child(2) { animation-delay: 0.44s; }
.quarto-listing-container-grid .g-col-1:nth-child(3) { animation-delay: 0.52s; }
.quarto-listing-container-grid .g-col-1:nth-child(4) { animation-delay: 0.60s; }

@media (prefers-reduced-motion: reduce) {
  section.sw-page-title,
  section#r-packages-section > h1,
  .quarto-listing-container-grid .g-col-1 {
    animation: none;
    opacity: 1;
  }
}

/* Page header block — title + description styled to match other pages */
section.sw-page-title {
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 2.5rem;
}

h1.sw-page-title {
  font-family: var(--ff);
  font-weight: 600;
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  letter-spacing: -0.02em;
  color: var(--ink-0);
  margin: 0 0 0.75rem;
  line-height: 1.05;
}

section.sw-page-title p {
  max-width: 60ch;
  font-size: 1rem;
  color: var(--ink-1);
  line-height: 1.65;
  margin: 0;
}

/* Tighten the gap between the page title block and the description */
.pub-detail header.quarto-title-block,
header#title-block-header {
  margin-bottom: 0.5rem !important;
}
header#title-block-header h1.title {
  margin-bottom: 0.4rem !important;
}

/* Section heading — quiet h1, soft blue underline (matches Tutorials) */
section#r-packages-section > h1 {
  font-family: var(--ff);
  font-weight: 300;
  font-size: 1.55rem;
  letter-spacing: -0.005em;
  color: #ffffff;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

/* ============================================
   Grid card listing — uses Quarto's actual
   .quarto-listing-container-grid > .list.grid
   structure so the rules actually match.
   ============================================ */
.quarto-listing-container-grid .list.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem;
  margin: 0;
}
@media (max-width: 600px) {
  .quarto-listing-container-grid .list.grid { grid-template-columns: 1fr; }
}

/* Each grid cell holds an <a class="quarto-grid-link"> wrapping the card */
.quarto-listing-container-grid .g-col-1 {
  width: 100%;
}
.quarto-listing-container-grid .quarto-grid-link {
  display: block;
  text-decoration: none !important;
  color: inherit;
}

/* The card itself — horizontal layout, gradient blue/gold border */
.quarto-listing-container-grid .quarto-grid-item.card {
  background: transparent !important;
  border: none !important;
  border-radius: 14px !important;
  overflow: hidden;
  padding: 2.8rem 2.4rem 2.4rem !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 420px;
  justify-content: center;
  box-shadow: none;
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s ease;
  position: relative;
}

.quarto-listing-container-grid .quarto-grid-link:hover .quarto-grid-item.card {
  transform: translateY(-3px);
  box-shadow: none;
}

/* Card image */
.quarto-listing-container-grid .card-img-top {
  margin: 0;
  text-align: center;
}
.quarto-listing-container-grid .thumbnail-image,
.quarto-listing-container-grid .card-img,
.quarto-listing-container-grid .card-img-top img {
  width: auto !important;
  height: 180px !important;
  object-fit: contain !important;
  display: block !important;
  margin: 0 auto !important;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.quarto-listing-container-grid .quarto-grid-link:hover .card-img-top img {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(100, 181, 246, 0.35)) drop-shadow(0 0 22px rgba(100, 181, 246, 0.12));
}

/* Card body */
.quarto-listing-container-grid .card-body {
  padding: 0;
  text-align: center;
  width: 100%;
}

/* Title */
.quarto-listing-container-grid .card-title,
.quarto-listing-container-grid .listing-title,
.quarto-listing-container-grid h5.card-title {
  font-family: var(--ff) !important;
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: #ffffff;
  margin: 0 0 0.5rem;
  text-align: center;
}

/* Hide description and date in the grid */
.quarto-listing-container-grid .listing-description,
.quarto-listing-container-grid .card-text,
.quarto-listing-container-grid .listing-date,
.quarto-listing-container-grid .card-attribution {
  display: none;
}

/* ============================================
   Card injected description + stats bar
   ============================================ */
.sw-pkg-desc {
  font-family: var(--ff);
  font-size: 0.84rem;
  color: rgba(220, 230, 240, 0.52);
  line-height: 1.6;
  text-align: center;
  margin: 0 auto 1rem;
  max-width: 56ch;
}

.sw-stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* README-style live badges (shields/r-pkg/cranlogs) */
.sw-badge { display: inline-flex; line-height: 0; }
.sw-stats-bar img {
  height: 20px;
  display: block;
  border-radius: 3px;
  opacity: 0.92;
  transition: opacity 0.25s var(--ease, ease);
}
.quarto-grid-link:hover .sw-stats-bar img { opacity: 1; }

.sw-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ff);
  font-size: 0.82rem; font-weight: 600;
  color: rgba(255,255,255,.4);
  letter-spacing: -.01em;
  transition: color .25s;
  white-space: nowrap;
}
.quarto-grid-link:hover .sw-pill { color: rgba(255,255,255,.85); }

.sw-pill .sw-pill-icon {
  color: rgba(255,255,255,.25);
  font-size: 0.78rem;
  transition: color .25s;
}
.quarto-grid-link:hover .sw-pill .sw-pill-icon { color: rgba(255,255,255,.65); }

.sw-pill .sw-pill-lbl {
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  transition: color .25s;
}
.quarto-grid-link:hover .sw-pill .sw-pill-lbl { color: rgba(255,255,255,.55); }

/* ============================================
   Package detail page — hero + logo
   ============================================ */
.pub-detail .pkg-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
}
.pub-detail .pkg-logo {
  width: 140px;
  height: auto;
  margin-bottom: 0.4rem;
  filter: none;
}
.pub-detail .pkg-hero h1 {
  font-family: var(--ff);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0.2rem 0 0.4rem;
}
.pub-detail .pkg-hero .pub-journal {
  font-family: var(--ff);
  font-weight: 400;
  color: rgba(220, 230, 240, 0.78);
}

/* Tagline pull-quote under the hero */
.pub-detail .pkg-tagline {
  font-family: var(--ff);
  font-weight: 300;
  font-size: 1.25rem;
  font-style: italic;
  letter-spacing: -0.005em;
  color: rgba(245, 248, 252, 0.92);
  text-align: center;
  margin: 2rem auto 2.6rem;
  max-width: 640px;
  padding: 0.6rem 1.2rem;
  border: none;
  border-left: 2px solid rgba(100, 181, 246, 0.55);
  background: linear-gradient(90deg, rgba(100, 181, 246, 0.05) 0%, transparent 100%);
}
.pub-detail .pkg-tagline strong {
  font-weight: 500;
  color: #ffffff;
}

/* Section headings on package detail pages — same FA-icon + gradient bar
   pattern as the tutorial detail pages so the two sections feel related. */
.pub-detail h2 {
  font-family: var(--ff);
  font-weight: 400;
  font-size: 1.35rem;
  letter-spacing: 0.005em;
  color: rgba(245, 248, 252, 0.94);
  margin-top: 3rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.pub-detail h2::before {
  content: "";
  flex: 0 0 auto;
  width: 100%;
  max-width: 64px;
  height: 2px;
  background: linear-gradient(90deg, #64B5F6, transparent);
  border-radius: 2px;
  align-self: center;
  order: -1;
}
.pub-detail h2 i.fa-solid,
.pub-detail h2 .fa-solid {
  color: #64B5F6;
  font-size: 0.78em;
  margin-right: 0.15rem;
  filter: drop-shadow(0 0 6px rgba(100, 181, 246, 0.35));
}

/* Tables on the detail page — quiet borders, comfortable typography */
.pub-detail table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.6rem;
  font-family: var(--ff);
  font-size: 0.9rem;
}
.pub-detail table th,
.pub-detail table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(100, 181, 246, 0.12);
  text-align: left;
  vertical-align: top;
  color: rgba(220, 230, 240, 0.85);
}
.pub-detail table th {
  font-weight: 500;
  color: #ffffff;
  background: rgba(100, 181, 246, 0.06);
  border-bottom-color: rgba(100, 181, 246, 0.32);
}
.pub-detail table code {
  background: rgba(100, 181, 246, 0.1);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-size: 0.88em;
  color: #ffd479;
}

/* Inline code accent on body paragraphs */
.pub-detail p code,
.pub-detail li code {
  background: rgba(100, 181, 246, 0.08);
  padding: 0.05rem 0.32rem;
  border-radius: 3px;
  font-size: 0.92em;
  color: #ffd479;
}

/* Code chunks (Solarized Dark) + filename labels + code-fold toggle now
   live in the global styles.css so every page with chunks reads the same.
   This file no longer needs its own copy. */

/* CTA links re-use the Tutorials text-link pattern (no button-y boxes) */
.pub-detail .pub-cta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.6rem;
  margin-top: 2.5rem;
}
.pub-detail .pub-cta a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  font-family: var(--ff);
  font-weight: 400;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  color: rgba(220, 230, 240, 0.78);
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0.15rem 0 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: color 0.25s ease;
}
.pub-detail .pub-cta a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: rgba(100, 181, 246, 0.55);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.pub-detail .pub-cta a:hover { color: #ffffff; }
.pub-detail .pub-cta a:hover::after { transform: scaleX(1); }
.pub-detail .pub-cta a i,
.pub-detail .pub-cta a .fa-solid,
.pub-detail .pub-cta a .fa-brands {
  color: #64B5F6;
  font-size: 0.92em;
}
