﻿/* Source: themes.css */
:root {
  --recipe_card_border: solid 1px rgba(30, 30, 30, 0.2);
  --highlight: rgba(0, 34, 255, 0.2);
  --lowlight: rgba(63, 63, 63, 0.2);
  --text_color: #20231e;
  --text_color_secondary: #70736b;
  --section_dark: #f7f5ef;
  --section_light: #f0eee7;
  --box_shadow_color: rgba(0, 0, 0, 0.2);
  --scrollbar_thumb_color: rgb(204, 203, 203);
  --scrollbar_track_color: rgb(231, 231, 231);
  --icon_filter: none;

  font-family: "DM Sans", sans-serif;
  color: var(--text_color);
  text-shadow: none;
}

body.dark_mode {
  --recipe_card_border: solid 1px #2a2a2a;
  --highlight: rgba(255, 255, 255, 0.04);
  --lowlight: rgba(255, 255, 255, 0.02);
  --text_color: #d4d4d4;
  --text_color_secondary: #9da5b4;
  --section_dark: #252526;
  --section_light: #2d2d2d;
  --box_shadow_color: rgba(0, 0, 0, 0.4);
  --scrollbar_thumb_color: #3e3e42;
  --scrollbar_track_color: #2a2d2e;
  --icon_filter: invert(1) brightness(1.1);

  background-color: #1e1e1e;
  color: var(--text_color);
  text-shadow: none;
}

body.dork_mode {
  --recipe_card_border: solid 1px rgba(79, 210, 105, 0.22);
  --highlight: rgba(71, 217, 101, 0.18);
  --lowlight: rgba(61, 153, 79, 0.13);
  --text_color: #8bd99a;
  --text_color_secondary: #5fa66d;
  --section_dark: #0b120d;
  --section_light: #0e1711;
  --box_shadow_color: rgba(0, 0, 0, 0.55);
  --scrollbar_thumb_color: #366b40;
  --scrollbar_track_color: #0a100c;
  --icon_filter: invert(77%) sepia(20%) saturate(947%) hue-rotate(79deg)
    brightness(91%);

  background-color: #070b08;
  color: var(--text_color);
  font-family: "Courier New", monospace;
  text-shadow: none;
  background-image:
    linear-gradient(rgba(55, 150, 72, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(55, 150, 72, 0.018) 1px, transparent 1px);
  background-size: 22px 22px;
}

body {
  background-color: var(--section_dark);
}

body.dork_mode .title_bar,
body.dork_mode #home_btn,
body.dork_mode #workspace_intro h1 {
  color: #a2e7ae;
  text-shadow: 0 0 7px rgba(71, 217, 101, 0.25);
}

body.dork_mode .recipe_card {
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.62),
    0 0 14px rgba(64, 185, 87, 0.07);
}

body.dork_mode .recipe_card button,
body.dork_mode #search_box {
  text-shadow: 0 0 5px rgba(71, 217, 101, 0.18);
}

/* Source: recipe_space_header.css */
body {
  margin: 0;
  min-height: 100vh;
  background: var(--section_light);
}

header {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  min-width: 30rem;
  padding: 1rem;
  background-color: var(--section_dark);
  position: relative;
  z-index: 5000;
  transition:
    margin-top 0.25s ease,
    box-shadow 0.25s ease;
}

header.collapsed {
  margin-top: -4rem;
}

#workspace_actions {
  flex: 1;
  max-width: 46rem;
  display: flex;
  align-items: stretch;
  height: 2rem;
}

/* ------------------------------ Home button ---------------------------- */
#home_btn {
  font-size: xx-large;
  color: var(--text_color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Fraunces", serif;
}

.brand_burner {
  display: block;
  width: 30px;
  height: 30px;
  border: 2px solid #111;
  border-radius: 50%;
  background: repeating-radial-gradient(
    circle,
    #111 0 2px,
    transparent 3px 5px,
    #111 6px 7px,
    transparent 8px 10px
  );
  transition: 0.3s;
}
#home_btn:hover .brand_burner {
  border-color: #c33b2c;
  background: repeating-radial-gradient(
    circle,
    #d64a37 0 2px,
    transparent 3px 5px,
    #c33b2c 6px 7px,
    transparent 8px 10px
  );
  box-shadow:
    0 0 8px #d64a3777,
    0 0 18px #d64a3738;
}
body.dark_mode .brand_burner,
body.dork_mode .brand_burner {
  background-color: #e8e8e1;
}

