/* ============================================================
   Computer Security US — Blog Theme
   Matches computersecurity.us design language
   ============================================================ */

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

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #f5f7fa;
}

a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ── Variables ───────────────────────────────────────────────── */
:root {
    --blue-dark:   #003366;
    --blue-mid:    #004c99;
    --blue-light:  #0066cc;
    --red:         #CC0000;
    --red-dark:    #aa0000;
    --bg:          #f5f7fa;
    --white:       #ffffff;
    --text:        #333333;
    --text-muted:  #718096;
    --border:      #e2e8f0;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --card-shadow-h:0 4px 16px rgba(0,0,0,0.13);
    --radius:      8px;
    --max-width:   1200px;
    --content-width: 740px;
}

/* ── Container ───────────────────────────────────────────────── */
.blog-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Header / Navigation ─────────────────────────────────────── */
.header-container {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 51, 102, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo-container a { display: block; line-height: 0; }

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.main-navigation {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Ghost outputs <ul><li><a> for {{navigation}} */
.main-navigation ul { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.main-navigation li { margin: 0; }

.nav-item,
.main-navigation a {
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: background 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-item:hover,
.main-navigation a:hover,
.nav-item.nav-current,
.main-navigation .current a {
    background-color: rgba(255,255,255,0.15);
}

/* Hamburger toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 0.4rem;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s;
}

/* Mobile nav */
.mobile-nav {
    background: var(--blue-dark);
    padding: 0.75rem 1.5rem 1rem;
}

.mobile-nav ul { flex-direction: column; }
.mobile-nav a,
.mobile-nav .nav-item { display: block; padding: 0.6rem 0.75rem; }

/* ── Blog hero ───────────────────────────────────────────────── */
.blog-hero {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
    color: #fff;
    padding: 3rem 0 2.5rem;
    text-align: center;
}

.hero-cover {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.blog-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.blog-description {
    color: rgba(255,255,255,0.78);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ── Tag/Author hero ─────────────────────────────────────────── */
.tag-hero,
.author-hero { padding: 2.5rem 0 2rem; }

.tag-label-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 0.75rem;
}

.tag-post-count {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.author-hero-inner {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    text-align: left;
}

.author-hero-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
}

.author-location,
.author-website { color: rgba(255,255,255,0.7); font-size: 0.9rem; margin-top: 0.3rem; }
.author-website:hover { color: #fff; }

/* ── Posts section ───────────────────────────────────────────── */
.posts-section { padding: 2.5rem 0 3rem; }

/* ── Post card ───────────────────────────────────────────────── */
.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.75rem;
}

.post-card:hover {
    box-shadow: var(--card-shadow-h);
    transform: translateY(-2px);
}

/* Featured posts (Ghost adds .post-card-featured) */
.post-card-featured {
    border-top: 3px solid var(--red);
}

.post-card-image-link { display: block; overflow: hidden; }

.post-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-card-image { transform: scale(1.03); }

.post-card-content {
    padding: 1.4rem 1.6rem 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--red);
    margin-bottom: 0.5rem;
    transition: color 0.2s;
}

.post-card-tag:hover { color: var(--red-dark); }

.post-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.post-card-title a { color: inherit; transition: color 0.2s; }
.post-card-title a:hover { color: var(--blue-mid); }

.post-card-excerpt {
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-footer {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 0.8rem;
    margin-top: auto;
}

.post-card-author { font-weight: 600; color: var(--text); }
.post-card-date::before,
.post-card-reading-time::before { content: "·"; margin-right: 0.4rem; color: var(--border); }

/* ── Pagination ──────────────────────────────────────────────── */
.pagination { padding: 0 0 3rem; }

.pagination-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--blue-mid);
    transition: all 0.2s;
    box-shadow: var(--card-shadow);
}

.pagination-btn:hover {
    background: var(--blue-mid);
    color: #fff;
    border-color: var(--blue-mid);
}

.pagination-info { color: var(--text-muted); font-size: 0.9rem; }

/* ── Post header ─────────────────────────────────────────────── */
.post-main { background: var(--bg); }

.post-header {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
    color: #fff;
    padding: 3rem 0 2.5rem;
}

.post-header-inner { max-width: var(--content-width); }

.post-tag-label {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    margin-bottom: 1rem;
    transition: background 0.2s;
}

.post-tag-label:hover { background: rgba(255,255,255,0.3); }

.post-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 1rem;
}

.post-excerpt {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.87rem;
    color: rgba(255,255,255,0.75);
}

.post-author { display: flex; align-items: center; gap: 0.5rem; }

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.4);
}

