/* ---------------------------------------------------------------------------
   BIGGS blog theme.

   Two jobs:

   1. Brand tokens. The Bootstrapmade "Yummy" blog template shipped with a pink
      accent (#ee4266) that had nothing to do with BIGGS — it was why category
      tags rendered magenta. Those 23 usages now read var(--biggs-red), defined
      below, so the palette lives in one place. The values are lifted from the
      site's own CSS: the red/gold/cyan stripe set and the navy footer in
      assets/css/main.css.

   2. Styles for the elements added during the SEO work — breadcrumbs, the hook
      paragraph, the CTA block, the author box, internal links, the category
      nav. These were emitted with class names that had no CSS behind them.

   Kept out of assets/blog/css/style.css so a template change can't drop them.
   --------------------------------------------------------------------------- */

:root {
    /* Straight from the BIGGS stripe bar and footer in main.css. */
    --biggs-red: #be2230;
    --biggs-red-dark: #9c1a26;
    --biggs-gold: #f8bd17;
    --biggs-cyan: #27a5df;
    --biggs-navy: #0c0942;

    --biggs-ink: #212529;
    --biggs-muted: #6c757d;
    --biggs-line: #e6e6e6;
    --biggs-wash: #f7f7f9;
}

/* --- Brand furniture ------------------------------------------------------ */

/* The three-colour stripe is the BIGGS signature; reusing it under section
   headings ties the blog to the rest of the site without new invention. */
.biggs-stripe-rule {
    display: flex;
    height: 4px;
    width: 64px;
    overflow: hidden;
    border-radius: 2px;
    margin-top: 0.5rem;
}

.biggs-stripe-rule span { flex: 1; }
.biggs-stripe-rule span:nth-child(1) { background: var(--biggs-red); }
.biggs-stripe-rule span:nth-child(2) { background: var(--biggs-gold); }
.biggs-stripe-rule span:nth-child(3) { background: var(--biggs-cyan); }

/* The template's section headings are plain text; give them the brand rule and
   consistent weight so the page has a visible rhythm. */
.section-title .title {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --- Category navigation -------------------------------------------------- */

/*
 * A visitor landing on a post had no way to reach a topic other than the
 * sidebar list, which sits below the fold on mobile. This bar is rendered
 * server-side on the index, post and category pages, so it is crawlable as
 * well as usable.
 */
.blog-topic-nav {
    border-bottom: 1px solid var(--biggs-line);
    margin-bottom: 1.5rem;
}

.blog-topic-nav ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0 0 0.75rem;
    list-style: none;
    /* Horizontal scroll rather than wrapping: keeps the bar one line tall on a
       phone instead of eating a third of the screen. */
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.blog-topic-nav li { flex: 0 0 auto; }

.blog-topic-nav a {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--biggs-line);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--biggs-ink);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.blog-topic-nav a:hover,
.blog-topic-nav a:focus-visible {
    background: var(--biggs-wash);
    border-color: var(--biggs-red);
    color: var(--biggs-red);
}

.blog-topic-nav a[aria-current="page"],
.blog-topic-nav a.is-active {
    background: var(--biggs-red);
    border-color: var(--biggs-red);
    color: #fff;
}

.blog-topic-nav .topic-count {
    opacity: 0.65;
    font-weight: 500;
    margin-left: 0.3rem;
}

/* --- Breadcrumbs ---------------------------------------------------------- */

.blog-breadcrumb {
    margin-bottom: 1.25rem;
}

.blog-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.4;
}

.blog-breadcrumb li {
    display: flex;
    align-items: center;
    color: var(--biggs-muted);
}

/* Separator on every crumb but the first, so no trailing slash. */
.blog-breadcrumb li + li::before {
    content: "/";
    margin-right: 0.5rem;
    color: #d0d0d0;
    font-weight: 400;
}