/* ------------------------------ Search ---------------------------- */
#search_box {
  --height: 2rem;

  position: relative;
  display: flex;
  justify-items: center;
  position: relative;
  height: 2rem;
  flex: 1;
  border-radius: calc(var(--height) / 2) 0 0 calc(var(--height) / 2);
  padding: 0rem 1rem 0rem 2rem;
  font-size: larger;
  border: var(--recipe_card_border);
  color: var(--text_color);
}
#search_box input {
  max-width: 100%;
  outline: none;
}
/* magnifying glass */
#search_box::before,
#search_box::after {
  position: absolute;
  content: "";
  left: calc(var(--height) / 2);
  top: calc(var(--height) / 2);
}
#search_box::after {
  height: 0.5rem;
  aspect-ratio: 1/1;
  border: solid 2px var(--text_color);
  border-radius: 50%;
  background-color: var(--section_dark);
  transform: translate(-65%, -65%);
}
#search_box::before {
  height: 0.2rem;
  width: 0.8rem;
  background-color: var(--text_color);
  transform: translate(-20%, 55%) rotate(45deg);
}

#search_results {
  display: none;
  flex-direction: column;
  box-sizing: border-box;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 100%;
  padding: 0.5rem;
  z-index: 9000;
  background-color: var(--section_dark);
  list-style-type: none;
}
#search_results > * {
  padding-bottom: 0.5rem;
  width: 100%;
}
#search_results > *:hover {
  background-color: var(--section_light);
}

#search_box input {
  min-width: 0;
}

#new_recipe_btn,
#workspace_intro button {
  border: 0;
  border-radius: 0.35rem;
  padding: 0.6rem 1rem;
  background: #b64230;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    color 0.2s;
}

#workspace_actions #new_recipe_btn {
  flex: 0 0 auto;
  border-radius: 0 calc(var(--height, 2rem) / 2) calc(var(--height, 2rem) / 2) 0;
  margin-left: -1px;
  padding-inline: 1.15rem;
}

#clear_space_btn {
  border: var(--recipe_card_border);
  border-left: 0;
  border-radius: 0 calc(var(--height, 2rem) / 2) calc(var(--height, 2rem) / 2) 0;
  padding: 0 0.85rem;
  background: var(--section_light);
  color: var(--text_color_secondary);
  cursor: pointer;
}

#make_all_btn {
  border: 0;
  border-radius: 0;
  padding: 0 1rem;
  background: #b64230;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s,
    color 0.2s;
}
#make_all_btn:hover {
  background: #c9513e;
}
body.dark_mode #make_all_btn {
  background: #3a3a3d;
  border: 1px solid #55555a;
  color: #eeeeef;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}
body.dark_mode #make_all_btn:hover {
  background: #4a4a4f;
  border-color: #6a6a70;
}
body.dork_mode #make_all_btn {
  background: #102b17;
  border: 1px solid #3c8750;
  color: #a2e7ae;
  box-shadow:
    inset 0 0 12px rgba(71, 217, 101, 0.06),
    0 0 8px rgba(71, 217, 101, 0.08);
  font-family: "Courier New", monospace;
  text-shadow: 0 0 5px rgba(71, 217, 101, 0.2);
}
body.dork_mode #make_all_btn:hover {
  background: #163a20;
  border-color: #58aa69;
}

#workspace_actions #new_recipe_btn {
  border-radius: 0;
}

#workspace_actions #search_box,
#workspace_actions #new_recipe_btn,
#workspace_actions #make_all_btn,
#workspace_actions #clear_space_btn {
  box-sizing: border-box;
  height: 2rem;
  min-height: 2rem;
}

#workspace_actions #new_recipe_btn,
#workspace_actions #clear_space_btn {
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}

#header_toggle {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  width: 46px;
  height: 24px;
  border: var(--recipe_card_border);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--section_dark);
  color: var(--text_color);
  box-shadow: 0 4px 8px var(--box_shadow_color);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

#new_recipe_btn:hover,
#workspace_intro button:hover {
  background: #c9513e;
}

#new_recipe_btn:focus-visible,
#workspace_intro button:focus-visible {
  outline: 2px solid #d66b59;
  outline-offset: 3px;
}

body.dark_mode #new_recipe_btn,
body.dark_mode #workspace_intro button {
  background: #3a3a3d;
  border: 1px solid #55555a;
  color: #eeeeef;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

body.dark_mode #new_recipe_btn:hover,
body.dark_mode #workspace_intro button:hover {
  background: #4a4a4f;
  border-color: #6a6a70;
}

body.dork_mode #new_recipe_btn,
body.dork_mode #workspace_intro button {
  background: #102b17;
  border: 1px solid #3c8750;
  color: #a2e7ae;
  box-shadow:
    inset 0 0 12px rgba(71, 217, 101, 0.06),
    0 0 8px rgba(71, 217, 101, 0.08);
  font-family: "Courier New", monospace;
  text-shadow: 0 0 5px rgba(71, 217, 101, 0.2);
}