.author-name { font-weight: 600; color: #fff; }

.post-date::before,
.post-reading-time::before { content: "·"; margin-right: 0.5rem; opacity: 0.5; }

/* ── Feature image ───────────────────────────────────────────── */
.post-feature-image { background: var(--white); padding: 2rem 0 0; }

.feature-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius);
}

.feature-caption {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ── Post body / Ghost content ───────────────────────────────── */
.post-body { padding: 2.5rem 0; background: var(--white); }

.post-content {
    max-width: var(--content-width);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

/* Typography inside post content */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    margin: 2rem 0 0.75rem;
    line-height: 1.25;
    color: var(--blue-dark);
    font-weight: 700;
}

.post-content h2 { font-size: 1.65rem; border-bottom: 2px solid var(--border); padding-bottom: 0.4rem; }
.post-content h3 { font-size: 1.35rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content p { margin-bottom: 1.4rem; }

.post-content a { color: var(--blue-mid); text-decoration: underline; transition: color 0.2s; }
.post-content a:hover { color: var(--red); }

.post-content strong { font-weight: 700; }
.post-content em { font-style: italic; }

.post-content ul,
.post-content ol {
    margin: 0 0 1.4rem 1.5rem;
    list-style: revert;
}

.post-content li { margin-bottom: 0.4rem; }

.post-content blockquote {
    border-left: 4px solid var(--red);
    background: #fff5f5;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: #555;
}

.post-content code {
    background: #f0f4f8;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: 'Courier New', Courier, monospace;
    color: var(--red-dark);
}

.post-content pre {
    background: #1a1a2e;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1.4rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

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

.post-content img {
    border-radius: var(--radius);
    margin: 1.5rem auto;
    box-shadow: var(--card-shadow);
}

.post-content hr {
    border: none;
    border-top: 2px solid var(--border);
    margin: 2rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.4rem;
    font-size: 0.93rem;
}

.post-content th,
.post-content td {
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    text-align: left;
}

.post-content th {
    background: var(--blue-dark);
    color: #fff;
    font-weight: 600;
}

.post-content tr:nth-child(even) { background: #f5f7fa; }

/* Ghost card styles */
.kg-width-wide { margin: 1.5rem -2rem; }
.kg-width-full { margin: 1.5rem calc(-50vw + 50%); }
.kg-image { border-radius: var(--radius); }
.kg-gallery-container { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.4rem; }
.kg-gallery-row { display: flex; gap: 0.5rem; width: 100%; }
.kg-gallery-image img { border-radius: var(--radius); object-fit: cover; height: 100%; }
.kg-bookmark-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.4rem; }
.kg-bookmark-content { padding: 1rem; }
.kg-bookmark-title { font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.kg-bookmark-description { font-size: 0.87rem; color: var(--text-muted); }
.kg-callout-card { display: flex; gap: 0.75rem; padding: 1rem 1.25rem; background: #fff5f5; border-left: 4px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 1.4rem; }
.kg-toggle-card { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.4rem; }
.kg-toggle-heading { padding: 0.75rem 1rem; font-weight: 600; cursor: pointer; }

/* ── Post footer ─────────────────────────────────────────────── */
.post-footer { background: var(--bg); padding: 2rem 0 3rem; }
.post-footer-inner { max-width: var(--content-width); }

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 2rem;
}

.tags-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

.post-tag {
    display: inline-block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    color: var(--blue-mid);
    font-weight: 500;
    transition: all 0.2s;
}

.post-tag:hover { background: var(--blue-mid); color: #fff; border-color: var(--blue-mid); }

/* Author bio card */
.author-bio-card {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
}

.author-bio-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 3px solid var(--border);
}

.author-bio-name { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 0.3rem; }
.author-bio-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 0.5rem; }
.author-bio-link { font-size: 0.88rem; color: var(--blue-mid); font-weight: 600; }
.author-bio-link:hover { color: var(--red); }

.back-to-blog {
    display: inline-block;
    color: var(--blue-mid);
    font-weight: 600;
    font-size: 0.93rem;
    transition: color 0.2s;
}

.back-to-blog:hover { color: var(--red); }

/* ── Page templates ──────────────────────────────────────────── */
.page-main { background: var(--bg); }

.page-header {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
    color: #fff;
    padding: 3rem 0 2.5rem;
}

.page-title { font-size: 2rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }
.page-excerpt { color: rgba(255,255,255,0.78); font-size: 1.05rem; }

.page-feature-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.page-body { background: var(--white); padding: 2.5rem 0 3rem; }

/* ── Error page ──────────────────────────────────────────────── */
.error-main {
    min-height: 60vh;
    display: flex;
    align-items: center;
    background: var(--bg);
}

.error-container { text-align: center; padding: 4rem 1.5rem; }

.error-code {
    font-size: 6rem;
    font-weight: 900;
    color: var(--red);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-title { font-size: 1.8rem; font-weight: 700; color: var(--blue-dark); margin-bottom: 1rem; }
.error-message { color: var(--text-muted); font-size: 1rem; margin-bottom: 2rem; max-width: 440px; margin-left: auto; margin-right: auto; }

.error-home-btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--blue-dark), var(--blue-mid));
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: opacity 0.2s;
}

.error-home-btn:hover { opacity: 0.85; }

/* ── No posts ─────────────────────────────────────────────────── */
.no-posts {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 3rem 0;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.85);
    padding: 3rem 0 0;
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2.5rem;
}

