/*
Theme Name: Trav's Cookbook
Theme URI: https://cookbook.travprojects.co.uk
Author: Travis Brown
Author URI: https://travisbrown.co.uk
Description: Demo project for learning WordPress themes.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: travs-cookbook
*/

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap');

body {
    background-color: #D7D9CE;
    color: #030301;
    font-family: "Noto Sans", sans-serif;
    margin: 0;
    padding: 0;
}

a {
    color: #2D936C;
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: #2D936C;
}

/* Header */
.header {
    background-color: #0A1F17;
    color: #D7D9CE;
    border-bottom: solid 5px #2D936C;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

.header h1 {
    font-size: 1.5rem;
    margin: 0 0 0 10px;
    display: inline-block;
}

.header .logo {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.header img {
    height: 40px;
    width: auto;
}

.header a {
    color: #D7D9CE;
}

/* Main nav */
.nav {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav li {
    position: relative;
}

.nav li a {
    color: #D7D9CE;
    text-decoration: none;
    padding: 5px 10px;
    display: block;
}

.nav li a:hover {
    color: #2D936C;
}

/* Dropdown */
.dropdown-menu {
    display: none;
    /* hidden by default */
    position: absolute;
    top: 100%;
    /* directly below parent */
    left: 0;
    background: #0A1F17;
    border: 1px solid #2D936C;
    list-style: none;
    margin: 0;
    padding: 10px 0;
    flex-direction: column;
    /* vertical layout */
    min-width: 180px;
    z-index: 1000;
}

.dropdown-menu li {
    padding: 5px 15px;
}

.dropdown-menu li a {
    color: #D7D9CE;
    text-decoration: none;
    display: block;
    width: 100%;
}

.dropdown-menu li a:hover {
    color: #2D936C;
}

/* Show dropdown on hover */
.nav li:hover>.dropdown-menu {
    display: flex;
}

/* Search dropdown */
.search #search-form {
    display: none;
}

.search #search-form.active {
    display: block;
    position: absolute;
    background: #0A1F17;
    padding: 10px;
    border: 1px solid #2D936C;
}

/* Main content */
.main-content {
    margin: 0 auto;
    padding: 0 2%;
    max-width: 1400px;
    min-height: 92vh;
}

.main-content img {
    border: solid 5px #0A1F17;
}

.main-content .wp-block-button .wp-element-button {
    background-color: #0A1F17;
    color: #D7D9CE;
    border: solid 3px #0A1F17;
    transition: all 0.2s;
}

.main-content .wp-block-button .wp-element-button:hover {
    color: #0A1F17;
    background-color: #D7D9CE;
}

/* Footer */
.footer {
    background-color: #0A1F17;
    color: #D7D9CE;
    border-top: solid 5px #2D936C;
    padding: 10px 20px;
    text-align: center;
}

.bottom-text {
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        /* stack in flow for mobile */
        border: none;
        background: transparent;
        padding: 0;
    }

    .dropdown-menu li a {
        padding: 5px 0;
    }
}

.search-form {
    display: flex;
    align-items: center;
    border: 2px solid #2D936C;
    border-radius: 5px;
    padding: 5px 10px;
    background: #D7D9CE;
    max-width: 300px;
}

.search-field {
    border: none;
    outline: none;
    background: transparent;
    color: #030301;
    flex: 1;
    padding: 5px;
    font-family: "Noto Sans", sans-serif;
}

.search-field::placeholder {
    color: #030301;
    opacity: 0.6;
}

.search-submit {
    background: none;
    border: none;
    color: #2D936C;
    cursor: pointer;
    padding: 0 5px;
    font-family: "Noto Sans", sans-serif;
}

.search-submit:hover {
    color: #0A1F17;
}

.recipe-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.recipe-card {
    background-color: #D0D3C5;
    border: 5px solid #0A1F17;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.recipe-card:hover {
    transform: scale(1.01);
}

.recipe-card a {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.recipe-thumb {
    width: 100%;
    height: 250px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.recipe-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.recipe-card h2 {
    font-size: 1.2rem;
    color: #0A1F17;
    margin: 10px 0 5px 0;
}

.recipe-card p {
    font-size: 0.9rem;
    color: #333;
    margin: 0 10px 10px 10px;
}

.text-center {
    text-align: center;
}

.featured-recipe {
    display: flex;
    background: #fff;
    border: 5px solid #0A1F17;
    margin-bottom: 40px;
    overflow: hidden;
    border-radius: 20px;
}

.featured-image {
    flex: 7;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: none;
}

.featured-content {
    flex: 3;
    padding: 20px;
    background: #D7D9CE;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-content h2 {
    margin-top: 0;
    color: #0A1F17;
}

.featured-content a {
    margin-top: 10px;
    color: #2D936C;
    font-weight: bold;
}

.newsletter-signup {
    background: #D0D3C5;
    padding: 40px 20px;
    text-align: center;
    margin: 40px 0;
    border-top: 5px solid #0A1F17;
    border-bottom: 5px solid #0A1F17;
}

.newsletter-signup h2 {
    margin-top: 0;
    color: #0A1F17;
}

.newsletter-signup p {
    color: #030301;
    margin-bottom: 20px;
}

.newsletter-signup form {
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 auto;
    gap: 10px;
}

.newsletter-signup input[type="email"] {
    flex: 1;
    padding: 10px;
    border: 2px solid #0A1F17;
    border-radius: 4px;
    font-family: "Noto Sans", sans-serif;
}

.newsletter-signup button {
    background: #0A1F17;
    color: #D7D9CE;
    border: 2px solid #0A1F17;
    padding: 10px 20px;
    cursor: pointer;
    font-family: "Noto Sans", sans-serif;
    transition: all 0.2s;
}

.newsletter-signup button:hover {
    background: #D7D9CE;
    color: #0A1F17;
}