/* Palette from the brief. The exact brand colours are used for surfaces, ribbons and borders; wherever text sits on
   or in them we use a deeper shade of the same colour, so it stays readable (WCAG AA, 4.5:1) for tired eyes on phones. */
:root {
    --ivory: #F5F2E8;          /* background, and reverse text on buttons */
    --blush: #DFC1B2;          /* ribbons & headlines */
    --terracotta: #C17B68;     /* secondary button / ribbon */
    --sage: #A1A28E;           /* "text colour" in the brief - too light for body text, used for borders & accents */
    --olive: #777E74;          /* CTA button */

    --text: #403F37;           /* body text - the deck's own label colour, 9.5:1 on ivory */
    --heading: #4F554C;        /* deeper olive, 6.9:1 */
    --cta: #5E655B;            /* olive, deepened for 5.4:1 with ivory text */
    --cta-hover: #4F554C;
    --secondary: #9E5A49;      /* terracotta, deepened for 4.7:1 with ivory text */
    --secondary-hover: #874B3C;
    --muted: #5E655B;

    --surface: #FBF9F3;
    --sage-tint: #E5E5DA;
    --blush-tint: #F0DFD5;
    --rule: #DAD6C8;

    --serif: 'Lora', Georgia, 'Times New Roman', serif;
    --sans: 'Inter', Arial, sans-serif;
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--ivory);
    color: var(--text);
    font-family: var(--sans);
    font-size: 18px;
    line-height: 1.65;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--secondary);
    text-underline-offset: 3px;
}

a:hover {
    color: var(--secondary-hover);
}

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

h1, h2, h3 {
    font-family: var(--serif);
    font-weight: 600;
    color: var(--heading);
    line-height: 1.25;
    text-wrap: balance;
}

h1 {
    font-size: clamp(2rem, 4.5vw, 2.9rem);
    margin: 0 0 16px;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    margin: 0 0 12px;
}

p {
    margin: 0 0 1em;
}

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding-top: 56px;
    padding-bottom: 56px;
}

.section--narrow {
    max-width: 800px;
}

.section__intro,
.lede {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 62ch;
}

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

.small {
    font-size: 0.875rem;
}

.visually-hidden,
.honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    padding: 10px 16px;
    background: var(--cta);
    color: var(--ivory);
    border-radius: 8px;
    z-index: 10;
}

.skip-link:focus {
    top: 12px;
}

.icon {
    flex: none;
    width: 1.5em;
    height: 1.5em;
}

/* ribbon / headline label - blush with olive slate text, as in the brief */
.ribbon {
    display: inline-block;
    margin: 0 0 16px;
    padding: 4px 14px;
    background: var(--blush);
    color: var(--text);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* buttons - simple sans serif, medium weight */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 24px;
    border: 0;
    border-radius: 999px;
    background: var(--cta);
    color: var(--ivory);
    font: 500 1rem/1.2 var(--sans);
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    background: var(--cta-hover);
    color: var(--ivory);
}

.button--secondary {
    background: var(--secondary);
}

.button--secondary:hover {
    background: var(--secondary-hover);
}

.button .icon {
    width: 1.2em;
    height: 1.2em;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

/* header */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
}

.site-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 24px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.wordmark {
    display: flex;
    flex-direction: column;
    margin: 0;
    font-family: var(--serif);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--heading);
    text-decoration: none;
}

.wordmark span {
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.04em;
}

.wordmark:hover {
    color: var(--heading);
}

.menu {
    margin-left: auto;
}

.menu summary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 18px;
    border: 1px solid var(--sage);
    border-radius: 999px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}

.menu summary::-webkit-details-marker {
    display: none;
}

.menu nav {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 16px;
    right: 16px;
    margin-top: 10px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: 0 12px 30px rgba(64, 63, 55, 0.12);
    z-index: 5;
}

.menu nav a {
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
}

.menu nav a:hover {
    background: var(--sage-tint);
}

.menu nav .nav-faq,
.primary-nav .nav-faq {
    color: var(--secondary);
}

.primary-nav {
    display: none;
}

.header-search {
    display: flex;
    flex: 1 1 100%;
    border: 1px solid var(--sage);
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.header-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 18px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
}

.header-search button {
    display: flex;
    align-items: center;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--heading);
    cursor: pointer;
}

