/* FRANK RIDES — stylesheet
   Values are based on the existing Figma desktop homepage. */
:root {
    --paper: #f7f7f2;
    --ink: #1a252c;
    --muted: #4e5c62;
    --accent: #c63b2f;
    --content-width: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Archivo', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* At 1440px this leaves 120px either side, matching Figma. */
.container {
    width: min(calc(100% - 48px), var(--content-width));
    margin-inline: auto;
}

.accent {
    color: var(--accent);
}

/* 01 — Header */
.site-header {
    height: 141px;

    /* 20px above the 88px nav, then 33px to the hero */
    padding-top: 20px;
}

.header-layout {
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}

.brand-name {
    font-size: 48px;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -1px;
}

.brand-subtitle {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    margin-top: 3px;
}

.main-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.main-nav a,
.main-nav span {
    color: var(--ink);
    text-decoration: none;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: var(--accent);
}

/* 02 — Hero */
.hero {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 1;
    height: auto;
    overflow: hidden;
}

.hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 39%;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
    90deg,
    rgba(247, 247, 242, 0.65) 0%,
    rgba(247, 247, 242, 0.20) 45%,
    rgba(247, 247, 242, 0) 70%,
    rgba(247, 247, 242, 0) 100%
  );
}

.hero-content {
    position: relative;
    z-index: 1;
    padding-top: 60px;
}

.hero h1 {
    margin: 0;
    font-size: 48px;
    font-weight: 900;
    line-height: 49px;
    letter-spacing: -0.02em;
}

/* 03 — Latest Articles */
.latest-articles {
    padding-block: 64px 80px;
}

.latest-articles h2 {
    font-size: 36px;
    font-weight: 900;
    line-height: 49px;
    margin: 0 0 32px;
    color: #000;
}

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

/* Homepage only: keep the archive's .articles-grid as a regular grid. */
.latest-articles .section-heading-row {
    align-items: center;
    margin-bottom: 32px;
}

.latest-articles .section-heading-row h2 {
    margin-bottom: 0;
}

/* The controls overlay the card images rather than occupying the heading. */
.latest-articles-carousel {
    --carousel-card-width: calc((100% - 48px) / 2.25);
    position: relative;
}

.carousel-controls {
    position: absolute;
    z-index: 2;
    inset: 0 0 auto;
    display: flex;
    align-items: center;
    pointer-events: none;

    /* Cards remain clickable beneath the overlay. */
}

/* Size the controls' row to the height of one card image (8:5).
   This keeps arrows centred on the images at every screen width. */
.carousel-controls::before {
    content: '';
    display: block;
    flex: none;
    width: var(--carousel-card-width);
    aspect-ratio: 8 / 5;
}

/* Light circular overlay controls on desktop/tablet. */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(26, 37, 44, .14);
    border-radius: 50%;
    background: rgba(247, 247, 242, .97);
    box-shadow: 0 3px 14px rgba(26, 37, 44, .13);
    color: var(--ink);
    cursor: pointer;
    pointer-events: auto;
    transition: background-color .18s, color .18s, box-shadow .18s, opacity .18s;
}

.carousel-arrow svg {
    display: block;
}

.carousel-arrow--prev {
    left: 10px;
}

.carousel-arrow--next {
    right: 10px;
}

.carousel-arrow:not(:disabled):hover {
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 4px 16px rgba(26, 37, 44, .2);
}

.carousel-arrow:disabled {
    opacity: 0;
    pointer-events: none;
    cursor: default;
}

/* Show two full cards and a glimpse of the next on desktop. */
.latest-articles .latest-articles-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.latest-articles .latest-articles-track::-webkit-scrollbar {
    display: none;
}

.latest-articles .latest-articles-track > .article-card {
    flex: 0 0 var(--carousel-card-width);
    scroll-snap-align: start;
}

.article-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.article-card-image {
    display: block;
    width: 100%;
    height: auto;

    /* Override the HTML height attribute so the image scales with the card. */
    aspect-ratio: 8 / 5;

    /* 384 x 240 from Figma */
    object-fit: cover;
}

.article-card-category,
.article-card h3,
.article-card-description {
    margin: 0;
}

.article-card-category {
    font-size: 12px;
    font-weight: 800;
    line-height: 16px;
    color: var(--accent);
}

.article-card h3 {
    font-size: 22px;
    font-weight: 800;
    line-height: 28px;
}

.article-card-description {
    font-size: 15px;
    font-weight: 400;
    line-height: 23px;
    color: var(--muted);
}

.article-card-link {
    font-size: 13px;
    font-weight: 600;
    line-height: 16px;
    color: var(--accent);
}

