/*
Theme Name: Kitty Terminal
Theme URI: https://github.com/yourusername/kitty-terminal-theme
Author: Your Name
Author URI: https://yourwebsite.com
Description: A beautiful WordPress theme inspired by Kitty terminal with JetBrains Mono font and Dracula color scheme. Features crisp text rendering, programming ligatures, and a modern dark aesthetic perfect for technical blogs and developer portfolios.
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kitty-terminal
Tags: dark, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready, blog, one-column, two-columns, right-sidebar

Kitty Terminal Theme, Copyright 2025
Kitty Terminal Theme is distributed under the terms of the GNU GPL.
*/

/* ═══════════════════════════════════════════════════════════════════════
   KITTY TERMINAL WORDPRESS THEME
   Modern • Aesthetic • Developer-Friendly
   ═══════════════════════════════════════════════════════════════════════ */

/* Import JetBrains Mono font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');

/* ───────────────────────────────────────────────────────────────────────
   COLOR VARIABLES (Kitty Dracula Theme)
   ─────────────────────────────────────────────────────────────────────── */

:root {
    /* Backgrounds */
    --bg-primary: #282A36;
    --bg-secondary: #21222C;
    --bg-tertiary: #44475A;
    --bg-selected: #6272A4;

    /* Foregrounds */
    --fg-primary: #F8F8F2;
    --fg-secondary: #6272A4;

    /* Accent Colors */
    --color-red: #FF5555;
    --color-red-bright: #FF6E6E;
    --color-green: #50FA7B;
    --color-green-bright: #69FF94;
    --color-yellow: #F1FA8C;
    --color-yellow-bright: #FFFFA5;
    --color-blue: #BD93F9;
    --color-blue-bright: #D6ACFF;
    --color-magenta: #FF79C6;
    --color-magenta-bright: #FF92DF;
    --color-cyan: #8BE9FD;
    --color-cyan-bright: #A4FFFF;
    --color-orange: #FFB86C;

    /* Selection */
    --color-selection-bg: #F8F8F2;
    --color-selection-fg: #282A36;

    /* Layout */
    --max-width: 1200px;
    --sidebar-width: 300px;
    --spacing-unit: 1.5rem;
}

/* ───────────────────────────────────────────────────────────────────────
   RESET & BASE
   ─────────────────────────────────────────────────────────────────────── */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    /* Font Stack - JetBrains Mono with fallbacks */
    font-family: 'JetBrains Mono', 'SF Mono', 'Monaco', 'Cascadia Code',
                 'Roboto Mono', 'Menlo', 'Consolas', 'DejaVu Sans Mono', monospace;

    /* Font Rendering - Crisp like Kitty */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;

    /* Enable Ligatures */
    font-variant-ligatures: common-ligatures contextual;
    font-feature-settings: "liga" 1, "calt" 1, "dlig" 1;

    /* Typography */
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.02em;

    /* Colors */
    color: var(--fg-primary);
    background-color: var(--bg-primary);
}

/* ───────────────────────────────────────────────────────────────────────
   TYPOGRAPHY
   ─────────────────────────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--fg-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5em; }
h2 { font-size: 2em; }
h3 { font-size: 1.75em; }
h4 { font-size: 1.5em; }
h5 { font-size: 1.25em; }
h6 { font-size: 1em; }

p {
    margin-bottom: 1rem;
}

/* ───────────────────────────────────────────────────────────────────────
   LINKS
   ─────────────────────────────────────────────────────────────────────── */

a {
    color: var(--color-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--color-cyan-bright);
}

a:visited {
    color: var(--color-magenta);
}

/* ───────────────────────────────────────────────────────────────────────
   CODE
   ─────────────────────────────────────────────────────────────────────── */

code,
pre,
kbd,
samp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875em;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "liga" 1, "calt" 1, "zero" 1;
}

pre {
    background-color: var(--bg-secondary);
    color: var(--fg-primary);
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

code {
    padding: 0.2em 0.4em;
    background-color: var(--bg-tertiary);
    color: var(--color-green);
    border-radius: 3px;
}

pre code {
    padding: 0;
    background-color: transparent;
    color: inherit;
}

/* ───────────────────────────────────────────────────────────────────────
   LAYOUT
   ─────────────────────────────────────────────────────────────────────── */

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-unit);
    width: 100%;
}

