/**
 * SevenScribes Main Styles
 * This file contains the main styles for the SevenScribes theme.
 */

/* -------------------------------------------------------------------------- */
/*                             Layout Components                              */
/* -------------------------------------------------------------------------- */

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    width: 100%;
    box-sizing: border-box;
}

.content-area {
    max-width: var(--content-width);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    transition: background-color var(--transition-medium), height var(--transition-medium);
    width: 100%;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    transition: height var(--transition-medium);
    padding: 0 15px;
}

.site-header.scrolled .container {
    height: 60px;
}

.site-branding {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: 15px;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: var(--font-family);
    letter-spacing: -0.5px;
}

.logo-highlight {
    color: var(--primary-color);
    font-weight: 800;
}

.site-description {
    display: none;
}

.main-navigation {
    display: flex;
    align-items: center;
    flex: 1 0 auto;
    justify-content: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    position: relative;
    margin: 0 var(--spacing-md);
}

.main-navigation a {
    display: block;
    padding: var(--spacing-sm) 0;
    font-weight: 500;
    font-size: 1rem;
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border-radius: 4px;
    padding: 5px 10px;
    margin-left: auto;
    flex: 0 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: background-color var(--transition-medium), box-shadow var(--transition-medium);
    gap: 12px;
}

body.dark-theme .header-actions {
    background-color: #212529;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.theme-toggle, .search-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    border: none;
    color: var(--text-color);
    width: 36px;
    height: 36px;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color var(--transition-fast);
    position: relative;
}

.theme-toggle:hover, .search-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.theme-toggle svg, .search-toggle svg {
    width: 22px;
    height: 22px;
    position: relative;
    z-index: 1000;
}

/* Make entire button area clickable with overlay */
.theme-toggle::after, .search-toggle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
}

body.dark-theme .theme-toggle svg {
    transform: rotate(40deg);
}

.subscribe-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #39a0ed;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    white-space: nowrap;
}

.subscribe-button:hover {
    background-color: #2e88d1;
    transform: translateY(-2px);
    color: white;
}

.subscribe-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    padding: 0;
    margin-left: auto;
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    color: var(--text-color);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.menu-toggle::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 1001;
}

.menu-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.hero-section {
    padding: var(--spacing-xxl) 0;
    text-align: center;
    background: var(--header-overlay), url('../images/hero-bg.jpg') center/cover no-repeat;
    color: #fff;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-xl);
    opacity: 0.9;
}

.site-footer {
    background-color: var(--footer-bg);
    padding: 50px 0 30px;
    color: var(--text-color);
    transition: background-color var(--transition-medium), color var(--transition-medium);
    position: relative;
    overflow: hidden;
    width: 100%;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    z-index: 2;
}

.site-footer::after {
    display: none;
}

.site-footer .container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    width: 100%;
    padding: 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    position: relative;
    padding: 0 var(--spacing-md);
}

.footer-widgets {
    position: relative;
    padding: 20px;
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.footer-widgets:hover {
    transform: none;
    box-shadow: none;
}

.footer-branding .footer-logo {
    margin-bottom: 15px;
}

.footer-branding .site-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    color: var(--text-color);
}

.footer-branding .site-title a {
    color: var(--text-color);
    text-decoration: none;
}

.footer-description p {
    line-height: 1.6;
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 0;
}

.footer-widgets h2 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    color: var(--text-color);
    position: relative;
    padding-bottom: 10px;
    font-weight: 600;
    letter-spacing: -0.5px;
    transition: color var(--transition-fast);
}

.footer-widgets h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width var(--transition-fast);
}

.footer-widgets:hover h2::after {
    width: 50px;
}

.footer-widgets ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widgets li {
    margin-bottom: 12px;
    transition: all var(--transition-fast);
    position: relative;
}

.footer-widgets li:hover {
    transform: none;
    padding-left: 0;
}

.footer-widgets li::before {
    display: none;
}

.footer-widgets a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-fast), transform var(--transition-fast);
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
    font-weight: 400;
    font-size: 0.9rem;
    position: relative;
    padding-left: 0;
}

.footer-widgets a:hover {
    color: var(--primary-color);
    opacity: 1;
    transform: translateX(5px);
}

.footer-quick-links li a::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 0 4px 4px;
    border-color: transparent transparent transparent var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition-fast), left var(--transition-fast);
}