body.dork_mode #new_recipe_btn:hover,
body.dork_mode #workspace_intro button:hover {
  background: #163a20;
  border-color: #58aa69;
  box-shadow:
    inset 0 0 14px rgba(71, 217, 101, 0.1),
    0 0 10px rgba(71, 217, 101, 0.12);
}

body.dork_mode #new_recipe_btn:focus-visible,
body.dork_mode #workspace_intro button:focus-visible {
  outline-color: #67bd78;
}

#workspace_intro {
  position: fixed;
  inset: 4rem 0 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 2rem;
  color: var(--text_color);
}

#workspace_intro.hidden {
  display: none;
}
#workspace_intro p {
  margin: 0;
  color: #b64230;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}
#workspace_intro h1 {
  margin: 0.5rem 0 1rem;
  font-family: Georgia, serif;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 500;
}
#workspace_intro span {
  max-width: 34rem;
  line-height: 1.6;
  color: var(--text_color_secondary);
}
#workspace_intro button {
  margin-top: 1.75rem;
}

@media (max-width: 680px) {
  header {
    min-width: 0;
    gap: 0.75rem;
  }
  #home_btn {
    font-size: 1.25rem;
  }
  #workspace_actions {
    min-width: 0;
  }
  #search_box {
    flex: 1;
    padding-left: 1.7rem;
  }
  #new_recipe_btn {
    font-size: 0;
    padding-inline: 0.8rem;
  }
  #new_recipe_btn::after {
    content: "+";
    font-size: 1.25rem;
  }
}

/* Source: recipe.css */
.recipe_card h3,
.recipe_card h1 {
  margin: 0;
}

.recipe_card ul,
.recipe_card ol {
  padding: 0;
}

ol {
  list-style-position: outside;
  padding-left: 2em;
}

/* this code helps ol list numbers start at the top */
.step-row {
  display: flex;
  align-items: flex-start;
}

/* ------------------------------ Fragments ---------------------------- */
.recipe_card li {
  margin: 0.5rem 0rem;
}

/* ------------------------------ Recipe card ---------------------------- */
.recipe_card {
  position: fixed;
  /* for js click-drag reposition */
  display: grid;
  align-items: start;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: auto 1fr auto;
  resize: none;
  min-width: 40em;
  min-height: 20em;
  z-index: 0;

  border-radius: 1em;
  border: var(--recipe_card_border);
  overflow: hidden;

  box-shadow: 0 0 3px 3px var(--box_shadow_color);
}

.title_bar {
  grid-column: span 2;
  display: flex;
  gap: 0.5rem;
  padding: 1rem 2rem;
  z-index: 10;
  font-size: x-large;
  font-weight: 700;
  background-color: var(--section_dark);
  box-shadow: 0px 4px 4px var(--box_shadow_color);
  cursor: grab;
}

.title_bar > div {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem;
  height: 1.5rem;
  width: fit-content;

  border-radius: 0.5rem;
  border: var(--recipe_card_border);
  color: black;
  background: var(--highlight);
}
.submit_btn {
  height: 1.5rem;
  padding: none;
}

.title_bar div img {
  max-height: 100%;
}

/* Editing is not implemented yet; do not render its empty placeholder. */
.title_bar .edit_btn {
  display: none;
}

.resize_handle {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 18px !important;
  height: 18px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background:
    linear-gradient(
        135deg,
        transparent 45%,
        var(--text_color) 47%,
        var(--text_color) 54%,
        transparent 56%
      )
      7px 7px / 8px 8px no-repeat,
    linear-gradient(
        135deg,
        transparent 45%,
        var(--text_color) 47%,
        var(--text_color) 54%,
        transparent 56%
      )
      1px 7px / 14px 14px no-repeat !important;
  opacity: 0.45;
  cursor: nwse-resize;
  z-index: 20;
}

.resize_handle:hover {
  opacity: 0.9;
}

.save_btn {
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.2s;
}
.save_btn.saving {
  opacity: 0.55;
}
.save_btn.saved {
  background: #4f7c58;
  transform: scale(1.08);
}

.ingredients::-webkit-scrollbar,
.steps::-webkit-scrollbar {
  width: 10px;
}

.ingredients::-webkit-scrollbar-thumb,
.steps::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar_thumb_color);
}

.ingredients::-webkit-scrollbar-track,
.steps::-webkit-scrollbar-track {
  background-color: var(--scrollbar_track_color);
}