/* ───────────────────────────────────────────────────────────────────────
   HEADER
   ─────────────────────────────────────────────────────────────────────── */

.site-header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--bg-tertiary);
    padding: 1rem var(--spacing-unit);
}

.site-header .site-branding {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Top row: Logo + Title/Tagline */
.header-top {
    display: flex;
    align-items: flex-start;
}

.site-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.custom-logo-link {
    display: block;
    line-height: 0;
}

.custom-logo {
    max-height: 80px;
    width: auto;
    display: block;
}

.site-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.site-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.2;
}

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

.site-title a:hover {
    color: var(--color-green-bright);
}

.site-description {
    color: var(--fg-secondary);
    font-size: 0.875rem;
    margin: 0;
    font-weight: 400;
    line-height: 1.3;
}

/* Bottom row: Social icons + Navigation */
.header-bottom {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--bg-tertiary);
}

/* ───────────────────────────────────────────────────────────────────────
   SOCIAL LINKS
   ─────────────────────────────────────────────────────────────────────── */

.social-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    color: var(--fg-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--bg-selected);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

/* Individual network hover colors - using Dracula palette */
.social-twitter:hover {
    background-color: var(--color-cyan);
    border-color: var(--color-cyan-bright);
    color: var(--bg-primary);
}

.social-gmail:hover {
    background-color: var(--color-red);
    border-color: var(--color-red-bright);
    color: var(--bg-primary);
}

.social-facebook:hover {
    background-color: var(--color-blue);
    border-color: var(--color-blue-bright);
    color: var(--bg-primary);
}

.social-instagram:hover {
    background-color: var(--color-magenta);
    border-color: var(--color-magenta-bright);
    color: var(--bg-primary);
}

/* ───────────────────────────────────────────────────────────────────────
   NAVIGATION
   ─────────────────────────────────────────────────────────────────────── */

.main-navigation {
    flex: 1;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
}

.main-navigation li {
    margin: 0;
}

.main-navigation a {
    color: var(--fg-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 4px;
    font-size: 0.9rem;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: var(--color-cyan);
    background-color: var(--bg-tertiary);
}

/* ───────────────────────────────────────────────────────────────────────
   POSTS & PAGES
   ─────────────────────────────────────────────────────────────────────── */

.content-area {
    flex: 1;
    max-width: 800px;
}

article {
    margin-bottom: 3rem;
    background-color: var(--bg-secondary);
    padding: var(--spacing-unit);
    border-radius: 4px;
}

.entry-header {
    margin-bottom: var(--spacing-unit);
}

.entry-title {
    color: var(--color-cyan);
    margin-bottom: 0.5rem;
}

.entry-title a {
    color: inherit;
    text-decoration: none;
}

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

.entry-meta {
    color: var(--fg-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.entry-meta a {
    color: var(--fg-secondary);
    text-decoration: none;
}

.entry-meta a:hover {
    color: var(--color-cyan);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.entry-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-tertiary);
    font-size: 0.875rem;
    color: var(--fg-secondary);
}

/* ───────────────────────────────────────────────────────────────────────
   FOOTNOTES & CITATIONS
   ─────────────────────────────────────────────────────────────────────── */

/* Main footnotes section */
.footnotes,
.references,
.wp-block-footnotes,
.entry-content ol[id^="footnotes"],
.entry-content .citations {
    font-size: 0.75rem;  /* 12px when base is 16px */
    line-height: 1.4;
    color: var(--fg-secondary);
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bg-tertiary);
}

/* Individual footnote items */
.footnotes li,
.references li,
[id^="fn-"] {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--fg-secondary);
}

/* Long URLs in citations - aggressive breaking */
.footnotes a[href^="http"],
.references a[href^="http"],
.citations a[href^="http"] {
    font-size: 0.7rem;  /* Even smaller for URLs */
    word-break: break-all;
    overflow-wrap: anywhere;
    color: var(--color-blue);  /* Different color for distinction */
}

/* Superscript footnote numbers in text */
sup {
    font-size: 0.7em;
    vertical-align: super;
    line-height: 0;
}