.footer-quick-links li a:hover::before {
    opacity: 1;
    left: -8px;
}

/* Simplified social links section */
.footer-social .social-text {
    margin-bottom: 20px;
    line-height: 1.6;
    opacity: 0.85;
    font-size: 0.9rem;
}

.social-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 6px;
    background-color: rgba(var(--primary-color-rgb, 52, 152, 219), 0.05);
    color: var(--text-color);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
    border-color: rgba(var(--primary-color-rgb, 52, 152, 219), 0.2);
}

.social-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.social-link span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.social-link:hover svg {
    transform: scale(1.1);
}

/* Twitter/X styling */
.social-link.twitter {
    background-color: rgba(29, 161, 242, 0.05);
}
.social-link.twitter:hover {
    color: #1da1f2;
    border-color: rgba(29, 161, 242, 0.2);
}

/* Facebook styling */
.social-link.facebook {
    background-color: rgba(66, 103, 178, 0.05);
}
.social-link.facebook:hover {
    color: #4267B2;
    border-color: rgba(66, 103, 178, 0.2);
}

/* LinkedIn styling */
.social-link.linkedin {
    background-color: rgba(0, 119, 181, 0.05);
}
.social-link.linkedin:hover {
    color: #0077B5;
    border-color: rgba(0, 119, 181, 0.2);
}

/* YouTube styling */
.social-link.youtube {
    background-color: rgba(255, 0, 0, 0.05);
}
.social-link.youtube:hover {
    color: #FF0000;
    border-color: rgba(255, 0, 0, 0.2);
}

/* YouTube button styling */
.youtube-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: linear-gradient(to right, #FF0000, #cc0000);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    border: none;
    white-space: nowrap;
}

.youtube-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.youtube-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.3);
}

.youtube-button:hover::before {
    opacity: 1;
    transform: scale(1);
}

.youtube-button svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Copyright section styling */
.site-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px var(--spacing-md);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    position: relative;
    background-color: var(--background-color);
    transition: background-color var(--transition-medium);
    max-width: 100%;
    flex-wrap: wrap;
    gap: 15px;
}

.site-info::before {
    display: none;
}

.site-info-left, 
.site-info-center,
.site-info-right {
    padding: 0 5px;
}

.site-info-left {
    flex: 1 1 30%;
    min-width: 200px;
}

.site-info-center {
    flex: 1 1 40%;
    min-width: 300px;
    display: flex;
    justify-content: center;
}

.site-info-right {
    flex: 1 1 30%;
    min-width: 200px;
    display: flex;
    justify-content: flex-end;
}

.site-info-left p {
    margin: 0;
    opacity: 0.8;
}

.site-info-left a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.site-info-left a:hover {
    color: var(--link-hover-color);
}

/* Center navigation */
.footer-bottom-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-bottom-nav li {
    position: relative;
}

.footer-bottom-nav a {
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.8;
    transition: color var(--transition-fast), opacity var(--transition-fast);
    font-size: 0.85rem;
}

.footer-bottom-nav a:hover {
    color: var(--primary-color);
    opacity: 1;
}

