/*
Theme Name: AI Rank Lab Blog
Theme URI: https://www.airanklab.com
Author: AI Rank Lab
Author URI: https://www.airanklab.com
Description: A clean, minimal WordPress theme inspired by AI Rank Lab's design and typography
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ai-rank-lab-blog
Tags: blog, minimal, clean, modern, typography, ai-rank-lab
*/

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    font-size: 21px;
    line-height: 1.58;
    letter-spacing: -.003em;
    color: rgba(0, 0, 0, 0.84);
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -.011em;
    margin-bottom: 0.8em;
}

h2 {
    font-size: 28px;
    margin-bottom: 0.6em;
}

h3 {
    font-size: 22px;
    margin-bottom: 0.5em;
}

h4 {
    font-size: 18px;
    margin-bottom: 0.4em;
}

h5 {
    font-size: 16px;
    margin-bottom: 0.4em;
}

h6 {
    font-size: 14px;
    margin-bottom: 0.4em;
}

p {
    margin-bottom: 1.46em;
    line-height: 1.7;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.7;
}

/* Container */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Improve readability */
.single-post-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.single-post-content ul,
.single-post-content ol {
    line-height: 1.7;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
    transition: background-color 0.3s ease;
}

.header-container {
    max-width: 1192px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 8px;
}

.site-logo a:hover {
    opacity: 1;
}

.site-logo img.custom-logo {
    max-height: 40px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.site-logo .custom-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.site-logo .custom-logo-link:hover {
    opacity: 1;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.02em;
    display: block;
    line-height: 1.2;
}

.site-description {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.54);
    font-weight: 400;
    margin-left: 8px;
    display: none;
}

/* Custom logo link styling */
.site-logo .custom-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.site-logo .custom-logo-link:hover {
    opacity: 1;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
}

/* Hamburger Menu Toggle Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    z-index: 1001;
    position: relative;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle:focus {
    outline: 2px solid rgba(0, 0, 0, 0.2);
    outline-offset: 2px;
    border-radius: 4px;
}

.menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 24px;
    height: 18px;
    position: relative;
}

.menu-toggle-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: rgba(0, 0, 0, 0.84);
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.menu-open .menu-toggle-icon span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle.menu-open .menu-toggle-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.menu-open .menu-toggle-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Menu Wrapper */
.site-nav-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-logo {
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.menu-logo img.custom-logo {
    max-height: 32px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.site-nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav-menu ul {
    display: flex;
    align-items: center;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav-menu li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.site-nav-menu a {
    font-size: 16px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 4px 0;
    position: relative;
}

.site-nav-menu a:hover {
    color: rgba(0, 0, 0, 0.84);
    opacity: 1;
}

.site-nav a {
    font-size: 16px;
    color: rgba(0, 0, 0, 0.6);
    font-weight: 400;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-nav a:hover {
    color: rgba(0, 0, 0, 0.84);
    opacity: 1;
}

/* Main Content */
.site-main {
    padding: 40px 0;
    min-height: calc(100vh - 200px);
}

/* Blog Listing / Landing Page */
.posts-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

.post-item {
    margin-bottom: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 18px;
    border-radius: 8px;
    background-color: transparent;
    border: 1px solid transparent;
}

.post-item:hover {
    background-color: rgb(255, 255, 255);
    color: black;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.post-item a {
    display: block;
    text-decoration: none;
    /* color: inherit; */
}

.post-thumbnail {
    margin-bottom: 20px;
    margin-left: -24px;
    margin-right: -24px;
    margin-top: -24px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

/* Ensure thumbnail extends to card edges when present */
.post-item {
    overflow: hidden;
}

.post-list-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-list-image {
    transform: scale(1.02);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.54);
}

.post-author {
    font-weight: 500;
    color: rgba(0, 0, 0, 0.84);
}

.post-date {
    color: rgba(0, 0, 0, 0.54);
}

.post-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -.022em;
    margin-bottom: 10px;
    color: rgba(0, 0, 0, 0.84);
}

.post-excerpt {
    font-size: 20px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.54);
    margin-bottom: 12px;
}

.post-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.54);
    margin-top: 12px;
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.post-tag {
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.68);
}

/* Single Post Page */
.single-post-header {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
    margin-bottom: 40px;
}

.single-post-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.04;
    letter-spacing: -.022em;
    margin-bottom: 20px;
    color: rgba(0, 0, 0, 0.84);
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.54);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.single-post-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

