﻿/*
Theme Name: Uptime Warriors
Description: A minimalist WordPress theme for "The One Who Keeps Everything Running"
Version: 2.1
Author: Uptime Warriors Team
Author URI: https://uptimewarriors.com
Text Domain: uptime-warriors
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: minimal, clean, responsive, blog
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    height: 100%;
}

/* Dynamic layout variables based on screen dimensions */
:root {
    --container-padding: clamp(1rem, 2vw, 1.5rem);
    --header-spacing: clamp(1rem, 2vw, 2rem);
    --content-gap: clamp(1.5rem, 3vw, 2.5rem);
    --sidebar-width: clamp(280px, 25vw, 350px);
    --title-size: clamp(1.2rem, 3vw, 1.6rem);
    --poem-size: clamp(0.8rem, 1.8vw, 0.9rem);
}

/* Apply dynamic variables */
body {
    padding: var(--container-padding);
}

.header {
    margin-bottom: var(--header-spacing);
}

.main-layout {
    gap: var(--content-gap);
}

.blog-sidebar {
    width: var(--sidebar-width);
}

.title {
    font-size: var(--title-size);
}

.poem {
    font-size: var(--poem-size);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    color: #333333;
    line-height: 1.7;
    font-size: 16px;
    padding: var(--container-padding);
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Desktop devices - prevent scrolling on homepage */
@media (min-width: 1024px) {
    body.home {
        height: 100vh;
        overflow: hidden;
        padding: var(--container-padding);
    }
    
    body:not(.home) {
        height: auto;
        overflow: visible;
        padding: var(--container-padding);
    }
}

/* Tablet landscape - natural flow */
@media (min-width: 769px) and (max-width: 1023px) {
    body.home {
        height: auto;
        overflow: visible;
        padding: var(--container-padding);
    }
    
    body:not(.home) {
        height: auto;
        overflow: visible;
        padding: var(--container-padding);
    }
}

/* Mobile and small tablet devices - always allow scrolling */
@media (max-width: 768px) {
    body {
        height: auto !important;
        overflow: visible !important;
        padding: var(--container-padding);
    }
    
    body.home {
        height: auto;
        overflow: visible;
    }
    
    /* Only disable scrolling when mobile menu is open */
    body.mobile-menu-open {
        position: fixed;
        width: 100%;
        height: 100%;
        overflow: hidden;
        top: 0;
        left: 0;
    }
    
    /* Ensure smooth scrolling on mobile */
    body {
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
    }
    
    .main-layout {
        height: auto !important;
        overflow: visible !important;
    }
    
    .content-container,
    .blog-sidebar {
        height: auto !important;
        overflow: visible !important;
    }
}

.container {
    display: flex;
    flex-direction: column;
    height: auto;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Homepage container - fit within viewport */
body.home .container {
    height: auto;
}

/* Desktop homepage - constrained to viewport */
@media (min-width: 1024px) {
    body.home .container {
        height: calc(100vh - 3rem);
        max-height: calc(100vh - 3rem);
        overflow: hidden;
    }
}

/* Tablet landscape - natural flow */
@media (min-width: 769px) and (max-width: 1023px) {
    body.home .container {
        height: auto;
        overflow: visible;
    }
}

/* Mobile - natural flow */
@media (max-width: 768px) {
    body.home .container {
        height: auto;
        overflow: visible;
    }
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 1rem;
    padding-right: 2rem;
    position: relative;
    height: auto;
}

/* Responsive header sizing - no min-height restrictions */
@media (min-width: 1024px) {
    .header {
        padding-right: 2rem;
        margin-bottom: 2rem;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .header {
        padding-right: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding-right: 0;
        margin-bottom: 1.5rem;
    }
}

.header h1 {
    font-family: 'Georgia', serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.header h1:hover {
    color: #666666;
}

/* Site Logo Styles */
.site-logo {
    height: 70px;
    width: auto;
    max-width: 450px;
    object-fit: contain;
    transition: opacity 0.3s ease;
    display: block;
    margin: 0 auto;
}

.site-logo:hover {
    opacity: 0.8;
}

/* Responsive logo sizing */
@media (max-width: 768px) {
    .site-logo {
        height: 55px;
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    .site-logo {
        height: 45px;
        max-width: 280px;
    }
}

.header nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-layout {
    flex: 1;
    display: flex;
    gap: 4rem;
    height: auto;
}

/* Desktop homepage - completely flexible */
@media (min-width: 1024px) {
    body.home .main-layout {
        overflow: visible;
        height: auto;
        gap: 2rem;
    }
}

/* Tablet - responsive layout switching with smaller gap */
@media (min-width: 769px) and (max-width: 1023px) {
    body.home .main-layout {
        flex-direction: row;
        gap: 1.5rem;
        overflow: visible;
        height: auto;
        align-items: flex-start;
    }
}

/* Mobile - column layout with smaller gap */
@media (max-width: 768px) {
    body.home .main-layout {
        flex-direction: column;
        gap: 1rem;
        overflow: visible;
        height: auto;
    }
}

.content-container {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    height: auto;
}

/* Desktop homepage - left aligned content */
@media (min-width: 1024px) {
    body.home .content-container {
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
        overflow: visible;
        height: auto;
        padding-top: 0.5rem;
    }
    
    /* Desktop-specific poem optimization */
    .poem {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .stanza {
        margin-bottom: 0.8rem;
    }
    
    .title {
        margin-bottom: 0.8rem;
    }
    
    .subtitle {
        margin-bottom: 1rem;
    }
}

/* Tablet homepage - left aligned */
@media (min-width: 769px) and (max-width: 1023px) {
    body.home .content-container {
        justify-content: flex-start;
        align-items: flex-start;
        text-align: left;
        overflow: visible;
        flex: 0 0 55%;
    }
}

/* Mobile homepage - natural flow */
@media (max-width: 768px) {
    body.home .content-container {
        justify-content: flex-start;
        align-items: stretch;
        text-align: left;
        overflow: visible;
        flex: 1;
    }
}

/* Normal flow for other pages */
body:not(.home) .content-container {
    padding-top: 1rem;
}

.title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: #333333;
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Responsive title sizing */
@media (max-width: 1023px) {
    .title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 768px) {
    .title {
        font-size: 1.2rem;
        line-height: 1.3;
        margin-bottom: 1.2rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.1rem;
    }
}

.subtitle {
    font-size: 1rem;
    color: #666666;
    margin-bottom: 1.2rem;
    font-weight: 400;
}

.poem {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #444444;
    max-width: 600px;
    font-weight: 400;
}

/* Responsive poem sizing */
@media (max-width: 1023px) {
    .poem {
        max-width: 500px;
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

@media (max-width: 768px) {
    .poem {
        max-width: 100%;
        font-size: 0.8rem;
        line-height: 1.5;
    }
}

.stanza {
    margin-bottom: 1rem;
}

.poem-line {
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
}

.blog-sidebar {
    flex: 1;
    min-width: 300px;
    max-width: 450px;
    height: auto;
    overflow: visible;
    padding-left: 2rem;
    border-left: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
}

/* Desktop - flexible width with more space */
@media (min-width: 1024px) {
    body.home .blog-sidebar {
        height: auto;
        overflow: visible;
        min-height: auto;
        flex: 1;
        min-width: 320px;
        max-width: 500px;
    }
}

/* Tablet - responsive width */
@media (min-width: 769px) and (max-width: 1023px) {
    body.home .blog-sidebar {
        height: auto;
        overflow: visible;
        padding-left: 1.5rem;
        flex: 1;
        min-width: 280px;
        max-width: 400px;
    }
}

/* Mobile - full width, no height restrictions */
@media (max-width: 768px) {
    body.home .blog-sidebar {
        width: 100%;
        height: auto;
        overflow: visible;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid #e5e5e5;
        padding-top: 2rem;
        margin-top: 1rem;
        min-width: auto;
        max-width: none;
    }
}

/* Allow natural height for non-homepage */
body:not(.home) .blog-sidebar {
    height: auto;
    overflow: visible;
}

.blog-sidebar h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 1rem;
    text-align: center;
}

.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.blog-card {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    position: relative;
    text-align: center;
}

.blog-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.blog-card-image {
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    text-align: center;
    line-height: 1;
}

.blog-card-content {
    text-align: center;
}

.blog-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.blog-card-excerpt {
    font-size: 0.8rem;
    color: #666666;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.blog-card-button {
    background: transparent;
    color: #333333;
    padding: 0.7rem 1.2rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: fit-content;
}

.blog-card-button:hover {
    background: #333333;
    color: #ffffff !important;
    border-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.blog-sidebar > div:last-child {
    margin-top: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.blog-sidebar > div:last-child a {
    font-size: 0.95rem;
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.blog-sidebar > div:last-child a:hover {
    color: #666666;
}

/* See All Blogs Link Styles */
.see-all-blogs {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    background: transparent;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.see-all-blogs:hover {
    background: #333333;
    color: #ffffff !important;
    border-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.see-all-blogs::after {
    content: '';
    margin-left: 0.5rem;
    display: inline-block;
    transition: transform 0.3s ease;
    color: inherit;
}

.see-all-blogs:hover::after {
    transform: translateX(4px);
    color: #ffffff;
}

/* Responsive see all blogs link */
@media (max-width: 768px) {
    .see-all-blogs {
        padding: 0.6rem 0.9rem;
        font-size: 0.8rem;
        margin-top: 0.8rem;
    }
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1001;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #333333;
    margin: 3px 0;
    transition: 0.3s;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-out, visibility 0.3s ease-out;
}

.mobile-nav.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.mobile-nav a {
    font-size: 1.5rem;
    color: #333333;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease, transform 0.2s ease;
    padding: 1rem;
    transform: translateY(20px);
    animation: slideInUp 0.4s ease-out forwards;
}

.mobile-nav.active a {
    transform: translateY(0);
}

.mobile-nav a:hover {
    color: #2563eb;
    transform: translateY(-2px);
}

.mobile-nav .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 2.5rem;
    color: #333333;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: all 0.2s ease;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    font-weight: 300;
    font-family: Arial, sans-serif;
}

.mobile-nav .close-btn:hover {
    color: #ff6b6b;
    transform: scale(1.1);
}

.mobile-nav .close-btn:active {
    transform: scale(0.9);
}

.nav-link {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #333333;
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #666666;
}

.nav-separator {
    margin: 0 1rem;
    color: #666666;
    font-weight: 300;
}

/* Blog Grid Styles for Blogs Page */
.blog-grid-page {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 0;
}

/* Large screens - 3 columns */
@media (min-width: 1200px) {
    .blog-grid-page {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Medium screens - 2 columns */
@media (min-width: 768px) and (max-width: 1199px) {
    .blog-grid-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Small screens - 1 column */
@media (max-width: 767px) {
    .blog-grid-page {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.blog-card-page {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 380px;
}

.blog-card-page:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.blog-card-image-page {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1;
}

.blog-card-title-page {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.blog-card-title-page a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-title-page a:hover {
    color: #2563eb;
}

.blog-card-content-page {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-excerpt-page {
    color: #666666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
}

.blog-card-button-page {
    display: inline-block;
    background: transparent;
    color: #333333;
    padding: 0.6rem 1.2rem;
    text-decoration: none;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.blog-card-button-page:hover {
    background: #333333;
    color: #ffffff !important;
    border-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 2rem;
    text-align: center;
}

.back-link {
    display: inline-block;
    color: #666666;
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

/* Related Posts Styles */
.related-posts {
    border-top: 1px solid #e5e5e5;
    padding-top: 1.5rem;
}

.related-posts h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333333;
    text-align: center;
    margin-bottom: 2rem;
}

.related-posts-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Related Stories Grid - Compact Layout */
.related-posts .blog-grid-page {
    display: grid;
    grid-template-columns: repeat(2, 320px);
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0;
}

.back-link:hover {
    color: #333333;
}

.blogs-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Newsletter Signup */
.newsletter-signup {
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem auto 2rem;
    max-width: 600px;
    text-align: center;
}

.newsletter-signup h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333333;
    margin-bottom: 0.5rem;
}

.newsletter-signup p {
    color: #666666;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-email {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.newsletter-email:focus {
    border-color: #2563eb;
}

.newsletter-submit {
    background: #333333;
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.newsletter-submit:hover {
    background: #555555;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Animation delays for poem lines */
.poem-line:nth-child(1) { animation-delay: 0.1s; }
.poem-line:nth-child(2) { animation-delay: 0.2s; }
.poem-line:nth-child(3) { animation-delay: 0.3s; }
.poem-line:nth-child(4) { animation-delay: 0.4s; }

.stanza:nth-child(2) .poem-line:nth-child(1) { animation-delay: 0.5s; }
.stanza:nth-child(2) .poem-line:nth-child(2) { animation-delay: 0.6s; }
.stanza:nth-child(2) .poem-line:nth-child(3) { animation-delay: 0.7s; }
.stanza:nth-child(2) .poem-line:nth-child(4) { animation-delay: 0.8s; }

.stanza:nth-child(3) .poem-line:nth-child(1) { animation-delay: 0.9s; }
.stanza:nth-child(3) .poem-line:nth-child(2) { animation-delay: 1.0s; }
.stanza:nth-child(3) .poem-line:nth-child(3) { animation-delay: 1.1s; }
.stanza:nth-child(3) .poem-line:nth-child(4) { animation-delay: 1.2s; }

.stanza:nth-child(4) .poem-line:nth-child(1) { animation-delay: 1.3s; }
.stanza:nth-child(4) .poem-line:nth-child(2) { animation-delay: 1.4s; }
.stanza:nth-child(4) .poem-line:nth-child(3) { animation-delay: 1.5s; }
.stanza:nth-child(4) .poem-line:nth-child(4) { animation-delay: 1.6s; }

.stanza:nth-child(5) .poem-line:nth-child(1) { animation-delay: 1.7s; }
.stanza:nth-child(5) .poem-line:nth-child(2) { animation-delay: 1.8s; }
.stanza:nth-child(5) .poem-line:nth-child(3) { animation-delay: 1.9s; }
.stanza:nth-child(5) .poem-line:nth-child(4) { animation-delay: 2.0s; }

/* Desktop responsiveness - ensure proper grid layout */
@media (min-width: 1024px) {
    .blog-grid-page {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2.5rem;
        padding: 0 2rem;
    }
    
    .blogs-main {
        padding: 0 2rem;
    }
    
    .related-posts-container {
        padding: 0 2rem;
        max-width: 800px;
    }
    
    /* Related Stories - Desktop Responsive */
    .related-posts .blog-grid-page {
        grid-template-columns: repeat(2, 300px);
        gap: 2rem;
    }
}

/* Tablet responsiveness */
@media (min-width: 769px) and (max-width: 1023px) {
    .blog-grid-page {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
        padding: 0 1.5rem;
    }
    
    .blogs-main {
        padding: 0 1.5rem;
    }
    
    .related-posts-container {
        padding: 0 1.5rem;
        max-width: 700px;
    }
    
    /* Related Stories - Tablet: 2 columns */
    .related-posts .blog-grid-page {
        grid-template-columns: repeat(2, 280px);
        gap: 1.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .newsletter-email {
        width: 100%;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    /* Mobile header and navigation */
    .hamburger {
        display: flex;
        top: 1.5rem;
        right: 1.5rem;
    }

    .header nav {
        display: none;
    }

    .header {
        padding-right: 0;
        margin-bottom: 1.5rem;
    }
    
    /* Ensure header always appears above content */
    .container {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .main-layout {
        flex-direction: column;
        gap: 2rem;
    }
    
    .content-container {
        flex: none;
        order: 1;
    }
    
    .blog-sidebar {
        flex: none;
        min-width: auto;
        order: 2;
        width: 100%;
        max-width: none;
        border-left: none;
        border-top: 1px solid #e5e5e5;
        padding-left: 0;
        padding-top: 2rem;
    }
    
    h1 {
        font-size: 1.3em;
        margin-bottom: 0;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .poem-line {
        font-size: 0.95em;
    }
    
    .blog-sidebar h2 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        text-align: center;
    }
    
    .blog-grid {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
    }
    
    .blog-card {
        background: #ffffff;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        padding: 1rem;
        transition: all 0.3s ease;
        text-decoration: none;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    .blog-card:hover {
        border-color: #d1d5db;
        box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
        transform: translateY(-1px);
    }
    
    .blog-card-image {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
        text-align: center;
    }
    
    .blog-card-content {
        text-align: center;
    }
    
    .blog-card-title {
        font-size: 0.95rem;
        font-weight: 500;
        color: #333333;
        margin-bottom: 0.6rem;
        line-height: 1.3;
    }
    
    .blog-card-excerpt {
        font-size: 0.85rem;
        color: #666666;
        line-height: 1.4;
        margin-bottom: 0.8rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        overflow: hidden;
    }
    
    .blog-card-button {
        background: transparent;
        color: #333333;
        text-decoration: none;
        font-weight: 400;
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
        transition: all 0.3s ease;
        display: inline-block;
        text-align: center;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        width: fit-content;
    }
    
    .blog-card-button:hover {
        background: #333333;
        color: #ffffff !important;
        border-color: #333333;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    
    .blog-sidebar > div:last-child {
        margin-top: 1rem;
        text-align: center;
    }
    
    .blog-sidebar > div:last-child a {
        font-size: 0.9rem;
        color: #333333;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
    }
    
    .blog-sidebar > div:last-child a:hover {
        color: #666666;
    }
    
    /* Blog page mobile styles */
    .blog-grid-page {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 2rem;
        padding: 0;
    }
    
    .blog-card-page {
        padding: 1.2rem;
        margin-bottom: 0;
        height: 350px;
    }
    
    .blog-card-image-page {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .blog-card-title-page {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .blog-card-excerpt-page {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .back-link {
        margin-bottom: 1rem;
    }
    
    .blogs-main {
        padding: 0;
    }
    
    .related-posts-container {
        padding: 0;
        max-width: 100%;
    }
    
    /* Related Stories - Mobile: 1 column */
    .related-posts .blog-grid-page {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 350px;
        margin: 0 auto;
    }
    
    .newsletter-signup {
        margin: 2rem auto 1rem;
        padding: 1.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
        gap: 1rem;
    }
    
    .newsletter-email {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 2rem 1rem 1rem 1rem;
    }
    
    h1 {
        font-size: 1.2em;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .poem-line {
        font-size: 0.9em;
        line-height: 1.4;
    }

    .hamburger {
        display: flex;
        top: 1.5rem;
        right: 1.5rem;
    }

    .header {
        margin-bottom: 2rem;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .blog-sidebar h2 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
        text-align: center;
    }
    
    .blog-grid {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
    }
    
    .blog-card {
        padding: 0.8rem;
        border-radius: 6px;
        min-height: auto;
    }
    
    .blog-card-image {
        font-size: 1.6rem;
        margin-bottom: 0.6rem;
    }
    
    .blog-card-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        line-height: 1.2;
    }
    
    .blog-card-excerpt {
        font-size: 0.8rem;
        margin-bottom: 0.7rem;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        overflow: hidden;
    }
    
    .blog-card-button {
        font-size: 0.75rem;
        padding: 0.5rem 0.8rem;
        border-radius: 5px;
        background: transparent;
        color: #333333;
        border: 1px solid #e5e5e5;
        width: fit-content;
    }
    
    .blog-card-button:hover {
        background: #333333;
        color: #ffffff !important;
        border-color: #333333;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .blog-sidebar > div:last-child a {
        font-size: 0.85rem;
    }
}

/* Breadcrumbs Styles */
.breadcrumbs {
    margin: 0 20px;
    padding: 0;
    font-size: 0.9rem;

    @media (max-width: 767px) {
        margin: 0 15px;
    }
}

.breadcrumbs a {
    color: #333333;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

.breadcrumbs a:hover {
    color: #007cba;
}

.breadcrumbs {
    color: #666;
}

/* Responsive blog card display - limit number based on screen size for height management */
/* Large screens with enough height for 3 cards */
@media (min-width: 1024px) and (min-height: 900px) {
    .blog-grid .blog-card:nth-child(n+4) {
        display: none;
    }
}

@media (min-width: 1024px) and (max-height: 899px) {
    .blog-grid .blog-card:nth-child(n+3) {
        display: none;
    }
    
    .blog-grid {
        max-height: 60vh;
        overflow: hidden;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .blog-grid .blog-card:nth-child(n+3) {
        display: none;
    }
    
    .blog-grid {
        max-height: 55vh;
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .blog-grid .blog-card:nth-child(n+2) {
        display: none;
    }
}

/* Blog Post Layout CSS */
.blog-post-main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.content-with-ads {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ad-sidebar {
    width: 160px;
    min-width: 160px;
    flex-shrink: 0;
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

.ad-sidebar-left {
    order: 1;
}

.main-content-area {
    flex: 1;
    max-width: calc(100% - 340px);
    order: 2;
    min-width: 0;
}

.ad-sidebar-right {
    order: 3;
}

.blog-post-article {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.blog-post-featured-image {
    width: 100%;
    margin-bottom: 1.5rem;
    text-align: center;
}

.blog-post-featured-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.blog-post-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.blog-post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1rem;
    line-height: 1.2;
    word-wrap: break-word;
}

.blog-post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.blog-post-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #333;
    margin-bottom: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content h2,
.blog-post-content h3,
.blog-post-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.blog-post-breadcrumbs {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.blog-post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.back-link:hover {
    background: #007cba;
    color: white;
    transform: translateX(-2px);
}

.ad-space {
    width: 100%;
    margin: 2rem 0;
    text-align: center;
}

.ad-space-after-content {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.ad-space-bottom {
    margin-top: 3rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Responsive Blog Post Layout */
@media (max-width: 1023px) {
    .content-with-ads {
        flex-direction: column;
        gap: 1rem;
    }
    
    .ad-sidebar {
        width: 100%;
        min-height: 120px;
        order: initial;
    }
    
    .main-content-area {
        max-width: 100%;
        order: initial;
    }
    
    .blog-post-title {
        font-size: 2rem;
    }
    
    .blog-post-main {
        padding: 0 1rem;
    }
}

@media (max-width: 768px) {
    .blog-post-title {
        font-size: 1.8rem;
    }
    
    .blog-post-content {
        font-size: 1rem;
    }
    
    .blog-post-main {
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .blog-post-title {
        font-size: 1.5rem;
    }
    
    .blog-post-featured-image img {
        border-radius: 8px;
    }
    
    .blog-post-main {
        padding: 0 0.5rem;
    }
}
