/* ============================================================
   Cooking & Food group — shared styles for the cooking tools.
   Loaded after main.css on every cooking page.
   Class prefix: cook-
   ============================================================ */

/* Page title. main.css leaves .section-title at 22px in the link blue, which reads
   as an accent rather than a heading. The group styles (cycling, health) override it
   to a large dark title; cooking follows that so the five pages look like one product. */
.cook-page .section-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #101c30;
    gap: 12px;
    margin-bottom: 10px;
}

.cook-page .section-title svg {
    width: 22px;
    height: 22px;
    padding: 8px;
    box-sizing: content-box;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #4a9df8, #1a73e8);
    flex: none;
}

.cook-page .section-subtitle {
    font-size: 15px;
    color: #4a5568;
    line-height: 1.6;
    margin: 0 0 22px;
    max-width: 70ch;
}

.cook-panel {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 26px;
}

.cook-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px 16px;
}

.cook-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cook-field label,
.cook-field .cook-label {
    font-size: 13px;
    font-weight: 600;
    color: #3c4043;
}

.cook-field input[type="number"],
.cook-field input[type="text"],
.cook-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    /* 16px is the floor for iOS Safari - anything smaller makes the page zoom on
       focus, which then never zooms back out. */
    font-size: 16px;
    color: #202124;
    background: #fff;
    font-family: inherit;
    line-height: 1.4;
    min-height: 44px;
}

.cook-field input[type="number"]:focus,
.cook-field input[type="text"]:focus,
.cook-field select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

/* Segmented radio control (shape pickers, mode switches) */
.cook-segment {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cook-segment label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    min-height: 40px;
    box-sizing: border-box;
    border: 1px solid #e3e6ea;
    border-radius: 999px;
    background: #f8f9fa;
    color: #555;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
    line-height: 1.3;
}

.cook-segment label:hover {
    border-color: #1a73e8;
    color: #1a73e8;
}

.cook-segment input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cook-segment input[type="radio"]:focus-visible + span {
    outline: 2px solid #1a73e8;
    outline-offset: 3px;
    border-radius: 4px;
}

.cook-segment input[type="radio"]:checked + span {
    color: inherit;
}

.cook-segment label:has(input[type="radio"]:checked) {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

/* Results */
.cook-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.cook-result-card {
    background: #f8fafc;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
}

.cook-result-card.is-primary {
    background: #eef4ff;
    border-color: #c7dbff;
    box-shadow: 0 2px 12px rgba(26, 115, 232, 0.08);
}

/* The primary figure is the answer; the other cards are context. Without the size
   jump they all read as one row of equal numbers. */
.cook-result-card.is-primary .cook-result-value {
    font-size: 32px;
}

.cook-result-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #5f6368;
    margin-bottom: 6px;
}

.cook-result-value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: #1a2a6c;
    line-height: 1.15;
    word-break: break-word;
}

/* The dough type is a word in a badge, not a figure: at the 26px result scale the
   badge reads like a headline. The compound selector keeps it winning over the
   mobile font-size override further down this file. */
.cook-result-value.cook-result-value--text {
    font-size: 17px;
    line-height: 1.35;
}

.cook-result-sub {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #5f6368;
}

.cook-result-value .cook-approx {
    font-size: 16px;
    font-weight: 600;
    color: #5f6368;
    margin-right: 2px;
}

.cook-copy {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 14px;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid #c7dbff;
    border-radius: 999px;
    background: #fff;
    color: #1a73e8;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.cook-copy:hover {
    background: #eef4ff;
    border-color: #1a73e8;
}

.cook-copy[aria-pressed="true"] {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

/* Coffee ratio: the brewing presets are toggles, not actions, so they get their own
   class instead of borrowing the copy button's block layout. */
.coffee-presets {
    margin-top: 10px;
}

.cook-preset {
    display: inline-block;
    padding: 8px 14px;
    min-height: 36px;
    box-sizing: border-box;
    border: 1px solid #c7dbff;
    border-radius: 999px;
    background: #fff;
    color: #1a73e8;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.cook-preset:hover {
    background: #eef4ff;
    border-color: #1a73e8;
}

.cook-preset[aria-pressed="true"] {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

/* Spacing that used to be inline on the coffee page: inline margins cannot be
   overridden by a media query, and they scattered the panel's rhythm. */
.coffee-mode-field {
    margin-bottom: 16px;
}

.coffee-ratio-field {
    margin-top: 16px;
}

/* Keyboard focus. Inputs and radios already get a ring; the buttons did not, so
   tabbing through the page was invisible past the last field. */
.cook-copy:focus-visible,
.cook-preset:focus-visible,
.cook-add:focus-visible,
.cook-remove:focus-visible,
.cook-related li a:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* Ingredient rows (recipe scaler) */
.cook-rows {
    margin-top: 18px;
}

.cook-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(70px, 0.7fr) minmax(90px, 0.9fr) 44px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.cook-row input,
.cook-row select {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 10px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: #202124;
    background: #fff;
    min-height: 44px;
}

.cook-row input:focus,
.cook-row select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.cook-row input:disabled {
    background: #f4f5f7;
    color: #9aa0a6;
}

.cook-remove {
    width: 44px;
    height: 44px;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    background: #fff;
    color: #a12626;
    font-size: 18px;
    line-height: 1;
    font-family: inherit;
    cursor: pointer;
}

.cook-remove:hover {
    background: #fdecec;
    border-color: #f3b7b7;
}

.cook-add {
    margin-top: 4px;
    padding: 10px 16px;
    min-height: 44px;
    border: 1px dashed #c7cdd4;
    border-radius: 8px;
    background: #fff;
    color: #1a73e8;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.cook-add:hover {
    border-color: #1a73e8;
    background: #f7fbff;
}

/* Scaled ingredient table */
.cook-scale-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 4px;
}

.cook-scale-table th,
.cook-scale-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eaeef2;
    text-align: left;
}