.blog-breadcrumb a {
    color: var(--biggs-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.blog-breadcrumb a:hover,
.blog-breadcrumb a:focus-visible {
    color: #111;
    text-decoration: underline;
}

/* The current page is the post title, which can be long — keep it on one line
   so a 12-word headline can't push the trail into a vertical stack. */
.blog-breadcrumb li[aria-current="page"] {
    color: #222;
    font-weight: 700;
    max-width: 32ch;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .blog-breadcrumb li[aria-current="page"] {
        max-width: 18ch;
    }
}

/* --- Post intro ----------------------------------------------------------- */

.post-hook {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #333;
}

.post-hook p:last-child {
    margin-bottom: 0;
}

/* --- Call to action ------------------------------------------------------- */

.blog-cta {
    background: var(--biggs-wash);
    border-left: 4px solid var(--biggs-red);
    padding: 1.5rem;
    border-radius: 6px;
}

.blog-cta p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.blog-cta p:last-child {
    margin-bottom: 0;
}

/* --- Author box ----------------------------------------------------------- */

.blog-author {
    background: var(--biggs-wash);
    padding: 1.5rem;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.blog-author img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
}

.blog-author h3 {
    margin-bottom: 0.25rem;
}

.blog-author p {
    color: #555;
    margin-bottom: 0.5rem;
}

.blog-author a {
    color: #666;
    font-size: 1rem;
}

.blog-author a:hover {
    color: var(--biggs-red);
}

@media (max-width: 575.98px) {
    .blog-author {
        flex-direction: column;
    }
}

/* --- Body sections (the editorial brief's structure) ---------------------- */

.post-section > h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-section p:last-child {
    margin-bottom: 0;
}

/* --- Internal links ------------------------------------------------------- */

.blog-internal-links {
    border-top: 1px solid var(--biggs-line);
    border-bottom: 1px solid var(--biggs-line);
    padding: 1.25rem 0;
}

.blog-internal-links h2 {
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.95rem;
    color: #666;
}

.blog-internal-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-internal-links li {
    position: relative;
}

.blog-internal-links a {
    color: var(--biggs-red);
    font-weight: 600;
    text-decoration: none;
}

.blog-internal-links a:hover,
.blog-internal-links a:focus-visible {
    text-decoration: underline;
}

/* --- Category intro copy -------------------------------------------------- */

.category-intro {
    max-width: 70ch;
    color: #444;
    line-height: 1.65;
}

.category-intro p:last-child {
    margin-bottom: 0;
}

/* --- Image captions ------------------------------------------------------- */

.image-upload-box figcaption {
    color: var(--biggs-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* --- Article typography --------------------------------------------------- */

/*
 * The template styles cards well but leaves body copy at default metrics, which
 * reads as a wall of text at desktop widths. A measure limit and looser leading
 * are the two changes that matter most for readability.
 */
.post-section,
.post-hook {
    max-width: 68ch;
}

.post-section p,
.post-hook p {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: #33373b;
}

.post-section ul,
.post-section ol {
    line-height: 1.75;
    padding-left: 1.25rem;
}

.post-section blockquote,
article blockquote.blockquote {
    border-left: 4px solid var(--biggs-gold);
    background: var(--biggs-wash);
    padding: 1rem 1.25rem;
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.6;
    font-style: italic;
    color: #2b2f33;
}

/* Post meta: byline, date, reading time. */
article .post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1.25rem;
    font-size: 0.82rem;
    color: var(--biggs-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

article .post-meta li { position: relative; }

/* --- Post cards ----------------------------------------------------------- */

/*
 * Card images arrived at whatever aspect ratio the upload happened to be, so a
 * grid of three posts had three different heights. A fixed ratio with
 * object-fit keeps rows aligned without cropping decisions in the admin.
 */
.post .post-img {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    background: #ececec;
}

.post .post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.post:hover .post-img img {
    transform: scale(1.04);
}

.post.post-sm .post-img,
.post.post-row .post-img {
    aspect-ratio: 16 / 10;
    max-height: none !important;
}

.post.post-widget .post-img {
    aspect-ratio: 4 / 3;
    max-height: none !important;
}

.post .post-title a {
    color: var(--biggs-ink);
    text-decoration: none;
}

.post .post-title a:hover {
    color: var(--biggs-red);
}

/* Category label on a card. */
.post .post-category a {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--biggs-red);
    text-decoration: none;
}

.post .post-category a:hover { text-decoration: underline; }

/* The template caps .post-body height and scrolls it, which hides card text
   behind an inner scrollbar. Let cards size to their content instead. */
.post .post-body {
    max-height: none !important;
    overflow: visible !important;
    padding-top: 0.75rem;
}

/* --- Prev / next ---------------------------------------------------------- */

.post-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    border-top: 1px solid var(--biggs-line);
    border-bottom: 1px solid var(--biggs-line);
    padding: 1.25rem 0;
}

.post-nav .prev-post,
.post-nav .next-post {
    flex: 1 1 240px;
    min-width: 0;
}

.post-nav .next-post { text-align: right; }

.post-nav .post-img {
    aspect-ratio: 16 / 9;
    max-height: none !important;
    margin-bottom: 0.5rem;
}

.post-nav .post-title {
    font-size: 1rem;
    line-height: 1.35;
    margin: 0 0 0.2rem;
}

.post-nav span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--biggs-muted);
}

/* --- Sidebar widgets ------------------------------------------------------ */

.aside-widget {
    margin-bottom: 2rem;
}

.category-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-widget li + li {
    border-top: 1px solid var(--biggs-line);
}

.category-widget a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    color: var(--biggs-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.category-widget a:hover { color: var(--biggs-red); }

.category-widget a span {
    background: var(--biggs-wash);
    border-radius: 999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--biggs-muted);
}

/* --- Share buttons -------------------------------------------------------- */

.post-share {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-share a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
}

/* --- Back to blog --------------------------------------------------------- */

.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--biggs-muted);
    text-decoration: none;
}

.blog-back-link:hover { color: var(--biggs-red); }

/* --- Pagination ----------------------------------------------------------- */

.pagination .page-link {
    color: var(--biggs-ink);
    border-color: var(--biggs-line);
    font-weight: 600;
}

.pagination .page-link:hover {
    background: var(--biggs-wash);
    color: var(--biggs-red);
    border-color: var(--biggs-red);
}

.pagination .page-item.active .page-link {
    background: var(--biggs-red);
    border-color: var(--biggs-red);
    color: #fff;
}

/* --- Category page header ------------------------------------------------- */

.page-header {
    position: relative;
    background: var(--biggs-navy);
}

.page-header-overlay {
    position: absolute;
    inset: 0;
    /* Navy wash rather than flat black: the header image is usually a food photo
       and plain black drains it. */
    background: linear-gradient(180deg, rgba(12, 9, 66, 0.55), rgba(12, 9, 66, 0.8));
}

.page-header .container { position: relative; z-index: 1; }

.page-header h1 {
    color: #fff;
}

.page-header p { color: rgba(255, 255, 255, 0.8); }

/* --- Focus visibility ----------------------------------------------------- */

/* The template removes focus outlines in places; keyboard users need them back. */
.blog-topic-nav a:focus-visible,
.blog-breadcrumb a:focus-visible,
.post .post-title a:focus-visible,
.blog-internal-links a:focus-visible,
.category-widget a:focus-visible {
    outline: 2px solid var(--biggs-cyan);
    outline-offset: 2px;
}
