/*
 * Blog layout modelled on blog.coursera.org: a magazine homepage (lead story + Trending, card grids per section,
 * topic tiles), 3-column archive grids, and a single 790px column for articles. Loaded after built/screen.css, which
 * has a few !important rules on .gh-main and .gh-content that this file has to beat.
 *
 * Type and colour follow odin: DEFAULT_TEXT_STYLE / DEFAULT_TEXT_STYLE_MOBILE in
 * src/styles/templates/DefaultStyleTemplates.ts and LIGHT_THEME_VARIABLES in src/styles/ThemeVariables.ts.
 * Rules name the odin style they copy; keep them in step.
 */

/* odin --primary-text-color, --secondary-text-color, --border-color, --tertiary-background-color, --green-text */
:root {
    --nl-text: rgba(0, 0, 0, 0.96);
    --nl-text-secondary: rgba(0, 0, 0, 0.75);
    --nl-border: #e5e5e5;
    --nl-pale: #f5f5f5;
    --nl-accent: #0a7d41;
    --nl-heading-font: "Lexend Exa", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --nl-body-font: "Lexend Deca", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

.nl-main {
    padding-top: 0 !important;
    padding-bottom: 0;
    font-family: var(--nl-body-font);
    color: var(--nl-text);
}

.nl-main a {
    color: inherit;
}

/* Shared pieces. Buttons follow nextleap.app: primary is black with white text, secondary is white with a black border. */

/* odin tag */
.nl-label {
    font-size: 12px;
    font-weight: 400;
    line-height: 110%;
    color: var(--nl-accent) !important;
}

.nl-label:hover {
    text-decoration: underline;
    opacity: 1;
}

/* odin buttonSmall */
.nl-btn-outline {
    display: inline-flex;
    flex-shrink: 0;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    font-size: 15px;
    font-weight: 500;
    line-height: 134%;
    letter-spacing: 0.25px;
    color: #000 !important;
    white-space: nowrap;
    background-color: #fff;
    border: 1px solid #000;
    border-radius: 6px;
    transition: background-color 0.15s;
}

.nl-btn-outline:hover {
    background-color: #f3f3f3;
    opacity: 1;
}

.nl-btn-outline svg {
    width: 16px;
    height: 16px;
}

.nl-section {
    padding: 56px 0;
}

.nl-section-head {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

/* odin heading3 */
.nl-section-title {
    margin: 0;
    font-family: var(--nl-heading-font);
    font-size: 30px;
    font-weight: 400;
    line-height: 125%;
    letter-spacing: -2.5px;
    font-feature-settings: 'liga' off;
    color: var(--nl-text);
}

.nl-section-title a:hover {
    opacity: 0.8;
}

/* odin body2 */
.nl-section-description {
    margin-top: 8px;
    font-size: 15px;
    line-height: 160%;
    letter-spacing: 0.25px;
    color: var(--nl-text-secondary);
}

/* Every other section block gets a tinted band, as on Coursera */
.nl-topics .nl-section-topic:nth-child(odd) {
    background-color: var(--nl-pale);
}

.nl-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 24px;
}

/* Post card */

.nl-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--nl-border);
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.nl-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.nl-card-image {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--nl-pale);
}

.nl-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.nl-card:hover .nl-card-image img {
    transform: scale(1.03);
}

.nl-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 10px;
    padding: 16px 16px 20px;
}

.nl-card-meta {
    display: flex;
    gap: 12px;
    align-items: baseline;
    justify-content: space-between;
}

/* odin caption */
.nl-card-date {
    flex-shrink: 0;
    font-size: 13px;
    line-height: 150%;
    color: var(--nl-text-secondary);
}

/* odin heading5, which odin's image cards use for titles */
.nl-card-title {
    margin: 0;
    font-family: var(--nl-body-font);
    font-size: 19px;
    font-weight: 400;
    line-height: 145%;
    letter-spacing: 0.15px;
}

.nl-card-title a:hover {
    opacity: 1;
    color: var(--nl-accent);
}

