/*
Theme Name: Minimum Lab Theme
Theme URI: https://minimumlab.work/
Author: 1.8 cubic meters Laboratory
Description: Custom theme for 1.8 cubic meters Laboratory. Dark mode, modern tech design.
Version: 1.0.0
Text Domain: minimumlab
*/

/* Base Variables */
:root {
    --bg-color: #0f172a;
    /* Slate 900 */
    --bg-secondary: #1e293b;
    /* Slate 800 */
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --accent-color: #06b6d4;
    /* Cyan 500 */
    --accent-glow: rgba(6, 182, 212, 0.4);
    --card-bg: rgba(30, 41, 59, 0.6);
    --border-color: rgba(148, 163, 184, 0.1);

    --font-heading: 'Inter', 'Noto Sans JP', sans-serif;
    --font-body: 'Noto Sans JP', sans-serif;

    --container-width: 1200px;
    --content-width: 800px;
    --header-height: 70px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    margin-top: 0 !important;
    /* Fix WP Admin bar overlap issue */
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.8;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Common Components */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color), #3b82f6);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 24px;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Header */
.site-header {
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.header-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo .highlight {
    color: var(--accent-color);
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

/* WP Nav Menu Adjustment */
.main-nav .menu {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
}

.main-nav a:hover,
.main-nav .current-menu-item>a {
    color: var(--text-primary);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav .current-menu-item>a::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s;
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 999;
    padding-top: 80px;
    transition: 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu ul {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 0;
}

.mobile-menu .menu-item {
    list-style: none;
    /* Ensure WP didn't add bullets */
}

.mobile-menu a {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: var(--header-height);
    background: radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 40%);
}

.hero::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

/* Post/Archive Header (No Hero) */
.page-header-section {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
    background: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    text-align: center;
}

/* Sections General */
.section {
    padding: 100px 0;
}

.bg-light {
    background-color: var(--bg-secondary);
}

.section-header {
    margin-bottom: 60px;
    text-align: center;
}

.section-tag {
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 10px;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-desc {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Card Grid Styles */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(6, 182, 212, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.card-image-wrapper {
    height: 200px;
    position: relative;
    overflow: hidden;
    background-color: #0f172a;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

/* Fallback for no thumbnail */
.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
}

.card-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    z-index: 5;
}

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.date i {
    margin-right: 5px;
}

.view-more-container {
    text-align: center;
    margin-top: 50px;
    margin-bottom: 50px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 10px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 600;
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Category Cards */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background: var(--bg-color);
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.category-card i {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.category-card h3 {
    margin-bottom: 10px;
}

.category-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* About Section */
.about-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-image {
    flex: 1;
    max-width: 400px;
}

.profile-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    background: #334155;
    border-radius: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: #64748b;
    position: relative;
    overflow: hidden;
}

.profile-placeholder img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

.profile-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 20%;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.about-content {
    flex: 1;
}

.about-text {
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.about-text p {
    margin-bottom: 15px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tech-stack span {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.sns-links {
    display: flex;
    gap: 20px;
}

.sns-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
    border: 1px solid var(--border-color);
}

.sns-icon:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Footer */
.site-footer {
    padding: 60px 0 30px;
    background: #0b1120;
    border-top: 1px solid var(--border-color);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-brand h3 {
    margin-bottom: 10px;
}

.footer-brand p {
    color: var(--text-secondary);
}

.footer-links h4 {
    margin-bottom: 20px;
    font-size: 1rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 30px;
    color: #475569;
    font-size: 0.85rem;
}

/* Single Post Styles */
.post-header-section {
    padding-top: calc(var(--header-height) + 60px);
    padding-bottom: 60px;
    background: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    text-align: center;
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-tag-badge {
    background: rgba(6, 182, 212, 0.2);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.post-tag-badge a {
    color: inherit;
}

.post-title {
    font-size: 2.5rem;
    max-width: 900px;
    margin: 0 auto 30px;
    line-height: 1.3;
}

.post-layout {
    display: flex;
    gap: 50px;
    margin-bottom: 100px;
    position: relative;
    padding-top: 60px;
}

.post-main {
    flex: 3;
    min-width: 0;
}

.post-sidebar {
    flex: 1;
    position: sticky;
    top: 100px;
    height: fit-content;
}

/* Article Body */
.article-body {
    font-size: 1.1rem;
    color: #cbd5e1;
}

/* WP Content specifics */
.article-body h2 {
    font-size: 1.8rem;
    margin: 3rem 0 1.5rem;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
    color: var(--text-primary);
}

.article-body h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent-color);
}

.article-body h3 {
    font-size: 1.4rem;
    margin: 2.5rem 0 1rem;
    padding-left: 15px;
    border-left: 4px solid var(--accent-color);
    color: var(--text-primary);
}

.article-body p {
    margin-bottom: 1.8rem;
    line-height: 1.9;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.8rem;
    padding-left: 1.5rem;
}

.article-body ul {
    list-style: disc;
}

.article-body ol {
    list-style: decimal;
}

.article-body ul li,
.article-body ol li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    background: rgba(30, 41, 59, 0.5);
    border-left: 4px solid var(--accent-color);
    padding: 20px 30px;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 8px 8px 0;
}

.article-body img {
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    height: auto;
}

/* Sidebar Widgets */
.widget {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    font-family: var(--font-heading);
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.widget ul li a {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget ul li a:hover {
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 900px) {
    .post-layout {
        flex-direction: column;
    }

    .post-sidebar {
        position: static;
        width: 100%;
        margin-top: 60px;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 0;
    }

    .main-nav {
        display: none;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .hero-title {
        font-size: 3rem;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }

    .about-image {
        max-width: 300px;
    }

    .sns-links,
    .tech-stack {
        justify-content: center;
    }

    .footer-container {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    .post-title {
        font-size: 1.8rem;
    }
}