.ingredients,
.steps {
  align-self: stretch;
  overflow-y: scroll;
  padding: 1rem 2rem;
  background-color: var(--section_light);
}
.ingredients ul {
  list-style: none;
}

.notes {
  grid-column: span 2;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem 2rem;

  border-top: var(--recipe_card_border);
  background-color: var(--section_light);
}

.notes .list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.note {
  flex-shrink: 0;
  flex-grow: 0;
  max-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.25em 0.75em;
  border-radius: 0.5em;
  background: var(--lowlight);
  word-break: break-word;
}

/* <a href="https://www.flaticon.com/free-icons/oven" title="oven icons">Oven icons created by Freepik - Flaticon</a> */
/* <a href="https://www.flaticon.com/free-icons/watch" title="watch icons">Watch icons created by Freepik - Flaticon</a> */
/* <a href="https://www.flaticon.com/free-icons/frying-pan" title="frying pan icons">Frying pan icons created by Octopocto - Flaticon</a> */
/* <a href="https://www.flaticon.com/free-icons/cooker" title="cooker icons">Cooker icons created by Freepik - Flaticon</a> */
/* <a href="https://www.flaticon.com/free-icons/burner" title="burner icons">Burner icons created by Nadiinko - Flaticon</a> */
/* <a href="https://www.flaticon.com/free-icons/save" title="save icons">Save icons created by Yogi Aprelliyanto - Flaticon</a> */

/* ---------------------------- input/ forms ---------------------------- */
/* only used in input_recipe or edit_recipt elements */
.title_bar > input {
  flex: 1 1 fit-content;
  font-size: x-large;
  font-weight: 700;
  padding-left: 0em;
}

input,
textarea {
  background-color: var(--section_dark, #333);
  border: none;
  width: 100%;
  padding-left: 0.35em;
  color: var(--text_color, #000);
  text-shadow: inherit;
  font: inherit;
}

textarea {
  height: 1em;
  resize: none;
  overflow: hidden;
}

input::placeholder,
textarea::placeholder {
  color: var(--text_color);
  opacity: 1;
}

.dork_mode input::placeholder,
.dork_mode textarea::placeholder {
  color: #477c51;
  text-shadow: none;
}

.note textarea {
  background-color: var(--lowlight, #333);
  color: var(--text_color_secondary, #000);
  text-shadow: inherit;
  border: none;
}

/* sizer helps make the input width dynamic */
.note .sizer {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  font: inherit;
  padding: 0.2em;
}

.recipe_card button {
  padding: 0.5em 0.75em;
  background-color: var(--lowlight);
  border: none;
  border-radius: 0.5em;
  color: var(--text_color);
}

.recipe_card button:hover {
  background-color: var(--highlight);
  box-shadow:
    0 0 5px var(--highlight),
    0 0 10px var(--highlight);
}

/* ------------------ dropdown ------------------ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-button {
  padding: 0.5em 1em;
  background: #3498db;
  color: white;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  display: none;
  border: 1px solid var(--text_color_secondary);
  box-shadow: 0 2px 5px var(--highlight);
  z-index: 1000;
  min-width: 250px;
}

.dropdown-menu label {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text_color);

  background-color: var(--section_dark);
}

.dropdown-menu label:has(input[type="checkbox"]:checked) {
  background: var(--section_light);
}

.dropdown-menu input {
  display: none;
}
.dropdown-menu img {
  height: 1.3em;
  filter: var(--icon_filter);
}

.dropdown-menu label:hover {
  background: var(--section_light);
  box-shadow:
    0 0 5px var(--lowlight),
    0 0 10px var(--lowlight);
  position: relative;
  z-index: 51111;
}

.dropdown.open .dropdown-menu {
  display: block;
}
body {
  cursor: default;
}
input:not([type]),
input[type="text"],
input[type="search"],
input[type="url"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
[contenteditable="true"] {
  cursor: text;
}

/* Source: context_menu.css */
#context_menu {
  position: absolute;
  z-index: 9999;
  min-width: 220px;
  padding: 6px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  color: #222;
}

.context_menu_block {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.context_menu_block + .context_menu_block {
  border-top: 1px solid #eee;
}

.context_menu_block li {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.context_menu_block li:hover {
  background: #f3f3f3;
}

.context_menu_block li:active {
  background: #e9e9e9;
}

/* Optional: make dangerous action feel dangerous */
.context_menu_block.recipe li:nth-child(3) {
  color: #b42318;
}

.context_menu_block.recipe li:nth-child(3):hover {
  background: #fee4e2;
}

#context_menu {
  display: none;
}

#context_menu.active {
  display: block;
}
