/* Recipe Goat theme — bright and cheerful to match the Twemoji icon
 * set: warm cream paper, vivid tangerine, sunny yellow, leaf green and
 * sky blue. Flat colors, big rounded corners, playful hover lifts.
 * Bootstrap still handles all layout and components; this file only
 * sets the palette, shapes and cheerful touches. */

:root {
  --goat-cream: #fff9f1;
  --goat-paper: #ffffff;
  --goat-sand: #ffe8c2;
  --goat-peach: #ffb74d;
  --goat-tang: #f76707;
  --goat-tang-deep: #e8590c;
  --goat-ink: #37474f;
  --goat-sun: #ffd43b;
  --goat-sun-deep: #fab005;
  --goat-sun-ink: #5c4800;
  --goat-leaf: #40c057;
  --goat-leaf-deep: #2f9e44;
  --goat-berry: #ff6b6b;
  --goat-sky: #4dabf7;
  --goat-sky-ink: #0b3d5c;
}

/* Reserve scrollbar space so the header doesn't shift on pages tall
 * enough to scroll. */
html {
  scrollbar-gutter: stable;
}

body {
  background-color: var(--goat-cream);
  color: var(--goat-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: clip;
}

h1,
h2,
h3,
.card-title {
  color: var(--goat-ink);
  font-weight: 800;
  letter-spacing: -0.01em;
}

a {
  color: var(--goat-tang);
}

a:hover {
  color: var(--goat-tang-deep);
}

/* --- Navbar: light sandy bar, dark links, tangerine hover --- */
.navbar-goat {
  background-color: var(--goat-sand);
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.12);
}

.navbar-goat .navbar-brand,
.navbar-goat .nav-link {
  color: var(--goat-ink);
  font-weight: 700;
}

.navbar-goat .nav-link:hover,
.navbar-goat .nav-link:focus {
  color: var(--goat-tang-deep);
}

/* --- Cards: white surface, peachy outline, big rounded corners --- */
.card {
  background-color: var(--goat-paper);
  border: 2px solid var(--goat-peach);
  border-radius: 1.25rem;
}

main .bg-light {
  background-color: var(--goat-sand) !important;
  border: 2px solid var(--goat-peach);
}

/* --- Recipe tiles: border brightens on hover --- */
#recent-list .card:hover,
#search-results .card:hover {
  border-color: var(--goat-tang);
}

/* --- Cook mode: highlight ingredients + amounts in the instructions --- */
#cook-content strong {
  font-weight: 800;
}

/* --- Cook mode: breathing room between instruction steps --- */
#cook-content ol li {
  margin-bottom: 0.25rem;
}

/* --- Recipe grid tiles: compact titles and tag pills --- */
#recent-list .card .fw-bold,
#search-results .card .fw-bold,
#favourites-list .card .fw-bold {
  font-size: 0.875rem;
}

#recent-list .card .card-body,
#search-results .card .card-body,
#favourites-list .card .card-body {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

#recent-list .card .badge,
#search-results .card .badge,
#favourites-list .card .badge {
  font-size: 0.65rem;
}

/* --- Small screens: larger readable text (Bootstrap scales in rem,
 * so lifting the root size grows body text, buttons and tiles too) --- */
@media (max-width: 576px) {
  html {
    font-size: 125%;
  }

  .hero-full .display-5 {
    font-size: 3rem;
  }
}

/* --- Full-screen hero (anonymous home): edge-to-edge gradient --- */
.hero-full {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: -1.5rem;
  margin-bottom: 2.5rem;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  background: linear-gradient(150deg, #ffd43b 0%, #ffa94d 50%, #ff8787 100%);
  border-radius: 0;
  border: none;
}
#recent-list .card:hover,
#search-results .card:hover {
  border-color: var(--goat-tang);
}

/* --- Buttons: sunny primary, leafy success --- */
.btn-primary {
  background-color: var(--goat-sun);
  border-color: var(--goat-sun-deep);
  color: var(--goat-sun-ink);
  font-weight: 700;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #ffe066;
  border-color: var(--goat-sun-deep);
  color: var(--goat-sun-ink);
}

