/*
Theme Name: SVGtoCode Theme
Theme URI: https://svgtocode.com
Author: SVGtoCode
Author URI: https://svgtocode.com
Description: A lightweight, modern WordPress theme designed to work seamlessly with the SVGtoCode Pro plugin. Features a clean, responsive design with matching CSS variables and styling.
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: svgtocode-theme
Tags: one-column, custom-menu, featured-images, translation-ready, blog

SVGtoCode Theme - A perfect companion for the SVGtoCode Pro plugin.
*/

/* ========================================
   CSS Variables (matching plugin)
======================================== */
:root {
    --svgtocode-brand-50: #eff6ff;
    --svgtocode-brand-100: #dbeafe;
    --svgtocode-brand-500: #3b82f6;
    --svgtocode-brand-600: #2563eb;
    --svgtocode-brand-700: #1d4ed8;
    --svgtocode-brand-900: #1e3a8a;

    --svgtocode-slate-50: #f8fafc;
    --svgtocode-slate-100: #f1f5f9;
    --svgtocode-slate-200: #e2e8f0;
    --svgtocode-slate-300: #cbd5e1;
    --svgtocode-slate-400: #94a3b8;
    --svgtocode-slate-500: #64748b;
    --svgtocode-slate-600: #475569;
    --svgtocode-slate-700: #334155;
    --svgtocode-slate-800: #1e293b;
    --svgtocode-slate-900: #0f172a;

    --svgtocode-success: #22c55e;
    --svgtocode-warning: #f59e0b;
    --svgtocode-error: #ef4444;
}

/* ========================================
   Reset & Base Styles
======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--svgtocode-slate-900);
    background-color: var(--svgtocode-slate-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--svgtocode-brand-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--svgtocode-brand-700);
}

img {
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    color: var(--svgtocode-slate-900);
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* ========================================
   Layout
======================================== */
.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
}

@media (max-width: 640px) {
    .site-content {
        padding: 0.75rem 0.75rem 1.5rem;
    }
}

.content-narrow {
    max-width: 800px;
    margin: 0 auto;
}

/* ========================================
   Header
======================================== */
.site-header {
    background: white;
    border-bottom: 1px solid var(--svgtocode-slate-200);
    position: sticky;
    top: 0;
    z-index: 2000;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--svgtocode-slate-900);
    text-decoration: none;
}

.site-logo:hover {
    color: var(--svgtocode-brand-600);
}

.site-logo img {
    height: 40px;
    width: auto;
}

.site-logo svg {
    width: 40px;
    height: 40px;
    color: var(--svgtocode-brand-600);
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
    gap: 2rem;
    min-width: 0;
}

.header-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.header-nav-item {
    position: relative;
}

.header-nav-item>a,
.header-nav-trigger {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--svgtocode-slate-600);
    border-radius: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.header-nav-trigger {
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    line-height: 1;
}

.header-nav-item>a:hover,
.header-nav-trigger:hover,
.header-nav-item.is-open .header-nav-trigger {
    color: var(--svgtocode-brand-600);
    background: var(--svgtocode-brand-50);
}

.header-nav-trigger-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.header-nav-trigger-icon svg {
    width: 16px;
    height: 16px;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-nav-item.is-open .header-nav-trigger-icon {
    transform: rotate(180deg);
}

.header-nav-item.is-open .header-nav-trigger {
    color: var(--svgtocode-brand-700);
}

.header-mega-panel {
    position: fixed;
    top: 82px;
    left: 50%;
    width: min(1080px, calc(100vw - 1.5rem));
    background: white;
    border: 1px solid var(--svgtocode-slate-200);
    border-radius: 16px;
    box-shadow: 0 24px 54px -26px rgba(15, 23, 42, 0.36);
    padding: 1.1rem;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    z-index: 1200;
    max-height: calc(100vh - 100px);
    overflow: auto;
}

.header-nav-item.is-open .header-mega-panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.header-mega-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
    border-bottom: 1px solid var(--svgtocode-slate-100);
    padding-bottom: 0.75rem;
    margin-bottom: 0.9rem;
}

