@import url("https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap");

:root {
    --bs-primary: #E07A3E; /* brand orange */
    --bs-primary-2: #C96A30; /* darker orange (hover/active) */
    --bs-espresso: #2E241D; /* navbar / dark accents */
    --bs-danger: rgb(250, 216, 218);
    --bs-danger-2: rgb(231, 91, 92);
    --bs-grey: #F4F1EB; /* warm light page background */
    --bs-black: #2E241D; /* warm near-black for text */
}

* {
    font-family: "Raleway", sans-serif;
    font-optical-sizing: auto;
    font-style: normal;
}

body {
    background-color: var(--bs-grey);
}

nav {
    margin-bottom: 20px;
}

.navbar {
    background: #2E241D !important;
    --bs-navbar-color: #C7B4A2; /* idle links */
    --bs-navbar-hover-color: #ffffff;
    --bs-navbar-active-color: #ffffff;
    --bs-navbar-brand-color: #E07A3E; /* wordmark */
    --bs-navbar-brand-hover-color: #ffffff;
}

.navbar .navbar-brand {
    color: #E07A3E !important;
}

.navbar .navbar-brand:hover {
    color: #FFFFFF !important;
}

.navbar a:hover, .navbar-brand:hover {
    text-decoration: none;
}

a {
    text-decoration: none;
    color: black;
}

a:hover {
    text-decoration: underline;
}

.shadow-bottom {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-control {
    border-radius: 2px;
    border: 2px solid #aaa !important;
}

.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary-2);
    --bs-btn-hover-border-color: var(--bs-primary-2);
    --bs-btn-active-bg: var(--bs-primary-2);
    --bs-btn-active-border-color: var(--bs-primary-2);
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
    --bs-btn-focus-shadow-rgb: 224, 122, 62;   /* orange focus ring, not blue */
    border-radius: 2px !important;
}

.form-control:focus {
    box-shadow: none; /* remove Bootstrap blue shadow */
    border-color: #666; /* warm focus border */
    outline: 2px dotted #666; /* warm dotted outline */
    outline-offset: 2px;
}

.alert-danger {
    border-radius: 0;
    border: none;
    background: var(--bs-danger) !important;
    border-left: 5px solid var(--bs-danger-2) !important;
}

.dropdown-menu {
    border: none;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
}

.dropdown-item {
    padding: 10px 20px;
}

.dropdown-item:active {
    background: none;
}

.active {
    font-weight: bold;
}

.form-label {
    color: var(--bs-black) !important;
}

.social {
    border: 1px solid #ccc;
    border-radius: 2px;
    margin-bottom: 20px;
}


.btn-light {
    border: none;
    border-radius: 2px;
    background-color: #F6E0C5; /* warm cream */
    transition: background-color 0.3s ease;
}

.btn-light:hover,
.btn-light:active {
    background-color: #EAC79C !important; /* deeper cream */
}

.no-outline:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: inherit !important;
}

.form-control {
    background-color: #f4f4f4 !important;
}

.form-control:focus {
    background-color: #dbdbdb !important;
}

.primary {
    color: #2E241D !important; /* espresso */
}

/* CHECKBOX */
.form-check-input:checked {
    border-color: #E07A3E;
    background-color: #E07A3E;
}

.form-check-input {
    border-radius: 1px !important;
    border: 2px solid #6c757d;
    transition: all 0.3s ease;
}

.form-check-input:hover {
    border-color: #C96A30;
}

.form-check-label {
    cursor: pointer;
}

li {
    list-style: none !important;
}

.header {
    background-color: #F6F1E8 !important; /* warm panel */
    border-radius: 2px;
}

h4 {
    font-weight: normal !important;
}

