/* tech.css — Blog-specific styles for tech.maksym.info
   Extends shared style.css from maksym.info */

/* ---- Blog Header ---- */
.blog-header {
    text-align: center;
    padding: 2rem 1rem 1rem;
}

.blog-header h1 a {
    text-decoration: none;
    color: var(--color-heading);
}

.blog-header h1 a:hover {
    color: var(--color-text);
}

.blog-header .blog-desc {
    font-style: italic;
    font-size: 0.9rem;
    opacity: 0.75;
    margin-top: 0.25rem;
}

/* ---- Post Card (index pages) ---- */
.post-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.post-card:last-child {
    margin-bottom: 0;
}

.post-card h2 {
    font-size: 1.2rem;
    margin-bottom: 0.4rem;
    border-bottom: none;
    padding-bottom: 0;
}

.post-card h2 a {
    text-decoration: none;
}

.post-card .post-meta {
    font-size: 0.82rem;
    color: var(--color-text);
    opacity: 0.7;
    margin-bottom: 0.6rem;
}

.post-card .post-excerpt {
    font-size: 0.92rem;
    line-height: 1.6;
}

.post-card .post-excerpt p {
    margin-bottom: 0.5rem;
}

.post-card .read-more {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ---- Full Post ---- */
.post-full {
    background-color: var(--color-surface);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.post-full h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-full .post-meta {
    font-size: 0.85rem;
    color: var(--color-text);
    opacity: 0.7;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-accent);
}

.post-full .post-meta a {
    color: var(--color-text);
    opacity: 0.85;
}

/* ---- WordPress Content Styles ---- */
.post-content {
    line-height: 1.8;
    font-size: 0.95rem;
    overflow: hidden;       /* contain floats */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.post-content p {
    margin-bottom: 1.2rem;
    text-align: left;
}

.post-content h2 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-content h3 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.post-content img {
    max-width: 100% !important;  /* override inline width attrs */
    height: auto !important;
    border-radius: var(--radius);
    box-sizing: border-box;
}

.post-content a {
    word-break: break-word;
}

/* WordPress image alignment — display full-width for readability */
.post-content .alignleft,
.post-content .alignright,
.post-content .aligncenter {
    float: none;
    display: block;
    margin: 1rem auto;
    max-width: 100%;
}

/* WordPress captions */
.wp-caption {
    max-width: 100% !important;  /* override inline width */
    width: auto !important;      /* override inline style="width: 570px" */
    margin: 1rem 0;
    box-sizing: border-box;
}

.wp-caption img {
    display: block;
    width: 100%;
}

.wp-caption-text,
figcaption {
    font-size: 0.82rem;
    color: var(--color-text);
    opacity: 0.65;
    text-align: center;
    margin-top: 0.4rem;
    font-style: italic;
}

/* WordPress block images */
.wp-block-image {
    margin: 1rem 0;
}

.wp-block-image figure {
    float: none !important;
    margin: 0 auto;
    max-width: 100%;
}

.wp-block-image img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    border-radius: var(--radius);
}

.wp-block-image figcaption {
    margin-top: 0.4rem;
}

/* WordPress galleries */
.wp-block-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.wp-block-gallery .wp-block-image {
    flex: 1 1 200px;
    margin: 0;
}

/* ---- Responsive YouTube Embeds ---- */
.wp-block-embed__wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1rem 0;
    border-radius: var(--radius);
}

.wp-block-embed__wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Also handle raw iframes in content */
.post-content iframe {
    max-width: 100%;
    border: none;
    border-radius: var(--radius);
}

/* ---- Code blocks (tech blog specific) ---- */
.post-content pre {
    background-color: var(--color-bg);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 1rem 0;
}

.post-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.88em;
}

.post-content p code,
.post-content li code {
    background-color: var(--color-bg);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 3px;
    padding: 0.15rem 0.4rem;
}

/* ---- Blockquotes ---- */
.post-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    font-style: italic;
    background-color: var(--color-bg);
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- Lists inside posts ---- */
.post-content ul,
.post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.post-content li {
    margin-bottom: 0.3rem;
    text-align: left;
}

/* ---- Tables (tech blog specific) ---- */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

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

.post-content th {
    background-color: var(--color-bg);
    font-weight: 600;
}

/* ---- Tag Pills ---- */
.post-tags {
    clear: both;            /* clear floated images above */
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-accent);
}

.tag-list {
    list-style: none !important;
    padding-left: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-list li {
    list-style: none !important;
    margin-bottom: 0;
}

.tag-list li a {
    display: inline-block;
    font-size: 0.82rem;
    padding: 0.2rem 0.65rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-accent);
    border-radius: 1rem;
    color: var(--color-text);
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}

.tag-list li a:hover {
    background-color: var(--color-accent);
    color: var(--color-bg);
}

.tag-list li span {
    display: inline-block;
    font-size: 0.82rem;
    padding: 0.2rem 0.65rem;
    background-color: var(--color-bg);
    border: 1px solid rgba(184, 134, 11, 0.3);
    border-radius: 1rem;
    color: var(--color-text);
    opacity: 0.7;
}

/* ---- Post Navigation (back link) ---- */
.post-nav {
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 1.5rem 0 0.5rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination .current {
    display: inline-block;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    text-decoration: none;
}

.pagination a {
    color: var(--color-heading);
    border: 1px solid var(--color-accent);
    transition: background-color var(--transition);
}

.pagination a:hover {
    background-color: var(--color-surface);
}

.pagination .current {
    background-color: var(--color-heading);
    color: var(--color-bg);
    font-weight: 600;
}

.pagination .ellipsis {
    padding: 0.35rem 0.3rem;
    color: var(--color-text);
    opacity: 0.5;
}

/* ---- Archive Pages ---- */
.archive-header {
    background-color: var(--color-surface);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
}

.archive-header h1 {
    font-size: 1.3rem;
    margin-bottom: 0;
}

.archive-header p {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

/* ---- Static Page ---- */
.static-page {
    background-color: var(--color-surface);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.static-page h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
}

/* ---- Sidebar Tweaks for Blog ---- */
.sidebar .widget {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}

.sidebar .widget:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar .widget h2 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-accent);
}

.sidebar .widget ul {
    list-style: none;
    padding-left: 0;
}

.sidebar .widget li {
    font-size: 0.85rem;
    padding: 0.4rem 0;
    line-height: 1.4;
}

.sidebar .widget li:last-child {
    border-bottom: none;
}

.sidebar .widget li a {
    text-decoration: none;
    color: var(--color-heading);
}

.sidebar .widget li a:hover {
    color: var(--color-text);
}

.sidebar .widget .count {
    font-size: 0.78rem;
    opacity: 0.6;
    margin-left: 0.25rem;
}

/* ---- Mobile Adjustments ---- */
@media (max-width: 767px) {

    .post-full {
        padding: 1rem;
    }

    .post-full h1 {
        font-size: 1.25rem;
    }

    .post-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .blog-header {
        padding: 1.25rem 0.75rem 0.75rem;
    }

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