.header-mega-head h2 {
    margin: 0;
    font-size: 1rem;
}

.header-mega-all-link {
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
}

.header-mega-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem 1.2rem;
}

.header-mega-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) and (min-width: 769px) {
    .main-navigation {
        gap: 1rem;
    }

    .header-nav {
        gap: 0.2rem;
    }

    .header-nav-item>a,
    .header-nav-trigger {
        padding: 0.45rem 0.7rem;
        font-size: 0.88rem;
    }

    .header-mega-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.header-mega-col h3 {
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--svgtocode-slate-500);
    margin: 0 0 0.4rem;
}

.header-mega-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
}

.header-mega-col li a {
    display: block;
    border-radius: 8px;
    padding: 0.34rem 0.5rem;
    color: var(--svgtocode-slate-700);
    font-size: 0.9rem;
}

.header-mega-col li a:hover {
    background: var(--svgtocode-brand-50);
    color: var(--svgtocode-brand-700);
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--svgtocode-brand-500), var(--svgtocode-brand-600));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--svgtocode-slate-100);
    color: var(--svgtocode-slate-700);
}

.btn-secondary:hover {
    background: var(--svgtocode-slate-200);
    color: var(--svgtocode-slate-900);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--svgtocode-slate-600);
    position: relative;
    z-index: 2100;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        padding: 1rem;
        border-bottom: 1px solid var(--svgtocode-slate-200);
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        display: none;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        z-index: 1900;
    }

    .main-navigation.is-open {
        display: flex;
    }

    .header-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .header-nav-item {
        width: 100%;
    }

    .header-nav-item>a,
    .header-nav-trigger {
        width: 100%;
        justify-content: space-between;
        border: 1px solid var(--svgtocode-slate-200);
        background: var(--svgtocode-slate-50);
    }

    .header-mega-panel {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        box-shadow: none;
        border-radius: 12px;
        padding: 0.85rem;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 55vh;
        overflow: auto;
        z-index: auto;
    }

    .header-nav-item.is-open .header-mega-panel {
        display: block;
        transform: none;
    }

    .header-mega-grid,
    .header-mega-grid-3 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .header-mega-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
        padding-bottom: 0.5rem;
        margin-bottom: 0.6rem;
    }

    .header-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ========================================
   Footer
======================================== */
.site-footer {
    background: #fff;
    color: var(--svgtocode-slate-600);
    padding: 1.1rem 0 1rem;
    border-top: 1px solid var(--svgtocode-slate-200);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, minmax(160px, 1fr));
    gap: 2rem;
    margin-bottom: 1.6rem;
}

.footer-minimal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.footer-minimal-brand {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.footer-minimal-brand strong {
    color: var(--svgtocode-slate-900);
    font-size: 0.96rem;
}

.footer-minimal-brand span {
    font-size: 0.84rem;
    color: var(--svgtocode-slate-500);
}

.footer-minimal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.footer-minimal-links a {
    color: var(--svgtocode-slate-600);
    font-size: 0.88rem;
}

.footer-minimal-links a:hover {
    color: var(--svgtocode-brand-700);
}

.footer-top-note {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.5rem;
    background: rgba(15, 23, 42, 0.32);
}

.footer-top-note p {
    margin: 0;
    color: var(--svgtocode-slate-300);
    font-size: 0.93rem;
}

.footer-col p {
    font-size: 0.9375rem;
    color: var(--svgtocode-slate-400);
}

.footer-col h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: var(--svgtocode-slate-400);
    font-size: 0.9375rem;
    transition: color 0.2s;
}

.footer-col ul li a:hover {
    color: white;
}

.footer-col-brand {
    max-width: 360px;
}

.footer-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 1rem;
    padding: 0;
    list-style: none;
}

