* {
  box-sizing: border-box;
}

.soft-sparkle {
  position: fixed;
  pointer-events: none;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 4px rgba(255, 255, 255, 0.8),
    0 0 10px rgba(255, 255, 255, 0.4);

  transform: translate(-50%, -50%);
  animation: floatSparkle 1.6s ease-out forwards;
  z-index: 9999;
}

@keyframes floatSparkle {
  0% {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1);
  }

  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--driftX)),
                calc(-50% + var(--driftY)))
      scale(1.6);
  }
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background-image: url("background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #222;
  text-transform: lowercase;
}

.win7-nav {
  width: min(100% - 4rem, 1470px);
  margin: 1.2rem auto 1.2rem;
   padding: 0.5rem 0.9rem;

  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
   margin: 1.2rem auto 1.8rem;


  background: linear-gradient(
    to bottom,
    #ddebf4 0%,
    #c7dcea 42%,
    #b9d0df 43%,
    #d8e9f3 100%
  );

  border: 1px solid #9aaab2;
  border-radius: 10px;

  box-shadow:
    0 0 0 1px rgba(88, 104, 112, 0.85),
    0 0 0 4px rgba(202, 221, 230, 0.72),
    0 0 0 5px rgba(241, 248, 251, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 0 0 1px rgba(167, 190, 200, 0.65),
    0 4px 8px rgba(0, 0, 0, 0.14);
}

.win7-nav a {
  color: #1d1d1d;
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.45rem 0.8rem;
  border-radius: 5px;
  border: 1px solid transparent;
}

.win7-nav a:hover {
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(140, 165, 178, 0.7);
}

.win7-nav a.active {
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #e7f1f6 48%,
    #d3e3eb 52%,
    #f0f6f9 100%
  );
  border: 1px solid #8d9da6;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.96),
    0 1px 0 rgba(255,255,255,0.35);
}

h1,
h2,
h3,
p,
li,
button,
span {
  font-weight: 400;
  text-transform: lowercase;
}

/* PAGE WIDTH */
.recipes-shell {
  width: min(100% - 4rem, 1520px);
  margin: 0 auto 2rem;
  padding: 1rem 1.6rem 1.6rem;
  overflow: visible;
}

/* LEFT GRID */
.recipe-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2.3rem;
  overflow: visible;
}

.recipe-card {
  position: relative;
  background: #efefef;
  border: 1px solid #9aaab2;
  border-radius: 10px;
  z-index: 1;
  padding: 1.1rem;
  cursor: pointer;
  overflow: visible;
  transition: transform 0.18s ease;
  box-shadow:
    0 0 0 1px rgba(88, 104, 112, 0.85),
    0 0 0 4px rgba(202, 221, 230, 0.72),
    0 0 0 5px rgba(241, 248, 251, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 0 0 1px rgba(167, 190, 200, 0.65),
    0 4px 8px rgba(0, 0, 0, 0.14);
}

.recipe-card:hover {
  transform: translateY(-2px);
  z-index: 10; 
}

.card-text {
  padding: 0;
}

.card-text h2 {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
}

.card-text p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
}

.recipe-view {
  margin-top: 0;
  display: none;
}

.hidden {
  display: none;
}

body.recipe-open #recipe-view {
  display: block;
  
}

/* OPEN MODE */
body.recipe-open .recipes-shell {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 2.7rem;
  align-items: start;
  height: calc(100vh - 120px);
  margin-bottom: 0;
  padding-bottom: 0;
}

body.recipe-open .recipe-window {
  align-self: start;
}

body.recipe-open .title {
  margin-bottom: 1.2rem;
}

body.recipe-open .recipe-grid {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: visible;
   scrollbar-width: none; 
  -ms-overflow-style: none; 
  padding: 0.35rem 1rem 0 0.8rem;
   padding-top: 0.5rem;
   padding-bottom: 0.5rem;
  margin-top: 0;
}


body.journal-page .recipes-shell {
  grid-template-columns: 1fr;
}