sup a {
    text-decoration: none;
    color: var(--color-cyan);
    padding: 0 0.15em;
}

sup a:hover {
    color: var(--color-cyan-bright);
    text-decoration: underline;
}

/* Return links from footnotes */
.footnotes .footnote-back-link,
a[href^="#fnref"] {
    font-size: 0.9em;
    color: var(--color-magenta);
    margin-left: 0.5em;
}

/* ───────────────────────────────────────────────────────────────────────
   SIDEBAR
   ─────────────────────────────────────────────────────────────────────── */

.widget-area {
    margin-left: 2rem;
    max-width: var(--sidebar-width);
}

.widget {
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.widget-title {
    color: var(--color-cyan);
    border-bottom: 2px solid var(--color-cyan);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.widget ul {
    list-style: none;
}

.widget li {
    padding: 0.25rem 0;
}

/* ───────────────────────────────────────────────────────────────────────
   FOOTER
   ─────────────────────────────────────────────────────────────────────── */

.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--bg-tertiary);
    padding: var(--spacing-unit);
    text-align: center;
    color: var(--fg-secondary);
    font-size: 0.875rem;
}

/* ───────────────────────────────────────────────────────────────────────
   BUTTONS & FORMS
   ─────────────────────────────────────────────────────────────────────── */

button,
.button,
input[type="submit"],
input[type="button"] {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    background-color: var(--color-green);
    color: var(--bg-primary);
    border: none;
    padding: 0.75em 1.5em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

button:hover,
.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
    background-color: var(--color-green-bright);
    transform: translateY(-1px);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
textarea {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--bg-tertiary);
    color: var(--fg-primary);
    border: 1px solid var(--bg-selected);
    padding: 0.5em;
    border-radius: 4px;
    width: 100%;
    transition: border-color 0.2s ease;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 2px rgba(139, 233, 253, 0.2);
}

/* ───────────────────────────────────────────────────────────────────────
   COMMENTS
   ─────────────────────────────────────────────────────────────────────── */

.comments-area {
    margin-top: 3rem;
}

.comment-list {
    list-style: none;
}

.comment-body {
    background-color: var(--bg-secondary);
    padding: 1em;
    border-radius: 4px;
    margin-bottom: 1em;
}

.comment-author {
    color: var(--color-green);
    font-weight: 700;
}

.comment-metadata {
    font-size: 0.875rem;
    color: var(--fg-secondary);
    margin-bottom: 0.5rem;
}

/* ───────────────────────────────────────────────────────────────────────
   SELECTION & SCROLLBAR
   ─────────────────────────────────────────────────────────────────────── */

::selection {
    background-color: var(--color-selection-bg);
    color: var(--color-selection-fg);
}

::-webkit-scrollbar {
    width: 12px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-selected);
}

/* ───────────────────────────────────────────────────────────────────────
   RESPONSIVE
   ─────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .site-content {
        flex-direction: column;
    }

    .widget-area {
        margin-left: 0;
        margin-top: 2rem;
        max-width: 100%;
    }

    .header-top {
        flex-direction: column;
    }
    
    .site-identity {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .main-navigation ul {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* ───────────────────────────────────────────────────────────────────────
   MACOS-SPECIFIC
   ─────────────────────────────────────────────────────────────────────── */

@supports (-webkit-appearance: none) {
    body,
    code,
    pre {
        -webkit-text-stroke: 0.25px rgba(248, 248, 242, 0.05);
    }
}


/* ───────────────────────────────────────────────────────────────────────
   SHARE/LIKE BAR
   ─────────────────────────────────────────────────────────────────────── */

.share-like-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-tertiary);
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 3px solid var(--color-cyan);
}

.share-label {
    font-weight: 600;
    color: var(--fg-primary);
    font-size: 0.9rem;
}

.share-btn {
    padding: 0.4rem 0.8rem;
    background-color: var(--bg-secondary);
    color: var(--color-cyan);
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border: 1px solid var(--bg-selected);
}

.share-btn:hover {
    background-color: var(--color-cyan);
    color: var(--bg-primary);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .share-like-bar {
        flex-wrap: wrap;
    }
}