/*
 * Ken's Recipe Website
 * Bootstrap 5.3.3 + custom site styling
 */

:root {
    --dark: #4d1717;
    --header: #b8c7a4;
    --primary: #3d6501;
    --accent: #ccce35;
    --text: #4d1717;
    --bs-body-color: var(--text);
    --bs-secondary-color: var(--text);
    --bs-secondary-color-rgb: 77, 23, 23;
    --bs-link-color: var(--text);
    --bs-link-color-rgb: 77, 23, 23;
    --bs-link-hover-color: var(--text);
    --bs-link-hover-color-rgb: 77, 23, 23;
    --bs-body-color-rgb: 77, 23, 23;
    --white: #fff;
    --sage: #b8c7a4;
    --cream: #eee8d4;
    --border: var(--sage);
    --danger: var(--dark);

    /* The public navbar's single source of truth. */
    --nav-button-height: 30px;
    --nav-button-font-size: 11px;
    --nav-button-gap: 6px;
    --nav-button-inline-padding: 8px;
    --nav-button-bg: var(--primary);
    --nav-button-foreground: var(--cream);
    --nav-button-hover-bg: var(--accent);
    --nav-button-hover-foreground: var(--dark);

    /* Knowledge Base-inspired shape, using Recipe Website colors. */
    --recipe-button-radius: 11px;
    --recipe-button-gradient: linear-gradient(135deg, var(--primary) 0%, #527c1b 100%);
    --recipe-button-hover-gradient: linear-gradient(135deg, var(--accent) 0%, #dee09b 100%);
    --recipe-button-shadow: 0 3px 9px rgb(36 64 9 / 16%);
    --recipe-button-hover-shadow: 0 8px 18px rgb(36 64 9 / 24%);

    /* Layout, page action and form-field tokens. */
    --stationary-footer-space: 80px;
    --page-button-font-size: 12px;
    --page-button-padding-y: 5px;
    --page-button-padding-x: 10px;
    --page-button-min-height: 32px;
    --recipe-field-border: #3d6501;
    --recipe-field-focus-ring: rgba(61, 101, 1, 0.20);
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    color: var(--text);
    background: var(--cream);
    background-image: url("../img/static_images/background.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    font-family: Arial, Helvetica, sans-serif;
}

/* Header */

.site-header {
    /* Sticky positioning is defined in the stationary layout section. */
    height: 110px;
    z-index: 1030;
    padding: 10px;
    background: linear-gradient(180deg, #32885f 0%, #4f966d 38%, #81b391 68%, #c4dfc6 100%);
    border: 2px solid #8a9d59;
    border-bottom-width: 3px;
    color: var(--dark);
}

.header-layout {
    width: 100%;
    height: 100%;
    padding: 0 6px;
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
}

/* Logo on the far left */

.brand-logo {
    grid-column: 1;
    width: 420px;
    height: 90px;
    display: block;
}

.brand-logo picture,
.brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
}

.brand-logo img {
    object-fit: contain;
    object-position: left center;
}

/* Search and filters */

.header-controls {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    height: 30px;
    width: max-content;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgb(204 206 53 / 40%);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.search-box {
    width: 450px;
    height: 30px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-box .form-control {
    flex: 1 1 auto;
    width: auto;
    height: 30px;
    min-width: 0;
    margin-left: 20px;
    margin-right: 5px;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 0;
}

.search-button {
    width: 36px;
    height: 30px;
    flex: 0 0 36px;
    margin-right: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cream);
    background: var(--recipe-button-gradient);
    border: 1px solid var(--cream);
    border-radius: var(--recipe-button-radius);
    box-shadow: var(--recipe-button-shadow);
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.search-icon {
    display: block;
    width: 18px;
    height: 18px;
    stroke: var(--cream);
    stroke-width: 0.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-header .search-button:hover,
.site-header .search-button:focus,
.site-header .search-button:focus-visible,
.site-header .search-button:active {
    color: var(--dark);
    background: var(--recipe-button-hover-gradient);
    border-color: var(--cream);
    box-shadow: var(--recipe-button-hover-shadow);
}

.site-header .search-button:hover { transform: translateY(-1px); }
.site-header .search-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Account controls on the far right */

.account-buttons {
    grid-column: 3;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: clamp(2px, 0.4vw, 6px);
}

.logout-form {
    margin: 0;
}

/* Shared button component: the Knowledge Base shape, Recipe Website palette.
   Applies to standard actions on recipe and admin pages without changing
   their existing widths, heights or button semantics. */
.btn-site {
    --bs-btn-color: var(--cream);
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--cream);
    --bs-btn-hover-color: var(--dark);
    --bs-btn-hover-border-color: var(--cream);
    --bs-btn-active-color: var(--dark);
    --bs-btn-focus-shadow-rgb: 61, 101, 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: 6px 16px;
    color: var(--cream);
    background: var(--recipe-button-gradient);
    border: 1px solid var(--cream);
    border-radius: var(--recipe-button-radius);
    box-shadow: var(--recipe-button-shadow);
    font-weight: 800;
    text-decoration: none;
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn-site:hover,
.btn-site:focus-visible {
    color: var(--dark);
    background: var(--recipe-button-hover-gradient);
    border-color: var(--cream);
    box-shadow: var(--recipe-button-hover-shadow);
}

.btn-site:hover { transform: translateY(-1px); }
.btn-site:active { transform: translateY(0); }
.btn-site:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ================================================================
   PUBLIC NAVBAR COMPONENT — KEEP NAVIGATION BUTTON STYLES HERE.
   Bootstrap .btn provides behavior; these classes provide the site's
   consistent green sizing and colors. Do not add later overrides for
   individual Home / Logout / Admin / Add Recipe buttons.
   ================================================================ */
.site-header .header-quick-links,
.site-header .header-filter-controls {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: var(--nav-button-gap);
}

.site-header .header-quick-links .logout-form {
    margin: 0;
}

.site-header .site-nav-button {
    /* Bootstrap 5.3 variables also cover hover, active and focus states. */
    --bs-btn-color: var(--nav-button-foreground);
    --bs-btn-bg: var(--nav-button-bg);
    --bs-btn-border-color: var(--cream);
    --bs-btn-hover-color: var(--nav-button-hover-foreground);
    --bs-btn-hover-bg: var(--nav-button-hover-bg);
    --bs-btn-hover-border-color: var(--cream);
    --bs-btn-active-color: var(--nav-button-hover-foreground);
    --bs-btn-active-bg: var(--nav-button-hover-bg);
    --bs-btn-active-border-color: var(--cream);
    --bs-btn-focus-shadow-rgb: 61, 101, 1;
    --bs-btn-disabled-color: var(--nav-button-foreground);
    --bs-btn-disabled-bg: var(--nav-button-bg);

    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 5px;
    width: auto;
    min-width: 58px;
    min-height: var(--nav-button-height);
    height: var(--nav-button-height);
    margin: 0;
    padding: 2px var(--nav-button-inline-padding);
    color: var(--bs-btn-color);
    background: var(--recipe-button-gradient);
    border: 1px solid var(--bs-btn-border-color);
    border-radius: var(--recipe-button-radius);
    box-shadow: var(--recipe-button-shadow);
    font-size: var(--nav-button-font-size);
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.site-header .site-nav-button:hover,
.site-header .site-nav-button:focus-visible {
    color: var(--bs-btn-hover-color);
    background: var(--recipe-button-hover-gradient);
    border-color: var(--bs-btn-hover-border-color);
    box-shadow: var(--recipe-button-hover-shadow);
}

.site-header .site-nav-button:focus-visible {
    outline: 2px solid var(--nav-button-hover-foreground);
    outline-offset: 2px;
}

.site-header .site-nav-button .header-nav-icon {
    display: block;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    stroke: currentColor;
    stroke-width: 0.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.site-header .site-nav-button .header-icon-label {
    display: inline;
    font-size: var(--nav-button-font-size);
    line-height: 1;
}

/* Breadcrumb */

.breadcrumb-bar {
    /* Directly after the header, regardless of viewport width. */
    position: relative;
    inset: auto;
    height: 35px;
    z-index: 1028;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: visible;
    padding: 0 12px;
    color: var(--dark);
    background: var(--sage);
    border-bottom: 2px solid var(--sage);
    font-size: 14px;
    font-weight: 700;
}

.breadcrumb-trail {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    padding-left: 0;
    list-style: none;
    white-space: nowrap;
}

.breadcrumb-trail li {
    display: flex;
    align-items: center;
    min-width: 0;
}

.breadcrumb-trail li + li::before {
    content: "/";
    margin: 0 9px;
    color: var(--dark);
}

.breadcrumb-trail a,
.breadcrumb-trail span {
    overflow: hidden;
    color: var(--dark);
    text-overflow: ellipsis;
    text-decoration: none;
}

.breadcrumb-trail a:hover,
.breadcrumb-trail a:focus-visible {
    text-decoration: underline;
}

/* Main content */

.site-content {
    flex: 1 0 auto;
    min-height: 0;
    /* No fixed-header spacer is needed now. */
    padding: 20px 40px 64px;
    background: transparent;
}

.recipe-feature {
    min-width: 0;
    max-width: 1100px;
    min-height: 280px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    background: #f0fff0;
    border: 2px solid var(--border);
    border-radius: 5px;
}

.recipe-copy {
    flex: 1 1 38%;
    min-width: 0;
    padding: 10px;
    text-align: left;
}

.recipe-copy h1 {
    margin: 0 0 16px;
    color: var(--text);
    font-size: 30px;
    font-weight: 700;
}

.recipe-copy p {
    margin: 0 0 14px;
    color: var(--text);
    line-height: 1.65;
}

.recipe-card-image {
    box-sizing: border-box;
    display: block;
    flex: 0 0 30%;
    width: 30%;
    max-width: 100%;
    min-width: 0;
    height: 220px;
    object-fit: cover;
    object-position: center;
    align-self: center;
    background-color: #f0fff0;
    border: 2px solid #2e0505;
}

.recipe-search-results {
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
}

.recipe-search-results > h1 {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 30px;
    font-weight: 700;
}

.search-summary,
.search-count {
    color: var(--text);
}

.matching-count {
    font-size: 1.25rem;
    font-weight: 700;
}

.recipe-search-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0 clamp(6px, 2vw, 24px);
    margin: 18px 0 20px;
    border-bottom: 1px solid var(--border);
}

.recipe-search-tab {
    display: inline-flex;
    flex: 0 1 300px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    margin-bottom: -1px;
    padding: 10px 14px 12px;
    color: var(--text);
    border-bottom: 4px solid transparent;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.recipe-search-tab:hover,
.recipe-search-tab:focus-visible {
    color: var(--primary);
    text-decoration: none;
}

.recipe-search-tab:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.recipe-search-tab.is-active {
    color: var(--primary);
    border-bottom-color: var(--accent);
}

.recipe-search-tab-count {
    color: var(--text);
    font-weight: 400;
}

.search-empty {
    margin-top: 24px;
    padding: 18px 20px;
    color: var(--text);
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 5px;
}

.recipe-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
    gap: 18px;
    margin-top: 18px;
}

.search-results-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 14px;
}

.recipe-result-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    background: #f0fff0;
    border: 2px solid var(--border);
    border-radius: 5px;
}

.recipe-result-main {
    min-width: 0;
    display: grid;
    grid-template-columns: clamp(80px, 38%, 200px) minmax(0, 1fr);
    align-items: stretch;
    gap: 16px;
    flex: 1 0 auto;
}

.recipe-result-image {
    box-sizing: border-box;
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
    background-color: #f0fff0;
    border-radius: 4px;
    border: 1px solid #2e0505;
}

.recipe-result-image-link {
    box-sizing: border-box;
    position: relative;
    display: block;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    aspect-ratio: 1;
    align-self: start;
    overflow: hidden;
    border-radius: 4px;
}

.recipe-result-content {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
}

.recipe-result-card h2 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
}

.recipe-result-title-link {
    color: inherit;
    text-decoration: none;
}

.recipe-result-title-link:hover,
.recipe-result-title-link:focus-visible {
    color: var(--accent);
    text-decoration: underline;
}

.recipe-result-card p {
    margin-bottom: 12px;
    line-height: 1.55;
}

.my-recipe-result-card .recipe-result-description {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.35;
}

.recipe-result-placeholder {
    color: var(--text);
    font-style: italic;
}

.recipe-result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0;
    padding: 10px 0 0;
    color: var(--text);
    border-top: 1px solid var(--border);
    font-size: 13px;
    list-style: none;
}

.recipe-result-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 14px;
}

.recipe-result-delete-form {
    display: flex;
    height: 38px;
    margin: 0;
}

.recipe-result-actions .recipe-view-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 6px 8px;
    line-height: 1.2;
    text-decoration: none;
    box-sizing: border-box;
}

.search-recipe-result-card .recipe-result-actions {
    justify-content: flex-end;
    padding-top: 8px;
}

.search-results-grid > .search-recipe-result-card {
    gap: 8px;
    padding: 12px;
}

.search-recipe-result-card .recipe-result-main {
    grid-template-columns: clamp(72px, 32%, 150px) minmax(0, 1fr);
    gap: 12px;
}

.search-recipe-result-card h2 {
    margin-bottom: 6px;
    font-size: 14px;
}

.search-recipe-result-card p {
    margin-bottom: 8px;
    line-height: 1.45;
}

.search-recipe-result-card .recipe-result-details {
    gap: 5px 10px;
    padding-top: 8px;
    font-size: 12px;
}

.recipe-pagination {
    margin-top: 24px;
}

.recipe-pagination-top {
    margin-top: 0;
    margin-bottom: -8px;
}

.recipe-pagination-list {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.recipe-page-number {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    background: var(--cream);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: 0 2px 5px rgba(61, 101, 1, 0.16);
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.recipe-page-number.is-current {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 5px rgba(61, 101, 1, 0.28);
}

.recipe-page-number:not(.is-current):hover {
    background: var(--sage);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.recipe-page-number:focus-visible,
.recipe-pagination-next:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.recipe-pagination-next {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.recipe-pagination-next:hover {
    color: var(--dark);
}

.recipe-pagination-arrow {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.my-recipe-result-card .recipe-result-actions {
    min-width: 0;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
}

.my-recipe-result-card .recipe-result-actions > a,
.my-recipe-result-card .recipe-result-actions > form {
    flex: 1 1 0;
    min-width: 0;
}

.my-recipe-result-card .recipe-result-actions .recipe-view-button {
    width: 100%;
    min-width: 0;
    padding-right: clamp(2px, 0.8vw, 8px);
    padding-left: clamp(2px, 0.8vw, 8px);
    font-size: clamp(11px, calc(0.5vw + 11px), 16px);
    white-space: nowrap;
}


.recipe-detail-page {
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
}

.recipe-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.recipe-detail-actions {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.recipe-detail-actions form {
    display: flex;
    width: 58px;
    height: 52px;
    margin: 0;
}

.recipe-detail-actions > .recipe-icon-action,
.recipe-detail-actions form > .recipe-icon-action {
    box-sizing: border-box;
    width: 58px;
    min-width: 58px;
    height: 52px;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px;
    line-height: 1;
}

.recipe-action-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.recipe-action-label {
    font-size: 11px;
    line-height: 1;
}

.recipe-detail-bottom-toolbar {
    justify-content: flex-end;
    width: 100%;
    margin-top: 14px;
    margin-bottom: 0;
}

.recipe-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.recipe-back-icon {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
}

.recipe-back-link:hover,
.recipe-back-link:focus-visible {
    color: var(--accent);
    text-decoration: underline;
}

.recipe-detail-card {
    padding: 28px;
    background: #f0fff0;
    border: 2px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgb(0 0 0 / 8%);
}

.recipe-detail-intro {
    min-width: 0;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.recipe-detail-heading {
    min-width: 0;
}

.recipe-detail-heading h1 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 30px;
    font-weight: 700;
}

.recipe-detail-heading p {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
}

.recipe-detail-image {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 180px;
    object-fit: cover;
    object-position: center;
    background-color: #f0fff0;
    border-radius: 5px;
    border: 2px solid #2e0505;
}

.recipe-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 12px;
    margin: 0 0 24px;
}

.recipe-facts > div {
    padding: 10px 12px;
    background: var(--cream);
    border-radius: 4px;
    text-align: center;
}

.recipe-facts dt {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.recipe-facts dd {
    margin: 3px 0 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.nutrition-note {
    margin: -14px 0 18px;
    color: var(--text);
    font-size: 12px;
    text-align: center;
}

.recipe-detail-section {
    margin-top: 22px;
}

.recipe-detail-section h2 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 21px;
    font-weight: 700;
}

.recipe-ingredients-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

.recipe-steps-list {
    margin: 0;
    padding-left: 22px;
    line-height: 1.7;
}

.recipe-steps-list li {
    padding-left: 4px;
    margin-bottom: 10px;
}

.ingredient-measure {
    font-weight: 700;
}

.login-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.login-card {
    width: min(100%, 440px);
    padding: 32px;
    background: #f0fff0;
    border: 2px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgb(0 0 0 / 8%);
}

.login-card h1 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
}

.login-intro {
    margin: 0 0 24px;
    color: var(--text);
}

.login-card .form-label {
    font-weight: 700;
}

.login-submit {
    width: 100%;
}

.add-recipe-card {
    width: min(100%, 1050px);
    margin: 0 auto;
    padding: 30px;
    background: #f0fff0;
    border: 2px solid var(--primary);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgb(0 0 0 / 8%);
}

.add-recipe-card h1 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
}

.recipe-feature h1,
.recipe-detail-card h1,
.login-card h1,
.add-recipe-card h1 {
    color: var(--primary);
}

.add-recipe-intro {
    margin: 0 0 24px;
    color: var(--text);
}

.add-recipe-card .form-label,
.add-recipe-card legend {
    color: var(--text);
    font-weight: 700;
}

.add-recipe-card legend {
    float: none;
    width: auto;
    margin-bottom: 5px;
    padding: 0 8px;
    font-size: 1rem;
}

.add-recipe-card .add-recipe-group {
    min-width: 0;
    margin: 0.75rem 0 0;
    padding: 8px 12px;
    background: #f0fff0;
    border: 1px solid var(--primary);
    border-radius: 6px;
}

.add-recipe-card .recipe-fact-input {
    width: 10ch;
    max-width: 100%;
}

.recipe-fact-error {
    margin-bottom: 0.15rem;
    color: var(--danger);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.add-recipe-card .recipe-wide-control {
    width: 66.6667%;
    max-width: 100%;
}

.add-recipe-card input[type="file"]::file-selector-button {
    margin: -0.375rem 0.75rem -0.375rem -0.75rem;
    padding: 0.375rem 0.75rem;
    color: var(--cream);
    background: var(--primary);
    border: 1px solid var(--cream);
}

.add-recipe-card input[type="file"]:hover::file-selector-button {
    color: var(--dark);
    background: var(--accent);
}

.add-recipe-card .recipe-autocomplete-wrap {
    position: relative;
    width: 20ch;
    max-width: 100%;
}

.add-recipe-card .recipe-ingredient-input,
.add-recipe-card .recipe-unit-input {
    width: 100%;
    max-width: 100%;
}

.recipe-autocomplete-list {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    z-index: 1200;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgb(0 0 0 / 16%);
}

.recipe-autocomplete-list[hidden] {
    display: none;
}

.recipe-autocomplete-option {
    display: block;
    width: 100%;
    padding: 6px 9px;
    color: var(--text);
    text-align: left;
    background: transparent;
    border: 0;
    border-radius: 3px;
}

.recipe-autocomplete-option:hover,
.recipe-autocomplete-option:focus-visible,
.recipe-autocomplete-option[aria-selected="true"] {
    color: var(--primary);
    background: var(--accent);
    outline: none;
}

.add-recipe-card .recipe-quantity-input {
    width: 15ch;
    max-width: 100%;
}

.add-recipe-card .recipe-unit-input {
    width: 100%;
    max-width: 100%;
}

.add-recipe-card label[for^="fact-"] {
    margin-bottom: 0.15rem;
}

.category-groups {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 10px;
}

.category-checkbox-group {
    min-width: 0;
    padding: 10px;
    background: #f0fff0;
    border: 1px solid var(--border);
    border-radius: 5px;
}

.category-checkbox-group h3 {
    margin: 12px 0 2px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 700;
}

.category-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.category-option {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 6px 10px;
    background: #f0fff0;
    border: 1px solid var(--primary);
    border-radius: 4px;
}

.category-option .form-check-input {
    margin: 0;
    border: 1px solid var(--primary);
    accent-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--cream);
}

.category-option .form-check-input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.ingredient-row,
.step-row {
    margin-bottom: 12px;
}

.ingredient-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.step-row-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.step-instruction-column .recipe-wide-control {
    width: 100%;
}

.recipe-row-action {
    width: 132px;
    height: 38px;
    min-height: 38px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.ingredient-row .form-label,
.step-row .form-label {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.add-recipe-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Footer */

.site-footer {
    /* Final fixed positioning is defined in the stationary layout section. */
    z-index: 1020;
    width: 100%;
    height: 40px;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    color: #d7f0cb;
    background: linear-gradient(to bottom, #c4dfc6 0%, #81b391 32%, #4f966d 62%, #32885f 100%);
    border: 2px solid #8a9d59;
    border-top-width: 3px;
    font-family: monospace;
    font-size: clamp(10px, 2.5vw, 18px);
    font-weight: 700;
}


a:hover,
.breadcrumb-trail a:hover,
.recipe-result-title-link:hover,
.recipe-back-link:hover {
    text-decoration: none;
}


/* Keep breadcrumb text and navbar controls centered on their navbar row. */
.breadcrumb-bar {
    box-sizing: border-box;
    align-items: center;
}

.breadcrumb-trail {
    align-self: center;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1;
    font-size: clamp(11px, calc(0.52vw + 9.5px), 17px);
}

/* Public header recipe actions */


body:not(.admin-site) .header-controls {
    display: flex;
    width: max-content;
    max-width: 100%;
    flex-wrap: nowrap;
    align-items: center;
    align-self: center;
    justify-content: center;
}

body:not(.admin-site) .header-controls .search-box,
body:not(.admin-site) .header-controls .search-box .form-control,
body:not(.admin-site) .header-controls .search-button {
    margin: 0;
}

body:not(.admin-site) .breadcrumb-bar {
    justify-content: space-between;
}



body:not(.admin-site) .header-controls {
    min-width: 0;
}

body:not(.admin-site) .header-controls .search-box {
    width: auto;
    min-width: 0;
    max-width: 720px;
    flex: 1 1 260px;
    gap: 8px;
}

body:not(.admin-site) .header-controls .search-box .form-control {
    min-width: 0;
    margin: 0;
    font-size: clamp(10px, 1.05vw, 14px);
}

body:not(.admin-site) .header-controls .search-box .form-control::placeholder {
    font-size: clamp(10px, 1.05vw, 14px);
}

body:not(.admin-site) .header-controls .search-box .search-button {
    margin: 0;
}


@page {
    size: letter portrait;
    margin: 0.45in;
}

@media print {
    html,
    body {
        width: auto !important;
        min-height: 0 !important;
        background: #fff !important;
        color: #000 !important;
    }

    body {
        display: block !important;
    }

    .site-header,
    .breadcrumb-bar,
    .site-footer,
    .recipe-detail-toolbar {
        display: none !important;
    }

    .site-content {
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .recipe-detail-page {
        max-width: none !important;
        margin: 0 !important;
    }

    .recipe-detail-card {
        padding: 0 !important;
        color: #000 !important;
        background: #fff !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    .recipe-detail-intro {
        grid-template-columns: 1.45in minmax(0, 1fr);
        gap: 0.22in;
        margin-bottom: 0.14in;
        padding-bottom: 0.14in;
        break-inside: avoid;
    }

    .recipe-detail-image {
        width: 1.45in;
        height: 1.1in;
        object-fit: contain;
        border: 1px solid #555;
    }

    .recipe-detail-heading h1 {
        margin-bottom: 6pt;
        color: #000 !important;
        font-size: 21pt;
    }

    .recipe-detail-heading p,
    .recipe-detail-section p,
    .recipe-ingredients-list,
    .recipe-steps-list {
        color: #000 !important;
        font-size: 9.5pt;
        line-height: 1.35;
    }

    .recipe-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 5pt;
        margin-bottom: 8pt;
        break-inside: avoid;
    }

    .recipe-facts > div {
        padding: 5pt;
        background: #fff !important;
        border: 1px solid #aaa;
        break-inside: avoid;
    }

    .recipe-facts dt,
    .recipe-facts dd,
    .recipe-detail-section h2 {
        color: #000 !important;
    }

    .recipe-facts dd {
        font-size: 11pt;
    }

    .nutrition-note {
        margin: 0 0 8pt;
        color: #000 !important;
        font-size: 8pt;
    }

    .recipe-detail-section {
        margin-top: 12pt;
    }

    .recipe-detail-section h2 {
        margin-bottom: 5pt;
        font-size: 14pt;
        break-after: avoid;
    }

    .recipe-steps-list li {
        margin-bottom: 5pt;
        break-inside: avoid;
    }
}



/* ================================================================
   RESPONSIVE LAYOUT — PUBLIC PAGES & SHARED STYLES
   Desktop base styles above remain untouched. Print rules above
   remain intact. These screen-only rules also load on admin pages.
   ================================================================ */

/* Safe defaults at every screen width. */
@media screen {
    html, body { max-width: 100%; }
    img, video, iframe { max-width: 100%; }
    .site-content, .admin-content, .header-layout, .header-controls,
    .recipe-feature, .recipe-detail-card, .add-recipe-card,
    .login-card, .recipe-result-card { min-width: 0; }
    .site-content { width: 100%; }
    .recipe-detail-heading, .recipe-result-content,
    .recipe-copy, .admin-option-card { overflow-wrap: anywhere; }
    .form-control, .form-select, textarea, input[type="file"] { max-width: 100%; }
    /* Prevent image/browser-specific layout overflow without clipping tables. */
    .recipe-results-grid, .search-results-grid { min-width: 0; }
}

/* Large tablets and compact laptop screens: the original 420px logo
   plus 450px search box and controls cannot fit on a single line. */
@media screen and (max-width: 1100px) {
    .site-header {
        height: auto;
        padding: 12px 16px;
    }
    .header-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        gap: 10px;
        height: auto;
        padding: 0;
    }
    .brand-logo {
        grid-column: 1;
        grid-row: 1;
        width: min(320px, 100%);
        max-width: 100%;
        height: 74px;
        justify-self: start;
    }
    .header-controls,
    body:not(.admin-site) .header-controls {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        max-width: none;
        height: auto;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px;
    }
    .search-box,
    body:not(.admin-site) .header-controls .search-box {
        flex: 1 1 260px;
        width: auto;
        max-width: none;
        min-width: 180px;
        margin: 0;
    }
    .search-box .form-control,
    .search-button { margin: 0; }
    .site-header .header-quick-links {
        display: flex;
        flex: 0 0 auto;
        flex-wrap: wrap;
        gap: 6px;
    }
    .breadcrumb-bar {
        position: relative;
        inset: auto;
        height: auto;
        min-height: 35px;
        padding: 7px 16px;
    }
    .breadcrumb-trail { flex-wrap: wrap; row-gap: 4px; white-space: normal; }
    .breadcrumb-trail a, .breadcrumb-trail span { overflow-wrap: anywhere; }
    .site-content { padding: 24px 24px 48px; }
    .site-footer {
        height: auto;
        min-height: 40px;
        padding: 9px 12px;
        text-align: center;
    }
    body { background-attachment: scroll; }
    .recipe-feature { gap: 18px; }
    .recipe-detail-card { padding: 22px; }
    .add-recipe-card { padding: 22px; }
    .recipe-admin-card { max-width: 100%; }
}

/* Tablets and smaller: stack hero cards and tighten spacing. */
@media screen and (max-width: 760px) {
    .site-header { padding: 10px 14px; }
    .brand-logo { height: 64px; width: min(270px, 100%); }
    .site-content { padding: 20px 14px 44px; }
    .recipe-feature {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        min-height: 0;
        padding: 18px;
    }
    .recipe-copy { flex: 1 1 auto; padding: 0; }
    .recipe-card-image {
        flex: none;
        width: 100%;
        height: auto;
        max-height: 300px;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }
    .recipe-search-results > h1,
    .recipe-copy h1,
    .recipe-detail-heading h1 { font-size: clamp(22px, 4.5vw, 30px); }
    .recipe-search-tabs { flex-wrap: wrap; }
    .recipe-results-grid, .search-results-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
        gap: 12px;
    }
    .recipe-detail-intro {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
    .recipe-detail-image {
        width: 100%;
        height: auto;
        max-height: 320px;
        aspect-ratio: 16 / 9;
    }
    .recipe-facts { grid-template-columns: repeat(auto-fit, minmax(min(115px, 100%), 1fr)); }
    .recipe-detail-toolbar { align-items: flex-start; }
    .recipe-detail-actions { justify-content: flex-start; }
    .recipe-detail-bottom-toolbar { justify-content: flex-end; }
    .login-card { padding: 24px; }
    .add-recipe-card { padding: 20px; }
    .add-recipe-card .recipe-wide-control { width: 100%; }
    .add-recipe-card .recipe-autocomplete-wrap { width: min(100%, 30ch); }
    .add-recipe-card .recipe-quantity-input { width: 100%; }
    .recipe-row-action { max-width: 100%; }
    .ingredient-row-actions, .step-row-actions { flex-wrap: wrap; }
    .category-groups { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
}

/* Phones: give search its own row, then keep nav links accessible. */
@media screen and (max-width: 520px) {
    .site-header { padding: 10px; }
    .header-layout { gap: 8px; }
    .brand-logo { height: 54px; width: min(228px, 100%); }
    /* Mobile search field, button, and dropdown sizing: navbar-placement.css. */

    .breadcrumb-bar { padding: 8px 10px; }
    .breadcrumb-trail { font-size: 12px; line-height: 1.3; }
    .breadcrumb-trail li + li::before { margin: 0 5px; }
    .site-content { padding: 16px 10px 40px; }
    .recipe-feature, .recipe-result-card, .recipe-detail-card,
    .login-card, .add-recipe-card { padding: 15px; }
    .recipe-result-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }
    .search-recipe-result-card .recipe-result-main {
        grid-template-columns: minmax(0, 1fr);
    }
    .recipe-result-image-link {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        aspect-ratio: 16 / 9;
    }
    .recipe-result-content { grid-column: 1; grid-row: 2; }
    .recipe-result-image { width: 100%; height: 100%; }
    .my-recipe-result-card .recipe-result-actions { flex-wrap: wrap; }
    .my-recipe-result-card .recipe-result-actions > a,
    .my-recipe-result-card .recipe-result-actions > form { flex: 1 1 125px; }
    .recipe-result-actions .recipe-view-button { white-space: normal; }
    .recipe-pagination-list { gap: 6px; }
    .recipe-page-number { width: 36px; height: 36px; }
    .recipe-pagination-next { white-space: normal; }
    .recipe-detail-toolbar { gap: 9px; }
    .recipe-detail-actions { gap: 6px; }
    .recipe-detail-actions form,
    .recipe-detail-actions > .recipe-icon-action,
    .recipe-detail-actions form > .recipe-icon-action {
        width: 52px;
        min-width: 52px;
        height: 50px;
        min-height: 50px;
    }
    .recipe-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .recipe-ingredients-list, .recipe-steps-list { padding-left: 18px; }
    .recipe-facts > div { padding: 8px; }
    .login-card { width: 100%; }
    .login-card h1, .add-recipe-card h1 { font-size: 24px; }
    .add-recipe-card .add-recipe-group { padding: 8px; }
    .recipe-row-action { width: auto; min-width: 120px; }
    .category-checkboxes { gap: 6px; }
    .site-footer { font-size: 12px; }
}

/* Very narrow phones: let header links wrap without horizontal scroll. */
@media screen and (max-width: 360px) {

    .recipe-facts { grid-template-columns: minmax(0, 1fr); }
    .recipe-detail-card { padding: 12px; }
}


/* ===============================================================
   COMPACT NAVIGATION MENU
   Shows the desktop links above 760px; on narrower screens a
   native <details> disclosure takes their place. No JS required.
   =============================================================== */
.site-header .header-mobile-menu {
    display: none;
}

@media screen and (max-width: 760px) {
    /* Desktop account links are replaced by the mobile account menu. */
    .site-header .header-quick-links,
    body:not(.admin-site) .header-controls .header-filter-controls {
        display: none;
    }

    /* Search row layout is controlled by navbar-placement.css. */

    .site-header .header-mobile-menu {
        display: block;
        position: relative;
        flex: 0 0 auto;
        margin-left: auto;
        z-index: 1050;
    }

    .site-header .header-mobile-menu-toggle {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 40px;
        padding: 0;
        color: var(--nav-button-foreground);
        background: var(--recipe-button-gradient);
        border: 1px solid var(--cream, #eee8d4);
        border-radius: var(--recipe-button-radius);
        box-shadow: var(--recipe-button-shadow);
        cursor: pointer;
        list-style: none;
    }

    .site-header .header-mobile-menu-toggle::-webkit-details-marker {
        display: none;
    }

    .site-header .header-mobile-menu-toggle:hover,
    .site-header .header-mobile-menu-toggle:focus-visible,
    .site-header .header-mobile-menu[open] > .header-mobile-menu-toggle {
        color: var(--nav-button-hover-foreground);
        background: var(--recipe-button-hover-gradient);
        box-shadow: var(--recipe-button-hover-shadow);
    }

    .site-header .header-mobile-menu-toggle:focus-visible {
        outline: 3px solid #fff;
        outline-offset: 2px;
    }

    .site-header .header-mobile-menu-panel {
        box-sizing: border-box;
        position: absolute;
        top: calc(100% + 7px);
        right: 0;
        width: min(240px, calc(100vw - 28px));
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding: 8px;
        background: var(--sage, #b8c7a4);
        border: 1px solid var(--primary, #3d6501);
        border-radius: 8px;
        box-shadow: 0 8px 20px rgb(0 0 0 / 20%);
    }

    .site-header .header-mobile-logout-form {
        width: 100%;
        margin: 0;
    }

    .site-header .header-mobile-menu-link {
        box-sizing: border-box;
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 42px;
        margin: 0;
        padding: 9px 12px;
        color: var(--nav-button-foreground);
        background: var(--recipe-button-gradient);
        border: 1px solid var(--cream, #eee8d4);
        border-radius: var(--recipe-button-radius);
        box-shadow: var(--recipe-button-shadow);
        font: 800 14px/1.3 Arial, Helvetica, sans-serif;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    /* Mobile Add Recipe icon: replaces an inline style attribute. */
    .site-header .header-mobile-menu-icon {
        display: block;
        flex: 0 0 16px;
        margin-right: 8px;
    }

    .site-header .header-mobile-menu-link:hover,
    .site-header .header-mobile-menu-link:focus-visible {
        color: var(--nav-button-hover-foreground);
        background: var(--recipe-button-hover-gradient);
        box-shadow: var(--recipe-button-hover-shadow);
        text-decoration: none;
    }
}

@media print {
    .site-header .header-mobile-menu {
        display: none !important;
    }
}

/* Keep buttons accessible for people who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
    .btn-site, .search-button { transition: none; }
    .btn-site:hover, .search-button:hover { transform: none; }
}

/* ================================================================
   WIDE SCREEN HEADER SEARCH FIELD
   On desktop, make the search form fill the available space beside
   the logo without moving or resizing the navigation buttons.
   ================================================================ */
@media screen and (min-width: 1101px) {
    .site-header .header-layout {
        grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    }

    .site-header .header-controls,
    body:not(.admin-site) .site-header .header-controls {
        width: 100%;
        max-width: none;
        min-width: 0;
        justify-self: stretch;
        justify-content: flex-start;
    }

    .site-header .header-controls .search-box,
    body:not(.admin-site) .site-header .header-controls .search-box {
        flex: 1 1 0;
        width: auto;
        max-width: 900px;
        min-width: 0;
    }

    .site-header .header-controls .search-box .form-control {
        flex: 1 1 0;
        width: 100%;
        min-width: 0;
    }
}

/* ============================================================
   STATIONARY NAVIGATION + FOOTER
   The public header and breadcrumb/Add Recipe bar form ONE sticky
   element. This avoids guessing the header height at mobile widths.
   Because sticky elements remain in page flow, they do not cover
   content on initial load. The footer keeps its existing fixed layout.
   ============================================================ */
.site-navigation-sticky {
    position: sticky;
    top: 0;
    z-index: 1030;
    width: 100%;
    flex: 0 0 auto;
}

/* Children scroll as one unit; do not give either its own sticky top. */
.site-navigation-sticky > .site-header {
    position: relative;
    inset: auto;
    top: auto;
    z-index: auto;
}

.site-navigation-sticky > .breadcrumb-bar {
    position: relative;
    inset: auto;
    top: auto;
    z-index: auto;
}

/* Admin uses its own separate header template, so keep that sticky. */
.admin-site .site-header {
    position: sticky;
    inset: auto;
    top: 0;
    z-index: 1030;
}

/* Reserve enough room at the bottom for the always-visible footer. */
body {
    padding-bottom: var(--stationary-footer-space);
}

.site-footer {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    inset: auto 0 0;
    box-sizing: border-box;
    min-height: 40px;
    height: auto;
    padding: 6px 10px;
    z-index: 1020;
    text-align: center;
}

/* Admin pages previously allocated 165px for a fixed header.
   Sticky headers are in document flow, so that spacer is obsolete. */
.admin-site .admin-content {
    padding-top: 24px;
}

@media screen and (max-width: 520px) {
    :root { --stationary-footer-space: 90px; }
    .admin-site .admin-content { padding-top: 16px; }
}

/* ==============================================================
   RECIPE DETAIL: TWO-COLUMN INGREDIENTS
   Keep a top-to-bottom reading order down the first column,
   then continue in the second. Only affects displayed recipes.
   ============================================================== */
@media screen and (min-width: 761px) {
    .recipe-detail-page .recipe-ingredients-list {
        column-count: 2;
        column-gap: clamp(20px, 3vw, 48px);
    }

    .recipe-detail-page .recipe-ingredients-list > li {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

@media screen and (max-width: 760px) {
    .recipe-detail-page .recipe-ingredients-list {
        column-count: 1;
    }
}

/* Preserve the existing single-column ingredient list on printouts. */
@media print {
    .recipe-detail-page .recipe-ingredients-list {
        column-count: 1 !important;
    }
}

/* ===============================================================
   SMALLER PAGE BUTTONS — HEADER EXCLUDED
   Keep these variables in :root; manage page actions here.
   One place to control the dimensions of regular buttons.
   Header/nav/search/hamburger styling is intentionally untouched.
   =============================================================== */
/* Standard Bootstrap, custom, and form buttons everywhere except
   inside the site's shared public/admin header. Colors are inherited. */
body :is(.btn, .btn-site, button, input[type="submit"], input[type="button"], input[type="reset"]):not(.site-header *) {
    font-size: var(--page-button-font-size);
    padding: var(--page-button-padding-y) var(--page-button-padding-x);
    min-height: var(--page-button-min-height);
    line-height: 1.25;
}

/* Buttons with dimensions defined independently of Bootstrap. */
body .recipe-result-actions .recipe-view-button {
    height: var(--page-button-min-height);
    min-height: var(--page-button-min-height);
    font-size: var(--page-button-font-size);
    padding: 4px 8px;
}
body .my-recipe-result-card .recipe-result-actions .recipe-view-button {
    font-size: var(--page-button-font-size);
}
body .recipe-result-delete-form {
    height: var(--page-button-min-height);
}
body .recipe-row-action {
    width: auto;
    min-width: 92px;
    height: var(--page-button-min-height);
    min-height: var(--page-button-min-height);
    padding: 4px 9px;
}
body .recipe-page-number {
    width: 32px;
    height: 32px;
    font-size: var(--page-button-font-size);
}
body .recipe-pagination-next {
    font-size: var(--page-button-font-size);
    padding: 4px 6px;
}

/* Print/Edit/Delete actions on the recipe detail view retain their
   vertical icon+label design but take up less room. */
body .recipe-detail-actions form {
    width: 48px;
    height: 44px;
}
body .recipe-detail-actions > .recipe-icon-action,
body .recipe-detail-actions form > .recipe-icon-action {
    width: 48px;
    min-width: 48px;
    height: 44px;
    min-height: 44px;
    gap: 2px;
    padding: 3px;
}
body .recipe-detail-actions .recipe-action-icon {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
}
body .recipe-detail-actions .recipe-action-label {
    font-size: 10px;
}

/* Admin controls previously had a fixed height/width; preserve
   mobile full-width controls where responsive layouts need them. */
body.admin-site .admin-content .account-action-button {
    width: auto;
    min-height: var(--page-button-min-height);
}
body.admin-site .admin-content .account-record .category-remove-button {
    height: var(--page-button-min-height);
    min-height: var(--page-button-min-height);
    padding: 4px 8px;
}
@media screen and (max-width: 520px) {
    body.admin-site .admin-content .account-action-button {
        width: 100%;
    }
}

/* Browsers render the Choose File control separately from normal
   buttons. Reduce its label/padding while leaving the input usable. */
body .add-recipe-card input[type="file"]::file-selector-button {
    font-size: var(--page-button-font-size);
    padding: 4px 8px;
}

/* Recipe Website: consistent dark-green borders for text fields.
   Does not modify checkboxes, radio buttons, file inputs, or buttons. */

/* Fields across recipe pages, authentication screens, admin, and search. */
body input:is([type="text"], [type="email"], [type="password"],
              [type="search"], [type="number"], [type="tel"],
              [type="url"], [type="date"], [type="time"],
              [type="datetime-local"]),
body input:not([type]):not([hidden]),
body textarea,
body select,
body .form-control:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
body .form-select {
    border-color: var(--recipe-field-border) !important;
}

/* Keep the same border on focus, with a visible green focus indicator. */
body input:is([type="text"], [type="email"], [type="password"],
              [type="search"], [type="number"], [type="tel"],
              [type="url"], [type="date"], [type="time"],
              [type="datetime-local"]):focus,
body input:not([type]):not([hidden]):focus,
body textarea:focus,
body select:focus,
body .form-control:not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus,
body .form-select:focus {
    border-color: var(--recipe-field-border) !important;
    box-shadow: 0 0 0 0.2rem var(--recipe-field-focus-ring);
}

/* ==============================================================
   RECIPE DETAIL: TWO-COLUMN DIRECTIONS
   Use the original ordered list so steps retain their numbering.
   Individual steps stay together when columns are balanced.
   ============================================================== */
@media screen and (min-width: 761px) {
    .recipe-detail-page .recipe-steps-list {
        column-count: 2;
        column-gap: clamp(24px, 3vw, 48px);
        column-fill: balance;
    }

    .recipe-detail-page .recipe-steps-list > li {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

@media screen and (max-width: 760px) {
    .recipe-detail-page .recipe-steps-list {
        column-count: 1;
    }
}

/* Keep printed directions together in one readable column. */
@media print {
    .recipe-detail-page .recipe-steps-list {
        column-count: 1 !important;
    }
}

/* RECIPE_STYLE_CLEANUP_20261021
   Bootstrap 5.3.3 loads before this stylesheet. Recipe photo frame geometry,
   colour tokens and screen breakpoints are owned by their component sections;
   do not append a second competing photo-size rule. */

/* Recipe result cards: categories directly above the action buttons. */
.recipe-result-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    line-height: 1.4;
}

.recipe-result-categories-label {
    margin-right: 2px;
    font-weight: 700;
}

.recipe-result-category {
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid var(--primary);
    border-radius: 10px;
    background: var(--cream);
    color: var(--primary);
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* Preserve the existing card buttons immediately under categories. */
.recipe-result-categories + .recipe-result-actions,
.search-recipe-result-card .recipe-result-categories + .recipe-result-actions {
    margin-top: 0;
    padding-top: 8px;
}

/* ================================================================
   ADD RECIPE ACTION IN BREADCRUMB BAR
   Navigation stays in the header; this action is shown only to users
   who are logged in (controlled by includes/header.php).
   ================================================================ */
.breadcrumb-bar .breadcrumb-trail {
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.breadcrumb-bar .breadcrumb-add-recipe {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    gap: 5px;
    min-height: 30px;
    height: 30px;
    margin: 0 0 0 auto;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}

.breadcrumb-bar .breadcrumb-add-recipe-icon {
    display: block;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
}

/* Allow the breadcrumb text to shrink while the action stays visible. */
@media screen and (max-width: 520px) {
    .breadcrumb-bar { gap: 8px; }
    .breadcrumb-bar .breadcrumb-trail {
        flex-wrap: nowrap;
        overflow: hidden;
        white-space: nowrap;
    }
    .breadcrumb-bar .breadcrumb-trail li { min-width: 0; }
    .breadcrumb-bar .breadcrumb-add-recipe {
        min-height: 32px;
        height: 32px;
        padding: 4px 8px;
        font-size: 11px;
    }
}

@media print {
    .breadcrumb-bar .breadcrumb-add-recipe { display: none !important; }
}

/* Printable recipes should not be affected by the sticky navigation. */
@media print {
    .site-navigation-sticky { position: static !important; z-index: auto !important; }
}

/* Guest recipe filters: Bootstrap row + input-group. Keep website colors. */
.guest-recipe-browse {
    background: #f0fff0;
    border-color: var(--primary) !important;
}

.guest-recipe-browse-form {
    min-width: 0;
    margin: 0;
}

.guest-recipe-browse-form .form-label {
    color: var(--text);
    margin-bottom: 6px;
}

.guest-recipe-browse-form .input-group > .form-select {
    min-width: 0;
    min-height: 40px;
    background-color: #fff;
    border-color: var(--primary) !important;
}

/* Dark green outline on guest dropdowns, including keyboard focus. */

.guest-recipe-browse-form .input-group > .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgb(61 101 1 / 20%);
}

.guest-recipe-browse-form .input-group > .btn-site {
    flex: 0 0 auto;
    min-height: 40px;
    border-radius: 0 9px 9px 0;
    white-space: nowrap;
}

@media screen and (max-width: 520px) {
    .guest-recipe-browse-form .input-group > .btn-site {
        padding-inline: 9px;
    }
}