/* Tablet: 2 columns and reduced margins. */
@media (max-width: 960px) {
    /* Slightly more than one article visible on tablets. */
    .latest-articles-carousel {
        --carousel-card-width: calc((100% - 24px) / 1.7);
    }

    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero {
        height: 430px;
    }

    .brand-name {
        font-size: 40px;
    }

    .brand-subtitle {
        font-size: 17px;
    }
}

/* Mobile: stack the navigation and cards. */
@media (max-width: 640px) {
    .latest-articles .section-heading-row {
        gap: 16px;
    }

    /* One article with the next one peeking in on phones. */
    .latest-articles-carousel {
        --carousel-card-width: 84%;
    }

    .latest-articles .latest-articles-track {
        gap: 16px;
    }

    /* Mobile uses touch/swipe scrolling: no overlay arrows. */
    .carousel-controls {
        display: none;
    }

    .container {
        width: calc(100% - 40px);
    }

    .site-header {
        height: auto;
        padding-block: 18px 20px;
    }

    .header-layout {
        height: auto;
        align-items: flex-start;
        flex-direction: column;
        gap: 20px;
    }

    .brand-name {
        font-size: 38px;
    }

    .brand-subtitle {
        font-size: 16px;
    }

    .main-nav {
        gap: 16px;
        font-size: 13px;
    }

    .hero {
        height: 400px;
    }

    .hero-image {
        object-position: 64% center;
    }

    .hero-gradient {
        background: linear-gradient(90deg, rgba(247,247,242,.80), rgba(247,247,242,.35) 70%, transparent);
    }

    .hero-content {
        padding-top: 40px;
    }

    .hero h1 {
        font-size: clamp(32px, 8.5vw, 44px);
        line-height: 1.06;
    }

    .latest-articles {
        padding-block: 48px 64px;
    }

    .latest-articles h2 {
        font-size: 30px;
        line-height: 1.2;
        margin-bottom: 28px;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Shared details for the archive and article page. */
a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
}

.section-heading-row h2 {
    margin-bottom: 32px;
}

.text-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    white-space: nowrap;
}

.text-link:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.main-nav a[aria-current="page"] {
    color: var(--accent);
    font-weight: 700;
}

/* 04 — Article archive page */
.archive-intro {
    border-bottom: 1px solid #d9dcd7;
    padding: 52px 0 64px;
}

.archive-eyebrow {
    color: var(--accent);
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .09em;
    margin: 0 0 18px;
}

.archive-intro h1 {
    max-width: 850px;
    font-size: clamp(54px,7vw,88px);
    line-height: .99;
    letter-spacing: -.055em;
    font-weight: 900;
    margin: 0;
}

.archive-intro h1 .accent {
    letter-spacing: 0;
}

.archive-intro-lead {
    font-size: 18px;
    line-height: 1.6;
    color: var(--muted);
    max-width: 610px;
    margin: 24px 0 0;
}

.archive-content {
    padding: 42px 0 110px;
}

.archive-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 24px;
    border-bottom: 1px solid #d9dcd7;
    padding-bottom: 24px;
    margin-bottom: 34px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-button {
    appearance: none;
    border: 1px solid #cdd1cc;
    background: transparent;
    color: var(--ink);
    font: 600 13px 'Archivo',Arial,sans-serif;
    padding: 11px 15px;
    border-radius: 0;
    cursor: pointer;
    transition: background .15s,border-color .15s,color .15s;
}

.filter-button:hover {
    border-color: var(--ink);
}

.filter-button[aria-pressed="true"] {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.archive-search {
    display: block;
    min-width: 250px;
    width: clamp(240px,25vw,310px);
}

.archive-search span {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .09em;
    margin-bottom: 9px;
}

.archive-search input {
    width: 100%;
    min-height: 44px;
    background: transparent;
    color: var(--ink);
    border: 1px solid #aeb6b2;
    padding: 10px 14px;
    font: 500 14px 'Archivo',Arial,sans-serif;
    border-radius: 0;
}

.archive-search input::placeholder {
    color: #758188;
}

.archive-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 23px;
}

