/* ===========================================
   Purple & White Whimsy Theme
   For gluten-free bakery site
   =========================================== */

@import url("https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&family=Pacifico&family=Quicksand:wght@400;500;700&display=swap");

:root {
  --purple-dark: #6b3fa0;
  --purple-main: #9b5de5;
  --purple-light: #c8a8f0;
  --purple-pale: #f3eaff;
  --white: #ffffff;
  --cream: #fffaf3;
  --text: #3a2c4d;
  --shadow: rgba(107, 63, 160, 0.2);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Quicksand", sans-serif;
  background-color: var(--purple-pale);
  background-image:
    radial-gradient(var(--purple-light) 1.5px, transparent 1.5px),
    radial-gradient(var(--purple-light) 1.5px, var(--purple-pale) 1.5px);
  background-size: 60px 60px;
  background-position:
    0 0,
    30px 30px;
  color: var(--text);
  line-height: 1.6;
  /* Side breathing room so content never touches the screen edges */
  padding: 0 2rem;
}

/* ---------- Header ---------- */
header {
  background: linear-gradient(135deg, var(--purple-main), var(--purple-dark));
  color: var(--white);
  text-align: center;
  padding: 3rem 1rem;
  border-bottom: 6px dashed var(--white);
  border-radius: 40px;
  box-shadow: 0 4px 12px var(--shadow);
}

header h1 {
  font-family: "Pacifico", cursive;
  font-size: 3rem;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 var(--purple-dark);
}

header h2 {
  font-family: "Quicksand", sans-serif;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--white);
  text-shadow: 1px 1px 0 var(--purple-dark);
  margin-top: 0.5rem;
}

header p {
  font-size: 1.1rem;
  margin-top: 0.5rem;
  opacity: 0.95;
}

/* ---------- Navigation ---------- */
nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem;
  background-color: var(--white);
  box-shadow: 0 2px 8px var(--shadow);
}

nav a {
  text-decoration: none;
  color: var(--purple-dark);
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  transition: all 0.25s ease;
}

nav a:hover {
  background-color: var(--purple-main);
  color: var(--white);
  transform: translateY(-2px) rotate(-2deg);
}

/* ---------- Site nav (logo + links as a bare <ul>) ---------- */
body > ul:first-of-type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  list-style: none;
  padding: 1rem;
  margin: 0;
  background-color: var(--white);
  border-radius: 0 0 40px 40px;
  box-shadow: 0 2px 8px var(--shadow);
}

body > ul:first-of-type li a {
  text-decoration: none;
  color: var(--purple-dark);
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  transition: all 0.25s ease;
}

body > ul:first-of-type li a:hover {
  background-color: var(--purple-main);
  color: var(--white);
  transform: translateY(-2px) rotate(-2deg);
}

body > ul:first-of-type li:first-child img {
  height: 90px;
  width: auto;
  border-radius: 50%;
  border: 3px solid var(--purple-light);
  display: block;
  transition: transform 0.3s ease;
}

body > ul:first-of-type li img:hover {
  transform: rotate(8deg) scale(1.05);
}

/* ---------- Page titles ---------- */
body > h1 {
  font-family: "Pacifico", cursive;
  color: var(--purple-dark);
  text-align: center;
  font-size: 2.5rem;
  margin: 2rem 0 1rem;
}

/* ---------- Contact form ---------- */
form {
  max-width: 500px;
  margin: 1rem auto 3rem;
  background-color: var(--white);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 6px 16px var(--shadow);
}

form p {
  font-weight: 700;
  color: var(--purple-dark);
  margin: 1rem 0 0.3rem;
}

form p:first-of-type {
  margin-top: 0;
}