.cook-scale-table th {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #5f6368;
    background: #f8fafc;
}

.cook-scale-table td.is-num {
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

.cook-scale-table td.is-muted {
    color: #9aa0a6;
    font-size: 12.5px;
}

/* Range slider */
.cook-slider {
    width: 100%;
    margin: 12px 0 6px;
    accent-color: #1a73e8;
}

.cook-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    /* #9aa0a6 only reached 2.6:1 on white, which fails WCAG AA for the 11.5px
       slider end labels. #6b7280 keeps the quiet look at 4.8:1. */
    color: #6b7280;
}

/* Dough hydration: the tick labels are hydration percentages, so each one has to
   sit where that percentage of the flour weighs on the slider track. The shared
   .cook-ticks rule spaces them evenly, which put "80 %" at the far right of a
   range that only reaches 200 % hydration. JS writes the left offset from the
   current flour; the inline values in the markup match the default 500 g flour. */
#doughTicks {
    position: relative;
    display: block;
    height: 16px;
    margin-top: 6px;
}

#doughTicks span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* The author-level display:block above outranks the user agent rule for
   [hidden], so the hidden attribute has to be honoured explicitly. */
#doughTicks[hidden] {
    display: none;
}

.cook-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
    color: #3c4043;
    cursor: pointer;
}

.cook-check input {
    width: 16px;
    height: 16px;
    accent-color: #1a73e8;
}

/* Notes, warnings, errors */
.cook-note {
    margin: 16px 0 0;
    font-size: 13px;
    color: #5f6368;
    line-height: 1.55;
}

.cook-warn {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #f5d08a;
    background: #fff8e6;
    color: #7a4b00;
    font-size: 13px;
    line-height: 1.55;
}

.cook-errors {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #f3b7b7;
    background: #fdecec;
    color: #a12626;
    font-size: 13px;
    line-height: 1.55;
}

.cook-errors[hidden],
.cook-warn[hidden] {
    display: none;
}

/* Inline formula / table blocks */
.cook-formula {
    margin: 14px 0;
    padding: 12px 16px;
    background: #f6f8fa;
    border-left: 3px solid #1a73e8;
    border-radius: 6px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13.5px;
    color: #243b53;
    overflow-x: auto;
}

.cook-table-wrap {
    margin: 18px 0;
    overflow-x: auto;
}

.cook-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cook-table caption {
    text-align: left;
    font-size: 13px;
    color: #5f6368;
    padding-bottom: 8px;
}

.cook-table th,
.cook-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #eaeef2;
    text-align: left;
}

.cook-table th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #5f6368;
}

.cook-table tr.is-nearest td {
    background: #eef4ff;
    font-weight: 600;
}

.cook-table td.is-num {
    font-variant-numeric: tabular-nums;
}

/* Sections */
.cook-section {
    margin-bottom: 30px;
}

.cook-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1a2a6c;
    margin: 0 0 12px;
}

.cook-section h3 {
    font-size: 15px;
    font-weight: 600;
    color: #243b53;
    margin: 18px 0 6px;
}

.cook-section p {
    font-size: 14.5px;
    color: #3c4043;
    line-height: 1.65;
    margin: 0 0 12px;
}

.cook-example {
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
}

.cook-example h3 {
    margin: 0 0 6px;
    font-size: 14px;
    color: #1a2a6c;
}

.cook-example p {
    margin: 0;
    font-size: 13.5px;
    color: #3c4043;
}

/* Related tools */
.cook-related {
    margin-bottom: 26px;
}

.cook-related h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a2a6c;
    margin: 0 0 12px;
}

.cook-related ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
}

.cook-related li a {
    display: block;
    padding: 12px 14px;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #fff;
    color: #1a73e8;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cook-related li a:hover {
    border-color: #1a73e8;
    box-shadow: 0 2px 10px rgba(26, 115, 232, 0.12);
}

.cook-related li a .cook-related-sub {
    display: block;
    margin-top: 3px;
    font-size: 12.5px;
    font-weight: 400;
    color: #5f6368;
}

/* Match badge (dough style, pan recommendation) */
.cook-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