.single-post-content p {
    font-size: 21px;
    line-height: 1.7;
    letter-spacing: -.003em;
    margin-bottom: 1.46em;
    color: rgba(0, 0, 0, 0.84);
}

.single-post-content p:last-child {
    margin-bottom: 0;
}

.single-post-content h1 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.015em;
    margin-top: 1.95em;
    margin-bottom: 0.8em;
}

.single-post-content h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.22;
    letter-spacing: -.012em;
    margin-top: 1.72em;
    margin-bottom: 0.6em;
}

.single-post-content h3 {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -.01em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.single-post-content h4 {
    font-size: 18px;
    font-weight: 700;
    margin-top: 1.3em;
    margin-bottom: 0.4em;
}

.single-post-content img {
    max-width: 100%;
    height: auto;
    margin: 2em 0;
    border-radius: 4px;
}

.single-post-content blockquote {
    border-left: 3px solid rgba(0, 0, 0, 0.84);
    padding-left: 20px;
    margin: 1.6em 0;
    font-style: italic;
    color: rgba(0, 0, 0, 0.68);
}

.single-post-content ul,
.single-post-content ol {
    margin: 1.46em 0;
    padding-left: 30px;
}

.single-post-content li {
    margin-bottom: 0.5em;
}

.single-post-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: "Courier New", monospace;
}

.single-post-content pre {
    background: rgba(0, 0, 0, 0.05);
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1.46em 0;
}

.single-post-content pre code {
    background: none;
    padding: 0;
}

/* Footer */
.site-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.09);
    padding: 40px 0;
    margin-top: 80px;
}

.footer-widgets {
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
    padding-bottom: 40px;
    margin-bottom: 40px;
}

.footer-widgets-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.54);
}

/* Breadcrumb */
.breadcrumb {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 20px 16px;
    margin-bottom: 8px;
}

.breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.54);
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
    color: rgba(0, 0, 0, 0.3);
}

.breadcrumb-item a {
    color: rgba(0, 0, 0, 0.54);
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: rgba(0, 0, 0, 0.84);
}

.breadcrumb-item.active {
    color: rgba(0, 0, 0, 0.84);
}

/* Widgets */
.widget {
    margin-bottom: 40px;
}

.widget:last-child {
    margin-bottom: 0;
}

.widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: rgba(0, 0, 0, 0.84);
}

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