.footer-badges li {
    margin: 0;
    font-size: 0.78rem;
    padding: 0.28rem 0.48rem;
    color: var(--svgtocode-slate-200);
    border-radius: 999px;
    border: 1px solid var(--svgtocode-slate-700);
}

.footer-bottom {
    padding-top: 0.8rem;
    border-top: 1px solid var(--svgtocode-slate-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.footer-copyright {
    font-size: 0.82rem;
    color: var(--svgtocode-slate-500);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: var(--svgtocode-slate-400);
    transition: color 0.2s;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--svgtocode-slate-700);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-social a:hover {
    color: white;
    border-color: var(--svgtocode-slate-500);
}

.footer-social svg {
    width: 17px;
    height: 17px;
}

.footer-powered {
    font-size: 0.82rem;
    color: var(--svgtocode-slate-500);
}

@media (max-width: 980px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .footer-minimal {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   Page Content
======================================== */
.page-header {
    text-align: center;
    padding: 1.25rem 0 0.75rem;
    margin-bottom: 1rem;
}

.blog .page-header,
.archive .page-header {
    text-align: left;
    padding: 0.75rem 0 0.5rem;
    margin-bottom: 0.75rem;
}

.page-header h1 {
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--svgtocode-slate-900), var(--svgtocode-brand-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    font-size: 1.125rem;
    color: var(--svgtocode-slate-500);
    margin: 0;
}

.entry-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--svgtocode-slate-200);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

@media (max-width: 768px) {
    .entry-content {
        padding: 0.85rem;
        border-radius: 12px;
    }
}

.entry-content>*:last-child {
    margin-bottom: 0;
}

/* ========================================
   Blog / Posts
======================================== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--svgtocode-slate-200);
    overflow: hidden;
    transition: all 0.2s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.15);
}

.post-card-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--svgtocode-slate-100);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-meta {
    font-size: 0.8125rem;
    color: var(--svgtocode-slate-500);
    margin-bottom: 0.5rem;
}

.post-card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.post-card-title a {
    color: var(--svgtocode-slate-900);
}

.post-card-title a:hover {
    color: var(--svgtocode-brand-600);
}

.post-card-excerpt {
    color: var(--svgtocode-slate-600);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.read-more {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--svgtocode-brand-600);
}

.read-more:hover {
    color: var(--svgtocode-brand-700);
}

/* ========================================
   Pagination
======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--svgtocode-slate-600);
    background: white;
    border: 1px solid var(--svgtocode-slate-200);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.pagination a:hover {
    background: var(--svgtocode-brand-50);
    border-color: var(--svgtocode-brand-200);
    color: var(--svgtocode-brand-600);
}

.pagination .current {
    background: var(--svgtocode-brand-600);
    border-color: var(--svgtocode-brand-600);
    color: white;
}

/* ========================================
   Single Post
======================================== */
.single-post-header {
    text-align: left;
    padding: 0.75rem 0 0.5rem;
}

.single-post-meta {
    font-size: 0.9375rem;
    color: var(--svgtocode-slate-500);
    margin-bottom: 1rem;
}

.single-post-title {
    font-size: clamp(1.75rem, 4vw, 2.4rem);
    margin-bottom: 0;
}

.featured-image {
    margin: 2rem 0;
    border-radius: 16px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
}

/* ========================================
   404 Page
======================================== */
.error-404 {
    text-align: center;
    padding: 4rem 1rem;
}

.error-404-icon {
    font-size: 6rem;
    margin-bottom: 1rem;
}

.error-404 h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.error-404 p {
    font-size: 1.125rem;
    color: var(--svgtocode-slate-500);
    margin-bottom: 2rem;
}

/* ========================================
   Forms
======================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--svgtocode-slate-900);
    background: white;
    border: 2px solid var(--svgtocode-slate-200);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--svgtocode-brand-500);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* ========================================
   Utilities
======================================== */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

/* Screen reader text */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* WordPress Alignments */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* WordPress Admin Bar Fix */
.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}