/* odin body2 */
.nl-card-excerpt {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    line-height: 160%;
    letter-spacing: 0.25px;
    color: var(--nl-text-secondary);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* odin caption */
.nl-card-author {
    margin-top: auto;
    padding-top: 6px;
    font-size: 13px;
    line-height: 150%;
    color: var(--nl-text-secondary);
}

.nl-card-author a {
    color: var(--nl-accent) !important;
}

/* Lead story: no card chrome, image on top, big headline */

.nl-card-hero {
    border: 0;
    border-radius: 0;
}

.nl-card-hero:hover {
    box-shadow: none;
}

.nl-card-hero .nl-card-image {
    border-radius: 8px;
}

.nl-card-hero .nl-card-body {
    padding: 16px 0 0;
}

.nl-card-hero .nl-card-meta {
    justify-content: flex-start;
}

/* odin heading2 */
.nl-card-hero .nl-card-title {
    font-family: var(--nl-heading-font);
    font-size: 35px;
    line-height: 120%;
    letter-spacing: -2.8px;
    font-feature-settings: 'liga' off;
}

/* Homepage lead + Trending */

.nl-section-lead {
    padding-top: 40px;
    padding-bottom: 48px;
}

.nl-section-lead + .nl-section {
    padding-top: 48px;
    border-top: 1px solid var(--nl-border);
}

.nl-lead {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.nl-lead-main:only-child {
    grid-column: 1 / -1;
}

/* odin heading4 */
.nl-trending-title {
    margin: 0 0 16px;
    font-family: var(--nl-heading-font);
    font-size: 22px;
    font-weight: 400;
    line-height: 128%;
    letter-spacing: -2.25px;
    font-feature-settings: 'liga' off;
}

.nl-compact {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 0;
    border-top: 1px solid var(--nl-border);
}

.nl-compact:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.nl-compact-image {
    flex-shrink: 0;
    width: 112px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--nl-pale);
    border-radius: 6px;
}

.nl-compact-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nl-compact-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

/* odin body2 at medium weight, like odin's media card titles */
.nl-compact-title {
    margin: 0;
    font-family: var(--nl-body-font);
    font-size: 15px;
    font-weight: 500;
    line-height: 150%;
    letter-spacing: 0.25px;
}

.nl-compact-title a:hover {
    opacity: 1;
    color: var(--nl-accent);
}

/* Explore by Topic tiles */

.nl-topic-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.nl-topic-tile {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--nl-pale);
    border-radius: 8px;
    transition: box-shadow 0.2s;
}

.nl-topic-tile:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    opacity: 1;
}

.nl-topic-tile-image {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, var(--nl-accent), #005353);
}

.nl-topic-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nl-topic-tile-icon {
    color: rgba(255, 255, 255, 0.9);
}

/* odin heading4 */
.nl-topic-tile-name {
    padding: 16px 16px 4px;
    font-family: var(--nl-heading-font);
    font-size: 22px;
    font-weight: 400;
    line-height: 128%;
    letter-spacing: -2.25px;
    font-feature-settings: 'liga' off;
    color: var(--nl-text);
}

/* odin caption */
.nl-topic-tile-count {
    padding: 0 16px 16px;
    font-size: 13px;
    line-height: 150%;
    color: var(--nl-text-secondary);
}

/* Breadcrumb */

/* odin caption */
.nl-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
    line-height: 150%;
    color: var(--nl-text-secondary);
}

.nl-breadcrumb a {
    display: inline-flex;
    color: var(--nl-accent) !important;
}

.nl-breadcrumb-current {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Archive pages: All articles, sections, authors */

.nl-archive {
    padding-top: 32px !important;
    padding-bottom: 80px;
}

.nl-archive-head {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
}

/* odin heading2 */
.nl-archive-title {
    margin: 0;
    font-family: var(--nl-heading-font);
    font-size: 35px;
    font-weight: 400;
    line-height: 120%;
    letter-spacing: -2.8px;
    font-feature-settings: 'liga' off;
}

/* odin body1 */
.nl-archive-description {
    max-width: 640px;
    margin-top: 12px;
    font-size: 17px;
    line-height: 160%;
    letter-spacing: 0.25px;
    color: var(--nl-text-secondary);
}

.nl-archive-image {
    width: 360px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
}

.nl-author-head {
    justify-content: flex-start;
    gap: 24px;
}

.nl-author-avatar {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 50%;
}

/* Article */

.nl-post {
    padding-top: 32px !important;
}

.nl-article-header {
    width: min(790px, 100% - 48px);
    margin: 0 auto;
}

/* odin heading2 */
.nl-article-title {
    margin: 0;
    font-family: var(--nl-heading-font);
    font-size: 35px;
    font-weight: 400;
    line-height: 120%;
    letter-spacing: -2.8px;
    font-feature-settings: 'liga' off;
    color: var(--nl-text);
}

/* odin body1 */
.nl-article-excerpt {
    margin-top: 16px;
    font-size: 17px;
    line-height: 160%;
    letter-spacing: 0.25px;
    color: var(--nl-text-secondary);
}

.nl-article-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin: 28px 0 32px;
}