.btn-primary:disabled {
  background-color: var(--goat-sun);
  border-color: var(--goat-sun-deep);
  color: var(--goat-sun-ink);
}

.btn-success {
  background-color: var(--goat-leaf);
  border-color: var(--goat-leaf-deep);
  font-weight: 700;
}

.btn-success:hover,
.btn-success:focus {
  background-color: #51cf66;
  border-color: var(--goat-leaf-deep);
}

.btn-link {
  color: var(--goat-tang);
  font-weight: 600;
}

/* --- Outline buttons in theme tangerine: white surface, tangerine frame --- */
.btn.btn-outline-goat {
  background-color: #ffffff;
  border: 2px solid var(--goat-tang);
  color: var(--goat-tang-deep);
  font-weight: 700;
}

.btn.btn-outline-goat:hover,
.btn.btn-outline-goat:focus {
  background-color: var(--goat-tang);
  border-color: var(--goat-tang-deep);
  color: #ffffff;
}

/* --- Forms: sunny focus ring --- */
.form-control:focus,
.form-check-input:focus {
  border-color: var(--goat-sun);
  box-shadow: 0 0 0 0.25rem rgba(255, 212, 59, 0.35);
}

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

/* --- Tag manager: bolder checkbox outlines when unchecked --- */
#tags-modal .form-check-input:not(:checked) {
  border-width: 2px;
}

/* --- Tag manager: colour square beside each library tag name --- */
.tag-color-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
  background-color: var(--goat-peach);
  display: inline-block;
  flex-shrink: 0;
}

/* --- Search tag dropdown: bolder checkbox outlines when unchecked --- */
#search-tags .form-check-input:not(:checked) {
  border-width: 2px;
}

/* --- Tag manager tabs: theme palette instead of Bootstrap blue --- */
#tags-modal .nav-tabs {
  border-bottom: 2px solid var(--goat-peach);
}

#tags-modal .nav-tabs .nav-link {
  color: var(--goat-ink);
  font-weight: 700;
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: 0.75rem 0.75rem 0 0;
}

#tags-modal .nav-tabs .nav-link:hover,
#tags-modal .nav-tabs .nav-link:focus {
  color: var(--goat-tang-deep);
  background-color: var(--goat-sand);
  border-color: var(--goat-peach);
  border-bottom: none;
}

#tags-modal .nav-tabs .nav-link.active {
  color: var(--goat-sun-ink);
  background-color: var(--goat-sun);
  border-color: var(--goat-sun-deep);
  border-bottom: none;
}

/* --- Feedback components in palette --- */
.progress-bar {
  background-color: var(--goat-leaf);
}

.alert-warning {
  border-width: 2px;
}

.badge.text-bg-secondary {
  background-color: var(--goat-sky) !important;
  color: var(--goat-sky-ink) !important;
}

/* --- Modals: rounded white with a tangerine frame --- */
.modal-content {
  background-color: var(--goat-paper);
  border: 3px solid var(--goat-tang);
  border-radius: 1.25rem;
}

.modal-header {
  border-bottom: 2px solid var(--goat-peach);
}

.modal-footer {
  border-top: 2px solid var(--goat-peach);
}

/* --- Floating add-recipe button: fixed circular plus, menu opens above --- */
.add-recipe-fab {
  position: fixed;
  right: 2.5rem;
  bottom: 2.5rem;
  /* Below the offcanvas sheet (1045) and its backdrop (1040) so the
   * recipe-options menu covers it, but above page content and the
   * mobile tab bar (1030). */
  z-index: 1035;
}

.add-recipe-fab-btn {
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  border: 2px solid var(--goat-sky-ink);
  background-color: var(--goat-sky);
  color: #ffffff;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0.25rem;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
}