/* Right section with social and subscribe */
.footer-bottom-social {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.footer-bottom-social a {
    color: var(--text-color);
    opacity: 0.8;
    transition: color var(--transition-fast), opacity var(--transition-fast), transform var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-bottom-social a:not(.footer-subscribe-button):hover {
    color: var(--primary-color);
    opacity: 1;
    transform: translateY(-2px);
}

.footer-subscribe-button {
    display: inline-block;
    padding: 6px 15px;
    background-color: #ff0000;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    white-space: nowrap;
    opacity: 1 !important;
}

.footer-subscribe-button:hover {
    background-color: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive styles for large devices (desktops) */
@media (max-width: 1200px) {
    .footer-content {
        gap: 20px;
    }
    
    .footer-widgets {
        min-height: 250px;
    }
}

/* Responsive styles for medium devices (tablets) */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .footer-widgets {
        min-height: 230px;
    }
    
    .site-info {
        padding: 15px 10px;
    }
    
    .site-info-left,
    .site-info-center,
    .site-info-right {
        flex: 1 1 100%;
        min-width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .site-info-center {
        order: 3;
    }
    
    .site-info-right {
        order: 2;
    }
    
    .footer-bottom-social {
        justify-content: center;
    }
}

/* Responsive styles for small devices (landscape phones) */
@media (max-width: 768px) {
    .site-footer {
        padding: 40px 0 20px;
    }
    
    .site-footer::before {
        height: 3px;
        background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    }
    
    .footer-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 20px;
    }
    
    .footer-widgets {
        min-height: auto;
    width: 100%;
        padding: 25px 20px;
        border-radius: 12px;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        border: 1px solid rgba(var(--primary-color-rgb, 57, 160, 237), 0.1);
    }
    
    .footer-widgets:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    }
    
    .footer-widgets h2 {
        font-size: 1.3rem;
        margin-bottom: 20px;
        color: var(--primary-color);
    }
    
    .footer-widgets h2::after {
        width: 50px;
        height: 3px;
        background: linear-gradient(to right, var(--primary-color), rgba(var(--primary-color-rgb, 57, 160, 237), 0.5));
    }
    
    .footer-widgets ul {
        margin-bottom: 0;
    }
    
    .footer-widgets li {
        margin-bottom: 12px;
        position: relative;
    }
    
    .footer-widgets a {
        padding-left: 0;
        font-size: 0.95rem;
    }
    
    .footer-widgets a:hover {
        transform: translateX(8px);
    }
    
    .footer-quick-links li a::before {
        left: -10px;
        border-width: 5px 0 5px 5px;
    }
    
    .footer-social .social-text {
        margin-bottom: 20px;
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .social-links-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .social-link {
        padding: 12px;
        border-radius: 8px;
    }
    
    .social-link:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.site-info {
        flex-direction: column;
        padding: 15px var(--spacing-sm);
    text-align: center;
        gap: 12px;
    }
    
    .site-info-left {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .site-info-left p {
    font-size: 0.9rem;
        opacity: 0.9;
        letter-spacing: 0.3px;
    }
    
    .footer-social {
        text-align: center;
    }
    
    .footer-bottom-nav ul {
        gap: 15px;
        justify-content: center;
        padding: 10px 0;
    }
    
    .youtube-button {
        margin: 0 auto 15px;
        justify-content: center;
        width: 100%;
        max-width: 250px;
    }
    
    /* Mobile menu extras display */
    .mobile-menu-extras {
        display: block;
    }
    
    .mobile-menu-social {
        display: block;
    }
    
    .mobile-menu-social-links {
        display: flex;
    }
    
    .mobile-menu-subscribe {
        display: block;
    }
    
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .single-post-header {
        height: 300px;
    }
    
    .single-post-title {
        font-size: 2rem;
    }
    
    .container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
        width: 100%;
        margin: 0;
    }
}

/* Responsive styles for extra small devices (portrait phones) */
@media (max-width: 480px) {
    .site-footer {
        padding: 30px 0 15px;
    }
    
    .footer-content {
        gap: 20px;
    }
    
    .footer-widgets {
        padding: 20px 15px;
    }
    
    .footer-widgets h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .footer-widgets a {
        font-size: 0.9rem;
    }
    
    .social-links-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .social-link {
        padding: 10px;
    }
    
    .site-info {
        padding: 12px var(--spacing-sm);
    }
    
    .site-info-left p {
        font-size: 0.8rem;
    }
    
    .footer-bottom-nav ul {
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-bottom-social {
        gap: 12px;
    }
    
    .youtube-button {
        max-width: 200px;
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .container {
        padding: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
}

/* Responsive styles for very small devices */
@media (max-width: 360px) {
    .footer-widgets h2 {
        font-size: 1.1rem;
    }
    
    .footer-widgets a {
        font-size: 0.85rem;
    }
    
    .social-link {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .social-link svg {
        width: 18px;
        height: 18px;
    }
    
    .site-info-left p {
        font-size: 0.75rem;
    }
    
    .footer-bottom-nav a {
        font-size: 0.75rem;
    }
    
    .footer-bottom-social a svg {
        width: 18px;
        height: 18px;
    }
    
    .footer-subscribe-button {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    .youtube-button {
        max-width: 180px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }
    
    .youtube-button svg {
        width: 18px;
        height: 18px;
    }
}

/* Landscape mode adjustments */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .site-header {
        position: relative;
    }
    
    .main-navigation {
        height: 100vh;
        overflow-y: auto;
    }
}

.search-form-container {
    display: none;
    position: absolute;
    top: 70px;
    right: 0;
    width: 350px;
    background-color: transparent;
    padding: 15px;
    box-shadow: none;
    z-index: 997;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    border-radius: 8px;
}

body.dark-theme .search-form-container {
    background-color: transparent;
    box-shadow: none;
}

.search-form-container.search-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.search-form {
    display: flex;
    align-items: center;
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    width: 100%;
}

body.dark-theme .search-form {
    background-color: #252525;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.search-form input[type="search"] {
    width: 100%;
    padding: 8px 45px 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    background-color: transparent;
    color: var(--text-color);
}

.search-form input[type="search"]::placeholder {
    color: #888;
}

.search-form input[type="search"]:focus {
    outline: none;
}

.search-form button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    padding: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form button svg {
    width: 22px;
    height: 22px;
}

.search-form-close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: #fff;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark-theme .search-form-close {
    background: #333;
    color: #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.search-form-close:hover {
    opacity: 1;
}

.search-form-close svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .search-form-container {
        width: 300px;
        top: 60px;
    }
}

@media (max-width: 480px) {
    .search-form-container {
        width: calc(100% - 20px);
        max-width: 350px;
        right: 10px;
        top: 55px;
    }
}

/* -------------------------------------------------------------------------- */
/*                            Latest Blog Posts                               */
/* -------------------------------------------------------------------------- */

.latest-posts-section {
    padding: var(--spacing-xxl) 0;
}

.latest-posts-title {
    position: relative;
    font-size: 2rem;
    margin-bottom: var(--spacing-xxl);
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.latest-posts-title::after {
    content: "";
    display: block;
    height: 4px;
    width: 50px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    margin-left: var(--spacing-md);
    border-radius: var(--border-radius-md);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--spacing-xl);
    margin: var(--spacing-lg) 0;
}

.post-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-medium), box-shadow var(--transition-medium), background-color var(--transition-medium);
    height: 100%;
    border: 1px solid var(--border-color);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

/* Dark theme enhancements for post cards */
body.dark-theme .post-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-theme .post-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 5px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .post-card-content {
    background-color: var(--card-bg);
}

body.dark-theme .entry-title a {
    color: var(--heading-color);
}

body.dark-theme .entry-meta,
body.dark-theme .entry-summary,
body.dark-theme .post-excerpt,
body.dark-theme .post-title a {
    color: var(--text-color);
}

body.dark-theme .post-thumbnail::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(30, 30, 30, 0.8) 100%);
}

body.dark-theme .read-more-link {
    background-color: rgba(97, 218, 251, 0.1);
    color: var(--link-color);
}

.post-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-category {
    position: absolute;
    bottom: var(--spacing-sm);
    left: var(--spacing-sm);
    padding: 4px 8px;
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
}

.post-content {
    padding: var(--spacing-lg);
}

.post-meta {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    color: rgba(var(--text-color-rgb), 0.7);
}

.post-meta > div {
    display: flex;
    align-items: center;
}

.post-meta svg {
    width: 16px;
    height: 16px;
    margin-right: 4px;
}

.post-meta .post-date {
    margin-right: var(--spacing-md);
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
    word-break: break-word;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(var(--text-color-rgb), 0.9);
    flex-grow: 1;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color var(--transition-fast);
}

.read-more svg {
    width: 18px;
    height: 18px;
    margin-left: 4px;
    transition: transform var(--transition-fast);
}

.read-more:hover {
    color: var(--link-hover-color);
}

.read-more:hover svg {
    transform: translateX(4px);
}

.pagination {
    display: flex;
    justify-content: center;
    margin: var(--spacing-xxl) 0;
}

.pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--spacing-sm);
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.pagination a:hover, .pagination span.current {
    background-color: var(--primary-color);
    color: white;
}

