/* Group Cookbook
   Green and cream, tuned: a deep herb green for actions and headings, warm parchment
   creams for surfaces, and a little honey for small labels. */

:root {
    --cream-50: #fffcf5;
    --cream-100: #f7f2e6;
    --cream-200: #efe6d1;
    --cream-300: #e0d3b6;

    --green-900: #1c3326;
    --green-800: #24422f;
    --green-700: #2f5a3d;
    --green-200: #cfdcc8;
    --green-100: #e5ede0;
    --green-50: #f1f6ee;

    --ink: #2a2924;
    --ink-soft: #57534a;
    --ink-faint: #857e6e;
    --honey: #9a6a24;

    --danger: #9c3b28;
    --danger-bg: #faebe6;

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

    --radius: 16px;
    --radius-small: 10px;
    --shadow: 0 1px 2px rgba(42, 41, 36, 0.04), 0 8px 24px rgba(60, 50, 25, 0.06);
    --shadow-raised: 0 2px 4px rgba(42, 41, 36, 0.05), 0 14px 32px rgba(60, 50, 25, 0.1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    background: var(--cream-100);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--cream-100);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
    margin: 0;
    color: var(--green-900);
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

p {
    margin: 0;
}

a {
    color: var(--green-700);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--green-900);
}

:focus-visible {
    outline: 2px solid var(--green-700);
    outline-offset: 3px;
    border-radius: 4px;
}

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

.is-hidden {
    display: none !important;
}

.eyebrow {
    margin-bottom: 0.5rem;
    color: var(--honey);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.text-link {
    font-weight: 500;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

/* Buttons. Colors are set on every link state so the site's link color never leaks in. */

.button,
.button:link,
.button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.6rem 1.15rem;
    border: 1px solid var(--green-700);
    border-radius: 999px;
    background: var(--green-700);
    color: var(--cream-50);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
    border-color: var(--green-900);
    background: var(--green-900);
    color: var(--cream-50);
}

.button-secondary,
.button-secondary:link,
.button-secondary:visited {
    border-color: var(--green-100);
    background: var(--green-100);
    color: var(--green-800);
}

.button-secondary:hover {
    border-color: var(--green-200);
    background: var(--green-200);
    color: var(--green-900);
}

.button-outline,
.button-outline:link,
.button-outline:visited {
    border-color: var(--green-700);
    background: transparent;
    color: var(--green-700);
}

.button-outline:hover {
    background: var(--green-700);
    color: var(--cream-50);
}

.button-quiet,
.button-quiet:link,
.button-quiet:visited {
    border-color: transparent;
    background: transparent;
    color: var(--ink-soft);
}

.button-quiet:hover {
    border-color: var(--cream-300);
    background: var(--cream-200);
    color: var(--ink);
}

.button-small {
    min-height: 36px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
}

.button-large {
    min-height: 50px;
    padding: 0.75rem 1.6rem;
    font-size: 1.05rem;
}

/* Form fields */

input[type="text"],
input[type="search"],
input[type="number"],
select {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-small);
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
    color: var(--ink-faint);
}

input:focus,
select:focus {
    border-color: var(--green-700);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 90, 61, 0.18);
}

/* Site header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--cream-300);
    background: rgba(247, 242, 230, 0.92);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.site-header-inner {
    display: flex;
    align-items: center;
    gap: 1.75rem;
    max-width: 1120px;
    min-height: 64px;
    margin: 0 auto;
    padding: 0.5rem 1.5rem;
}

.wordmark,
.wordmark:link,
.wordmark:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--green-900);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.wordmark-mark {
    width: 28px;
    height: 28px;
    color: var(--green-700);
}

.site-nav {
    display: flex;
    gap: 0.25rem;
}

.site-nav a {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    color: var(--ink-soft);
    font-weight: 500;
    text-decoration: none;
}

.site-nav a:hover {
    background: var(--cream-200);
    color: var(--ink);
}

.site-nav a[aria-current="page"] {
    background: var(--green-100);
    color: var(--green-800);
}

.user-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.user-name {
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Page layout */

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 5rem;
}

.page-narrow {
    max-width: 520px;
    padding-top: 4rem;
}

.section {
    margin-top: 3rem;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-header h2,
.section-title {
    font-size: 1.5rem;
}

.result-count {
    color: var(--ink-faint);
    font-size: 0.9rem;
}

/* Home and search intro */

.intro {
    max-width: 680px;
}

.intro h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
}

.intro-lede {
    margin-top: 0.75rem;
    color: var(--ink-soft);
    font-size: 1.15rem;
}

