@import url('https://fonts.googleapis.com/css2?family=Amatic+SC:wght@400;700&display=swap');

/* ============================================================
   GLOBAL VARIABLES & RESET
   ============================================================ */
:root {
    --primary-blue: #0047AB;
    --accent-bronze: #8d6e63;
    --dark-blue: #0047AB;
    --text-black: #2c1810;
    --beige-bg: #fdf6e3;
    --box-bg: #fffff0;
    --font-main: 'Fredoka', 'Segoe UI', Tahoma, Arial, sans-serif;
    --font-title: 'Frank Ruhl Libre', serif;
    --font-handwriting: 'Klee One', cursive;
    --a4-width: 210mm;
    --a4-height: 297mm;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    background-color: #f0f2f5;
    font-family: var(--font-main);
    color: var(--text-black);
    overflow-x: hidden;
}

/* ============================================================
   SHARED TOP BAR NAVIGATION
   ============================================================ */
.top-bar {
    height: 70px;
    background: #1f2937;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger-btn-top {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hamburger-btn-top:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.page-title {
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.top-bar-left img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

/* ============================================================
   VIEW SWITCHER
   ============================================================ */
.view {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   APP HEADER
   ============================================================ */
.app-header {
    background: url('images/רקע תכלת לוגו עגלה.png') no-repeat center center;
    background-size: cover;
    color: black;
    padding: 15px 20px;
    position: relative;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header-logo {
    height: 80px;
    width: auto;
    object-fit: contain;
}

/* Logo pinned to the left edge of the recipe-grid */
.header-logo-top {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: max(20px, calc((100% - 1200px) / 2 + 20px));
    height: 80px;
    width: auto;
    object-fit: contain;
    opacity: 0.7;
}

.header-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.header-title {
    margin: 10px 0;
    font-family: var(--font-title);
    color: black;
    font-size: 2rem;
}

.header-subtitle {
    margin: 0;
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: normal;
    align-self: flex-start;
}

.header-tagline {
    margin: 5px 0 0;
    font-size: 1.2rem;
    font-weight: normal;
    align-self: flex-start;
}

/* ============================================================
   HAMBURGER / MENU ALIGNMENT
   ============================================================ */
.menu-alignment-container {
    max-width: 1200px;
    margin: 0 auto;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    z-index: 1500;
    pointer-events: none;
}

.hamburger-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: max(10px, calc((100% - 1200px) / 2 + 10px));
    background: none;
    border: none;
    color: black;
    cursor: pointer;
    padding: 5px;
    pointer-events: auto;
}

.hamburger-btn svg {
    width: 50px;
    height: 50px;
}

/* ============================================================
   RECIPE GRID  (Desktop: 4-column grid)
   ============================================================ */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.recipe-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: auto;
}

.card-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

.card-info {
    flex: 1;
    width: 100%;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
}

.card-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    margin-top: 0;
}

.card-info p {
    font-size: 0.9rem;
    font-weight: 400;
    color: #444;
    margin: 0;
}

/* ============================================================
   CLOSE BUTTON
   ============================================================ */
.close-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #6495ED;
    color: white;
    border: 2px solid white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, opacity 0.2s;
    opacity: 0.7;
}

.close-btn:hover {
    transform: scale(1.1);
    background: #4169E1;
    opacity: 1;
}

/* ============================================================
   SINGLE RECIPE PAGE  (Desktop default: A4-ish wide)
   ============================================================ */
.page {
    width: 90%;
    max-width: 1400px;
    min-height: 80vh;
    background-color: var(--beige-bg);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    position: relative;
    padding: 50px;
    margin: 20px auto;
    overflow: hidden;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
}

.page::before {
    display: none;
}

.recipe-header {
    text-align: center;
    margin-bottom: 8mm;
    position: relative;
    z-index: 10;
}

.recipe-title {
    font-size: 2.5rem;
    color: var(--dark-blue);
    font-family: var(--font-title);
    font-weight: 700;
    margin: 0;
}

.recipe-author {
    font-size: 2rem;
    color: var(--text-black);
    font-family: var(--font-handwriting);
    margin-top: 2mm;
    font-style: italic;
}

.recipe-content {
    display: flex;
    justify-content: center;
    gap: 20px;
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

.ingredients-box {
    flex: 1;
}

.instructions-box {
    flex: 2;
}

.ingredients-box,
.instructions-box {
    min-width: 300px;
    background: var(--box-bg);
    padding: 20px;
    border-radius: 8px;
    font-family: var(--font-main);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--accent-bronze);
}

.ingredients-box div,
.instructions-box div {
    line-height: 1.8;
    font-size: 1.5rem;
}

.box-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent-bronze);
    display: inline-block;
    color: var(--dark-blue);
    font-family: var(--font-title);
}

/* ============================================================
   SIDE MENU
   ============================================================ */
.side-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2100;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.side-menu.active {
    right: 0;
}

.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2050;
    display: none;
    backdrop-filter: blur(2px);
}

.side-menu-overlay.active {
    display: block;
}

.close-menu-btn {
    align-self: flex-end;
    background: none;
    border: none;
    cursor: pointer;
    margin-bottom: 20px;
    color: #444;
}