/* -------------------------------------------------------------------------- */
/*                              Single Post Styles                            */
/* -------------------------------------------------------------------------- */

.single-post-header {
    position: relative;
    height: 500px;
    margin-bottom: var(--spacing-xxl);
    color: white;
}

.single-post-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single-post-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--spacing-xxl) 0;
}

.single-post-title {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1rem;
}

.single-post-meta > div {
    display: flex;
    align-items: center;
}

.single-post-meta svg {
    width: 18px;
    height: 18px;
    margin-right: 6px;
}

.single-post-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

/* -------------------------------------------------------------------------- */
/*                                Media Queries                               */
/* -------------------------------------------------------------------------- */

/* Extra large devices (large desktops) */
@media (max-width: 1400px) {
    :root {
        --container-width: 1200px;
    }
}

/* Large devices (desktops) */
@media (max-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    :root {
        --container-width: 90%;
    }
    
    .site-header .container {
        padding: 0 20px;
    }
    
    .main-navigation li {
        margin: 0 12px;
    }
    
    .main-navigation a {
        font-size: 0.95rem;
    }
    
    .header-actions {
        padding: 4px 8px;
        gap: 8px;
    }
    
    .subscribe-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Medium devices (tablets) */
@media (max-width: 992px) {
    .site-header .container {
        height: 65px;
        padding: 0 15px;
    }
    
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--background-color);
        padding: 80px 25px 25px;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .main-navigation.toggled {
        right: 0;
    }
    
    .main-navigation ul {
        flex-direction: column;
        margin: 0;
        padding: 0;
    }
    
    .main-navigation li {
        margin: 0;
        padding: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        padding: 15px 0;
        font-size: 1rem;
        color: var(--text-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-weight: 500;
    }

    .main-navigation a:hover {
        color: var(--primary-color);
    }

    .main-navigation a::after {
        content: '›';
        font-size: 1.2rem;
        opacity: 0.5;
        transition: transform 0.3s ease;
    }

    .main-navigation a:hover::after {
        transform: translateX(5px);
        opacity: 1;
        color: var(--primary-color);
    }
    
    .menu-toggle {
        display: flex;
        margin-left: 0;
        margin-right: 10px;
    }
    
    .header-actions {
        margin-left: auto;
    }

    .site-branding {
        margin-right: 25px;
    }

    /* Mobile menu extras styling */
    .mobile-menu-extras {
        display: block;
        margin-top: 30px;
    }

    .mobile-menu-social {
        display: block;
        margin-top: 25px;
        padding-top: 25px;
        border-top: 1px solid var(--border-color);
    }

    .mobile-menu-social-title {
        font-size: 0.9rem;
        color: var(--text-color);
        opacity: 0.7;
        margin-bottom: 15px;
        font-weight: 500;
    }

    .mobile-menu-social-links {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .mobile-menu-social-links a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 8px;
        background-color: var(--card-bg);
        color: var(--text-color);
        transition: all 0.3s ease;
        border: 1px solid var(--border-color);
    }

    .mobile-menu-social-links a:hover {
        background-color: var(--primary-color);
        color: white;
        transform: translateY(-2px);
    }

    .mobile-menu-social-links svg {
        width: 20px;
        height: 20px;
    }

    .mobile-menu-subscribe {
        display: block;
        margin-top: 25px;
    }

    .mobile-menu-subscribe .youtube-button {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 0.95rem;
    }
}

/* Dark theme enhancements for mobile menu */
body.dark-theme .main-navigation {
    background: var(--background-color);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
}

body.dark-theme .mobile-menu-social-links a {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .mobile-menu-social-links a:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Small devices (landscape phones) */
@media (max-width: 768px) {
    .site-header .container {
        height: 60px;
    }
    
    .site-branding {
        margin-right: 20px;
    }
    
    .header-actions {
        padding: 3px 6px;
        gap: 6px;
    }
    
    .theme-toggle, .search-toggle {
        width: 32px;
        height: 32px;
    }
    
    .theme-toggle svg, .search-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    .subscribe-button {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .subscribe-button svg {
        width: 16px;
        height: 16px;
    }
    
    .menu-toggle {
        width: 40px;
        height: 40px;
        margin-right: 8px;
    }
    
    .menu-toggle svg {
        width: 22px;
        height: 22px;
    }
    
    .main-navigation {
        width: 280px;
    }
    
    .container {
        padding-left: 0;
        padding-right: 0;
        max-width: 100%;
        width: 100%;
        margin: 0;
    }
}

/* Extra small devices (portrait phones) */
@media (max-width: 480px) {
    .site-header .container {
        height: 55px;
        padding: 0 10px;
    }
    
    .site-logo {
        font-size: 1.2rem;
    }
    
    .theme-toggle, .search-toggle {
        width: 30px;
        height: 30px;
        padding: 4px;
    }
    
    .subscribe-button {
        padding: 5px 8px;
        font-size: 0.75rem;
    }
    
    .menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .main-navigation {
        width: 100%;
        padding: 70px 15px 15px;
    }
    
    .main-navigation a {
        font-size: 1rem;
    }
}

/* Very small devices */
@media (max-width: 360px) {
    .site-header .container {
        height: 50px;
    }
    
    .theme-toggle, .search-toggle, .subscribe-button {
        padding: 4px;
    }
    
    .subscribe-button span {
        display: none;
    }
    
    .menu-toggle {
        width: 32px;
        height: 32px;
    }
    
    .menu-toggle svg {
        width: 20px;
        height: 20px;
    }
}

/* Landscape mode adjustments */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .site-header {
        position: relative;
    }
    
    .main-navigation {
        height: 100vh;
        overflow-y: auto;
    }
}

.search-form-container {
    display: none;
    position: absolute;
    top: 70px;
    right: 0;
    width: 350px;
    background-color: transparent;
    padding: 15px;
    box-shadow: none;
    z-index: 997;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    border-radius: 8px;
}

body.dark-theme .search-form-container {
    background-color: transparent;
    box-shadow: none;
}

.search-form-container.search-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.search-form {
    display: flex;
    align-items: center;
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    width: 100%;
}

body.dark-theme .search-form {
    background-color: #252525;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.search-form input[type="search"] {
    width: 100%;
    padding: 8px 45px 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    background-color: transparent;
    color: var(--text-color);
}

.search-form input[type="search"]::placeholder {
    color: #888;
}

.search-form input[type="search"]:focus {
    outline: none;
}

.search-form button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: transparent;
    color: var(--primary-color);
    border: none;
    cursor: pointer;
    padding: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form button svg {
    width: 22px;
    height: 22px;
}

.search-form-close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: #fff;
    border: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark-theme .search-form-close {
    background: #333;
    color: #ccc;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.search-form-close:hover {
    opacity: 1;
}

.search-form-close svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .search-form-container {
        width: 300px;
        top: 60px;
    }
}

@media (max-width: 480px) {
    .search-form-container {
        width: calc(100% - 20px);
        max-width: 350px;
        right: 10px;
        top: 55px;
    }
}

/* -------------------------------------------------------------------------- */
/*                            Latest Blog Posts                               */
/* -------------------------------------------------------------------------- */

.latest-posts-section {
    padding: var(--spacing-xxl) 0;
}

.latest-posts-title {
    position: relative;
    font-size: 2rem;
    margin-bottom: var(--spacing-xxl);
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.latest-posts-title::after {
    content: "";
    display: block;
    height: 4px;
    width: 50px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    margin-left: var(--spacing-md);
    border-radius: var(--border-radius-md);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--spacing-xl);
    margin: var(--spacing-lg) 0;
}

.post-card {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    border: 1px solid var(--border-color);
}

/* Update dark theme card styles */
body.dark-theme .post-card {
    background-color: #2a2a2a;
    border-color: #444444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark-theme .post-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 5px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .post-card-content {
    background-color: #2a2a2a;
}

body.dark-theme .entry-title a {
    color: #fff;
}

body.dark-theme .entry-meta,
body.dark-theme .entry-summary,
body.dark-theme .entry-footer {
    color: #f5f5f5;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

.post-category {
    position: absolute;
    bottom: var(--spacing-sm);
    left: var(--spacing-sm);
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.post-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.entry-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
}

.entry-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.entry-title a:hover {
    color: var(--primary-color);
}

.entry-meta {
    display: flex;
    align-items: center;
    margin-bottom: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.8;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

.post-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-author img {
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.entry-summary {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-color);
    opacity: 0.85;
    margin-bottom: var(--spacing-md);
    flex-grow: 1;
}

.entry-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 4px;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(var(--primary-color-rgb), 0.2);
}

.read-more-link svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.read-more-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--primary-color-rgb), 0.3);
    color: white;
}