.widget li {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.widget li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget a {
    color: rgba(0, 0, 0, 0.54);
    font-size: 15px;
}

.widget a:hover {
    color: rgba(0, 0, 0, 0.84);
}

/* Sidebar */
.sidebar {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Layout with sidebar */
.content-area {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 0;
}

.content-area .site-main {
    flex: 1;
    min-width: 0;
}

.content-area .sidebar {
    width: 300px;
    flex-shrink: 0;
    padding: 0;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 18px;
    }
    
    body.menu-open {
        overflow: hidden;
    }
    
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 24px;
    }
    
    h3 {
        font-size: 20px;
    }
    
    .post-title {
        font-size: 24px;
    }
    
    .single-post-title {
        font-size: 32px;
    }
    
    .single-post-content {
        font-size: 18px;
    }
    
    .single-post-content h1 {
        font-size: 32px;
    }
    
    .single-post-content h2 {
        font-size: 24px;
    }
    
    .single-post-content h3 {
        font-size: 20px;
    }
    
    .header-container {
        padding: 0 16px;
    }
    
    /* Mobile Menu Styles */
    .menu-toggle {
        display: flex;
    }
    
    .site-nav-wrapper {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid rgba(0, 0, 0, 0.09);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        flex-direction: column;
        align-items: flex-start;
        padding: 0;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }
    
    .site-nav-wrapper.menu-open {
        max-height: 600px;
        opacity: 1;
        visibility: visible;
        padding: 24px;
    }
    
    .site-nav-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }
    
    .site-nav-menu ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        width: 100%;
    }
    
    .site-nav-menu li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .site-nav-menu li:last-child {
        border-bottom: none;
    }
    
    .site-nav-menu a {
        font-size: 16px;
        padding: 14px 0;
        width: 100%;
        color: rgba(0, 0, 0, 0.84);
        font-weight: 400;
        display: block;
        transition: all 0.2s ease;
        border-radius: 4px;
        margin: 2px 0;
    }
    
    .site-nav-menu a:hover {
        color: rgba(0, 0, 0, 0.84);
        background-color: rgba(0, 0, 0, 0.03);
        padding-left: 12px;
    }
    
    .site-nav-menu a:active {
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    .menu-logo {
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.09);
        width: 100%;
    }
    
    .menu-logo img.custom-logo {
        max-height: 28px;
    }
    
    .site-logo .custom-logo {
        max-height: 32px;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .post-thumbnail {
        margin-bottom: 16px;
    }
    
    .breadcrumb {
        padding: 16px 16px 0;
    }
    
    .breadcrumb-list {
        font-size: 13px;
    }
    
    .content-area {
        flex-direction: column;
        gap: 30px;
        padding: 30px 16px 0;
    }
    
    .content-area .sidebar {
        width: 100%;
    }
    
    .container,
    .posts-container,
    .single-post-content,
    .single-post-header {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .post-item {
        margin-bottom: 24px;
        padding: 20px;
    }
    
    .post-thumbnail {
        margin-left: -20px;
        margin-right: -20px;
        margin-top: -20px;
        border-radius: 8px 8px 0 0;
    }
    
    .post-item:hover {
        transform: translateY(-1px);
    }
    
    .post-excerpt {
        font-size: 18px;
    }
    
    .widget {
        margin-bottom: 30px;
    }
    
    .footer-widgets-container {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 0 16px;
    }
    
    .footer-widgets {
        padding-bottom: 30px;
        margin-bottom: 30px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: 26px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 17px;
    }
    
    .single-post-title {
        font-size: 26px;
    }
    
    .single-post-content {
        font-size: 16px;
    }
    
    .single-post-content h1 {
        font-size: 26px;
    }
    
    .single-post-content h2 {
        font-size: 20px;
    }
    
    .single-post-content h3 {
        font-size: 17px;
    }
    
    .post-title {
        font-size: 20px;
    }
    
    .site-nav-wrapper {
        top: 60px;
    }
    
    .site-nav-wrapper.menu-open {
        padding: 20px;
    }
    
    .site-nav-menu a {
        font-size: 15px;
        padding: 14px 0;
    }
    
    .menu-logo img.custom-logo {
        max-height: 24px;
    }
    
    .site-logo .custom-logo {
        max-height: 28px;
    }
    
    .site-title {
        font-size: 18px;
    }
    
    .post-item {
        margin-bottom: 20px;
        padding: 16px;
    }
    
    .post-thumbnail {
        margin-left: -16px;
        margin-right: -16px;
        margin-top: -16px;
        margin-bottom: 12px;
        border-radius: 8px 8px 0 0;
    }
    
    .single-post-content p {
        font-size: 16px;
        line-height: 1.75;
    }
    
    .menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .menu-toggle-icon {
        width: 20px;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .site-nav-menu {
        gap: 20px;
    }
    
    .site-nav-menu ul {
        gap: 20px;
    }
    
    .site-nav-menu a {
        font-size: 15px;
    }
}

/* Pagination */
.pagination {
    margin: 60px 0;
    text-align: center;
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.pagination .page-numbers {
    padding: 8px 16px;
    color: rgba(0, 0, 0, 0.54);
    font-size: 16px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background-color: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.84);
}

/* Post Navigation */
.post-navigation {
    max-width: 680px;
    margin: 60px auto 0;
    padding: 0 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.09);
    padding-top: 40px;
}

.post-navigation .nav-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.54);
    margin-bottom: 4px;
}

.post-navigation .nav-title {
    font-size: 18px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.84);
}

/* Post Taxonomies */
.post-taxonomies {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.09);
    font-size: 16px;
}

.post-taxonomies > div {
    margin-bottom: 16px;
}

.post-taxonomies strong {
    color: rgba(0, 0, 0, 0.84);
    margin-right: 8px;
}

.post-taxonomies a {
    color: rgba(0, 0, 0, 0.54);
    margin-right: 12px;
}

.post-taxonomies a:hover {
    color: rgba(0, 0, 0, 0.84);
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 60px 20px;
}

.no-posts h2 {
    font-size: 32px;
    margin-bottom: 16px;
}

.no-posts p {
    color: rgba(0, 0, 0, 0.54);
    margin-bottom: 24px;
}

/* Search Form */
.search-form {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 3px;
    font-size: 16px;
    font-family: inherit;
}

.search-form input[type="submit"] {
    padding: 12px 24px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.search-form input[type="submit"]:hover {
    opacity: 0.8;
}

/* Featured Image */
.post-featured-image {
    width: 100%;
    height: auto;
    margin: 40px 0;
    border-radius: 4px;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1em; }
.mt-2 { margin-top: 2em; }
.mb-1 { margin-bottom: 1em; }
.mb-2 { margin-bottom: 2em; }