.intro-compact h1 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
}

.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 560px;
    margin-top: 1.75rem;
}

.search-form input {
    flex: 1;
    min-height: 48px;
    padding-left: 1rem;
    border-radius: 999px;
}

.search-form .button {
    min-height: 48px;
}

/* Recipe cards */

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.recipe-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--cream-300);
    border-radius: var(--radius);
    background: var(--cream-50);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.recipe-card:hover {
    border-color: var(--green-200);
    box-shadow: var(--shadow-raised);
    transform: translateY(-2px);
}

.recipe-card-media img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.recipe-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.25rem 1.1rem;
}

.recipe-card-title {
    font-size: 1.3rem;
}

.recipe-card-title a {
    color: inherit;
    text-decoration: none;
}

/* The title link covers the whole card; tag links sit above it. */
.recipe-card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.recipe-card-title a:focus-visible {
    outline: none;
}

.recipe-card:has(.recipe-card-title a:focus-visible) {
    outline: 2px solid var(--green-700);
    outline-offset: 3px;
}

.recipe-card-meta {
    color: var(--ink-faint);
    font-size: 0.85rem;
    font-weight: 500;
}

.recipe-card-description {
    color: var(--ink-soft);
    font-size: 0.95rem;
}

.recipe-card .tag-list {
    position: relative;
    z-index: 1;
    margin-top: auto;
    padding-top: 0.5rem;
}

/* Tags */

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tag,
.tag:link,
.tag:visited {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--cream-200);
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
}

a.tag:hover {
    background: var(--green-100);
    color: var(--green-800);
}

.empty-state {
    grid-column: 1 / -1;
    padding: 2.5rem 1.5rem;
    border: 1px dashed var(--cream-300);
    border-radius: var(--radius);
    color: var(--ink-faint);
    text-align: center;
}

/* Recipe page */

.recipe-hero {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

.recipe-hero-copy {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 720px;
}

.recipe-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.3rem);
}

.recipe-byline {
    color: var(--ink-soft);
}

.recipe-byline a {
    font-weight: 600;
}

.recipe-description {
    max-width: 62ch;
    color: var(--ink-soft);
    font-size: 1.1rem;
    line-height: 1.65;
}

.recipe-hero-media img {
    width: 100%;
    max-height: 440px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: var(--shadow-raised);
}

.recipe-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0.5rem 0 0;
    border-top: 1px solid var(--cream-300);
    border-bottom: 1px solid var(--cream-300);
}

.recipe-stat {
    padding: 0.85rem 1rem;
}

.recipe-stat + .recipe-stat {
    border-left: 1px solid var(--cream-300);
}

.recipe-stat:first-child {
    padding-left: 0;
}

.recipe-stat dt {
    color: var(--ink-faint);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.recipe-stat dd {
    margin: 0.15rem 0 0;
    color: var(--green-900);
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
}

.recipe-actions {
    margin-top: 0.5rem;
}

.recipe-layout {
    display: grid;
    gap: 2rem;
    margin-top: 3rem;
}

.recipe-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.panel {
    padding: 1.4rem;
    border: 1px solid var(--cream-300);
    border-radius: var(--radius);
    background: var(--cream-50);
    box-shadow: var(--shadow);
}

.panel-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* Scaling */

.scale-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scale-form label {
    color: var(--ink);
    font-weight: 600;
}

.field-hint {
    margin-top: -0.25rem;
    color: var(--ink-faint);
    font-size: 0.85rem;
    line-height: 1.45;
}

.field-row {
    display: flex;
    gap: 0.5rem;
}

.field-row input {
    flex: 1;
    min-width: 0;
}

.scale-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.1rem 0;
    color: var(--ink-faint);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.scale-divider::before,
.scale-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--cream-300);
}

.scale-error,
.notice {
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-small);
    background: var(--cream-200);
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.scale-error,
.notice-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.scale-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-small);
    background: var(--green-50);
    color: var(--green-800);
    font-size: 0.9rem;
}

.scale-summary-label {
    font-weight: 600;
}

.scale-summary-chip {
    display: inline-flex;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--green-700);
    color: var(--cream-50);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Ingredients */

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

.ingredient-list li {
    position: relative;
    padding: 0.6rem 0 0.6rem 1.35rem;
    border-bottom: 1px dashed var(--cream-300);
}

.ingredient-list li:last-child {
    border-bottom: 0;
}

.ingredient-list li::before {
    content: "";
    position: absolute;
    top: 1.05rem;
    left: 0.2rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green-700);
    opacity: 0.6;
}