.menu-header h3 {
    margin: 0 0 20px 0;
    color: var(--primary-blue);
    font-family: var(--font-title);
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-nav a {
    text-decoration: none;
    color: var(--text-black);
    font-size: 1.2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.menu-nav a:hover {
    background: #f5f5f5;
    color: var(--primary-blue);
}

/* ============================================================
   AMIT'S STORY PAGE
   ============================================================ */
.story-page {
    padding: 30px;
    background: var(--box-bg);
    max-width: 800px;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    min-height: 80vh;
}

.story-content {
    text-align: right;
    line-height: 1.8;
    color: var(--text-black);
}

.story-title {
    font-family: var(--font-title);
    color: var(--primary-blue);
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 2px solid var(--accent-bronze);
    padding-bottom: 10px;
}

.story-content p {
    margin-bottom: 20px;
    font-size: 1.5rem;
    line-height: 2;
}

.story-footer {
    font-weight: bold;
    text-align: center;
    margin-top: 40px;
    font-size: 1.8rem;
    color: var(--primary-blue);
}

/* ============================================================
   LOCATION PAGE
   ============================================================ */
.location-page {
    padding: 30px;
    max-width: 800px;
    margin: 20px auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: relative;
    min-height: 80vh;
    text-align: right;
}

.location-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.location-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.location-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: var(--box-bg);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--accent-bronze);
}

.location-item i {
    color: var(--primary-blue);
    margin-top: 5px;
}

.location-item strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.2rem;
    color: var(--primary-blue);
    font-family: var(--font-title);
}

.location-item p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-black);
}

.box-waze {
    flex-direction: column;
    align-items: stretch;
}

.waze-btn {
    display: inline-block;
    margin-top: 10px;
    background: #33ccff;
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    text-align: center;
    align-self: flex-start;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.map-container {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
}

/* ============================================================
   PLACEHOLDER PAGES & HOME
   ============================================================ */
.hello-world-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 70px);
    font-size: 5rem;
    color: #fff;
    text-shadow: 0px 4px 10px rgba(0, 0, 0, 0.5);
    font-weight: 700;
    background: linear-gradient(135deg, #1f2937, #111827);
    text-align: center;
}

.memorial-image {
    width: 280px;
    height: auto;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    margin-bottom: 20px;
    border: 4px solid rgba(255, 255, 255, 0.15);
}

.memorial-dates {
    font-size: 0.5em;
    /* 50% of the container's font size */
    margin-top: 5px;
    opacity: 0.9;
    font-weight: 400;
    /* slightly less bold than the name */
}

.memorial-quote {
    margin-top: 40px;
    font-size: 2.2rem;
    font-family: 'Guttman Yad', 'Amatic SC', var(--font-handwriting), cursive;
    font-weight: normal;
    line-height: 1.4;
}

.container {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.container h2 {
    color: #1f2937;
}

/* ============================================================
   MOBILE OVERRIDES  (max-width: 599px)
   ============================================================ */
@media (max-width: 600px) {

    /* Header */
    .app-header {
        padding-top: 15px;
    }

    .header-title {
        font-size: 1.4rem;
        margin-top: 0;
    }

    .header-subtitle,
    .header-tagline {
        font-size: 0.8rem;
    }

    /* Hamburger */
    .hamburger-btn svg {
        width: 22px;
        height: 22px;
    }

    .hamburger-btn {
        top: 15px;
        transform: none;
    }

    /* Logo */
    .header-logo-top {
        height: 50px;
        top: 65%;
        left: 5px;
    }

    /* Recipe Grid — single column list */
    .recipe-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    /* Card — horizontal row on mobile */
    .recipe-card {
        flex-direction: row;
        align-items: stretch;
        min-height: 75px;
    }

    .card-img {
        width: 65px;
        aspect-ratio: 1 / 1;
    }

    .card-info {
        padding: 6px 12px;
        min-height: unset;
    }

    .card-info h3 {
        font-size: 1rem;
    }

    .card-info p {
        font-size: 0.9rem;
    }

    /* Single Recipe Page */
    .page {
        width: 100%;
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        padding: 20px;
    }

    .recipe-title {
        font-size: 1.4rem;
    }

    .recipe-author {
        font-size: 1rem;
    }

    .recipe-content {
        flex-direction: column;
    }

    .ingredients-box {
        flex: none;
        width: 100%;
    }

    .ingredients-box div,
    .instructions-box div {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    .box-title {
        font-size: 1.4rem;
    }

    /* Story */
    .story-title {
        font-size: 1.8rem;
    }

    .story-content p {
        font-size: 1.2rem;
        line-height: 1.8;
    }

    .story-footer {
        font-size: 1.3rem;
    }

    /* Containers & Pages */
    .hello-world-container {
        font-size: 2rem;
        height: min-content;
        min-height: calc(100vh - 65px);
        padding: 45px 20px 20px 20px;
        justify-content: flex-start;
    }

    .memorial-image {
        width: 200px;
        margin-bottom: 15px;
    }

    .memorial-quote {
        margin-top: 30px;
        font-size: 1.15rem;
    }

    .container {
        margin: 20px;
        padding: 20px;
    }
}