/*
Theme Name: Nullscape
Theme URI: https://github.com/example/nullscape
Author: KotiadisE
Description: A minimalist WordPress theme
Version: 1.0.0
License: MIT
Text Domain: nullscape
*/

/* =================================================================*********
   Variables (Tailwind-like tokens)
   ========================================================================== */
:root {
    /* Light mode colors */
    --bg-body: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-accent: #0891b2;
    --border-color: #e5e7eb;

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;

    /* Layout */
    --container-width: 42rem;
    --header-height: 5rem;
}

/* Dark mode */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-accent: #22d3ee;
    --border-color: #334155;
}

/* =================================================================*********
   Reset
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Utility Classes */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.menu-toggle {
    display: none;
}

.no-scroll {
    overflow: hidden;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.75;
    font-size: 1.125rem;
    /* 18px */
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--text-accent);
}

/* Ensure main content takes up at least 60% of viewport */
#page {
    min-height: 60vh;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.025em;
    margin-bottom: var(--spacing-4);
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--spacing-6);
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
    padding: 0.5rem 0.75rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--text-primary);
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: border-color 0.2s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--text-accent);
}

button,
input[type="submit"] {
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-size: 1rem;
    color: var(--bg-body);
    background-color: var(--text-accent);
    border: 1px solid var(--text-accent);
    border-radius: 0.25rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

button:hover,
input[type="submit"]:hover {
    opacity: 0.9;
}

/* =================================================================*********
   Layout
   ========================================================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-4);
}

.site-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-16);
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-link {
    display: flex;
    align-items: center;
}

.custom-logo {
    height: 1.25rem;
    /* Matches .site-title font-size */
    width: auto;
    display: block;
}

/* Invert logo to white in dark mode */
[data-theme="dark"] .custom-logo {
    filter: brightness(0) invert(1);
}

.site-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    margin-left: 0.75rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    color: var(--text-accent);
    border-color: var(--text-accent);
    transform: translateY(-2px);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

.site-nav ul {
    display: flex;
    gap: var(--spacing-6);
    list-style: none;
}

.site-nav a {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
    position: relative;
}

.site-nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--text-accent);
    transition: width 0.3s ease;
}

.site-nav a:hover {
    color: var(--text-accent);
}

.site-nav a:hover::after {
    width: 100%;
}

/* Active page indicator */
.site-nav .current-menu-item a,
.site-nav .current_page_item a {
    color: var(--text-accent);
}

/* =================================================================*********
   About Page
   ========================================================================== */
.about-page {
    max-width: 65ch;
}

.about-header {
    margin-bottom: var(--spacing-12);
    padding-bottom: var(--spacing-8);
    border-bottom: 2px solid var(--border-color);
}

.about-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-2);
    color: var(--text-primary);
}

.about-subtitle {
    font-size: 1.25rem;
    color: var(--text-accent);
    font-family: var(--font-mono);
    font-weight: 500;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-12);
}

.about-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-4);
    color: var(--text-primary);
}

.about-section p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: var(--spacing-4);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-6);
    margin-top: var(--spacing-6);
}

.skill-item {
    padding: var(--spacing-6);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.skill-item:hover {
    border-color: var(--text-accent);
    transform: translateY(-2px);
}

.skill-item h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-2);
    color: var(--text-primary);
}

.skill-item p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
}

.social-links-large {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-4);
    margin-top: var(--spacing-6);
}

.social-link-large {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
    padding: var(--spacing-4);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
}

.social-link-large:hover {
    color: var(--text-accent);
    border-color: var(--text-accent);
    transform: translateY(-2px);
}

.social-link-large svg {
    flex-shrink: 0;
}

/* =================================================================*********
   Post List (The "No Box" Look)
   ========================================================================== */
.post-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-12);
}

.post-entry article {
    display: flex;
    flex-direction: column;
}

.entry-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--spacing-2);
}

.entry-title a {
    color: var(--text-primary);
    position: relative;
    display: inline-block;
}

.entry-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--text-accent);
    transition: width 0.3s ease;
}

.entry-title a:hover {
    color: var(--text-primary);
}

.entry-title a:hover::after {
    width: 100%;
}

.entry-meta {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-3);
}

.entry-excerpt,
.entry-content {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.625;
}

.entry-content p {
    margin-bottom: var(--spacing-6);
}

/* Code Blocks */
.code-block {
    margin: var(--spacing-6) 0;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.code-block pre {
    margin: 0;
    padding: var(--spacing-6);
    background-color: #1e1e1e;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    color: #d4d4d4;
    display: block;
}

/* Inline code */
.entry-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    color: var(--text-primary);
}

.entry-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

.entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: var(--spacing-4);
}

.entry-tags .tag {
    font-size: 0.875rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-family: var(--font-mono);
}

.entry-tags .tag:hover {
    color: var(--text-accent);
    border-color: var(--text-accent);
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text-accent);
    color: var(--bg-body);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.scroll-to-top svg {
    width: 20px;
    height: 20px;
}

/* =================================================================*********
   Footer
   ========================================================================== */
.site-footer {
    margin-top: var(--spacing-16);
    padding: var(--spacing-16) 0;
    background-color: #0c101a;
    color: #9ca3af;
    font-size: 0.875rem;
    width: 100%;
    flex-grow: 1;
}

/* =================================================================*********
   Tablet Styling (768px - 1024px)
   ========================================================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .social-links-large {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* =================================================================*********
   Mobile Styling (up to 768px)
   ========================================================================== */
/* Mobile Styling */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 2rem;
        height: 2rem;
        padding: 0;
        border: none;
        background: transparent;
        cursor: pointer;
        z-index: 200;
        position: relative;
        /* Essential for z-index */
    }

    .menu-toggle .icon-bar {
        width: 100%;
        height: 3px;
        background-color: var(--text-primary);
        border-radius: 1px;
        transition: all 0.3s ease;
    }

    .site-nav ul {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-body);
        padding: var(--spacing-16) var(--spacing-4);
        gap: var(--spacing-8);
        font-size: 1.5rem;
        z-index: 150;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .site-nav.toggled ul {
        display: flex;
        opacity: 1;
        visibility: visible;
    }

    /* Animate Hamburger to X */
    .site-nav.toggled .menu-toggle .icon-bar:nth-child(2) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .site-nav.toggled .menu-toggle .icon-bar:nth-child(3) {
        opacity: 0;
    }

    .site-nav.toggled .menu-toggle .icon-bar:nth-child(4) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .social-links-large {
        grid-template-columns: 1fr;
    }

    .scroll-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer h5,
.site-footer h6 {
    color: #ffffff;
}

.site-footer a {
    color: #d1d5db;
}

.site-footer a:hover {
    color: var(--text-accent);
}