/* Fluida2 Timber - Racery Blog Theme CSS */
/* Designed to work with existing Racery server CSS */

/* Racery Brand Colors Reference:
   #319eb3 - Teal (background, actions)
   #177fa5 - Blue (links)
   #333333 - Text
   #4f555f - Dark (header, footer)
   #f0f0f0 - Light (containers)
*/

/* Base styles that complement existing Racery CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
    background: #f5f6f7; /* Light grey background */
    padding-top: 90px; /* Account for fixed header + categories bar */
    font-weight: 300;
}

/* Modern enhancements */
html {
    scroll-behavior: smooth;
}

/* Smooth animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item {
    animation: fadeInUp 0.6s ease-out;
}

/* Global link styles */
a {
    color: #177fa5;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #319eb3;
}

/* Include critical blog_header.css styles */
#author-info,
#nav-below {
    display: none !important;
}

.single-post .one-column,
.page-id-6565 .one-column,
.page-id-6574 .one-column {
    max-width: 800px !important;
}

.comments-link {
    display: none !important;
}

/* Header styles - work with existing #cssmenu */
.raceryheader {
    height: 3.7em;
    line-height: 3.5em;
    background: #4f555f;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
}

.raceryheader h1 {
    margin: 0;
    float: left;
}

.raceryheader h1 img {
    position: relative;
    top: .1em;
    max-width: none;
}

#page-logo {
    height: 40px;
    vertical-align: middle;
    margin-top: -5px;
}

/* Container for header elements */
.raceryheader .container {
    max-width: 100%;
    margin: 0px 1% 0px 1%;
}

/* Clear floats in header */
.raceryheader .container:after {
    content: "";
    display: table;
    clear: both;
}

/* CSSmenu styles from blog_header.css */
#cssmenu {
    border: none;
    margin: 0px;
    padding: 0px;
    padding-left: 180px;
    font: 67.5% "Lucida Sans Unicode", "Bitstream Vera Sans", "Trebuchet Unicode MS", "Lucida Grande", Verdana, Helvetica, sans-serif;
    font-weight: bold;
    width: auto;
    float: left;
}

#cssmenu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#cssmenu li {
    float: left;
    padding: 0px;
    position: relative;
}

#cssmenu li a {
    display: block;
    font-weight: normal;
    line-height: 35px;
    margin: 0px;
    padding: 4px 25px;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    color: #FFFFFF;
}

#cssmenu>ul>li>a {
    line-height: 1.2;
}

#cssmenu>ul>li>a>span:first-child {
    font-size: 2em;
    text-transform: uppercase;
}

#cssmenu li ul {
    background: #333333;
    display: none;
    height: auto;
    padding: 0px;
    margin: 0px;
    border: 0px;
    position: absolute;
    width: 235px;
    z-index: 200;
}

#cssmenu li:hover ul {
    display: block;
}

#cssmenu li ul a {
    display: block;
    height: 35px;
    font-size: 1.25em;
    font-style: normal;
    margin: 0px;
    padding: 0px 10px 0px 15px;
    text-align: left;
    text-transform: lowercase;
}

#cssmenu ul ul a {
    color: #cccccc;
}

#cssmenu li>a:hover,
#cssmenu ul li:hover>a,
#cssmenu li ul a:hover,
#cssmenu li ul li:hover>a {
    background: #2580a2;
    color: #FFFFFF;
    text-decoration: none;
}

/* Social icons */
.socials {
    float: right;
}

.raceryheader #social {
    float: right;
}

.raceryheader #social a {
    display: inline-block;
    height: 1.7em;
    width: 1.7em;
    line-height: 1.7em;
    margin-top: .85em;
    margin-left: .5em;
    padding: .1em;
    color: #fff;
    border-radius: 2px;
    text-align: center;
}

.raceryheader #social a:hover {
    background: #eee;
    color: #4f555f;
    text-decoration: none;
}

.socials a {
    color: #fff;
    margin-left: 10px;
    font-size: 18px;
}

/* Layout - container for main content area */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

#content {
    margin: 20px auto;
    max-width: 1240px;
}

#content .container {
    display: flex;
    gap: 30px;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    min-height: 600px;
}