.cook-badge.is-cool { background: #e8f0fe; color: #1a4b9c; }
.cook-badge.is-ok { background: #e6f4ea; color: #137333; }
.cook-badge.is-warm { background: #fef7e0; color: #8a5300; }
.cook-badge.is-hot { background: #fce8e6; color: #a12626; }

.cook-noscript {
    margin: 24px 0;
    padding: 16px 18px;
    border: 1px dashed #c7cdd4;
    border-radius: 10px;
    background: #fafbfc;
    font-size: 14px;
    color: #3c4043;
}

.cook-noscript h2 {
    font-size: 17px;
    margin: 0 0 10px;
    color: #1a2a6c;
}

@media (max-width: 640px) {
    .cook-page .section-title {
        font-size: 21px;
    }

    .cook-page .section-title svg {
        width: 18px;
        height: 18px;
        padding: 6px;
        border-radius: 10px;
    }

    .cook-panel {
        padding: 16px;
    }

    .cook-result-value {
        font-size: 22px;
    }

    .cook-result-card.is-primary .cook-result-value {
        font-size: 28px;
    }

    .cook-results {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

    .cook-table th,
    .cook-table td {
        padding: 7px 9px;
        font-size: 13px;
    }

    /* Uppercase headers with wide tracking eat the width the numbers need. */
    .cook-scale-table th {
        font-size: 12.5px;
        letter-spacing: 0;
        text-transform: none;
        padding: 8px;
    }

    .cook-scale-table td {
        padding: 8px;
        font-size: 13.5px;
    }
}

/* Narrow phones: a 98px name field shows three letters of "Bread flour". The row
   splits into name on one line and amount + unit + remove on the next. */
@media (max-width: 480px) {
    .cook-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px;
        grid-template-areas:
            "name name name"
            "amount unit remove";
        row-gap: 8px;
    }

    .cook-row [data-field="name"] {
        grid-area: name;
    }

    .cook-row [data-field="amount"] {
        grid-area: amount;
    }

    .cook-row [data-field="unit"] {
        grid-area: unit;
    }

    .cook-remove {
        grid-area: remove;
    }
}

/* Quick temperature chips: most conversions are one of seven dial numbers, so a
   single tap replaces two interactions (switch scale, then type a value). */
.cook-quick { margin: 16px 0 4px; }
.cook-quick-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #5f6368;
}
.cook-quick-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cook-quick-chips button {
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid #d7dbe0;
    border-radius: 999px;
    background: #fff;
    color: #1a2a6c;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.cook-quick-chips button:hover { background: #eef4ff; border-color: #1a73e8; }
.cook-quick-chips button:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }

/* "Related reading" callout closing the worked examples. */
.cook-reading {
    margin: 22px 0;
    padding: 14px 16px;
    border: 1px solid #e3e9f5;
    border-left: 4px solid #1a2a6c;
    border-radius: 10px;
    background: #f8fafd;
    font-size: 14px;
    line-height: 1.65;
    color: #3c4043;
}
.cook-reading strong { display: block; margin-bottom: 6px; color: #1a2a6c; }
.cook-reading p { margin: 4px 0; }
.cook-reading a { color: #1a73e8; font-weight: 600; }

/* Pan converter: quick presets, swap button, step list and size table. */
.pan-presets {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 4px 0 14px;
}
.pan-presets .cook-label { margin-right: 4px; }
.pan-preset {
    padding: 5px 10px;
    border: 1px solid #d7dee9;
    border-radius: 999px;
    background: #fff;
    color: #1a2a6c;
    font-size: 13px;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}
.pan-preset:hover { background: #eef4ff; border-color: #1a73e8; }
.pan-preset:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }

.pan-swap {
    display: block;
    width: fit-content;
    margin: 18px auto 14px;
    padding: 7px 14px;
    border: 1px solid #1a73e8;
    border-radius: 8px;
    background: #fff;
    color: #1a73e8;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}
.pan-swap:hover { background: #eef4ff; }
.pan-swap:focus-visible { outline: 2px solid #1a73e8; outline-offset: 2px; }

.pan-steps { margin: 6px 0 14px; padding-left: 22px; }
.pan-steps li { margin: 6px 0; line-height: 1.6; }

.pan-size-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
}
.pan-size-table th, .pan-size-table td {
    border: 1px solid #e3e9f5;
    padding: 8px 10px;
    text-align: left;
}
.pan-size-table th { background: #f1f5fb; color: #1a2a6c; }
.pan-size-table tbody tr:nth-child(even) { background: #f8fafd; }

/* Print view: the four result cards and the Gas Mark table are the only things
   worth carrying into a kitchen. Everything else is navigation. */
@media print {
    .site-header, .sidebar, .simple-footer, .cook-quick, .cook-errors,
    .cook-related, .faq, .cook-reading, .cook-copy, .cook-noscript,
    .article-share, .breadcrumb, .author-byline, .cook-note, .cook-formula,
    .pan-presets, .pan-swap,
    .cook-section:not(#ovenHow), #ovenHow h3, #ovenHow p { display: none !important; }
    .cook-panel, .cook-results, .cook-table-wrap { box-shadow: none; border: 0; }
    .cook-table { width: 100%; font-size: 11pt; page-break-inside: avoid; }
    .cook-table caption { font-weight: 700; }
    .cook-result-card { break-inside: avoid; }
    body { background: #fff; color: #000; }
}
