/*
Theme Name: Recipestarter
Theme URI: https://example.com/recipestarter
Author: Mosaab
Author URI: https://example.com
Description: A simple, fast, and responsive WordPress theme for recipe and women-related niches. Optimized for AdSense and performance with full Customizer controls for typography, ad placement, and content visibility.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: recipestarter
Tags: blog, food-and-drink, one-column, two-columns, custom-menu, featured-images, threaded-comments, translation-ready
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
*/

/* ==========================================================================
   CSS RESET & BASE
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background-color: #f9f9f9;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #e05d5d;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: #c0392b;
}

ul,
ol {
    list-style-position: inside;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px 4px;
}

.content-area {
    width: 100%;
}

.site-content.has-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.site-content.has-sidebar .content-area {
    width: 100%;
    min-width: 0;
}

.site-content.has-sidebar .widget-area {
    display: none;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.site-title a {
    color: #222;
    text-decoration: none;
}

.site-title a:hover {
    color: #e05d5d;
}

.site-description {
    font-size: 13px;
    color: #888;
    margin-top: 2px;
}

.custom-logo {
    max-height: 50px;
    width: auto;
}

/* ==========================================================================
   NAVIGATION
   ========================================================================== */

.main-navigation {
    position: static;
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #333;
    font-size: 24px;
    line-height: 1;
}

.menu-toggle .hamburger {
    display: block;
    width: 26px;
    height: 2px;
    background: #333;
    position: relative;
    transition: background 0.2s;
}

.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
    content: '';
    display: block;
    width: 26px;
    height: 2px;
    background: #333;
    position: absolute;
    transition: transform 0.2s, top 0.2s;
}

.menu-toggle .hamburger::before {
    top: -8px;
}

.menu-toggle .hamburger::after {
    top: 8px;
}

.menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.menu-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

.primary-menu {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    padding: 0;
    list-style: none;
    z-index: 998;
    border-top: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.primary-menu.toggled {
    display: block;
}

.primary-menu li {
    list-style: none;
    border-bottom: 1px solid #eee;
}

.primary-menu li:last-child {
    border-bottom: none;
}

.primary-menu a {
    display: block;
    padding: 14px 20px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s, color 0.2s;
}

.primary-menu a:hover {
    background: #f9f9f9;
    color: #e05d5d;
}

.primary-menu .sub-menu {
    list-style: none;
    padding-left: 0;
}

.primary-menu .sub-menu a {
    font-size: 13px;
    color: #777;
    padding: 12px 20px;
}

/* ==========================================================================
   POST CARDS (Archive / Index)
   ========================================================================== */

.posts-grid {
    display: grid;
    gap: 25px;
}

.post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.post-card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.post-card .post-thumbnail {
    aspect-ratio: 16/9;
    overflow: hidden;
}

.post-card .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.03);
}

.post-card .post-card-content {
    padding: 18px;
}

.post-card .entry-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

.post-card .entry-title a {
    color: #222;
}

.post-card .entry-title a:hover {
    color: #e05d5d;
}

.post-card .entry-meta {
    font-size: 12px;
    color: #999;
    margin-bottom: 10px;
}

.post-card .entry-meta a {
    color: #999;
}

.post-card .entry-meta span+span::before {
    content: '·';
    margin: 0 6px;
}

.post-card .entry-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* ==========================================================================
   SINGLE POST
   ========================================================================== */

.single-post-content {
    background: #fff;
    border-radius: 8px;
    padding: 23px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.single-post-content .entry-header {
    margin-bottom: 20px;
}

.single-post-content .entry-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    color: #222;
    margin-bottom: 10px;
}

.single-post-content .entry-meta {
    font-size: 13px;
    color: #999;
}

.single-post-content .entry-meta a {
    color: #e05d5d;
}

.single-post-content .entry-meta span+span::before {
    content: '·';
    margin: 0 6px;
}

.single-post-content .post-thumbnail {
    margin-bottom: 20px;
    border-radius: 6px;
    overflow: hidden;
}

.single-post-content .post-thumbnail img {
    width: 100%;
    height: auto;
}

.single-post-content .entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
}

