  :root {
    --cream: #f5ecd7;
    --parchment: #e8d5b0;
    --brown-dark: #3b2a1a;
    --brown-mid: #6b4c2a;
    --brown-light: #a07850;
    --rust: #8b3a1e;
    --ink: #2a1f14;
    --shadow: rgba(59,42,26,0.18);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    background-color: #2a1f14;
    background-image:
      repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(255,255,255,0.015) 40px, rgba(255,255,255,0.015) 41px),
      repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(255,255,255,0.015) 40px, rgba(255,255,255,0.015) 41px);
    min-height: 100vh;
    font-family: 'Lora', Georgia, serif;
    color: var(--ink);
  }

  /* HEADER */
  .site-header {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    position: relative;
  }
  .header-inner {
    display: inline-block;
    background: var(--cream);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
    border: 3px solid var(--brown-mid);
    border-radius: 2px;
    padding: 2.5rem 4rem;
    box-shadow: 6px 6px 0 var(--brown-dark), 0 0 40px rgba(0,0,0,0.5);
    position: relative;
  }
  .header-inner::before, .header-inner::after {
    content: '✦';
    position: absolute;
    color: var(--brown-light);
    font-size: 1.2rem;
  }
  .header-inner::before { top: 10px; left: 14px; }
  .header-inner::after { bottom: 10px; right: 14px; }

  .header-dedication {
	text-align: center;
    display: inline-block;
    background: var(--cream);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
	
	width: fit-content;    /* Shrinks the box to fit your content exactly */
	text-align: center;   /* Centers the text inside */
	margin: 0 auto;       /* Centers the block if it's a block-level element */

	/* Existing styles */
	display: flex;             /* Use Flexbox */
	flex-direction: row;       /* Keeps them in a line */
	justify-content: center;   /* Centers them horizontally */
	gap: 20px;                 /* Adds the space between each link */	
	
    /* border: 1px solid var(--brown-mid);
    border-radius: 1px;
	*/
    padding: 1rem 4rem;
    /* box-shadow: 6px 6px 0 var(--brown-dark), 0 0 40px rgba(0,0,0,0.5);
	*/
    position: relative;
  }

  .site-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--brown-dark);
    letter-spacing: 0.04em;
    line-height: 1.15;
  }
  .site-subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--brown-light);
    margin-top: 0.5rem;
    letter-spacing: 0.08em;
  }
  .divider {
    text-align: center;
    color: var(--brown-light);
    font-size: 1rem;
    letter-spacing: 0.5em;
    margin: 0.8rem 0 0;
  }

  /* SEARCH & FILTER */
  .toolbar {
    max-width: 860px;
    margin: 2rem auto 1.5rem;
    padding: 0 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
  }
  .search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
  }
  .search-wrap input {
    width: 100%;
    background: var(--cream);
    border: 2px solid var(--brown-mid);
    border-radius: 2px;
    padding: 0.65rem 1rem 0.65rem 2.4rem;
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.2s;
  }
  .search-wrap input:focus { border-color: var(--rust); }
  .search-wrap::before {
    content: '⚲';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    color: var(--brown-light);
    font-size: 1.1rem;
    pointer-events: none;
  }
  .filter-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
  .filter-btn {
    background: transparent;
    border: 2px solid var(--brown-mid);
    border-radius: 2px;
    padding: 0.5rem 1rem;
    font-family: 'Lora', serif;
    font-size: 0.85rem;
    color: var(--parchment);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.04em;
  }
  .filter-btn:hover, .filter-btn.active {
    background: var(--brown-mid);
    color: var(--cream);
  }

  /* RECIPE COUNT */
  .recipe-count {
    max-width: 860px;
    margin: 0 auto 1rem;
    padding: 0 1.5rem;
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: var(--brown-light);
  }

  /* RECIPE GRID */
  .recipe-grid {
    max-width: 860px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
  }

  /* RECIPE CARD */
  .recipe-card {
    background: var(--cream);
    border: 2px solid var(--brown-mid);
    border-radius: 2px;
    box-shadow: 4px 4px 0 var(--brown-dark);
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
    overflow: hidden;
    animation: fadeUp 0.4s ease both;
  }
  .recipe-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--brown-dark);
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .card-header {
    background: var(--brown-mid);
    padding: 1rem 1.2rem 0.8rem;
    position: relative;
  }
  .card-category {
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--parchment);
    opacity: 0.8;
    margin-bottom: 0.3rem;
  }
  .card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cream);
    line-height: 1.25;
  }
  .card-contributor {
    font-style: italic;
    font-size: 0.8rem;
    color: var(--parchment);
    margin-top: 0.25rem;
    opacity: 0.85;
  }
  .card-body {
    padding: 1rem 1.2rem;
  }
  .card-meta {
    display: flex;
    gap: 1.2rem;
    font-size: 0.78rem;
    color: var(--brown-mid);
    margin-bottom: 0.75rem;
  }
  .card-meta span { display: flex; align-items: center; gap: 0.3rem; }
  .card-preview {
    font-size: 0.85rem;
    color: var(--brown-dark);
    line-height: 1.5;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* MODAL */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42,31,20,0.88);
    z-index: 100;
    overflow-y: auto;
    padding: 2rem 1rem;
    animation: fadeIn 0.2s ease;
  }
  .modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  .modal {
    background: var(--cream);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
    border: 2px solid var(--brown-mid);
    border-radius: 2px;
    box-shadow: 8px 8px 0 var(--brown-dark);
    max-width: 640px;
    width: 100%;
    animation: slideUp 0.25s ease;
    position: relative;
  }
  @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  .modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--cream);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
  }
  .modal-head {
    background: var(--brown-dark);
    padding: 2rem 2rem 1.5rem;
    border-bottom: 3px solid var(--brown-mid);
  }
  .modal-category {
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brown-light);
    margin-bottom: 0.4rem;
  }
  .modal-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--cream);
    line-height: 1.2;
  }
  .modal-contributor {
    font-style: italic;
    color: var(--parchment);
    font-size: 0.9rem;
    margin-top: 0.4rem;
    opacity: 0.85;
  }
  .modal-meta {
    display: flex; gap: 1.5rem;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--parchment);
    opacity: 0.8;
    flex-wrap: wrap;
  }

  .modal-body { padding: 1.8rem 2rem; }

  /* SERVING ADJUSTER */
  .serving-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--parchment);
  }
  .serving-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    color: var(--brown-mid);
    font-style: italic;
  }
  .serving-controls { display: flex; align-items: center; gap: 0.6rem; }
  .serving-btn {
    width: 28px; height: 28px;
    border: 2px solid var(--brown-mid);
    background: none;
    border-radius: 2px;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--brown-mid);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
  }
  .serving-btn:hover { background: var(--brown-mid); color: var(--cream); }
  .serving-count {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--brown-dark);
    min-width: 2rem;
    text-align: center;
  }

  /* INGREDIENTS */
  .section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--brown-dark);
    margin-bottom: 0.8rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--parchment);
    letter-spacing: 0.03em;
  }
  .ingredients-list {
    list-style: none;
    margin-bottom: 1.8rem;
  }
  .ingredients-list li {
    padding: 0.45rem 0;
    font-size: 0.92rem;
    color: var(--brown-dark);
    border-bottom: 1px dotted var(--parchment);
    display: flex;
    gap: 0.6rem;
    line-height: 1.45;
  }
  .ingredients-list li::before {
    content: '—';
    color: var(--brown-light);
    flex-shrink: 0;
    margin-top: 0.05rem;
  }
  .ing-amount {
    font-weight: 500;
    color: var(--rust);
    white-space: nowrap;
  }

  /* INSTRUCTIONS */
  .steps-list { list-style: none; margin-bottom: 1.5rem; }
  .step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
  }
  .step-num {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brown-light);
    line-height: 1;
    flex-shrink: 0;
    width: 1.6rem;
    text-align: right;
  }
  .step-text {
    font-size: 0.92rem;
    color: var(--brown-dark);
    line-height: 1.65;
  }

  /* NOTES */
  .recipe-notes {
    background: var(--parchment);
    border-left: 4px solid var(--brown-light);
    padding: 1rem 1.2rem;
    border-radius: 0 2px 2px 0;
    font-style: italic;
    font-size: 0.88rem;
    color: var(--brown-mid);
    line-height: 1.6;
    margin-top: 0.5rem;
  }
  .recipe-notes strong {
    font-style: normal;
    display: block;
    margin-bottom: 0.3rem;
    color: var(--brown-dark);
    font-family: 'Playfair Display', serif;
  }

  /* EMPTY STATE */
  .empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--parchment);
    font-style: italic;
    opacity: 0.6;
    font-size: 1.1rem;
  }

  /* FOOTER */
  footer {
    text-align: center;
    padding: 2rem;
    color: var(--brown-light);
    font-style: italic;
    font-size: 0.82rem;
    opacity: 0.6;
    letter-spacing: 0.05em;
  }

  @media (max-width: 500px) {
    .header-inner { padding: 1.8rem 1.5rem; }
    .modal-body, .modal-head { padding: 1.2rem; }
  }



  /* ==========================================================================
     IMAGE MODAL EXTENSION 
     ========================================================================== */

  /* The link styled to look clickable but seamless */
  .image-modal-link {
    color: var(--rust);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
  }
  
  .image-modal-link:hover {
    color: var(--brown-mid);
  }

  /* Dedicated overlay backdrop for the image view */
  .image-modal-overlay {
    display: none; 
    position: fixed; 
    inset: 0;
    background-color: rgba(42, 31, 20, 0.85); /* Dark brown tint to match body background */
    backdrop-filter: blur(4px); /* Soft blur effect */
    z-index: 1000; /* Keeps it strictly above standard layouts */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    padding: 2rem;
  }

  /* Class toggled by JavaScript to run the soft fade-in */
  .image-modal-overlay.show {
    display: flex;
    opacity: 1;
  }

  /* Container wrapper for the visual asset to structure shadow & constraints */
  .image-modal-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* The scaled responsive image presentation */
  .image-modal-content {
    max-width: 100%;
    max-height: 85vh;
    border: 3px solid var(--parchment); /* Elegant matching border framing */
    border-radius: 2px;
    box-shadow: 6px 6px 0 var(--brown-dark), 0 10px 30px rgba(0, 0, 0, 0.5);
    object-fit: contain;
  }

  /* High contrast close button element */
  .image-modal-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    color: var(--cream);
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
    user-select: none;
  }

  .image-modal-close:hover {
    color: var(--rust);
  }

  @media (max-width: 500px) {
    .image-modal-overlay { padding: 1rem; }
    .image-modal-close { top: -2.2rem; right: 5px; }
  }
  
  /* ==========================================================================
     Flipbook link
     ========================================================================== */
	.flipbook-link {
		position: absolute;
		top: 20px;
		right: 20px;
		font-family: 'Lora', Georgia, serif; /* Matches header font */
		color: #a07850; /* Matches your header color scheme */
		text-decoration: none;
		font-size: 1.1rem;
	}

	.flipbook-link:hover {
		text-decoration: underline;
	}
	