.site-main {
    flex: 1;
}

.widget-area {
    width: 300px;
    flex-shrink: 0;
    height: fit-content;
}

/* Categories Bar - connected to header */
.categories-bar {
    background: #fff;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
    position: fixed;
    top: 3.7em; /* Directly below fixed header */
    width: 100%;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.categories-bar .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.categories-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap; /* Keep everything in one row */
}

.categories-list {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap; /* No wrapping - stay in single line */
    overflow-x: auto; /* Horizontal scroll if needed */
    flex: 1 1 auto;
}

.category-link {
    display: inline-block;
    padding: 4px 12px;
    background: #f8f9fa;
    border: 1px solid #177fa5;
    border-radius: 15px;
    color: #177fa5;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
    font-weight: 400;
    white-space: nowrap; /* Prevent text wrapping */
    flex-shrink: 0; /* Don't shrink */
}

.category-link:hover {
    background: #177fa5;
    color: #fff;
    text-decoration: none;
    border-color: #177fa5;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(23,127,165,0.3);
}

/* Posts */
.post-item {
    margin-bottom: 50px;
    padding-bottom: 50px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.post-thumbnail {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(23,127,165,0.08);
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
    position: relative;
    aspect-ratio: 16/4; /* Maintain 800x200 ratio */
    max-height: 200px;
}

.post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.4s ease;
    display: block;
}

/* Ensure extracted images fit properly */
.posts-grid .post-thumbnail img {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-thumbnail:hover img {
    transform: scale(1.03);
    opacity: 0.95;
}

/* Placeholder for posts without images */
.post-thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #177fa5 0%, #319eb3 100%);
    opacity: 0.1;
}

.placeholder-content {
    text-align: center;
    color: #177fa5;
}

.placeholder-icon {
    font-size: 48px;
    opacity: 0.3;
}

.entry-header {
    margin-bottom: 20px;
}

.entry-title {
    font-family: 'Source Sans Pro', 'Open Sans', sans-serif;
    font-size: 28px;
    margin-bottom: 15px;
    line-height: 1.4;
    font-weight: 300; /* Light weight like live site */
}

.entry-title a {
    color: #2c3e50;
    transition: color 0.3s ease;
}

.entry-title a:hover {
    color: #177fa5;
    text-decoration: none;
}