/* odin body2 */
.nl-byline {
    font-size: 15px;
    line-height: 160%;
    letter-spacing: 0.25px;
}

.nl-byline-authors a {
    font-weight: 500;
    color: var(--nl-accent) !important;
}

/* odin caption */
.nl-byline-sub {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    line-height: 150%;
    color: var(--nl-text-secondary);
}

.nl-dot {
    width: 3px;
    height: 3px;
    background: currentColor;
    border-radius: 50%;
}

/* odin buttonSmall */
.nl-share {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    font-family: var(--nl-body-font);
    font-size: 15px;
    font-weight: 500;
    line-height: 134%;
    letter-spacing: 0.25px;
    color: #fff;
    cursor: pointer;
    background: #000;
    border: 0;
    border-radius: 6px;
}

.nl-share:hover {
    background: #333;
}

.nl-article-image {
    margin: 0 0 40px;
}

.nl-article-image img {
    width: 100%;
    border-radius: 8px;
}

.nl-article-image figcaption {
    margin-top: 10px;
    font-size: 13px;
    line-height: 150%;
    color: var(--nl-text-secondary);
    text-align: center;
}

/* Body: screen.css forces .gh-canvas to a flex column at 70% width; put the card grid back at 790px */
.gh-content.nl-article-content {
    --content-width: 790px;
    --container-width: 1200px;
    display: grid !important;
    width: 100%;
    padding-bottom: 72px;
}

/* odin heading4 */
.nl-article-content > h2 {
    font-family: var(--nl-heading-font);
    font-size: 22px;
    font-weight: 400;
    line-height: 128%;
    letter-spacing: -2.25px;
    font-feature-settings: 'liga' off;
    color: var(--nl-text);
}

/* odin heading5, at medium weight so it stands apart from body text */
.nl-article-content > h3,
.nl-article-content > h4 {
    font-family: var(--nl-body-font);
    font-size: 19px;
    font-weight: 500;
    line-height: 145%;
    letter-spacing: 0.15px;
    color: var(--nl-text);
}

.nl-article-content > p,
.nl-article-content > ul,
.nl-article-content > ol {
    color: var(--nl-text);
}

.nl-related {
    background-color: var(--nl-pale);
}

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

    .nl-lead {
        grid-template-columns: minmax(0, 1fr);
    }

    .nl-trending {
        padding-top: 32px;
        border-top: 1px solid var(--nl-border);
    }
}

@media (max-width: 767px) {
    .nl-section {
        padding: 40px 0;
    }

    .nl-section-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 24px;
    }

    /* odin DEFAULT_TEXT_STYLE_MOBILE heading3 */
    .nl-section-title {
        font-size: 24px;
        line-height: 118%;
        letter-spacing: -2px;
    }

    .nl-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    /* odin DEFAULT_TEXT_STYLE_MOBILE heading2 */
    .nl-card-hero .nl-card-title {
        font-size: 27px;
        line-height: 114%;
    }

    .nl-topic-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .nl-archive-head {
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 24px;
    }

    .nl-archive-image {
        width: 100%;
    }

    /* odin DEFAULT_TEXT_STYLE_MOBILE heading2 */
    .nl-archive-title,
    .nl-article-title {
        font-size: 27px;
        line-height: 114%;
    }

    .nl-article-header {
        width: calc(100% - 48px);
    }

    .nl-breadcrumb-current,
    .nl-breadcrumb-sep:last-of-type {
        display: none;
    }
}