.read-more-link:hover svg {
    transform: translateX(4px);
}

.view-all-posts {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-xl);
}

.view-all-posts a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--border-radius-md);
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.2);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.view-all-posts a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.view-all-posts a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.3);
    color: white;
}

.view-all-posts a:hover::before {
    opacity: 1;
}

.view-all-posts svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.view-all-posts a:hover svg {
    transform: translateX(4px);
}

/* Dark theme adjustments */
body.dark-theme .read-more-link,
body.dark-theme .view-all-posts a {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark-theme .read-more-link:hover,
body.dark-theme .view-all-posts a:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.reading-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
}

.view-all-posts {
    display: flex;
    justify-content: center;
    margin-top: var(--spacing-xl);
}

.view-all-posts a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--card-bg-color);
    color: var(--text-color);
    font-weight: 600;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.view-all-posts a:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.view-all-posts svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.view-all-posts a:hover svg {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
    
    .post-thumbnail {
        height: 200px;
    }
    
    .latest-posts-title {
        font-size: 1.7rem;
    }
}

/* Logo Styles for Light and Dark Themes */
.custom-logo-link {
    display: block;
}

.custom-logo {
    max-height: 60px;
    width: auto;
}

/* Text-based site title (when no custom logo is set) */
.site-title {
    position: relative;
}