@media (min-width: 960px) {
    .menu {
        display: none;
    }

    /* the menu is generated from the topics, so give it its own row rather than squeezing it beside the logo */
    .primary-nav {
        display: flex;
        flex-wrap: wrap;
        flex-basis: 100%;
        order: 3;
        gap: 2px;
        margin: 0 -10px;
    }

    .primary-nav a {
        padding: 8px 10px;
        border-radius: 8px;
        color: var(--text);
        font-size: 0.95rem;
        font-weight: 500;
        text-decoration: none;
        white-space: nowrap;
    }

    .primary-nav a:hover,
    .primary-nav a[aria-current] {
        background: var(--sage-tint);
    }

    .header-search {
        order: 2;
        flex: 0 1 220px;
        margin-left: auto;
    }
}

/* hero */
.hero {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
}

.hero__inner {
    display: grid;
    gap: 32px;
    padding-top: 48px;
    padding-bottom: 48px;
    align-items: center;
}

.hero__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 24px 24px 120px 24px;
}

@media (min-width: 860px) {
    .hero__inner {
        grid-template-columns: 1.1fr 1fr;
        gap: 56px;
        padding-top: 72px;
        padding-bottom: 72px;
    }
}

/* search */
.search {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 16px;
    max-width: 680px;
}

.search input {
    flex: 1 1 260px;
    min-height: 52px;
    padding: 12px 20px;
    border: 1px solid var(--sage);
    border-radius: 999px;
    background: #fff;
    font: inherit;
    color: var(--text);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 32px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 16px;
    border: 1px solid var(--sage);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
}

.chip:hover {
    background: var(--sage-tint);
    color: var(--text);
}

.chip--active {
    background: var(--cta);
    border-color: var(--cta);
    color: var(--ivory);
}

.chip--active:hover {
    background: var(--cta-hover);
    color: var(--ivory);
}

/* topic cards - numbered, alternating sage and blush, as in the example nav */
.topic-grid {
    display: grid;
    gap: 14px;
}

@media (min-width: 720px) {
    .topic-grid {
        grid-template-columns: 1fr 1fr;
    }

    .topic-card--wide {
        grid-column: 1 / -1;
    }
}

.topic-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 24px;
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.topic-card:hover {
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(64, 63, 55, 0.1);
}

.topic-card .icon {
    color: var(--heading);
    margin-bottom: 6px;
}

.topic-card--sage {
    background: var(--sage-tint);
}

.topic-card--blush {
    background: var(--blush-tint);
}

.topic-card--wide {
    background: var(--cta);
    color: var(--ivory);
}

.topic-card--wide:hover,
.topic-card--wide .icon {
    color: var(--ivory);
}

.topic-card__title {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
}

.topic-card__summary {
    font-size: 0.98rem;
}

/* why I created this */
.why {
    background: var(--surface);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}

.why__inner {
    display: grid;
    gap: 32px;
    padding-top: 56px;
    padding-bottom: 56px;
}

.why__image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 24px 120px 24px 24px;
}

@media (min-width: 860px) {
    .why__inner {
        grid-template-columns: 1fr 1.25fr;
        gap: 56px;
        align-items: start;
    }

    .why__image {
        position: sticky;
        top: 24px;
        aspect-ratio: 4 / 5;
    }
}

.prose {
    max-width: 68ch;
}

.prose .aside {
    padding: 14px 18px;
    background: var(--blush-tint);
    border-radius: 10px;
    font-style: italic;
}

/* "a little note" disclaimer */
.note {
    margin: 32px 0;
    padding: 24px 28px;
    background: var(--blush-tint);
    border-radius: var(--radius);
}

.note h2 {
    font-size: 1.3rem;
}

.note p {
    font-size: 0.98rem;
}

.note p:last-child {
    margin-bottom: 0;
    font-weight: 600;
}

/* FAQs - click to expand */
.faq {
    border-bottom: 1px solid var(--rule);
}

.faq:first-of-type {
    border-top: 1px solid var(--rule);
}

.faq summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 4px;
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--heading);
    cursor: pointer;
    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq__question {
    flex: 1;
    min-width: 0;
}

.faq summary::after {
    content: '+';
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sage-tint);
    font-family: var(--sans);
    font-size: 1.3rem;
    font-weight: 400;
}

.faq[open] summary::after {
    content: '\2212';
}