body.recipe-open .recipe-grid::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* no visible active state */
.active-recipe {
  box-shadow:
    0 0 0 1px rgba(88, 104, 112, 0.85),
    0 0 0 4px rgba(202, 221, 230, 0.72),
    0 0 0 5px rgba(241, 248, 251, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 0 0 1px rgba(167, 190, 200, 0.65),
    0 4px 8px rgba(0, 0, 0, 0.14);
}


.recipe-window {
  position: relative;
  background: #efefef;
  border: 1px solid #9aaab2;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(88, 104, 112, 0.85),
    0 0 0 4px rgba(202, 221, 230, 0.72),
    0 0 0 5px rgba(241, 248, 251, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 0 0 1px rgba(167, 190, 200, 0.65),
    0 5px 10px rgba(0, 0, 0, 0.15);
}


.window-titlebar {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.32rem 0.5rem 0.32rem 0.5rem;
  border-bottom: 1px solid #aebdc5;
  background: linear-gradient(
    to bottom,
    #ddebf4 0%,
    #c7dcea 42%,
    #b9d0df 43%,
    #d8e9f3 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 -1px 0 rgba(150, 170, 180, 0.28);
}

.window-title-left {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.titlebar-icon {
  width: 12px;
  height: 12px;
  display: block;
  flex: 0 0 auto;
}

.window-title-left span {
  font-size: 0.95rem;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  align-items: center;
  height: 100%;
}

.window-btn {
  width: 22px;
  height: 16px;
  margin-top: 1px;
  border-radius: 2px;
  border: 1px solid #94a4ad;
  background: linear-gradient(
    to bottom,
    #f8fbfd 0%,
    #dbe7ee 100%
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 1px 0 rgba(255, 255, 255, 0.3);
  position: relative;
}

.min-btn::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 4px;
  height: 2px;
  background: #586972;
}

.max-btn::before {
  content: "";
  position: absolute;

  width: 8px;
  height: 6px;

  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%);

  border: 2px solid #586972;
  background: transparent;
}


.window-body {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 430px;
  background: #ffffff;
}


.recipe-sidebar {
  background: #eaf4fb;
  border-right: 1px solid #c7d8e2;
  padding: 1.2rem 1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
}

.sidebar-spacer {
  flex: 1;
  min-height: 3rem;
}


.recipe-main {
  background: #ffffff;
  padding: 1.3rem 1.5rem 1.5rem;
}

.recipe-main p {
  margin: 0 0 1.35rem;
  line-height: 1.65;
}

.recipe-main p:last-child {
  margin-bottom: 0;
}

.recipe-meta-block + .recipe-meta-block {
  margin-top: 1.5rem;
}

.meta-label {
  margin: 0 0 0.6rem;
  color: #222;
}

.window-btn {
  cursor: pointer;
}

#recipe-ingredients {
  margin: 0;
  padding-left: 1.2rem;
}

#recipe-time,
#recipe-tags {
  margin: 0;
}


@media (max-width: 1000px) {
  .recipe-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .window-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 800px) {
  .recipe-grid {
    grid-template-columns: repeat(3, 1fr);
  }



  body.recipe-open .recipe-grid {
    max-height: none;
    overflow-y: visible;
  }

  .window-body {
    grid-template-columns: 1fr;
  }

  .recipe-sidebar {
    border-right: none;
    border-bottom: 1px solid #c7d8e2;
  }

  .sidebar-spacer {
    min-height: 1.5rem;
  }
}

@media (max-width: 600px) {
  .recipes-shell {
    width: min(100% - 1rem, 1520px);
    padding: 1rem;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .card-text h2 {
    font-size: 0.95rem;
  }

  .card-text p {
    font-size: 0.82rem;
  }

  .window-titlebar {
    min-height: 31px;
    padding: 0.3rem 0.4rem;
  }

  .window-btn {
    width: 21px;
    height: 17px;
  }

  .titlebar-icon {
    width: 11px;
    height: 11px;
  }

  .window-body {
    min-height: 0;
  }

  .recipe-sidebar,
  .recipe-main {
    padding: 1rem 1.1rem 1.15rem;
  }
}