.footer-section h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--red);
    display: inline-block;
}

.footer-section p {
    font-size: 0.88rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.68);
    margin-bottom: 1rem;
}

.footer-social { display: flex; gap: 0.75rem; margin-top: 0.75rem; }

.footer-social a {
    color: rgba(255,255,255,0.65);
    transition: color 0.2s;
    line-height: 0;
}

.footer-social a:hover { color: #fff; }

.footer-links { display: flex; flex-direction: column; gap: 0.4rem; }

.footer-links a {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    transition: color 0.2s;
    padding: 0.1rem 0;
}

.footer-links a:hover { color: #fff; }

.footer-cta-btn {
    display: inline-block;
    background: var(--red);
    color: #fff;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.footer-cta-btn:hover { background: var(--red-dark); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-width: var(--max-width);
    margin: 0 auto;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.45);
}

.footer-bottom-links { display: flex; gap: 1.25rem; }

.footer-bottom-links a {
    color: rgba(255,255,255,0.45);
    transition: color 0.2s;
}

.footer-bottom-links a:hover { color: #fff; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .main-navigation { display: none; }
    .nav-toggle { display: flex; }
    .main-navigation.is-open { display: flex; }

    .blog-title { font-size: 1.7rem; }
    .post-title { font-size: 1.6rem; }
    .post-content { font-size: 1rem; }
    .kg-width-wide { margin: 1rem 0; }
    .kg-width-full { margin: 1rem 0; }
    .author-bio-card { flex-direction: column; }
    .pagination-inner { justify-content: center; }
    .footer-content { grid-template-columns: 1fr 1fr; gap: 1.75rem; }
    .footer-bottom { justify-content: center; text-align: center; }
}

@media (max-width: 480px) {
    .main-header { padding: 0.75rem 1rem; }
    .post-card-image { height: 180px; }
    .footer-content { grid-template-columns: 1fr; }
    .author-hero-inner { flex-direction: column; text-align: center; }
    .error-code { font-size: 4rem; }
}
