/*
Theme Name: Ryano Blog
Theme URI: https://ryanoccg.com
Author: Ryano Chu
Author URI: https://ryanoccg.com
Description: Custom blog theme matching Ryano's portfolio design - dark theme with blue accents, tech-focused
Version: 2.1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ryano
Tags: blog, dark, modern, responsive, custom, tech, developer
*/

:root {
    --color-bg: #161616;
    --color-bg-secondary: #1a1a1a;
    --color-bg-card: #1e1e1e;
    --color-border: #2a2a2a;
    --color-primary: #069AFF;
    --color-primary-hover: #0077cc;
    --color-primary-dim: rgba(6, 154, 255, 0.12);
    --color-accent: #FFB800;
    --color-text: #ffffff;
    --color-text-muted: #cccccc;
    --color-text-dim: #888888;
    --font-mono: 'Courier New', Courier, monospace;
}

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

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    font-size: 16px;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    cursor: pointer;
}

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

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background-color: rgba(22, 22, 22, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    margin: 0;
    transition: all 0.3s ease;
}

.site-header.scrolled {
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(6, 154, 255, 0.1);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-img {
    height: 40px;
    width: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.logo-img:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.site-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}

.site-nav a {
    color: var(--color-text-muted);
    font-weight: 500;
    position: relative;
    transition: color 0.3s ease;
}

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: width 0.3s ease;
}

.site-nav a:hover {
    color: var(--color-primary);
}

.site-nav a:hover::after {
    width: 100%;
}

/* Hero Section - Blog Index */
.blog-hero {
    position: relative;
    padding: 6rem 0 4rem;
    overflow: hidden;
    background: linear-gradient(180deg, #161616 0%, #1a1a1a 100%);
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background-image: url('assets/hero-bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
}

.blog-hero::after {
    content: '// code';
    position: absolute;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
    font-size: 8rem;
    font-family: var(--font-mono);
    color: rgba(6, 154, 255, 0.03);
    font-weight: bold;
    z-index: 0;
    pointer-events: none;
}

/* Main Content */
.site-main {
    min-height: calc(100vh - 250px);
    padding: 3rem 0 4rem;
    background: var(--color-bg);
    position: relative;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 1rem 0 2rem;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: var(--color-primary);
    opacity: 0.5;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.page-title .title-prefix {
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-weight: 400;
    margin-right: 0.5rem;
}

.page-description {
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-top: 0.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

.blog-card {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(26, 26, 26, 0.98) 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px rgba(6, 154, 255, 0.25);
    background: linear-gradient(135deg, rgba(30, 30, 30, 1) 0%, rgba(26, 26, 26, 1) 100%);
}

.blog-card:hover::before {
    opacity: 1;
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.blog-card-thumbnail {
    width: 100%;
    aspect-ratio: 1024 / 683;
    object-fit: contain;
    object-position: center;
    background: linear-gradient(135deg, #0d0d0d 0%, #161616 60%, #0a2540 100%);
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

.blog-card:hover .blog-card-thumbnail {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.blog-card-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-dim);
    flex-wrap: wrap;
}

.blog-card-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.blog-card-date::before {
    content: '📅 ';
    opacity: 0.6;
}

.blog-card-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-primary-dim);
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-size: 0.72rem;
    border-radius: 4px;
    border: 1px solid rgba(6, 154, 255, 0.3);
    transition: all 0.3s ease;
}

.blog-card:hover .blog-card-category {
    background: var(--color-primary);
    color: var(--color-bg);
}

.blog-card-title {
    font-size: 1.5rem;
    margin-bottom: 0.875rem;
    line-height: 1.3;
    color: var(--color-text);
    font-weight: 600;
    transition: color 0.3s ease;
}

.blog-card-link:hover .blog-card-title {
    color: var(--color-primary);
}

.blog-card-excerpt {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 1.25rem;
    flex: 1;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.25rem;
    margin-top: auto;
    border-top: 1px solid var(--color-border);
}

.read-more {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.blog-card:hover .read-more {
    gap: 0.75rem;
}

.reading-time {
    font-size: 0.85rem;
    color: var(--color-text-dim);
    font-family: var(--font-mono);
}

/* Single Post */
.site-main-single {
    padding: 3rem 2rem 4rem;
    background: var(--color-bg);
    position: relative;
}

.site-main-single::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 800px;
    background-image: url('assets/hero-bg.png');
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.site-main-single .single-post {
    position: relative;
    z-index: 1;
}

.single-post {
    margin: 0 auto;
    width: 100%;
}

.post-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 2px solid var(--color-border);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.post-header::before {
    content: '/* article */';
    position: absolute;
    top: -2rem;
    left: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-text-dim);
    opacity: 0.4;
}

.post-title {
    font-size: 2.75rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--color-text-dim);
    flex-wrap: wrap;
}

.post-category {
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    background: var(--color-primary-dim);
    border-radius: 4px;
    border: 1px solid rgba(6, 154, 255, 0.3);
}

.post-date {
    font-family: var(--font-mono);
    color: var(--color-text-dim);
}

.reading-time {
    font-family: var(--font-mono);
    color: var(--color-text-dim);
}

.post-thumbnail {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-thumbnail:hover {
    transform: scale(1.01);
    box-shadow: 0 20px 40px rgba(6, 154, 255, 0.15);
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--color-text-muted);
    max-width: 900px;
    margin: 0 auto;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--color-text);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-weight: 600;
    position: relative;
    padding-left: 2.5rem;
}

.post-content h2::before,
.post-content h3::before,
.post-content h4::before {
    content: '// ';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-family: var(--font-mono);
    opacity: 0.6;
}

.post-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.25rem;
}

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

.post-content ul,
.post-content ol {
    margin-bottom: 1.75rem;
    padding-left: 2.5rem;
}

.post-content li {
    margin-bottom: 0.75rem;
    position: relative;
}

.post-content ul li::marker {
    color: var(--color-primary);
}

.post-content img {
    border-radius: 12px;
    margin: 2.5rem 0;
    border: 1px solid var(--color-border);
    transition: transform 0.3s ease;
}

.post-content img:hover {
    transform: scale(1.02);
}

.post-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
}