form input[type="text"] {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 2px solid var(--purple-light);
  border-radius: 999px;
  font-family: "Quicksand", sans-serif;
  font-size: 1rem;
  background-color: var(--purple-pale);
  color: var(--text);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

form input[type="text"]:focus {
  outline: none;
  border-color: var(--purple-main);
  box-shadow: 0 0 0 3px var(--purple-light);
  background-color: var(--white);
}

form input[type="submit"] {
  margin-top: 1.5rem;
  background-color: var(--purple-main);
  color: var(--white);
  font-weight: 700;
  font-family: "Quicksand", sans-serif;
  font-size: 1rem;
  border: 3px solid var(--purple-dark);
  border-radius: 999px;
  padding: 0.75rem 1.8rem;
  box-shadow: 3px 3px 0 var(--purple-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

form input[type="submit"]:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--purple-dark);
  background-color: var(--purple-light);
  color: var(--purple-dark);
}

/* ---------- Main content ---------- */
main {
  max-width: 900px;
  margin: 3rem auto;
  padding: 2rem 2rem;
}

section {
  background-color: var(--white);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 6px 16px var(--shadow);
  position: relative;
  overflow: hidden;
}

/* ---------- Body text readability ---------- */
/* Gives paragraphs a solid background so the dotted page
   background doesn't show through and distract from the text */
p {
  background-color: var(--white);
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  box-shadow: 0 2px 6px var(--shadow);
  margin-bottom: 1rem;
}

/* Paragraphs already inside a white card don't need a second background */
section p,
.card p {
  background: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 0.8rem;
}

/* Form labels shouldn't get a paragraph background/box */
form p {
  background: none;
  box-shadow: none;
  padding: 0;
}

section::before {
  content: "✦";
  position: absolute;
  top: -10px;
  right: 20px;
  font-size: 2.5rem;
  color: var(--purple-light);
  transform: rotate(15deg);
}

h2 {
  font-family: "Pacifico", cursive;
  color: var(--purple-dark);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

h3 {
  color: var(--purple-main);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background-color: var(--purple-main);
  color: var(--white);
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 1.8rem;
  border-radius: 999px;
  border: 3px solid var(--purple-dark);
  box-shadow: 3px 3px 0 var(--purple-dark);
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--purple-dark);
  background-color: var(--purple-light);
  color: var(--purple-dark);
}

/* ---------- Menu items ---------- */
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 2px dotted var(--purple-light);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item .price {
  font-weight: 700;
  color: var(--purple-dark);
  background-color: var(--purple-pale);
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
}

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  font-size: 0.85rem;
}

/* ---------- Cards (e.g. gallery, products) ---------- */
.card {
  background-color: var(--cream);
  border: 2px solid var(--purple-light);
  border-radius: 18px;
  padding: 1rem;
  text-align: center;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.card {
  cursor: pointer;
}

.card:hover {
  transform: translateY(-5px) rotate(1deg);
  box-shadow: 0 8px 20px var(--shadow);
}

/* ---------- Ingredient info modal ---------- */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(107, 63, 160, 0.4);
  backdrop-filter: blur(3px);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

#modal-overlay.active {
  display: flex;
}

#modal {
  background: var(--white);
  border-radius: 24px;
  padding: 2rem;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 12px 32px var(--shadow);
  position: relative;
  text-align: center;
  animation: popIn 0.2s ease;
}

@keyframes popIn {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

#modal h3 {
  font-family: "Pacifico", cursive;
  color: var(--purple-dark);
  margin-bottom: 0.75rem;
}

#modal p {
  background: none;
  box-shadow: none;
  padding: 0;
  color: var(--text);
  margin: 0;
}

#modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--purple-light);
  cursor: pointer;
  line-height: 1;
}

#modal-close:hover {
  color: var(--purple-dark);
}

.card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 0.5rem;
}

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background-color: var(--purple-dark);
  color: var(--white);
  border-radius: 40px 40px 0 0;
  margin-top: 2rem;
}

/* Footer text shouldn't get the white paragraph background */
footer p {
  background: none;
  box-shadow: none;
  padding: 0;
  color: var(--white);
}

footer a {
  color: var(--purple-light);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* ---------- Sticky note (market announcement) ---------- */
.sticky-note {
  background-color: #fff79a;
  color: #5a4a00;
  font-family: "Kalam", cursive;
  font-size: 1.3rem;
  text-align: center;
  max-width: 320px;
  margin: 0 auto 2.5rem;
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: 4px;
  box-shadow: 4px 6px 12px rgba(0, 0, 0, 0.2);
  transform: rotate(-3deg);
  position: relative;
}

.sticky-note::before {
  content: "";
  position: absolute;
  top: -14px;
  left: 50%;
  width: 70px;
  height: 26px;
  background-color: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.85);
  transform: translateX(-50%) rotate(-4deg);
}

.sticky-note strong {
  color: var(--purple-dark);
}

/* ---------- Cursor sparkle trail ---------- */
.sparkle {
  position: fixed;
  pointer-events: none;
  user-select: none;
  z-index: 9999;
  font-size: 1rem;
  animation: sparkle-fade 0.8s ease forwards;
  transform: translate(-50%, -50%);
}

@keyframes sparkle-fade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -220%) scale(0.2);
  }
}

/* ---------- Whimsical touches ---------- */
.wiggle {
  display: inline-block;
  animation: wiggle 2.5s ease-in-out infinite;
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(-3deg);
  }
  50% {
    transform: rotate(3deg);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body {
    padding: 0 0.75rem;
  }

  header h1 {
    font-size: 2.2rem;
  }

  nav {
    gap: 0.5rem;
  }

  section {
    padding: 1.25rem;
  }
}
