/* =========================================================
   ClubApi Blog styles (blog/index.php and blog/post.php)
   Uses colours from style.css (:root)
   ========================================================= */

/* ---------- Blog list heading ---------- */
.blog-head h1 { font-size: 2.6rem; }

.blog-search { position: relative; max-width: 520px; }
.blog-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.blog-search input {
    width: 100%; padding: 13px 16px 13px 44px;
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    color: var(--white); outline: none;
}
.blog-search input:focus { border-color: var(--green); }

/* category buttons */
.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.blog-cats button {
    background: var(--card); border: 1px solid var(--border); color: var(--text);
    border-radius: 20px; padding: 7px 14px; font-size: 14px; cursor: pointer;
}
.blog-cats button span { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 4px; }
.blog-cats button:hover { border-color: var(--green); }
.blog-cats button.active { background: var(--green); border-color: var(--green); color: #0b1020; font-weight: 600; }
.blog-cats button.active span { color: #0b1020; }

/* ---------- Post cards ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.post-card {
    background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    overflow: hidden; display: flex; flex-direction: column; transition: 0.25s;
}
.post-card:hover { border-color: var(--green); transform: translateY(-4px); }
.post-card-img { display: block; aspect-ratio: 1200 / 630; background: var(--bg-2); overflow: hidden; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: 0.4s; }
.post-card:hover .post-card-img img { transform: scale(1.03); }
.post-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card h2, .post-card h3 { font-size: 1.15rem; line-height: 1.4; margin: 10px 0 8px; }
.post-card h2 a, .post-card h3 a { color: var(--white); }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--green); }
.post-card p { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; flex: 1; }
.read-more { font-family: var(--mono); font-size: 13px; color: var(--green); }

/* first (newest) post is big */
.post-card.featured { grid-column: 1 / -1; flex-direction: row; }
.post-card.featured .post-card-img { flex: 0 0 55%; aspect-ratio: auto; }
.post-card.featured .post-card-body { padding: 34px; justify-content: center; }
.post-card.featured h2 { font-size: 1.7rem; }
.post-card.featured p { flex: 0; font-size: 16px; }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.post-meta i { color: var(--green); margin-right: 4px; }
.post-cat {
    display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
    color: var(--green); background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px; padding: 2px 10px; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ---------- Single post heading ---------- */
.post-head { padding: 56px 0 40px; }
.post-head-inner { max-width: 860px; }
.post-head h1 { font-size: 2.5rem; line-height: 1.2; margin: 14px 0 14px; }
.post-lead { font-size: 1.15rem; color: var(--muted); margin-bottom: 20px; }

.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--green); z-index: 2000; transition: width 0.1s; }

.post-cover { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 32px; }

/* ---------- Article text ---------- */
.post-body { font-size: 17px; line-height: 1.8; color: var(--text); }
.post-body p { margin-bottom: 1.3em; }
.post-body h2 {
    font-size: 1.6rem; color: var(--white); margin: 2.2em 0 0.8em;
    padding-bottom: 10px; border-bottom: 1px solid var(--border); scroll-margin-top: 90px;
}
.post-body h2::before { content: "## "; color: var(--green); font-family: var(--mono); }
.post-body h3 { font-size: 1.25rem; color: var(--white); margin: 1.6em 0 0.6em; }
.post-body a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.post-body strong { color: var(--white); }
.post-body ul, .post-body ol { padding-left: 1.3em; margin-bottom: 1.3em; }
.post-body li { margin-bottom: 0.5em; }
.post-body li::marker { color: var(--green); }
.post-body code {
    font-family: var(--mono); font-size: 0.85em; color: var(--cyan);
    background: rgba(56, 189, 248, 0.08); border-radius: 5px; padding: 2px 6px;
}
.post-body pre {
    position: relative; background: #070b16; border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; font-size: 14px; line-height: 1.6; overflow-x: auto; margin-bottom: 1.5em;
}
.post-body pre code { background: none; padding: 0; color: #e2e8f0; font-size: 13.5px; }
.code-copy {
    position: absolute; top: 10px; right: 10px; font-family: var(--mono); font-size: 11px;
    background: var(--card); color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px; cursor: pointer;
}
.code-copy:hover { color: var(--green); border-color: var(--green); }
.post-body blockquote {
    border-left: 3px solid var(--green); background: var(--card); border-radius: 0 10px 10px 0;
    padding: 16px 20px; margin: 0 0 1.4em; color: var(--white);
}
.post-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; font-size: 15px; display: block; overflow-x: auto; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; vertical-align: top; }
.post-body th { background: var(--card); color: var(--white); font-weight: 600; }

/* tip / warning box inside article */
.note { border: 1px solid var(--border); border-left: 4px solid var(--cyan); background: var(--card); border-radius: 10px; padding: 16px 18px; margin-bottom: 1.4em; font-size: 15.5px; }
.note.tip { border-left-color: var(--green); }
.note.warn { border-left-color: var(--yellow); }
.note b:first-child { display: block; color: var(--white); margin-bottom: 4px; }

/* FAQ in article */
.post-faq { margin-top: 40px; }
.post-faq h2 { font-size: 1.6rem; margin-bottom: 18px; scroll-margin-top: 90px; }

/* tags + share */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 20px; }
.post-tags span { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; }

.post-share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.post-share b { color: var(--white); margin-right: 8px; font-size: 15px; }
.post-share a, .post-share button {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--card);
    color: var(--text); display: inline-flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer;
}
.post-share a:hover, .post-share button:hover { color: var(--green); border-color: var(--green); }

/* author */
.author-box { display: flex; gap: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 22px; margin: 28px 0; }
.author-logo { flex: 0 0 52px; height: 52px; border-radius: 12px; background: rgba(34, 197, 94, 0.12); color: var(--green); font-family: var(--mono); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.author-box b { color: var(--white); }
.author-box p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }

/* previous / next */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav a { display: block; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; color: var(--white); font-weight: 600; font-size: 15px; }
.post-nav a:hover { border-color: var(--green); }
.post-nav small { display: block; font-family: var(--mono); font-weight: 400; color: var(--green); font-size: 12px; margin-bottom: 4px; }

/* sidebar */
.post-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 20px; }
.post-side .side-box { position: static; }
.toc-box .list-link { font-size: 14px; }
.toc-box .list-link.active { color: var(--green); }
.side-cta p { color: var(--muted); font-size: 14.5px; }

/* ---------- Mobile ---------- */
@media (max-width: 991px) {
    .blog-grid { grid-template-columns: 1fr 1fr; }
    .post-card.featured { flex-direction: column; }
    .post-card.featured .post-card-img { aspect-ratio: 1200 / 630; }
    .post-card.featured .post-card-body { padding: 22px; }
    .post-side { position: static; }
    .toc-box { display: none; }
}
@media (max-width: 600px) {
    .blog-head h1 { font-size: 2rem; }
    .blog-grid { grid-template-columns: 1fr; }
    .post-card.featured h2 { font-size: 1.3rem; }
    .post-head { padding: 36px 0 24px; }
    .post-head h1 { font-size: 1.75rem; }
    .post-lead { font-size: 1rem; }
    .post-body { font-size: 16px; }
    .post-body h2 { font-size: 1.35rem; }
    .post-nav { grid-template-columns: 1fr; }
}

/* keep search icon in place if a browser extension adds an image */
.blog-search i { top: 25px; }
.blog-search img { position: absolute; right: 10px; top: 12px; max-height: 24px; }
@media (max-width: 991px) {
    .post-card.featured .post-card-img { flex: none; }
}