.single-post-content .entry-content p {
    margin-bottom: 1.2em;
}

.single-post-content .entry-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 1.5em 0 0.6em;
    color: #222;
}

.single-post-content .entry-content h3 {
    font-size: 19px;
    font-weight: 600;
    margin: 1.3em 0 0.5em;
    color: #333;
}

.single-post-content .entry-content ul,
.single-post-content .entry-content ol {
    margin-bottom: 1.2em;
    padding-left: 1.5em;
    list-style-position: outside;
}

.single-post-content .entry-content li {
    margin-bottom: 0.4em;
}

.single-post-content .entry-content blockquote {
    border-left: 3px solid #e05d5d;
    padding: 12px 20px;
    margin: 1.2em 0;
    background: #fdf5f5;
    font-style: italic;
    color: #555;
}

.single-post-content .entry-content img {
    border-radius: 6px;
    margin: 1em 0;
}

.single-post-content .entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
}

.single-post-content .entry-content th,
.single-post-content .entry-content td {
    border: 1px solid #eee;
    padding: 8px 12px;
    text-align: left;
}

.single-post-content .entry-content th {
    background: #f9f9f9;
    font-weight: 600;
}

/* ==========================================================================
   AD WIDGET AREAS
   ========================================================================== */

.ad-widget-area {
    text-align: center;
    margin: 20px 0;
    clear: both;
    width: 100%;
}

.ad-widget-area .widget {
    display: block;
    width: 100%;
    max-width: 100%;
}

.ad-widget-area .widget ins {
    display: block;
    width: 100%;
}