/* ==========================================================================
   Flipbook Page Layout
   ========================================================================== */

/* The back-link in the header of the flipbook page */
.back-link {
    color: var(--brown-light);
    text-decoration: none;
    font-size: 1.1rem;
    /*border-bottom: 1px solid var(--brown-light); */
    transition: all 0.2s ease;
}



.back-link:hover {
    /* text-decoration: underline; */
    color: var(--cream); /* This sets the hover color to cream */
    border-bottom-color: var(--cream); /* Optional: makes the underline cream too */
}

/* Container for the flipbook to keep it framed and centered */


.flipbook-container {
    width: 95%;          /* Makes it take up more of the screen width */
    max-width: 1200px;   /* Increases the maximum size limit */
    aspect-ratio: 16 / 11; /* Slightly taller for better readability */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    background: var(--cream);
    border: 3px solid var(--brown-mid);
    border-radius: 2px;
    margin: 20px auto;
    overflow: hidden;
}

.fp-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}


/* ==========================================================================
   Mobile Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    /* Make the container fill more of the mobile screen */
    .flipbook-container {
        width: 98%;           /* Use almost the entire width */
        margin: 10px auto;    /* Smaller margins for mobile */
        aspect-ratio: 4 / 5;  /* Taller aspect ratio works better for vertical phones */
    }

    /* Adjust the back link for smaller screens */
    .back-link {
        font-size: 1rem;
        padding-bottom: 2px;
    }
}

