/* Base styles */
html,
body,
.govuk-template,
.govuk-template__body {
    background-color: white !important;
}

/* Post title spacing */
.govuk-heading-xl {
    margin-bottom: 20px !important;
}

/* Header */
.custom-header {
    background-color: #1d70b8; 
    padding-top: 5px;
    padding-bottom: 20px;
}

.custom-header .govuk-header__container {
    border-bottom: none;
    padding-bottom: 0;
}

.custom-header .govuk-header__logotype-text {
    color: white;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

@media (min-width: 40.0625em) {
    .custom-header .govuk-header__logotype-text {
        font-size: 30px;
    }
}

.custom-header .govuk-header__logo {
    margin-bottom: 0;
}

.header-content {
    padding-top: 40px;
    padding-bottom: 0;
}

.header-content .govuk-heading-l {
    font-size: 24px;
    margin-bottom: 3px;
}

.header-content .govuk-body-l {
    font-size: 24px;
    font-weight: 400;
}

@media (min-width: 40.0625em) {
    .header-content {
        padding-top: 52.5px;
        padding-bottom: 0;
    }

    .header-content .govuk-heading-l {
        font-size: 36px;
    }

    .header-content .govuk-body-l {
        font-size: 36px;
    }
}

.weeknote-meta {
    color: #505a5f;
    font-size: 16px;
    margin-bottom: 10px;
}

.weeknote-meta time {
    font-family: "GDS Transport", arial, sans-serif;
}

/* Author pill styling */
.author-pills {
    margin-top: 10px;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.author-pills--inline {
    display: inline-flex;
    margin: 0;
    vertical-align: middle;
}

.author-pill {
    display: inline-block;
    font-family: "GDS Transport", arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    color: #505a5f;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

@media (min-width: 40.0625em) {
    .author-pill {
        font-size: 16px;
        padding: 0;
        border-radius: 0;
    }
}

.author-pill--small {
    padding: 0;
    border-radius: 0;
}

@media (min-width: 40.0625em) {
    .author-pill--small {
        padding: 0;
        border-radius: 0;
    }
}

/* Post meta styling for homepage */
.post-meta {
    font-family: "GDS Transport", arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #505a5f;
    margin-top: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

@media (min-width: 40.0625em) {
    .post-meta {
        font-size: 16px;
    }
}

.post-meta time {
    white-space: nowrap;
}

.meta-separator {
    color: #b1b4b6;
    font-weight: 400;
}

/* Weeknote cards */
.weeknote-card {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.weeknote-card::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 6px;
    width: 14px;
    height: 14px;
    background-color: #00ffe0;
    border-radius: 50%;
}

@media (min-width: 40.0625em) {
    .weeknote-card::before {
        left: -28px;
        top: 8px;
        width: 18px;
        height: 18px;
    }
}

.weeknote-card .weeknote-meta {
    display: none;
}

.weeknote-card h2 {
    display: inline;
    margin-bottom: 0;
    line-height: 1.4;
}

.weeknote-card .govuk-link {
    font-weight: 700;
    line-height: 1.4;
}

.weeknote-card .govuk-link::after {
    content: ".";
}

.weeknote-card p {
    display: inline;
    font-size: 18px;
    line-height: 1.4;
}

@media (min-width: 40.0625em) {
    .weeknote-card p {
        font-size: 24px;
    }
}

/* Dividers and footer */
.content-divider {
    border-top: 4px solid #1d70b8;
    margin: 30px 0;
}

@media (min-width: 40.0625em) {
    .content-divider {
        margin: 40px 0;
    }
}

.footer-section {
    font-size: 18px;
}

@media (min-width: 40.0625em) {
    .footer-section {
        font-size: 22px;
    }
}

/* Typography overrides */
.govuk-body {
    font-size: 16px;
}

.govuk-body-l {
    font-size: 18px;
}

@media (min-width: 40.0625em) {
    .govuk-body {
        font-size: 19px;
    }

    .govuk-body-l {
        font-size: 19px;
    }
}

.weeknote-content {
    font-size: 16px;
    line-height: 1.6;
}

@media (min-width: 40.0625em) {
    .weeknote-content {
        font-size: 19px;
    }
}

/* Apply GOV.UK body styles to paragraphs */
.weeknote-content p {
    font-family: "GDS Transport", arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.25;
    color: #0b0c0c;
    margin-top: 0;
    margin-bottom: 20px;
}

@media (min-width: 40.0625em) {
    .weeknote-content p {
        font-size: 19px;
        line-height: 1.31579;
        margin-bottom: 20px;
    }
}

/* Apply GOV.UK heading styles */
.weeknote-content h2 {
    font-family: "GDS Transport", arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 700;
    font-size: 18px;
    line-height: 1.11111;
    color: #0b0c0c;
    margin-top: 0;
    margin-bottom: 20px;
}

@media (min-width: 40.0625em) {
    .weeknote-content h2 {
        font-size: 24px;
        line-height: 1.25;
        margin-bottom: 20px;
    }
}

/* Apply GOV.UK list styles */
.weeknote-content ul,
.weeknote-content ol {
    font-family: "GDS Transport", arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.25;
    color: #0b0c0c;
    margin-top: 0;
    margin-bottom: 20px;
    padding-left: 0;
    list-style-type: none;
}

@media (min-width: 40.0625em) {
    .weeknote-content ul,
    .weeknote-content ol {
        font-size: 19px;
        line-height: 1.31579;
        margin-bottom: 20px;
    }
}

.weeknote-content ul li,
.weeknote-content ol li {
    margin-bottom: 5px;
}

.weeknote-content ul li:before {
    content: "—";
    position: relative;
    left: 0;
    width: 20px;
    padding-right: 10px;
}

.weeknote-content ol {
    counter-reset: list-counter;
}

.weeknote-content ol li {
    counter-increment: list-counter;
}

.weeknote-content ol li:before {
    content: counter(list-counter) ". ";
    font-weight: 700;
    padding-right: 10px;
}

/* Apply GOV.UK link styles */
.weeknote-content a {
    font-family: "GDS Transport", arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-decoration: underline;
    color: #1d70b8;
}

.weeknote-content a:visited {
    color: #4c2c92;
}

.weeknote-content a:hover {
    color: #003078;
}

.weeknote-content a:active {
    color: #0b0c0c;
}

.weeknote-content a:focus {
    outline: 3px solid #ffdd00;
    outline-offset: 0;
    background-color: #ffdd00;
    color: #0b0c0c;
    text-decoration: none;
}

.weeknote-content figure {
    margin: 0;
    margin-bottom: 30px;
}

.weeknote-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid #b1b4b6;
}

.weeknote-content figcaption,
.weeknote-content .caption-style {
    font-size: 16px;
    color: #505a5f;
    margin-top: 10px;
    margin-bottom: 0;
    font-family: "GDS Transport", arial, sans-serif;
}

/* Archive page styles */
.archive-link {
    margin-top: 30px;
    font-size: 19px;
}

@media (min-width: 40.0625em) {
    .archive-link {
        margin-top: 40px;
    }
}

.archive-list {
    margin-top: 30px;
}

/* Sidebar styles for post pages */
/* Ensure grid row allows sticky positioning */
.govuk-main-wrapper .govuk-grid-row {
    align-items: flex-start;
}

.post-sidebar {
    padding: 20px;
    background-color: #f3f2f1;
    margin-top: 0;
}

@media (min-width: 40.0625em) {
    .post-sidebar {
        padding: 30px;
    }

    .sticky-sidebar {
        position: -webkit-sticky;
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }
}

.post-sidebar .govuk-heading-s {
    margin-top: 0;
    margin-bottom: 10px;
}

.post-sidebar .govuk-heading-s:not(:first-child) {
    margin-top: 20px;
}

.post-sidebar .govuk-body-s {
    margin-bottom: 0;
}

.post-sidebar .govuk-body-s:not(:last-child) {
    margin-bottom: 15px;
}