/* Create two logo slots that we can swap between */
.site-branding .site-title a,
.footer-branding .site-title a {
    display: block;
    text-indent: -9999px;
    overflow: hidden;
    height: 60px;
    width: 240px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin: 0;
}

/* Light theme logo (dark logo on white background) */
.site-branding .site-title a {
    background-image: url('../images/Logo of 7Scribe dark for white.png');
}

body.dark-theme .site-branding .site-title a {
    background-image: url('../images/Logo of 7Scribe white for dark.png');
}

/* Footer logo versions */
.footer-branding .site-title a {
    background-image: url('../images/Logo of 7Scribe dark for white.png');
    height: 50px;
    width: 200px;
    margin-bottom: 10px;
}

body.dark-theme .footer-branding .site-title a {
    background-image: url('../images/Logo of 7Scribe white for dark.png');
}

/* Make sure logos are responsive */
@media (max-width: 768px) {
    .site-branding .site-title a,
    .footer-branding .site-title a {
        width: 180px;
        height: 45px;
    }
    
    .custom-logo {
        max-height: 45px;
    }
}

@media (max-width: 480px) {
    .site-branding .site-title a,
    .footer-branding .site-title a {
        width: 140px;
        height: 35px;
    }
    
    .custom-logo {
        max-height: 35px;
    }
}