.recept-link {
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.recept-link:hover {
    font-weight: bold;
    text-decoration: underline;
}

.preserve-newlines {
    white-space: pre-line;
}

/* ---- Field validation (modern) ---------------------------------- */
.form-control.is-invalid,
.form-control.is-invalid:focus {
    border-color: var(--bs-danger-2) !important;
    background-color: #fff6f5 !important; /* soft tint, not grey */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23e75b5c'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23e75b5c' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    background-size: 16px 16px;
    padding-right: 2.75rem;
}

.form-control.is-invalid:focus {
    outline: none !important; /* drop the dotted outline */
    box-shadow: 0 0 0 3px rgba(231, 91, 92, 0.18) !important; /* soft focus ring */
}

.field-error {
    display: inline;
    margin-left: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 400; /* not bold like the label */
    color: var(--bs-danger-2);
    animation: field-error-in 0.18s ease-out;
}

@keyframes field-error-in {
    from {
        opacity: 0;
        transform: translateX(-4px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .field-error {
        animation: none;
    }
}

/* ---- Surfaces ---------------------------------------------------- */
.card {
    border: 0;
    padding: 24px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 20px rgba(46, 36, 29, 0.06);
}

html { scroll-behavior: smooth; }

/* ---- Page hero --------------------------------------------------- */
.page-hero { margin: 8px 0 26px; }
.page-hero h1 {
    font-weight: 800;
    color: var(--bs-espresso);
    letter-spacing: -0.02em;
    margin: 0;
}
.page-hero p { color: #8a7d70; margin: 4px 0 0; }

/* ---- Category chips (anchor nav) --------------------------------- */
.chip-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--bs-espresso);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(46, 36, 29, 0.05);
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}
.chip:hover {
    border-color: var(--bs-primary);
    transform: translateY(-1px);
    text-decoration: none;
}

/* ---- Sections ---------------------------------------------------- */
.recipe-section { margin-bottom: 38px; scroll-margin-top: 90px; }
.recipe-section__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.recipe-section__head h2 {
    font-weight: 800;
    color: var(--bs-espresso);
    margin: 0;
    font-size: 1.4rem;
}
.recipe-section__count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bs-primary);
    background: #fff;
    padding: 2px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(46, 36, 29, 0.05);
}

/* ---- Grid + cards ------------------------------------------------ */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.recipe-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(46, 36, 29, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    height: 100%;
    animation: card-in 0.35s ease both;
}
.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(46, 36, 29, 0.13);
    text-decoration: none;
}
.recipe-thumb {
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
}
.cat-meat .recipe-thumb { background: linear-gradient(135deg, #F7E4CC 0%, #EAB98C 100%); }
.cat-veg  .recipe-thumb { background: linear-gradient(135deg, #E7F0DA 0%, #C2DBA6 100%); }

.recipe-card__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}
.recipe-card__title {
    font-weight: 700;
    color: var(--bs-espresso);
    line-height: 1.25;
    font-size: 0.98rem;
}
.recipe-card__meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }

/* ---- Soft badges ------------------------------------------------- */
.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
}
.badge-days  { background: #F4F1EB; color: var(--bs-espresso); }
.badge-salty { background: #FBE7D5; color: var(--bs-primary-2); }
.badge-sweet { background: #F3E1EF; color: #9c4f86; }

/* ---- Detail page ------------------------------------------------- */
.back-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--bs-espresso);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(46, 36, 29, 0.06);
    margin-bottom: 18px;
    transition: all 0.2s ease;
}
.back-chip:hover { transform: translateX(-2px); color: var(--bs-primary); text-decoration: none; }

.detail-hero {
    background: linear-gradient(135deg, var(--bs-espresso) 0%, #4a3a2e 100%);
    color: #fff;
    border-radius: 22px;
    padding: 30px 28px;
    margin-bottom: 18px;
}
.detail-hero h1 { font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; font-size: 1.8rem; }
.detail-hero .badge-soft { background: rgba(255, 255, 255, 0.15); color: #fff; }

.instructions-block { font-size: 1rem; line-height: 1.7; color: #3a2f26; }

/* ---- Navbar active pill ------------------------------------------ */
.navbar .nav-link { border-radius: 999px; padding-left: 14px; padding-right: 14px; transition: all 0.2s ease; }
.navbar .nav-link.active { background: rgba(224, 122, 62, 0.20); color: #fff !important; }

/* ---- Motion ------------------------------------------------------ */
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .recipe-card { animation: none; }
    html { scroll-behavior: auto; }
}

.badge-glass { background: rgba(255, 255, 255, 0.16); color: #fff; }