/* Make the back link look like a button on mobile for better tap-ability */
@media (max-width: 768px) {
    .back-link {
        display: inline-block;
        padding: 10px 15px;
        background: var(--brown-mid);
        color: var(--cream);
        border-radius: 4px;
        border-bottom: none;
    }
}



/* ==========================================================================
	filter buttons
   ========================================================================== */

.filter-btns {
  display: flex;
  flex-direction: column; /* Stack the rows vertically */
  gap: 10px;              /* Spacing between row 1 and row 2 */
}

.btn-row {
  display: flex;
  flex-wrap: wrap;        /* Allows line 2 to wrap gracefully on small mobile screens */
  gap: 8px;               /* Spacing between buttons side-by-side */
}

/* ==========================================================================
   Submit Recipe Page
   ========================================================================== */

.submit-container {
  max-width: 640px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.coming-soon {
  background: var(--cream);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
  border: 2px solid var(--brown-mid);
  border-radius: 2px;
  box-shadow: 6px 6px 0 var(--brown-dark);
  padding: 3rem 2rem;
  text-align: center;
}

.coming-soon h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--brown-dark);
  margin-bottom: 0.75rem;
}

.coming-soon p {
  font-style: italic;
  color: var(--brown-mid);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

@media (max-width: 500px) {
  .coming-soon { padding: 2rem 1.25rem; }
}

	