/* =========================================
   Equivest Metals Blog — Dark Theme
   ========================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #252838;
    color: rgba(255,255,255,0.62);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #9694FF;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #ABA9FF;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1, h2, h3, h4, h5, h6 {
    color: #F0F2F8;
    font-weight: 700;
    line-height: 1.3;
}

/* --- Layout --- */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Site Header --- */
.site-header {
    border-bottom: 1px solid rgba(150,148,255,0.10);
    padding: 16px 0;
    position: sticky;
    top: 0;
    background-color: rgba(37,40,56,0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.site-logo:hover {
    color: #ffffff;
}

.site-logo img {
    height: 32px;
    width: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-nav a {
    color: rgba(255,255,255,0.62);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
    color: #ffffff;
}

.site-nav a.nav-contact {
    border: 1px solid #9694FF;
    border-radius: 6px;
    padding: 6px 16px;
    color: #9694FF;
}

.site-nav a.nav-contact:hover {
    background: #9694FF;
    color: #ffffff;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #F0F2F8;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #F0F2F8;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* --- Blog Hero --- */
.blog-hero {
    text-align: center;
    padding: 64px 24px 40px;
}

.blog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.hero-subtitle {
    color: rgba(255,255,255,0.38);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Tag Filters --- */
.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0 24px 40px;
}

.tag-filter {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(150,148,255,0.10);
    color: #ABA9FF;
    border: 1px solid rgba(150,148,255,0.18);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tag-filter:hover,
.tag-filter.active {
    background: rgba(150,148,255,0.18);
    color: #ffffff;
    border-color: rgba(150,148,255,0.35);
}

/* --- Blog List --- */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Post Card --- */
.post-card {
    display: flex;
    gap: 32px;
    padding: 32px 0;
    border-bottom: 1px solid rgba(150,148,255,0.10);
    align-items: flex-start;
}

.post-card:first-child {
    padding-top: 0;
}

.post-card-image {
    flex-shrink: 0;
    width: 280px;
    height: 190px;
    border-radius: 8px;
    overflow: hidden;
    order: 2;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-content {
    flex: 1;
    min-width: 0;
    order: 1;
}

.post-meta {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.38);
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.post-meta span + span::before {
    content: "\00B7";
    margin-right: 6px;
}

.post-card h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.post-card h2 a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-card h2 a:hover {
    color: #9694FF;
}

.post-excerpt {
    color: rgba(255,255,255,0.38);
    font-size: 0.95rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    background: rgba(150,148,255,0.10);
    color: #9694FF;
    text-decoration: none;
}

.tag:hover {
    background: rgba(150,148,255,0.18);
    color: #ABA9FF;
}

/* --- Single Post --- */
.post {
    padding: 40px 0 80px;
}

.post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.post-header {
    text-align: center;
    margin-bottom: 40px;
}

.post-header h1 {
    font-size: 2.2rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.post-header .post-meta {
    justify-content: center;
}

.post-featured-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Responsive Video --- */
.post-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 32px 0;
    border-radius: 8px;
}

.post-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* --- Post Content (Article Typography) --- */
.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255,255,255,0.62);
}

.post-content p {
    margin-bottom: 1.5em;
}

.post-content h2 {
    font-size: 1.5rem;
    margin-top: 2.5em;
    margin-bottom: 0.8em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid rgba(150,148,255,0.10);
}

.post-content h3 {
    font-size: 1.25rem;
    margin-top: 2em;
    margin-bottom: 0.6em;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 2em auto;
    display: block;
}

.post-content em:only-child,
.post-content p > em:only-child {
    display: block;
    text-align: center;
    color: rgba(255,255,255,0.38);
    font-size: 0.85rem;
    margin-top: -1.5em;
    margin-bottom: 2em;
}

.post-content blockquote {
    border-left: 3px solid #9694FF;
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: rgba(150,148,255,0.05);
    border-radius: 0 8px 8px 0;
    color: rgba(255,255,255,0.62);
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content ul,
.post-content ol {
    margin: 1em 0 1.5em;
    padding-left: 1.5em;
}

.post-content li {
    margin-bottom: 0.5em;
}

.post-content code {
    background: rgba(150,148,255,0.10);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.post-content pre {
    background: #1a1c2e;
    padding: 1.5em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content a {
    color: #9694FF;
    text-decoration: underline;
    text-decoration-color: rgba(123, 140, 222, 0.3);
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: #ABA9FF;
    text-decoration-color: rgba(150,148,255,0.4);
}

/* --- Post Footer --- */
.post-footer {
    margin-top: 60px;
    padding-top: 24px;
    border-top: 1px solid rgba(150,148,255,0.10);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #9694FF;
    font-size: 0.9rem;
    font-weight: 500;
}

.back-link:hover {
    color: #ABA9FF;
}

/* --- Contact Page --- */
.contact-page {
    padding: 64px 0 80px;
}

.contact-page h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.contact-page > .container > p,
.contact-page > .post-container > p,
.contact-page .container p:first-of-type {
    color: rgba(255,255,255,0.38);
    margin-bottom: 40px;
    font-size: 1.05rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255,255,255,0.62);
}

.form-group input,
.form-group textarea {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(150,148,255,0.18);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 1rem;
    color: #F0F2F8;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(150,148,255,0.4);
    background: rgba(255,255,255,0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.btn-submit {
    display: inline-block;
    padding: 12px 32px;
    background: #9694FF;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    align-self: flex-start;
}

.btn-submit:hover {
    background: #ABA9FF;
}

.btn-submit:active {
    transform: scale(0.98);
}

/* --- Site Footer --- */
.site-footer {
    border-top: 1px solid rgba(150,148,255,0.10);
    padding: 32px 0;
    margin-top: 80px;
}

.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.site-footer p {
    color: rgba(255,255,255,0.38);
    font-size: 0.85rem;
}

.site-footer a {
    color: rgba(255,255,255,0.38);
}

.site-footer a:hover {
    color: #ABA9FF;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 40px 0;
}

.pagination a {
    color: #9694FF;
    font-weight: 500;
}

.pagination a:hover {
    color: #ABA9FF;
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* =========================================
   Responsive — Tablet (<768px)
   ========================================= */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #252838;
        flex-direction: column;
        padding: 16px 24px 24px;
        gap: 16px;
        border-bottom: 1px solid rgba(150,148,255,0.10);
    }

    .site-nav.open {
        display: flex;
    }

    .site-header {
        position: relative;
    }

    .blog-hero {
        padding: 40px 24px 24px;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .post-card {
        flex-direction: column;
        gap: 16px;
    }

    .post-card-image {
        width: 100%;
        height: 200px;
    }

    .post-header h1 {
        font-size: 1.8rem;
    }

    .contact-page {
        padding: 40px 0 60px;
    }

    .site-footer .container {
        flex-direction: column;
        text-align: center;
    }
}

/* =========================================
   Responsive — Mobile (<480px)
   ========================================= */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .blog-hero h1 {
        font-size: 1.7rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .post-card {
        padding: 24px 0;
    }

    .post-card-image {
        height: 160px;
    }

    .post-card h2 {
        font-size: 1.15rem;
    }

    .post-header h1 {
        font-size: 1.5rem;
    }

    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.3rem;
    }

    .tag-filters {
        padding: 0 16px 24px;
    }

    .contact-page h1 {
        font-size: 1.8rem;
    }
}