.faq__answer {
    padding: 0 4px 12px;
}

/* feedback form */
.feedback {
    margin-top: 48px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.feedback label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.feedback textarea {
    width: 100%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--sage);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    color: var(--text);
}

.feedback__thanks {
    margin: 0;
    font-weight: 600;
}

.error {
    color: var(--secondary);
    font-weight: 600;
}

/* library & articles */
.results-summary {
    font-weight: 500;
}

.library-section {
    margin-top: 40px;
}

.with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-grid {
    display: grid;
    gap: 12px;
}

@media (min-width: 720px) {
    .article-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

.article-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
}

.article-card:hover {
    color: var(--text);
    border-color: var(--sage);
    background: #fff;
}

.article-card__title {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading);
}

.article-card__summary {
    font-size: 0.95rem;
    color: var(--muted);
}

.article-card__snippet {
    margin-top: 4px;
    font-size: 0.9rem;
    font-style: italic;
}

/* search matches, highlighted in the results */
mark {
    padding: 0 2px;
    background: var(--blush);
    color: var(--text);
    border-radius: 3px;
}

.empty {
    margin-top: 32px;
    padding: 28px;
    background: var(--surface);
    border-radius: var(--radius);
}

.breadcrumbs {
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.breadcrumbs span {
    margin: 0 6px;
    color: var(--sage);
}

.article__header {
    display: grid;
    gap: 28px;
    margin-bottom: 32px;
}

.article__image {
    width: 100%;
    max-height: 340px;
    object-fit: cover;
    border-radius: 24px 24px 80px 24px;
}

@media (min-width: 860px) {
    .article__header {
        grid-template-columns: 1.4fr 1fr;
        align-items: center;
        gap: 48px;
    }
}

.article__body,
.article__section {
    max-width: 760px;
}

.article__section {
    margin-top: 48px;
}

.coming-soon {
    padding: 18px 22px;
    background: var(--sage-tint);
    border-radius: 10px;
}

.coming-soon > :last-child {
    margin-bottom: 0;
}

/* the FAQs page - every question, under its topic and subtopic */
.faqs {
    margin-top: 48px;
}

.faq-subtopic {
    margin: 28px 0 8px;
    font-size: 1.1rem;
}

.faq-subtopic a {
    color: var(--heading);
}

.links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.links li {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
}

.links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.links .icon {
    width: 1em;
    height: 1em;
}

.links .muted {
    display: block;
    font-size: 0.875rem;
}

/* printable diary */
.diary__sheet {
    margin-top: 40px;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow-x: auto;
}

.diary__sheet-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px 24px;
}

.fill-line {
    display: inline-block;
    width: 180px;
    border-bottom: 1px solid var(--text);
}

.diary__table {
    width: 100%;
    min-width: 720px;
    margin-bottom: 16px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.diary__table th {
    padding: 10px;
    background: var(--sage-tint);
    border: 1px solid var(--sage);
    text-align: left;
    vertical-align: top;
}

.diary__table th span {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--muted);
}

.diary__table td {
    height: 46px;
    border: 1px solid var(--sage);
}

/* footer */
.site-footer {
    margin-top: 40px;
    padding: 48px 0 32px;
    background: var(--sage-tint);
}

.urgent {
    margin-bottom: 36px;
    padding: 22px 26px;
    background: var(--surface);
    border-radius: var(--radius);
}

.urgent h2 {
    font-size: 1.25rem;
}

.urgent p {
    margin: 0;
}

.site-footer__cols {
    display: grid;
    gap: 24px;
    margin-bottom: 24px;
}

.site-footer nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-footer nav a {
    color: var(--text);
}

.wordmark--footer {
    margin-bottom: 6px;
}

@media (min-width: 720px) {
    .site-footer__cols {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topic-card {
        transition: none;
    }

    .topic-card:hover {
        transform: none;
    }
}

@media print {
    @page {
        size: A4 landscape;
        margin: 12mm;
    }

    body {
        background: #fff;
        font-size: 11pt;
    }

    .site-header,
    .site-footer,
    .skip-link,
    .no-print {
        display: none;
    }

    .section {
        padding: 0;
    }

    .diary__sheet {
        margin: 0;
        padding: 0;
        border: 0;
        overflow: visible;
    }

    .diary__table {
        min-width: 0;
    }

    .diary__table td {
        height: 34px;
    }
}