.archive-count {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.archive-grid {
    row-gap: 56px;
}

.archive-card {
    position: relative;
}

.archive-card .article-card-image,
.archive-card .article-cover {
    aspect-ratio: 8/5;
}

.article-cover {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px 27px;
    min-height: 0;
    background: var(--ink);
    color: var(--paper);
    overflow: hidden;
}

.article-cover--red {
    background: var(--accent);
}

.article-cover--light {
    background: #dce0da;
    color: var(--ink);
}

.article-cover--slate {
    background: #4e5c62;
}

.article-cover span {
    font-size: 11px;
    letter-spacing: .13em;
    font-weight: 800;
}

.article-cover strong {
    font-size: clamp(20px,2.1vw,32px);
    font-weight: 900;
    line-height: 1.03;
    letter-spacing: -.025em;
}

.archive-card .article-card-category {
    margin-top: 3px;
}

.article-card-kicker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.article-card-date {
    font-size: 11px;
    color: var(--muted);
}

.article-card-link--inactive {
    color: var(--muted);
}

.sample-flag {
    font-size: 10px;
    letter-spacing: .08em;
    color: var(--muted);
    font-weight: 700;
    border: 1px solid #c8cec9;
    padding: 4px 6px;
}

.archive-card .article-card-image {
    object-fit: cover;
}

.archive-card h3 {
    min-height: 56px;
}

.archive-card .article-card-description {
    flex-grow: 1;
}

.article-card-link[href] {
    align-self: flex-start;
    text-decoration: none;
}

.article-card-link[href]:hover {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.empty-results {
    padding: 80px 20px;
    text-align: center;
    border: 1px dashed #b6c0b8;
}

.empty-results h2 {
    font-size: 28px;
    margin: 0 0 10px;
}

.empty-results p {
    color: var(--muted);
    margin: 0;
}

[hidden] {
    display: none !important;
}

/* Simple site footer. */
.site-footer {
    border-top: 1px solid #d9dcd7;
    padding: 36px 0 42px;
}

.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.footer-brand {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -.015em;
    text-decoration: none;
}

.site-footer p {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

/* Example individual review: a reusable article page, no framework or CMS. */
.story-intro {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1.08fr);
    gap: 60px;
    padding: 22px 0 60px;
    align-items: center;
}

.story-intro h1 {
    font-weight: 900;
    font-size: clamp(38px,4.1vw,58px);
    line-height: 1.03;
    letter-spacing: -.035em;
    margin: 20px 0 22px;
}

.story-intro p {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
    margin: 0 0 28px;
}

.story-photo {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 624 / 400;
    object-fit: cover;
}

.story-meta {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding-top: 19px;
    border-top: 1px solid #d9dcd7;
}

.story-body-layout {
    display: grid;
    grid-template-columns: minmax(0,1.6fr) minmax(260px,.9fr);
    gap: 86px;
    border-top: 1px solid #d9dcd7;
    padding: 55px 0 125px;
}

.story-prose {
    max-width: 690px;
}

.story-prose h2 {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -.025em;
    margin: 42px 0 17px;
}

.story-prose h2:first-child {
    margin-top: 0;
}

.story-prose p {
    color: var(--ink);
    font-size: 16px;
    line-height: 1.78;
    margin: 0 0 24px;
}

.story-prose img {
    display: block;
    width: 100%;
    height: auto;
    margin: 32px 0;
}

.story-side {
    background: #eef0eb;
    padding: 26px;
    align-self: start;
}

.story-side h2 {
    font-size: 13px;
    letter-spacing: .09em;
    color: var(--accent);
    margin: 0 0 25px;
}

.story-side dl {
    margin: 0;
}

.story-side dt {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    margin: 19px 0 6px;
}

.story-side dd {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #d1d7d2;
}

.draft-note {
    border-left: 4px solid var(--accent);
    background: #f1eae3;
    padding: 16px 18px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 33px;
}

@media (max-width:960px) {
    .archive-toolbar {
        align-items: stretch;
    }

    .archive-search {
        width: 100%;
    }

    .story-intro {
        gap: 28px;
    }

    .story-body-layout {
        gap: 30px;
    }
}

@media (max-width:640px) {
    .section-heading-row {
        flex-wrap: wrap;
        align-items: start;
    }

    .section-heading-row h2 {
        margin-bottom: 0;
    }

    .archive-intro {
        padding: 38px 0 45px;
    }

    .archive-intro h1 {
        font-size: clamp(48px,12vw,67px);
    }

    .archive-intro-lead {
        font-size: 16px;
    }

    .archive-content {
        padding: 30px 0 70px;
    }

    .filter-button {
        font-size: 12px;
        padding: 9px 12px;
    }

    .archive-grid {
        row-gap: 44px;
    }

    .archive-card h3 {
        min-height: 0;
    }

    .article-cover strong {
        font-size: clamp(25px,6vw,33px);
    }

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

    .story-intro {
        grid-template-columns: 1fr;
        padding-top: 0;
    }

    .story-body-layout {
        grid-template-columns: 1fr;
        padding-top: 30px;
    }
}