.entry-meta {
    color: #7f8c8d;
    font-size: 13px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.entry-meta .posted-on {
    color: #177fa5;
    font-weight: 400;
}

.entry-meta span {
    margin-right: 20px;
}

.category-tag {
    display: inline-block;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    color: #177fa5;
    padding: 3px 10px;
    border: 1px solid #177fa5;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.category-tag:hover {
    background: #177fa5;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(23,127,165,0.2);
}

.entry-content {
    margin-bottom: 25px;
    color: #555;
    line-height: 1.8;
    font-size: 16px;
}

.entry-excerpt::after {
    content: "...";
}

.read-more {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #177fa5 0%, #319eb3 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.3s ease;
    font-weight: 400;
    box-shadow: 0 2px 10px rgba(23,127,165,0.2);
    position: relative;
}

.read-more:after {
    content: '→';
    margin-left: 5px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.read-more:hover {
    background: linear-gradient(135deg, #319eb3 0%, #177fa5 100%);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(49,158,179,0.3);
}

.read-more:hover:after {
    transform: translateX(3px);
}

/* Single Post */
.post-single {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(23,127,165,0.05);
    max-width: 800px;
    margin: 0 auto;
}

/* Featured image on single posts */
.post-featured-image {
    margin: 30px -40px;
    overflow: hidden;
    aspect-ratio: 3/1;
    max-height: 400px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
}

.post-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-single .entry-title {
    font-size: 36px;
    margin-bottom: 20px;
    text-align: center;
    color: #2c3e50;
    font-weight: 300;
}

.post-single .entry-content {
    font-size: 17px;
    line-height: 1.8;
    color: #4a4a4a;
}

/* Responsive images in post content */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 20px auto;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.entry-content .alignleft {
    float: left;
    margin: 0 20px 20px 0;
    max-width: 50%;
}

.entry-content .alignright {
    float: right;
    margin: 0 0 20px 20px;
    max-width: 50%;
}

.entry-content .aligncenter {
    display: block;
    margin: 20px auto;
}

.entry-content .alignnone {
    margin: 20px 0;
}

/* WordPress galleries */
.entry-content .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.entry-content .gallery-item img {
    width: 100%;
    height: auto;
}

/* Add blue accent line to single post title */
.post-single .entry-title:after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #177fa5 0%, #319eb3 100%);
    margin: 20px auto;
    border-radius: 2px;
}

.post-single .entry-content h2 {
    margin: 30px 0 15px;
}

.post-single .entry-content h3 {
    margin: 25px 0 10px;
}

/* Sidebar */
.widget {
    margin-bottom: 30px;
    padding: 0;
    background: #fff;
    border: 1px solid #e8ecf1;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.widget:hover {
    box-shadow: 0 5px 15px rgba(23,127,165,0.08);
}

.widget-title {
    font-size: 14px;
    margin: 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8fbff 0%, #f0f8ff 100%);
    border-bottom: 2px solid #177fa5;
    color: #177fa5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.widget ul {
    list-style: none;
    padding: 15px 20px;
}

.widget li {
    padding: 8px 0;
    border-bottom: 1px dotted #e0e0e0;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: #555;
    transition: color 0.3s ease;
}

.widget a:hover {
    color: #e74c3c;
    text-decoration: none;
}

/* Footer */
.site-footer {
    background: #4f555f; /* Match header dark color */
    color: #ecf0f1;
    padding: 50px 0 30px;
    margin-top: 0;
    box-shadow: 0 -3px 10px rgba(0,0,0,0.1);
}

.footer-widgets {
    margin-bottom: 30px;
}

.site-info {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #34495e;
    font-size: 14px;
    color: #95a5a6;
}

/* Pagination */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 10px 20px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    margin: 0 5px;
}

.pagination a:hover {
    background: #0073e5;
    color: #fff;
    border-color: #0073e5;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.menu-icon {
    display: block;
    width: 25px;
    height: 20px;
    position: relative;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    position: absolute;
    transition: all 0.3s ease;
}

.menu-icon span:nth-child(1) {
    top: 0;
}

.menu-icon span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.menu-icon span:nth-child(3) {
    bottom: 0;
}

/* Active state - transforms into X */
.mobile-menu-toggle.active .menu-icon span:nth-child(1) {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.mobile-menu-toggle.active .menu-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .menu-icon span:nth-child(3) {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding-top: 100px; /* Reduced - no desktop menu now */
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
    }

    /* Ensure header stays fixed and doesn't overflow */
    .raceryheader {
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 1000;
        background: #4f555f;
        height: 50px;
    }

    /* Hide desktop menu by default on mobile */
    #cssmenu {
        position: fixed;
        top: 50px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 50px);
        background: #4f555f;
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 998;
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }

    /* Show menu when active */
    #cssmenu.mobile-active {
        left: 0;
    }

    /* Style mobile menu items */
    #cssmenu ul {
        display: block;
        padding: 20px 0;
    }

    #cssmenu > ul > li {
        display: block;
        margin: 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    #cssmenu > ul > li > a {
        display: block;
        padding: 15px 20px;
        text-align: left;
        font-size: 16px;
    }

    #cssmenu li ul {
        position: static;
        display: block;
        width: 100%;
        background: rgba(0,0,0,0.1);
    }

    /* Ensure categories bar positions correctly below header */
    .categories-bar {
        position: fixed;
        top: 50px; /* Adjusted for simplified mobile header */
        width: 100%;
        z-index: 997;
    }

    #content .container {
        flex-direction: column;
        padding: 20px;
    }

    .widget-area {
        width: 100%;
    }

    #cssmenu {
        padding-left: 10px;
    }

    .categories-bar {
        padding: 5px 0;
    }

    .categories-bar .category-link {
        font-size: 11px;
        padding: 4px 10px;
        margin: 2px;
    }

    .entry-title {
        font-size: 24px;
    }
}

/* Search Form Styles */
.header-search {
    flex: 0 0 auto; /* Don't grow or shrink */
    margin-left: auto; /* Push to right side */
}

