/* ================================
   MyWebsite — Global Styles
   ================================ */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --bg: #f7f8fc;
    --text: #2d3748;
    --text-light: #718096;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navigation */
nav {
    background: var(--white);
    box-shadow: var(--shadow);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.nav-brand-text {
    text-decoration: none;
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-brand-text:hover {
    opacity: 0.9;
}

.nav-logo-link {
    display: flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}

.nav-logo-img {
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.nav-links > li {
    position: relative;
}

.nav-item.has-children > a::after {
    content: " ▾";
    font-size: 0.65em;
    opacity: 0.75;
    margin-left: 0.15em;
}

.nav-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
    padding: 0.35rem 0;
    list-style: none;
    z-index: 200;
    margin-top: 0.2rem;
}

.nav-item.has-children:hover > .nav-submenu,
.nav-item.has-children:focus-within > .nav-submenu {
    display: block;
}

.nav-submenu a {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: 0;
    white-space: nowrap;
}

.nav-submenu a:hover,
.nav-submenu a.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.08);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
}

/* Main Content */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    width: 100%;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    color: white;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--white);
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

form .btn {
    background: var(--primary);
    color: white;
    width: 100%;
    padding: 1rem;
    margin-top: 0.5rem;
}

form .btn:hover {
    background: var(--primary-dark);
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card h3 {
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Content Block */
.content-block {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.content-block h2 {
    color: var(--primary);
    margin: 1.5rem 0 0.75rem;
    font-size: 1.3rem;
}

.content-block h2:first-child {
    margin-top: 0;
}

.content-block ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.content-block li {
    margin-bottom: 0.4rem;
    color: var(--text-light);
}

.content-block pre {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.8;
}

/* Contact Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.contact-info {
    padding: 1rem 0;
}

.contact-info p {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-light);
}

/* Alert */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #c6f6d5;
    color: #276749;
    border: 1px solid #9ae6b4;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.footer-content-custom p {
    margin: 0.35rem 0;
}

.footer-content-custom a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer-content-custom a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .contact-grid { grid-template-columns: 1fr; }
    nav { padding: 0 1rem; }
    .nav-links { gap: 0; }
    .nav-links a { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
}

/* Archive pages (category, tag, author) */
.archive-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}
.archive-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--white);
    background: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}
.archive-header h1 {
    font-size: 2rem;
    color: #1e293b;
    margin: 0.5rem 0 0.4rem;
}
.archive-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}
.archive-count {
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Blog single post */
.blog-single { max-width: 760px; margin: 0 auto; padding: 2rem 0; }
.blog-single-header { margin-bottom: 2rem; border-bottom: 2px solid #e5e7eb; padding-bottom: 1rem; }
.blog-single-header h1 { font-size: 2rem; color: #1e293b; margin-bottom: 0.5rem; }
.blog-single-body { line-height: 1.8; color: #374151; }
.blog-single-body h2 { margin: 1.5rem 0 0.75rem; color: #1e293b; }
.blog-single-body pre { background: #1e293b; color: #e2e8f0; padding: 1rem 1.25rem; border-radius: 8px; overflow-x: auto; margin: 1rem 0; }
.blog-single-body code { font-family: monospace; font-size: 0.92em; }
.blog-single-body p { margin-bottom: 1rem; }
.blog-single-footer { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid #e5e7eb; }
.blog-date { color: #6b7280; font-size: 0.9rem; }

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2.5rem 0 1rem;
    flex-wrap: wrap;
}
.page-info { color: #6b7280; font-size: 0.9rem; }
.btn-outline {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.btn-outline:hover { background: var(--primary); color: #fff; }

/* Alert styles for contact form */
.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Categories listing grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.category-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(99,102,241,0.12);
    transform: translateY(-2px);
}
.category-card-icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}
.category-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
}
.category-card-desc {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}
.category-card-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    background: #eef2ff;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    margin-top: auto;
}

/* Tags cloud listing */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.9rem;
    transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}
.tag-cloud-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eef2ff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.1);
}
.tag-cloud-name { line-height: 1; }
.tag-cloud-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 50px;
    line-height: 1;
}
.tag-cloud-item:hover .tag-cloud-count {
    background: var(--primary);
    color: #fff;
}

#page-featured-preview img,
#featured-preview img {
margin: 0 auto;
}