.add-recipe-fab-btn:hover,
.add-recipe-fab-btn:focus {
  background-color: #74c0fc;
  color: #ffffff;
}

/* --- Mobile bottom tab bar: visible only below the md breakpoint
 * (paired with d-md-none in base.html) --- */
.mobile-tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  background-color: var(--goat-paper);
  border-top: 2px solid var(--goat-peach);
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-tabbar a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.25rem;
  color: var(--goat-ink);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.mobile-tabbar a:hover,
.mobile-tabbar a:focus,
.mobile-tabbar a.active {
  color: var(--goat-tang-deep);
}

.mobile-tabbar #cart-count-mobile {
  margin-top: 0.15rem;
}

@media (max-width: 767.98px) {
  /* Keep page content and the add-recipe button clear of the tab bar. */
  body {
    padding-bottom: 4.5rem;
  }

  .add-recipe-fab {
    bottom: 5.5rem;
    right: 1.5rem;
  }
}

/* --- Dropdown menus: white surface, peachy frame, rounded like cards --- */
.dropdown-menu {
  background-color: var(--goat-paper);
  border: 2px solid var(--goat-peach);
  border-radius: 1rem;
}

.dropdown-item {
  color: var(--goat-ink);
  font-weight: 600;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--goat-sand);
  color: var(--goat-tang-deep);
}

/* --- Popup menus: slightly larger item text --- */
.dropdown-menu .dropdown-item {
  font-size: 1.125rem;
}

/* --- Ghost round buttons: transparent until hovered --- */
.btn-ghost-round {
  background-color: transparent;
  border-color: transparent;
  color: var(--goat-ink);
}
.btn-ghost-round:hover,
.btn-ghost-round:focus {
  background-color: var(--goat-sand);
  border-color: var(--goat-peach);
  color: var(--goat-tang-deep);
}

/* --- Bottom sheets: grabber hint for swipe-to-dismiss --- */
.sheet-grabber {
  width: 3rem;
  height: 0.3rem;
  border-radius: 999px;
  background-color: var(--goat-peach);
  margin: 0.35rem auto 0.75rem;
}

/* --- Bottom sheets: rounded top corners to match the cards --- */
.offcanvas.offcanvas-bottom {
  border-top-left-radius: 1.25rem;
  border-top-right-radius: 1.25rem;
  border-top: 2px solid var(--goat-tang);
}

/* --- View page pill buttons: light yellow sun tint --- */
.btn-sun-pill {
  background-color: #ffe066;
  border: 1px solid var(--goat-sun-deep);
  color: var(--goat-sun-ink);
}

.btn-sun-pill:hover,
.btn-sun-pill:focus {
  background-color: var(--goat-sun);
  border-color: var(--goat-sun-deep);
  color: var(--goat-sun-ink);
}

/* --- Cook mode: full-screen overlay above navs and tab bar --- */
#cook-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: var(--goat-cream);
  overflow-y: auto;
  padding: 1rem 1rem 3rem;
}

#cook-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 2px solid var(--goat-ink);
  background-color: var(--goat-paper);
  color: var(--goat-ink);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 0.25rem;
}

#cook-close:hover,
#cook-close:focus {
  background-color: var(--goat-sand);
  color: var(--goat-tang-deep);
  border-color: var(--goat-tang-deep);
}

#cook-overlay-inner {
  max-width: 48rem;
  margin: 0 auto;
}

#cook-content ol {
  list-style-position: inside;
  padding-left: 0;
}

#cook-content ol li {
  cursor: pointer;
  padding: 0.5rem 0.9rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  font-size: 1.15rem;
  line-height: 1.5;
}

#cook-content ul li {
  font-size: 1.15rem;
  line-height: 1.5;
}

#cook-content h2,
#cook-content .cook-section-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: underline;
}

#cook-content ol li:hover {
  border-color: var(--goat-peach);
}

#cook-content ol li.cook-active {
  background-color: var(--goat-sun);
  border-color: var(--goat-sun-deep);
  color: var(--goat-sun-ink);
}

