/* ---------- GLOBAL RESET ---------- */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: "Segoe UI", sans-serif;
    margin: 0;
    padding: 20px;
    color: #333;

    background-image: url("/static/images/floral_bg.jpg");
    background-size: 800px;
    background-repeat: repeat;
    background-attachment: scroll;
    background-color: #f5f8ff;
}

/* Prevent iOS zoom on inputs */
input,
button,
textarea {
    font-size: 16px;
}

/* ---------- UTILITIES ---------- */

.center { text-align: center; }
.subtitle { color: #5f7d8a; }
.top-space { margin-top: 20px; }

/* ---------- LAYOUT ---------- */

.card {
    background: rgba(255, 253, 247, 0.92);
    padding: 25px;
    border-radius: 14px;
    max-width: 800px;
    margin: auto;
    backdrop-filter: blur(2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.home-photo {
    display: block;
    margin: 0 auto 15px auto;
    max-width: 350px;
    width: 100%;
    border-radius: 12px;
    border: 6px solid rgba(255,255,255,0.9);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* ---------- BUTTONS ---------- */

.button {
    background: #e7b3b5;
    color: white;
    padding: 14px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    min-height: 44px;
    text-align: center;
    transition: 0.2s;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* ---------- SEARCH ---------- */

.search-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 14px 16px;
    border-radius: 20px;
    border: 1px solid #e7b3b5;
    box-shadow: 0 2px 4px rgba(201, 122, 134, 0.15);
    min-height: 44px;
}

.search-button {
    padding: 14px 20px;
    border: none;
    background: #7fc1e3;
    color: white;
    border-radius: 20px;
    font-weight: bold;
    min-height: 44px;
    transition: 0.2s;
}

.search-button:hover {
    transform: translateY(-2px);
}

/* ---------- RECIPE GRID ---------- */

.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.recipe-card {
    background: rgba(255, 253, 247, 0.88);
    color: #4a4a4a;
    border-left: 6px solid #e7b3b5;
    border-top: 6px solid #e7b3b5;
    border-radius: 14px;
    padding: 18px 20px;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transition: 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recipe-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.recipe-card-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2d4a5b;
}

.recipe-card-desc {
    font-size: 1rem;
    color: #5f7d8a;
    line-height: 1.5;
}

/* ---------- MODAL ---------- */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(200, 220, 255, 0.55);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    padding: 12px;
}

.modal-box {
    background: #ffffff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 28px;
    padding: 6px;
    cursor: pointer;
}

/* ---------- CONTENT ---------- */

.ingredients,
.method {
    white-space: pre-line;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* ---------- ANIMATION ---------- */

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease-in forwards;
}

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

/* ---------- DECOR ---------- */

.paper-background {
    padding: 25px;
    border-radius: 12px;
    background: #fffdf7;
    box-shadow: 0 0 12px rgba(0,0,0,0.06);
}

.floral-corners {
    position: relative;
}

.floral-corners::before,
.floral-corners::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.25;
    pointer-events: none;
}

.floral-corners::before {
    top: -20px;
    left: -20px;
    background-image: url("/static/floral_top_left.png");
}

.floral-corners::after {
    bottom: -20px;
    right: -20px;
    background-image: url("/static/floral_bottom_right.png");
}

/* ---------- MOBILE ---------- */

@media (max-width: 600px) {
    html {
        font-size: 17px; /* overall text scale */
    }

    body {
        padding: 14px;
        background-size: 500px;
    }

    .card {
        max-width: 100%;
        padding: 16px;
        margin: 0;
    }

    .home-photo {
        max-width: 220px;
        border-width: 4px;
    }

    .search-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .search-input,
    .search-button,
    .button {
        width: 100%;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .recipe-card {
        padding: 16px;
        gap: 12px;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    h3 { font-size: 1.2rem; }

    .floral-corners::before,
    .floral-corners::after {
        display: none;
    }
}