.post-content a:hover {
    color: var(--color-accent);
    text-decoration-thickness: 2px;
}

.post-content blockquote {
    border-left: 4px solid var(--color-primary);
    background: linear-gradient(90deg, rgba(6, 154, 255, 0.08) 0%, transparent 100%);
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    font-style: italic;
    color: var(--color-text-muted);
    position: relative;
    border-radius: 0 8px 8px 0;
}

.post-content blockquote p {
    margin-bottom: 0;
    margin-left: 20px;
}

.post-content blockquote::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 15px;
    font-size: 4rem;
    color: var(--color-primary);
    opacity: 0.2;
    font-family: Georgia, serif;
}

.post-content code {
    background: var(--color-bg-card);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--color-accent);
    border: 1px solid var(--color-border);
}

.post-content pre {
    background: var(--color-bg-card);
    padding: 1.75rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 2.5rem 0;
    border: 1px solid var(--color-border);
    position: relative;
}

.post-content pre::before {
    content: '';
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 0.75rem;
    color: var(--color-text-dim);
    font-family: var(--font-mono);
    opacity: 0.4;
}

.post-content pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: var(--color-text-muted);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--color-bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.post-content th,
.post-content td {
    padding: 1rem;
    text-align: left;
    border: 1px solid var(--color-border);
}

.post-content th {
    background: rgba(6, 154, 255, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

/* Post Navigation */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 2px solid var(--color-border);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.post-navigation a {
    flex: 1;
    padding: 1.5rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.post-navigation a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(6, 154, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-navigation a:hover {
    border-color: var(--color-primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(6, 154, 255, 0.2);
}

.post-navigation a:hover::before {
    opacity: 1;
}

.post-navigation .nav-previous {
    text-align: left;
}

.post-navigation .nav-next {
    text-align: right;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 4rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 0.75rem 1.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    transition: all 0.3s ease;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    min-width: 45px;
    text-align: center;
}

.pagination a:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6, 154, 255, 0.3);
}

.pagination .current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-bg);
    font-weight: 600;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(6, 154, 255, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 6px 20px rgba(6, 154, 255, 0.6);
    transform: translateY(-3px);
}

.back-to-top:active {
    transform: translateY(-1px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 1.5rem;
        right: 1.5rem;
    }

    .back-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, #161616 0%, #0d0d0d 100%);
    border-top: 1px solid var(--color-border);
    padding: 3rem 0 2rem;
    margin-top: 5rem;
    text-align: center;
    position: relative;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
}

.footer-text {
    color: var(--color-text-dim);
    font-size: 0.9rem;
}

.footer-text a {
    color: var(--color-primary);
    transition: color 0.3s ease;
    font-weight: 500;
}

.footer-text a:hover {
    color: var(--color-accent);
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card {
    animation: fadeInUp 0.6s ease-out;
}

.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .page-header {
        margin-bottom: 2rem;
        padding: 0.5rem 0 1.5rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-description {
        font-size: 0.95rem;
    }

    .post-title {
        font-size: 2rem;
    }

    .site-nav ul {
        gap: 1rem;
    }

    .post-meta {
        flex-direction: column;
        gap: 0.75rem;
    }

    .post-navigation {
        flex-direction: column;
    }

    .blog-hero::after {
        font-size: 4rem;
        right: 2%;
    }

    .post-content h2 {
        font-size: 1.6rem;
    }

    .post-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .site-nav {
        display: none;
    }

    .page-title {
        font-size: 2rem;
    }

    .post-title {
        font-size: 1.6rem;
    }

    .blog-hero {
        padding: 4rem 0 3rem;
    }

    .page-description {
        font-size: 1rem;
    }

    .blog-card-thumbnail {
        height: 200px;
    }
}

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

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-bg-card);
    border-radius: 6px;
    border: 2px solid var(--color-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* Code blocks with custom wrapper */
.coding-div {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    position: relative;
}

.coding-div::before {
    content: 'CODE';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    opacity: 0.5;
}

.coding-div pre {
    margin: 0;
    background: transparent;
    padding: 0;
    border: none;
}

.coding-div code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    line-height: 1.6;
    color: #e0e0e0;
}

/* Hide floating buttons on single post pages */
.single .whatsapp-float,
.single .whatsapp-button {
    display: none !important;
}