/* Mobile-optimized ad containers */
.ad-before-post,
.ad-before-title,
.ad-after-title,
.ad-after-featured-image,
.ad-after-post-content {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   SIDEBAR WIDGETS
   ========================================================================== */

.widget-area .widget {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.widget-area .widget-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e05d5d;
    color: #222;
}

.widget-area .widget ul {
    list-style: none;
    padding: 0;
}

.widget-area .widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.widget-area .widget ul li:last-child {
    border-bottom: none;
}

.widget-area .widget ul li a {
    color: #555;
}

.widget-area .widget ul li a:hover {
    color: #e05d5d;
}

/* ==========================================================================
   RELATED POSTS SLIDER (Top — before content)
   ========================================================================== */

.related-posts-slider-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.related-posts-slider-section .section-title {
    font-size: 18px;
    font-weight: 700;
    color: #222;
    margin-bottom: 15px;
}

.related-posts-slider {
    position: relative;
    overflow: hidden;
    padding: 0 40px;
}

.related-posts-track {
    display: flex;
    transition: transform 0.4s ease;
    gap: 15px;
}

.related-post-slide {
    flex: 0 0 calc(50% - 8px);
    min-width: 0;
}

.related-post-slide .slide-thumbnail {
    aspect-ratio: 16/10;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.related-post-slide .slide-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-slide .slide-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.related-post-slide .slide-title a {
    color: #333;
}

.related-post-slide .slide-title a:hover {
    color: #e05d5d;
}

/* Slider buttons — positioned left and right */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 5;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}

.slider-prev {
    left: 0;
}

.slider-next {
    right: 0;
}

/* ==========================================================================
   RELATED POSTS STATIC GRID (Bottom — after content)
   ========================================================================== */

.related-posts-static {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.related-posts-static .section-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.related-post-card {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.related-card-thumbnail {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.related-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-card-thumbnail img {
    transform: scale(1.03);
}

.related-card-title {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.related-card-title a {
    color: #333;
}

.related-card-title a:hover {
    color: #e05d5d;
}

/* ==========================================================================
   POST NAVIGATION (Next/Previous)
   ========================================================================== */

.post-navigation {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 4px;
}

.post-navigation .nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.post-navigation a:hover .nav-title {
    color: #e05d5d;
}

/* ==========================================================================
   COMMENTS
   ========================================================================== */

.comments-area {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.comments-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
}

.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list .comment {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.comment-list .comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.comment-metadata {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.comment-respond .comment-reply-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #222;
}

.comment-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #555;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #e05d5d;
}

.comment-form .submit {
    background: #e05d5d;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .submit:hover {
    background: #c0392b;
}

.comment-list .children {
    list-style: none;
    padding-left: 25px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: #222;
    color: #aaa;
    padding: 30px 15px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px 20px;
}

.footer-menu li {
    list-style: none;
}

.footer-menu a {
    color: #ccc;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-menu a:hover {
    color: #e05d5d;
}

.site-info {
    font-size: 13px;
    color: #777;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
}

.pagination .page-numbers:hover {
    background: #e05d5d;
    color: #fff;
}

.pagination .page-numbers.current {
    background: #e05d5d;
    color: #fff;
}

/* ==========================================================================
   404 PAGE
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 60px 20px;
}

.error-404 .page-title {
    font-size: 72px;
    font-weight: 800;
    color: #e05d5d;
    margin-bottom: 10px;
}

.error-404 p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.error-404 .search-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
}

.error-404 .search-form .search-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 14px;
    outline: none;
}

.error-404 .search-form .search-submit {
    background: #e05d5d;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 0 5px 5px 0;
    font-size: 14px;
    cursor: pointer;
}

/* ==========================================================================
   SEARCH RESULTS
   ========================================================================== */

.search-results .page-header {
    margin-bottom: 25px;
}

.search-results .page-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

/* ==========================================================================
   ARCHIVE HEADER
   ========================================================================== */

.archive-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.archive-header .archive-title {
    font-size: 22px;
    font-weight: 600;
    color: #333;
}

.archive-header .archive-description {
    font-size: 14px;
    color: #777;
    margin-top: 5px;
}

/* ==========================================================================
   UTILITY
   ========================================================================== */

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 14px;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* ==========================================================================
   RESPONSIVE — TABLET (≥768px)
   ========================================================================== */

@media (min-width: 768px) {
    .site-content {
        padding: 30px 20px;
    }

    .site-content.has-sidebar {
        gap: 30px;
    }

    .menu-toggle {
        display: none;
    }

    .primary-menu {
        display: flex !important;
        position: static;
        box-shadow: none;
        padding: 0;
        gap: 0;
        background: transparent;
        border-top: none;
    }

    .primary-menu li {
        border-bottom: none;
    }

    .primary-menu a {
        padding: 6px 14px;
        font-size: 14px;
        text-transform: none;
        letter-spacing: 0;
    }

    .primary-menu a:hover {
        background: transparent;
    }

    .primary-menu>li {
        position: relative;
    }

    .primary-menu>li>.sub-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        background: #fff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border-radius: 6px;
        padding: 8px 0;
        min-width: 200px;
        z-index: 999;
    }

    .primary-menu>li:hover>.sub-menu {
        display: block;
    }

    .primary-menu .sub-menu a {
        padding-left: 20px;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .related-post-slide {
        flex: 0 0 calc(33.333% - 10px);
    }

    .related-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .single-post-content {
        padding: 35px 30px;
    }

    .single-post-content .entry-title {
        font-size: 32px;
    }
}

/* ==========================================================================
   RESPONSIVE — DESKTOP (≥1024px)
   ========================================================================== */

@media (min-width: 1024px) {
    .header-inner {
        padding: 15px 20px;
    }

    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .single-post-content {
        padding: 40px;
    }

    .single-post-content .entry-title {
        font-size: 36px;
    }

    .site-content {
        padding: 40px 20px;
    }

    .site-content.has-sidebar {
        flex-direction: row;
    }

    .site-content.has-sidebar .content-area {
        flex: 1;
    }

    .site-content.has-sidebar .widget-area {
        display: block;
        width: 300px;
        flex-shrink: 0;
    }
}

/* ==========================================================================
   PAGE TEMPLATE
   ========================================================================== */

.page-content {
    background: #fff;
    border-radius: 8px;
    padding: 25px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.page-content .entry-title {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    margin-bottom: 20px;
}

.page-content .entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
}

.page-content .entry-content p {
    margin-bottom: 1.2em;
}

@media (min-width: 768px) {
    .page-content {
        padding: 35px 30px;
    }

    .page-content .entry-title {
        font-size: 32px;
    }
}

@media (min-width: 1024px) {
    .page-content {
        padding: 40px;
    }
}