@import url("/assets/site.css");

/* Minimal, clean recipe styling */
:root { --max: 980px; --radius: 14px; --border: #e6e6e6; --muted: #666; }

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; line-height: 1.55; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.recipe-page, .recipes-index {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px;
}

.recipe-header h1 { margin: 0 0 6px; font-size: 1.9rem; }
.lead { margin: 0 0 10px; color: var(--muted); }
.meta { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }

.recipe-figure { margin: 12px 0 18px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }

.cols { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 820px) { .cols { grid-template-columns: 1fr 1.2fr; } }

.ingredients, .steps {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px;
}

h2 { margin: 0 0 10px; font-size: 1.25rem; }
h3 { margin: 14px 0 8px; font-size: 1.05rem; color: #222; }

ul { margin: 0; padding-left: 18px; }
li { margin: 6px 0; }

ol { margin: 0; padding-left: 20px; }
ol li { padding-left: 2px; }

.source { margin-top: 14px; color: var(--muted); font-size: 0.9rem; word-break: break-word; }
.recipe-footer { margin-top: 18px; color: var(--muted); font-size: 0.9rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.recipes-list { list-style: none; padding: 0; margin: 14px 0 0; }
.recipes-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0;
}
.recipes-item a { text-decoration: none; }
.recipes-item a:hover { text-decoration: underline; }

/* === RECIPEAPP_CONTRAST_FIX === */
.recipe-card-title, .recipe-card-title a { color: #fff !important; }
h2, h3, h4 { color: #fff !important; }

/* === RECIPEAPP_CONTRAST_FIX_V2 === */
.recipe-card-title, .recipe-card-title a { color:#fff !important; }
.card h2, .card h3, .card h4 { color:#fff !important; }

/* === TAGS_AND_CONTRAST_FIX === */
.recipe-card-title,
.recipe-card-title a,
.recipe-card-link,
.recipe-card-link * { color:#fff !important; }

.card h2, .card h3, .card h4 { color:#fff !important; }

/* === RECIPES_LAYOUT_V1 === */
/* Gör receptlistan till: vänster sidebar + höger card-grid */
.recipes-layout {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
}

/* Se till att "Sök"-kortet blir sidebar-bredd och inte försöker ta hela grid */
.recipes-layout #search.recipe-wide {
  grid-column: auto;
}

/* Receptkorten hamnar i en egen grid som fyller resten */
.recipes-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

/* På smal skärm: stacka */
@media (max-width: 900px) {
  .recipes-layout {
    grid-template-columns: 1fr;
  }
}

/* === RECIPES_LAYOUT_V2 ===
   Override av sidebar-layouten: sök överst + kort-grid i full bredd (desktop).
*/
.recipes-layout { 
  display: contents;          /* gör att barnen hamnar direkt i parent-grid */
}

/* Sök-kortet ska alltid vara full bredd */
.recipes-layout #search {
  grid-column: 1 / -1 !important;
}

/* Ankare/diven "all" behöver inte ta plats */
.recipes-layout #all {
  display: none !important;
}

/* Kort-grid: fyll hela bredden och packa snyggt */
.recipes-cards {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important;
  gap: 22px !important;
}

/* === RECIPE_HUB_DELETE_V1 === */
.add-recipe-row{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.add-recipe-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.35);
  text-decoration: none;
  color: #fff;
  background: rgba(15,23,42,0.25);
}

.add-recipe-btn:hover{
  border-color: rgba(56,189,248,0.6);
}

.recipe-title-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recipe-del-inline{
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(248,113,113,0.55);
  background: rgba(248,113,113,0.16);
  color: #fecaca;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.recipe-del-inline:hover{
  border-color: rgba(248,113,113,0.9);
  background: rgba(248,113,113,0.22);
}

/* === RECIPE_DEL_BTN_V2 === */
.recipe-card { position: relative; }

.recipe-del-btn{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(248,113,113,0.55);
  background: rgba(248,113,113,0.16);
  color: #fecaca;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
}

.recipe-del-btn:hover{
  border-color: rgba(248,113,113,0.9);
  background: rgba(248,113,113,0.22);
}

/* === RECIPE_CARD_TOOLBAR_V1 === */
.recipe-card .tagline{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* liten vit delete-knapp på chip-raden */
.recipe-card .recipe-del-btn{
  position: static;          /* inte längre absolut i hörnet */
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

.recipe-card .recipe-del-btn:hover{
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.14);
}


/* === RECIPE_TITLE_DELETE_V1 === */
.recipe-title-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.recipe-x-btn{
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}

/* Desktop: göm tills hover */
@media (hover: hover) and (pointer: fine){
  .recipe-x-btn{ opacity: 0; pointer-events: none; }
  .recipe-card:hover .recipe-x-btn{ opacity: 1; pointer-events: auto; }
}

/* Mobile/touch: alltid synlig */
@media (hover: none) and (pointer: coarse){
  .recipe-x-btn{ opacity: 1; pointer-events: auto; }
}


/* === RECIPE_DELETE_BUTTON_POLISH_V2 === */

/* Se till att title-row alltid blir en rad: titel vänster, delete höger */
.recipe-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

/* Nollställ ALLT som kan påverka knappen (desktop + mobile) */
.recipe-x-btn{
  -webkit-appearance:none;
  appearance:none;
  text-decoration:none !important;
  font: inherit;
  padding:0;
  margin:0;
  outline:none;
  box-shadow:none;

  width:26px;
  height:26px;
  border-radius:999px;

  border:1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);

  display:grid;
  place-items:center;

  cursor:pointer;
  flex:0 0 auto;
}

/* Vi ritar ett kryss med pseudo-element (inte en bokstav) */
.recipe-x-btn::before,
.recipe-x-btn::after{
  content:"";
  position:absolute;
  width:12px;
  height:2px;
  background: rgba(255,255,255,0.95);
  border-radius:2px;
}

/* Behöver position:relative för pseudo-element */
.recipe-x-btn{ position:relative; }

.recipe-x-btn::before{ transform:rotate(45deg); }
.recipe-x-btn::after { transform:rotate(-45deg); }

.recipe-x-btn:hover{
  border-color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.14);
}

/* Desktop: göm tills hover */
@media (hover:hover) and (pointer:fine){
  .recipe-x-btn{ opacity:0; pointer-events:none; }
  .recipe-card:hover .recipe-x-btn{ opacity:1; pointer-events:auto; }
}

/* Mobile/touch: alltid synlig */
@media (hover:none) and (pointer:coarse){
  .recipe-x-btn{ opacity:1; pointer-events:auto; }
}


/* === RECIPE_DELETE_BUTTON_MOBILE_FIX_V1 === */
@media (hover:none) and (pointer:coarse){
  .recipe-x-btn{
    width:32px;
    height:32px;
    border-width: 1px;
  }
  .recipe-x-btn::before,
  .recipe-x-btn::after{
    width:16px;
    height:3px;
    background: rgba(255,255,255,0.98);
  }
}


/* === RECIPE_DELETE_BUTTON_SVG_V1 === */

/* stäng av pseudo-element-krysset (mobil buggar ibland) */
.recipe-x-btn::before,
.recipe-x-btn::after{
  content: none !important;
}

/* SVG-krysset */
.recipe-x-btn svg{
  width: 14px;
  height: 14px;
  display: block;
}

.recipe-x-btn svg line{
  stroke: rgba(255,255,255,0.95);
  stroke-width: 2.6;
  stroke-linecap: round;
}

@media (hover:none) and (pointer:coarse){
  .recipe-x-btn svg{
    width: 16px;
    height: 16px;
  }
  .recipe-x-btn svg line{
    stroke-width: 3.0;
  }
}

