/* Custom CSS for ASAP pkgdown site */
/* Based on warbleR styling */

body {
    margin-top: 16px;
    margin-bottom: 16px;
    font-size: 19px;
    font-weight: 200;
}

#sidebar {
    font-size: 16px
}

#sidebar p {
    font-size: 16px
}

/* Anchor link offset for TOC clicks (modern approach) */
.contents h1,
.contents h2,
.contents h3,
.contents h4 {
    scroll-margin-top: 60px;
}

/* Heading font sizes */
h4 {
    font-size: 19px;
}

h3 {
    font-size: 22px;
}

h2 {
    font-size: 26px;
}

h1 {
    font-size: 30px;
}

pre {
    border: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    word-wrap: break-word;
    background: #f5f5f5;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    padding-left: 20px;
    padding-right: 20px;
    line-height: 21px;
    font-size: 15px;
}

pre code {
    color: #182125;
    background: #f5f5f5;
}

code {
    word-wrap: break-word;
    font-size: 85%;
    font-family: Consolas, Monaco, "Courier New", monospace;
    border-radius: 0;
}

.nav-pills>li>a {
    border-radius: 0;
}

.navbar-default .navbar-nav>.active>a,
.navbar-default .navbar-nav>.active>a:focus,
.navbar-default .navbar-nav>.active>a:hover {
    color: #1e88e5;
}

.navbar-default .navbar-nav>li>a {
    color: #1e88e5;
}

table p {
    font-size: 85%;
}

.ref-index h2 {
    font-size: 24px;
}

/* Blue headings */
h1,
h2 {
    color: #1e88e5;
}

/* Sidebar TOC header */
.sidebar-section h2,
aside h2,
.toc-heading {
    color: #1e88e5 !important;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Wider search box */
.navbar .form-control,
#search-input {
    min-width: 180px;
}

/* Content/sidebar ratio */
@media (min-width: 992px) {
    .col-md-9 {
        flex: 0 0 80%;
        max-width: 80%;
    }

    .col-md-3 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* Sidebar TOC link styling */
aside nav a,
.sidebar nav a {
    color: #333;
    font-size: 0.95rem;
    padding: 0.25rem 0;
}

aside nav a:hover,
.sidebar nav a:hover {
    color: #1e88e5;
}

aside nav a.active,
.sidebar nav a.active {
    background-color: #e3f2fd;
    color: #1e88e5;
}

/* Section spacing for vignettes/articles */
.contents h2 {
    margin-top: 4em;
    padding-top: 1em;
    border-top: 1px solid #eee;
}

/* First h2 shouldn't have top border */
.contents h2:first-of-type {
    border-top: none;
    margin-top: 1em;
}

/* Subsection spacing */
.contents h3 {
    margin-top: 2em;
}

/* ============================================================
   Get Started – tutorial card grid  (Seurat-style)
   ============================================================ */

/* Section header on the articles index page */
.articles-index h2.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #1e88e5;
    border-bottom: 2px solid #e3f2fd;
    padding-bottom: 0.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}

/* Responsive card grid */
.tutorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.4rem;
    margin-bottom: 3rem;
}

/* Individual card */
.tutorial-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    text-decoration: none !important;
    color: inherit !important;
}

.tutorial-card:hover {
    box-shadow: 0 6px 24px rgba(30, 136, 229, 0.18);
    transform: translateY(-3px);
    text-decoration: none;
}

/* Card thumbnail */
.tutorial-card .card-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-bottom: 1px solid #f0f0f0;
    background-color: #f5f8ff;
}

/* Card body */
.tutorial-card .card-body {
    padding: 1rem 1.1rem 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tutorial-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e88e5;
    margin-bottom: 0.4rem;
    line-height: 1.35;
}

.tutorial-card .card-desc {
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;
    flex: 1;
}

.tutorial-card .card-tag {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e88e5;
    opacity: 0.75;
}