.ingredient-list small {
    display: block;
    margin-top: 0.1rem;
    color: var(--ink-faint);
    font-size: 0.8rem;
}

/* Steps */

.recipe-main .section-title {
    margin-bottom: 1rem;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.3rem 1.4rem;
    border: 1px solid var(--cream-300);
    border-radius: var(--radius);
    background: var(--cream-50);
}

.step-card strong {
    display: block;
    margin-bottom: 0.3rem;
    color: var(--honey);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.step-card p {
    font-size: 1.05rem;
    line-height: 1.7;
}

.step-ingredients {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-small);
    background: var(--green-50);
}

.step-ingredients-label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--green-800);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.step-ingredients ul,
.cooking-inline-measurements ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.step-ingredients li,
.cooking-inline-measurements li {
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--green-200);
    border-radius: 999px;
    background: #fff;
    color: var(--green-900);
    font-size: 0.88rem;
}

/* Profile */

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.avatar {
    flex: none;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.avatar-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--green-700);
    color: var(--cream-50);
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
}

.profile-header h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
}

.profile-username {
    margin-top: 0.2rem;
    color: var(--ink-faint);
}

.profile-bio {
    max-width: 60ch;
    margin-top: 0.6rem;
    color: var(--ink-soft);
}

/* Sign in */

.sign-in-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 2rem 2rem;
    border: 1px solid var(--cream-300);
    border-radius: 20px;
    background: var(--cream-50);
    box-shadow: var(--shadow-raised);
    text-align: center;
}

.sign-in-card h1 {
    font-size: 2.2rem;
}

.sign-in-card > p:not(.eyebrow) {
    margin-top: 0.75rem;
}

.sign-in-copy {
    max-width: 34ch;
    color: var(--ink-soft);
}

.sign-in-card .notice {
    width: 100%;
}

.sign-in-card .button {
    margin-top: 1.5rem;
}

/* Follows Google's sign-in button guidance: white, neutral border, full-color "G". */
.google-button,
.google-button:link,
.google-button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 48px;
    margin-top: 1.75rem;
    padding: 0.6rem 1.5rem 0.6rem 1.25rem;
    border: 1px solid #747775;
    border-radius: 999px;
    background: #fff;
    color: #1f1f1f;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.google-button:hover {
    background: #f8faf7;
    color: #1f1f1f;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.25);
}

.google-logo {
    flex: none;
    width: 20px;
    height: 20px;
}

.sign-in-back {
    margin-top: 1.75rem;
    font-size: 0.9rem;
}

/* Cooking view: bigger type, nothing in the way */

.cooking-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--cream-300);
    background: rgba(247, 242, 230, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cooking-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 820px;
    min-height: 56px;
    margin: 0 auto;
    padding: 0.4rem 1.5rem;
}

.cooking-bar-label {
    color: var(--honey);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cooking-shell {
    max-width: 820px;
}

.cooking-header h1 {
    font-size: clamp(2.2rem, 6vw, 3.2rem);
}

.cooking-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    color: var(--green-800);
    font-weight: 500;
}

.cooking-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 2rem;
}

.cooking-step-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.75rem;
    border: 1px solid var(--cream-300);
    border-radius: 20px;
    background: var(--cream-50);
    box-shadow: var(--shadow);
}

.cooking-step-number {
    color: var(--honey);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cooking-step-text {
    color: var(--ink);
    font-size: clamp(1.2rem, 2.6vw, 1.45rem);
    line-height: 1.6;
}

.cooking-inline-measurements {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.cooking-inline-measurements > span {
    color: var(--green-800);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cooking-inline-measurements li {
    font-size: 1rem;
}

/* Wider screens */

@media (min-width: 900px) {
    .recipe-hero-with-media {
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    }

    .recipe-layout {
        grid-template-columns: 340px minmax(0, 1fr);
        align-items: start;
    }
}

/* Phones */

@media (max-width: 640px) {
    .site-header-inner {
        flex-wrap: wrap;
        gap: 0.25rem 1rem;
        padding: 0.6rem 1rem;
    }

    .site-nav {
        order: 3;
        width: 100%;
        margin-left: -0.4rem;
    }

    .user-name {
        display: none;
    }

    .page {
        padding: 1.75rem 1rem 4rem;
    }

    .search-form {
        flex-direction: column;
    }

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

    .recipe-stat:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .recipe-stat:nth-child(n + 3) {
        border-top: 1px solid var(--cream-300);
    }

    .profile-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .cooking-step-card {
        padding: 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}