.mobile-menu-extras,
.mobile-menu-social,
.mobile-menu-social-links,
.mobile-menu-subscribe {
    display: none;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Re-add the rule for toggled menu overlay */
@media (max-width: 768px) {
    .main-navigation.toggled ~ .menu-overlay {
        display: block;
        opacity: 1;
    }
}

:root {
    --container-width: 1280px;
    --content-width: 800px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    --primary-color: #3498db;
    --primary-color-rgb: 52, 152, 219;
    --secondary-color: #2ecc71;
    --secondary-color-rgb: 46, 204, 113;
    --text-color: #333333;
    --text-color-rgb: 51, 51, 51;
    --heading-color: #111111;
    --background-color: #ffffff;
    --card-bg: #f9f9f9;
    --border-color: #e0e0e0;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #f5f5f5;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --header-height: 70px;
    --link-color: #3498db;
    --link-hover-color: #2980b9;
    --dark-shadow-color: rgba(0, 0, 0, 0.2);
    --gradient-start: #3498db;
    --gradient-end: #2ecc71;
    --header-overlay: linear-gradient(135deg, rgba(52, 152, 219, 0.8), rgba(46, 204, 113, 0.8));
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.3s ease;
    --transition-slow: 0.5s ease;
    --border-radius: 8px;
}

/* Dark theme variables */
body.dark-theme, 
body.dark-mode {
    --primary-color: #2186c4;
    --primary-color-rgb: 33, 134, 196;
    --secondary-color: #27ae60;
    --secondary-color-rgb: 39, 174, 96;
    --text-color: rgba(255, 255, 255, 0.9);
    --text-color-rgb: 255, 255, 255;
    --heading-color: #ffffff;
    --background-color: #121212;
    --card-bg: #1e1e1e;
    --border-color: #2a2a2a;
    --nav-bg: rgba(26, 26, 26, 0.95);
    --footer-bg: #1a1a1a;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --link-color: #61dafb;
    --link-hover-color: #a0e9ff;
    --dark-shadow-color: rgba(0, 0, 0, 0.3);
    --dark-primary-color: #2186c4;
    --dark-secondary-color: #27ae60;
    --gradient-start: #2186c4;
    --gradient-end: #27ae60;
    --header-overlay: linear-gradient(135deg, rgba(33, 134, 196, 0.8), rgba(39, 174, 96, 0.8));
}

/* Apply smooth transitions for theme switching */
html {
    transition: background-color 0.3s ease;
}

body {
    transition: color 0.3s ease, background-color 0.3s ease;
    font-family: var(--font-family);
    background-color: var(--background-color, #ffffff);
    color: var(--text-color, #333333);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main.site-main {
    flex: 1 0 auto;
}

footer.site-footer {
    flex-shrink: 0;
    margin-top: 0;
}

*, ::before, ::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color, #ffffff);
    color: var(--text-color, #333333);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Enhanced touch targets for mobile devices */
@media (max-width: 768px) {
    .footer-widgets a {
        padding: 5px 0;
        display: inline-block;
        width: 100%;
    }
    
    .social-link {
        padding: 12px 16px;
        height: auto;
        min-height: 45px;
    }
    
    .footer-bottom-nav a {
        padding: 8px 5px;
        display: inline-block;
    }
    
    .footer-bottom-social a {
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .footer-widgets h2 {
        font-size: 1.4rem;
        margin-top: 0;
    }
    
    /* Add hover and touch feedback */
    .footer-widgets a:active,
    .social-link:active,
    .footer-bottom-nav a:active,
    .footer-bottom-social a:active {
        opacity: 0.7;
        transform: scale(0.98);
    }
}

/* iPad specific optimizations */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .footer-widgets {
        min-height: 250px;
    }
    
    .footer-widgets a {
        padding: 5px 0;
    }
    
    .social-links-grid {
        gap: 15px;
    }
    
    .footer-widgets h2 {
        font-size: 1.3rem;
    }
    
    .site-info {
        padding: 20px var(--spacing-md);
    }
}

/* Landscape mode optimizations */
@media screen and (orientation: landscape) and (max-height: 600px) {
    .site-footer {
        padding: 30px 0 15px;
    }
    
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .footer-widgets {
        min-height: auto;
        padding: 15px;
    }
    
    .footer-widgets h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .footer-widgets a {
        font-size: 0.9rem;
    }
    
    .social-links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Dark theme enhancements for better contrast */
body.dark-theme .site-footer {
    background-color: var(--footer-bg);
}

body.dark-theme .footer-widgets {
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .footer-widgets a:hover {
    color: #4facf1;
}

body.dark-theme .site-info {
    background-color: rgba(0, 0, 0, 0.2);
    border-top-color: rgba(255, 255, 255, 0.05);
}

/* Fix for screen readers */
.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;
}

/* Fix for sticky footer on short pages */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1 0 auto;
}

.site-footer {
    flex-shrink: 0;
}

/* Dark Mode Styles */
body.dark-mode {
    --background-color: #121212;
    --card-bg: #1e1e1e;
    --border-color: #2a2a2a;
    --text-color: rgba(255, 255, 255, 0.9);
    --text-color-rgb: 255, 255, 255;
    --heading-color: #ffffff;
    --link-color: #61dafb;
    --link-hover-color: #a0e9ff;
    --nav-bg: #1a1a1a;
    --footer-bg: #1a1a1a;
    --shadow-color: rgba(0, 0, 0, 0.2);
}

/* Dark mode adjustments for cards */
body.dark-mode .post-card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .post-card-content {
    background-color: var(--card-bg);
}

body.dark-mode .post-title a {
    color: var(--heading-color);
}

body.dark-mode .entry-meta,
body.dark-mode .entry-summary {
    color: var(--text-color);
}

body.dark-mode .post-thumbnail::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(30, 30, 30, 0.8) 100%);
}

body.dark-mode .read-more-link {
    background-color: rgba(97, 218, 251, 0.1);
    color: var(--link-color);
} 