Grandma’s Kitchen Hub – Delicious Homemade Meals
:root {
–primary: #e63946;
–secondary: #f4a261;
–accent: #2a9d8f;
–light: #f1faee;
–dark: #1d3557;
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
font-family: ‘Segoe UI’, Tahoma, Geneva, Verdana, sans-serif;
background: var(–light);
color: #333;
line-height: 1.6;
min-height: 100vh;
}
header {
background: linear-gradient(135deg, var(–dark), #457b9d);
color: white;
text-align: center;
padding: 2.5rem 1rem;
position: sticky;
top: 0;
z-index: 900;
}
header h1 { font-size: 3rem; margin-bottom: 0.5rem; }
nav a {
color: white;
text-decoration: none;
margin: 0 1.2rem;
font-weight: bold;
transition: color 0.3s;
cursor: pointer;
}
nav a:hover { color: var(–secondary); }
.hero {
background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url(‘https://images.unsplash.com/photo-1555939594-58d7cb561ad1?auto=format&fit=crop&q=80’) center/cover;
height: 400px;
display: flex;
align-items: center;
justify-content: center;
color: white;
text-shadow: 2px 2px 8px rgba(0,0,0,0.7);
}
.hero h2 { font-size: 3.2rem; padding: 0 1rem; }
.container {
max-width: 1300px;
margin: 3rem auto;
padding: 0 1.5rem;
}
h2.section-title {
color: var(–dark);
text-align: center;
margin-bottom: 2.5rem;
font-size: 2.5rem;
position: relative;
}
h2.section-title::after {
content: ”;
width: 80px;
height: 4px;
background: var(–primary);
position: absolute;
bottom: -12px;
left: 50%;
transform: translateX(-50%);
}
.category-section {
margin-bottom: 4rem;
}
.category-section h2 {
font-size: 2.2rem;
color: var(–primary);
margin-bottom: 1.5rem;
text-align: center;
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 2rem;
}
.card {
background: white;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 8px 20px rgba(0,0,0,0.12);
transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer;
}
.card:hover {
transform: translateY(-10px);
box-shadow: 0 15px 30px rgba(0,0,0,0.18);
}
.card img {
width: 100%;
height: 220px;
object-fit: cover;
}
.card-content {
padding: 1.5rem;
}
.tag {
display: inline-block;
background: var(–secondary);
color: #1d3557;
padding: 0.4rem 1rem;
border-radius: 30px;
font-size: 0.9rem;
font-weight: bold;
margin-bottom: 0.8rem;
}
.card h3 {
color: var(–dark);
margin-bottom: 0.8rem;
font-size: 1.5rem;
}
.card p {
color: #555;
font-size: 1rem;
}
/* MODAL styles remain unchanged */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px);
display: none;
align-items: center;
justify-content: center;
z-index: 1000;
opacity: 0;
transition: opacity 0.4s ease;
}
.modal-overlay.active {
display: flex;
opacity: 1;
}
.modal-content {
background: white;
border-radius: 16px;
max-width: 720px;
width: 90%;
max-height: 88vh;
overflow-y: auto;
box-shadow: 0 20px 60px rgba(0,0,0,0.45);
position: relative;
padding: 2.5rem;
transform: scale(0.85);
transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-content {
transform: scale(1);
}
.close-modal {
position: absolute;
top: 15px;
right: 20px;
font-size: 2.5rem;
color: #555;
cursor: pointer;
background: none;
border: none;
line-height: 1;
}
.close-modal:hover { color: var(–primary); }
.modal-content h2 {
color: var(–dark);
margin-bottom: 1rem;
font-size: 2.1rem;
}
.modal-content h3 {
margin: 1.8rem 0 0.8rem;
color: var(–primary);
}
.modal-content ul, .modal-content ol {
padding-left: 1.8rem;
margin: 1.2rem 0;
}
.modal-content li {
margin-bottom: 0.7rem;
font-size: 1.05rem;
}
footer {
background: var(–dark);
color: white;
text-align: center;
padding: 3rem 0 2rem;
margin-top: 5rem;
}
.disclaimer-bar {
background: #0f1e3a;
width: 100%;
padding: 1.8rem 0;
}
.disclaimer {
max-width: 1300px;
margin: 0 auto;
padding: 0 1.5rem;
font-size: 0.9rem;
color: #ccc;
text-align: left;
line-height: 1.5;
}
.disclaimer strong { color: #eee; }
.copyright {
margin-top: 1.8rem;
font-size: 0.95rem;
color: #aaa;
}
@media (max-width: 768px) {
.hero h2 { font-size: 2.2rem; }
header h1 { font-size: 2.4rem; }
.modal-content { padding: 1.8rem; }
.modal-content h2 { font-size: 1.8rem; }
nav a { margin: 0 0.8rem; font-size: 0.95rem; }
}
// ────────────────────────────────────────────────
// SMOOTH SCROLLING + MODAL LOGIC
// ────────────────────────────────────────────────
const headerOffset = 100; // Adjust this value based on your header height + some padding
function smoothScrollTo(targetId) {
const targetElement = document.getElementById(targetId);
if (!targetElement) return;
const elementPosition = targetElement.getBoundingClientRect().top;
const offsetPosition = elementPosition + window.pageYOffset – headerOffset;
window.scrollTo({
top: offsetPosition,
behavior: ‘smooth’
});
}
// Navigation smooth scrolling
document.querySelectorAll(‘nav a’).forEach(link => {
link.addEventListener(‘click’, function(e) {
e.preventDefault();
const targetId = this.getAttribute(‘data-target’);
smoothScrollTo(targetId);
});
});
// Modal logic (unchanged from previous version)
const recipes = {
rec1: `… (paste all 18 recipe strings here as before) …`,
rec2: `…`,
// … all other recipes …
rec18: `…`
};
function openModal(recipeId) {
const modal = document.getElementById(‘modalOverlay’);
const body = document.getElementById(‘modalBody’);
if (recipes[recipeId]) {
body.innerHTML = recipes[recipeId];
modal.classList.add(‘active’);
document.body.style.overflow = ‘hidden’;
}
}
function closeModal() {
const modal = document.getElementById(‘modalOverlay’);
modal.classList.remove(‘active’);
document.body.style.overflow = ”;
}
document.getElementById(‘modalOverlay’).addEventListener(‘click’, function(e) {
if (e.target === this) closeModal();
});
document.querySelectorAll(‘.card’).forEach(card => {
card.addEventListener(‘click’, () => {
const id = card.getAttribute(‘data-recipe’);
if (id) openModal(id);
});
});