.search-form {
    display: flex;
    align-items: center;
    gap: 5px;
}

.search-field {
    padding: 5px 10px;
    border: 1px solid #177fa5;
    border-radius: 15px;
    font-size: 12px;
    width: 150px;
    transition: width 0.3s ease;
}

.search-field:focus {
    outline: none;
    width: 200px;
    border-color: #319eb3;
}

.search-submit {
    background: #177fa5;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 3px;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.search-submit:hover {
    background: #319eb3;
}

.search-icon {
    font-size: 14px;
}

.search-text {
    display: none;
}

@media (min-width: 768px) {
    .search-text {
        display: inline;
    }
}

/* Grid Layout Updates */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.posts-grid .post-item {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 0;
    border-bottom: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.posts-grid .post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.posts-grid .entry-content {
    flex: 1;
}

.posts-grid .entry-footer {
    margin-top: auto;
}

/* Pages (FAQs, About, etc.) */
.page-content .page-single {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.page-single .entry-title {
    font-size: 32px;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #177fa5;
}

.page-single .entry-content {
    font-size: 16px;
    line-height: 1.8;
}

.page-single .entry-content h2 {
    color: #177fa5;
    margin-top: 30px;
    margin-bottom: 15px;
}

.page-single .entry-content h3 {
    color: #333;
    margin-top: 25px;
    margin-bottom: 12px;
}

.page-single .entry-content ul,
.page-single .entry-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.page-single .entry-content li {
    margin-bottom: 10px;
}

/* FAQ Specific Styles */
.page-single .entry-content .faq-item,
.page-single .entry-content .wp-block-group {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-left: 3px solid #177fa5;
}

/* Search Results Page */
.page-header {
    background: white;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.page-title {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.search-term {
    color: #177fa5;
    font-weight: 600;
}

.no-results {
    background: white;
    padding: 40px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.no-results h2 {
    color: #333;
    margin-bottom: 15px;
}

.no-results p {
    color: #666;
    margin-bottom: 30px;
}

/* Categories Bar Responsive Updates */
@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .categories-bar-content {
        /* Keep single row even on mobile */
        flex-direction: row;
        gap: 10px;
    }

    .categories-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .search-field {
        width: 100px; /* Smaller on mobile */
    }

    .search-field:focus {
        width: 130px;
    }

    .search-text {
        display: none; /* Hide "Search" text on mobile */
    }

    .categories-bar .category-link {
        font-size: 10px;
        padding: 3px 8px;
    }
}

/* Mobile menu overlay */
body.mobile-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 996;
}

@media (max-width: 640px) {
    body {
        padding-top: 100px; /* Simplified for mobile with hamburger */
    }

    .raceryheader {
        padding: 10px 0;
    }

    .raceryheader>.container>h1 {
        width: 18px;
        overflow: hidden;
    }

    #cssmenu {
        padding-left: 0;
    }

    /* Adjust categories bar for small screens */
    .categories-bar {
        top: 70px; /* Account for taller mobile header */
        padding: 8px 0;
    }

    #cssmenu li ul,
    #cssmenu li li {
        width: 160px;
    }

    #cssmenu>ul>li>a {
        font-size: 10px;
        padding: 12px 10px;
    }

    #social {
        display: none;
    }

    #cssmenu li ul a {
        font-size: 10px !important;
    }

    .raceryheader h1 img {
        position: relative;
        top: .2em;
        max-width: none;
    }
}

@media only screen and (max-width: 700px) {
    #cssmenu>ul>li:nth-child(1) {
        margin-left: 2%;
    }

    .raceryheader .container {
        margin-left: 5%;
    }
}

@media only screen and (max-width: 500px) {
    #cssmenu>ul>li:nth-child(4) {
        display: none;
    }
}

@media only screen and (max-width: 370px) {
    body {
        padding-top: 100px; /* Consistent with hamburger menu */
    }

    .categories-bar {
        top: 50px; /* Consistent positioning */
    }

    #cssmenu>ul>li:nth-child(n+3) {
        display: none;
    }

    /* Make categories scrollable on tiny screens */
    .categories-list {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .category-link {
        font-size: 9px;
        padding: 2px 6px;
    }
}