/*
Theme Name: Quartal Blog Theme
Theme URI: https://quartal.app/
Author: Quartal Finance
Author URI: https://quartal.app/
Description: Premium, clean, and progressive WordPress theme for Ukrainian sole proprietors (FOP). Created for Quartal.
Version: 1.2.0
License: GNU GPLv2 or later
Text Domain: quartal-theme
*/

:root {
    /* Premium Color Palette (aligned with colors.js of the app) */
    --primary: #18181B;        /* Zinc 900 */
    --primary-light: #3F3F46;  /* Zinc 700 */
    --background: #F9FAFB;     /* Cool Gray 50 */
    --surface: #FFFFFF;
    --border: rgba(24, 24, 27, 0.08); /* Very fine, non-obtrusive separator */
    --border-solid: #E5E7EB;   /* Gray 200 */
    
    /* Accents (Tax Green / Growth Green) */
    --accent: #10B981;         /* Emerald 500 */
    --accent-dark: #059669;    /* Emerald 600 */
    --accent-light: #F0FDF4;   /* Emerald 50 */
    
    /* Text */
    --text: #18181B;           /* Zinc 900 */
    --text-muted: #71717A;     /* Zinc 500 */
    --text-light: #A1A1AA;     /* Zinc 400 */
    
    /* Fonts & Radii */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    /* Shadows (used extremely sparingly) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.02);
    
    /* Viewport Spacing */
    --container-width: 1120px;
    --header-height: 72px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Ambient Background Blobs (Exact replication of bgBlob1 and bgBlob2 from HomeScreen.js) */
body::before {
    content: "";
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    border-radius: 150px;
    background-color: rgba(99, 102, 241, 0.04); /* Indigo with 4% opacity */
    z-index: -1;
    pointer-events: none;
    filter: blur(50px);
}

body::after {
    content: "";
    position: absolute;
    top: 200px;
    left: -150px;
    width: 400px;
    height: 400px;
    border-radius: 200px;
    background-color: rgba(16, 185, 129, 0.03); /* Emerald Green with 3% opacity */
    z-index: -1;
    pointer-events: none;
    filter: blur(60px);
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* Scroll Reading Progress Bar */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease-out;
}

/* Header & Glassmorphic Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
    border-bottom-color: var(--border-solid);
}

.nav-container {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.nav-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--primary);
    line-height: 1;
}

.logo-tag {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1.5px solid var(--border-solid);
    align-self: center;
    line-height: 1.2;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
    padding: 6px 0;
    transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
    background: var(--primary);
    color: var(--surface);
}

.btn-primary:hover {
    background: #000;
    transform: translateY(-1px);
}

/* Asymmetric 2-Column Layout Wrapper */
.blog-layout-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 64px;
    padding: 130px 0 96px;
}

/* Sticky Editorial Sidebar */
.blog-sidebar {
    position: sticky;
    top: 104px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-logo .nav-logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.sidebar-logo .logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--primary);
    line-height: 1;
}

.sidebar-logo .logo-tag {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    align-self: center;
}

.sidebar-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
}

.sidebar-title {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* Minimalist Search */
.sidebar-search {
    position: relative;
    margin-bottom: 32px;
}

.sidebar-search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-solid);
    padding: 8px 0 8px 24px;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.sidebar-search-input:focus {
    border-color: var(--accent);
}

.sidebar-search-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* Sidebar Hashtag Categories */
.sidebar-categories {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 36px;
}

.sidebar-cat-item {
    display: block;
}

.sidebar-cat-item a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    background: transparent;
}

.sidebar-cat-item a::before {
    content: "#";
    color: var(--text-light);
    margin-right: 4px;
    font-weight: 600;
}

.sidebar-cat-item a:hover {
    background: rgba(24, 24, 27, 0.03);
    color: var(--text);
    transform: translateX(2px);
}

.sidebar-cat-item.active a {
    background: rgba(16, 185, 129, 0.06);
    color: var(--accent-dark);
}

.sidebar-cat-item.active a::before {
    color: var(--accent);
}

.sidebar-app-box {
    border: 1px solid var(--border-solid);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-top: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-app-box:hover {
    border-color: rgba(24, 24, 27, 0.12);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
}

.sidebar-app-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 14px;
}

.sidebar-app-link {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sidebar-app-link:hover {
    color: var(--accent-dark);
}

/* Feed Column */
.blog-feed {
    display: flex;
    flex-direction: column;
}

/* Featured Article Row (Large visual weight) */
.featured-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 48px;
}

.featured-img-container {
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--border-solid);
    margin-bottom: 24px;
}

.featured-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-row:hover .featured-img-container img {
    transform: scale(1.02);
}

/* Monospace Metadata (Linear / Stripe Press Style) */
.post-meta-mono {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-cat-badge {
    color: var(--accent-dark);
}

.post-meta-sep {
    color: var(--text-light);
}

.featured-row .post-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.25;
    margin-bottom: 14px;
    color: var(--primary);
}

.post-title a:hover {
    color: var(--accent-dark);
}

.featured-row .post-excerpt {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 20px;
}

/* Read Link */
.read-link {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding-bottom: 2px;
    align-self: flex-start;
}

.read-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.read-link svg {
    color: var(--accent);
    transition: transform 0.2s ease;
}

.featured-row:hover .read-link::after, .post-row:hover .read-link::after {
    transform: scaleX(1);
}

.featured-row:hover .read-link svg, .post-row:hover .read-link svg {
    transform: translateX(4px);
}

/* Post Row Layout (Typography focus, Small Image Right, NO CARDS) */
.post-row {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 48px;
    padding: 36px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.post-row-content {
    display: flex;
    flex-direction: column;
}

.post-row .post-title {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.35;
    margin-bottom: 10px;
    color: var(--primary);
}

.post-row .post-excerpt {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.post-row-img-container {
    aspect-ratio: 3/2;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--border-solid);
}

.post-row-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-row:hover .post-row-img-container img {
    transform: scale(1.03);
}

/* Post Row variation: No image (clean typography) */
.post-row.no-image {
    grid-template-columns: 1fr;
    max-width: 760px;
}

/* Article Template (single.php) 2-Column Layout */
.article-layout-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 64px;
    padding: 130px 0 96px;
}

.article-post-container {
    max-width: 1200px;
}

.article-main-content {
    min-width: 0;
    max-width: 860px; /* Stretches to cover the space of the removed right column */
}

.article-container {
    max-width: 100%;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 24px;
    width: fit-content;
}

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

.back-to-blog svg {
    transition: transform 0.2s ease;
}

.back-to-blog:hover svg {
    transform: translateX(-3px);
}

.article-header {
    text-align: center;
    margin-bottom: 44px;
}

.article-cat-wrap {
    margin-bottom: 16px;
}

.post-meta-mono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 16px;
    margin-bottom: 0;
}

.post-cat-badge {
    background: #DCFCE7; /* Emerald 100 - clear pill badge */
    color: var(--accent-dark);
    padding: 4px 12px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.05em;
}

.post-meta-sep {
    color: var(--border);
}

.article-title {
    font-size: clamp(28px, 4.5vw, 36px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
    color: var(--primary);
    margin-top: 12px;
}

.article-featured-img {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 48px;
    max-height: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.article-featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Editorial Typography */
.article-content {
    font-size: 18px;
    line-height: 1.85;
    color: #27272A; /* Zinc 800 for high readability */
}

.article-content p {
    margin-bottom: 24px;
}

.article-content h2, .article-content h3 {
    color: var(--primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 48px 0 20px;
    line-height: 1.3;
}

.article-content h2 {
    font-size: 24px;
    border-left: 3px solid var(--accent);
    padding-left: 16px;
}

.article-content h3 {
    font-size: 20px;
    padding-left: 8px;
}

.article-content ul, .article-content ol {
    padding-left: 0;
    margin-left: 0;
    margin-bottom: 28px;
    list-style: none;
}

.article-content ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    font-size: 17.5px;
    line-height: 1.7;
}

.article-content ul li::before {
    content: "•";
    color: var(--accent);
    font-weight: 900;
    font-size: 22px;
    position: absolute;
    left: 6px;
    top: -2px;
}

.article-content ol {
    counter-reset: ol-counter;
}

.article-content ol li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-size: 17.5px;
    line-height: 1.7;
}

.article-content ol li::before {
    counter-increment: ol-counter;
    content: counter(ol-counter) ".";
    color: var(--accent-dark);
    font-weight: 700;
    font-size: 15px;
    position: absolute;
    left: 6px;
    top: 0;
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 16px 24px;
    margin: 36px 0;
    background: var(--accent-light);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--primary);
    font-size: 18px;
}

.article-content blockquote p {
    margin-bottom: 0;
}

.article-content code {
    background: #F3F4F6;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-mono);
    color: var(--accent-dark);
}

.article-content pre {
    background: var(--primary);
    color: var(--background);
    padding: 24px;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 32px;
    font-size: 13.5px;
}

.article-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Premium Minimal Author Box */
.author-box {
    margin-top: 64px;
    padding: 28px;
    background: #F9FAFB;
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    gap: 24px;
    align-items: center;
}

.author-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-info h4 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--primary);
    margin-bottom: 2px;
}

.author-role {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.author-info p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* Navigation Links inside Post */
.post-navigation-wrap {
    margin-top: 64px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

.nav-post-link {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.nav-post-link:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.03);
}

.nav-post-link span {
    font-family: var(--font-mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    font-weight: 700;
}

.nav-post-title {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.45;
    transition: color 0.2s ease;
}

.nav-post-link:hover .nav-post-title {
    color: var(--accent-dark);
}

.empty-nav {
    border: 1px dashed var(--border);
    background: transparent;
    opacity: 0.5;
    pointer-events: none;
}

/* Minimalist Pagination */
.pagination {
    margin-top: 56px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
}

.pagination .page-numbers {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.pagination .page-numbers.current, .pagination .page-numbers:hover {
    background: var(--primary);
    color: var(--surface);
}

/* Footer Section */
/* Footer Section */
.footer {
    background: var(--background);
    border-top: 1px solid var(--border);
    padding: 80px 0 48px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 64px;
}

.footer-brand-col {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 320px;
}

.footer-socials {
    display: flex;
    gap: 16px;
}

.footer-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-solid);
    color: var(--text-muted);
    background: #FFFFFF;
    transition: all 0.2s ease;
}

.footer-socials a:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.footer-col-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 20px;
}

.footer-col-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col-links a {
    font-size: 13.5px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-col-links a:hover {
    color: var(--primary);
}

.footer-col-links a.highlight-link {
    color: var(--accent-dark);
    font-weight: 600;
}

.footer-col-links a.highlight-link:hover {
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 28px;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12.5px;
    color: var(--text-light);
}

.footer-copyright {
    color: var(--text-muted);
}

/* Modal Overlay & Card styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(24, 24, 27, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: #FFFFFF;
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    color: var(--primary);
    background: rgba(24, 24, 27, 0.04);
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-family: var(--font-sans);
    font-size: 13.5px;
    outline: none;
    background: #FFFFFF;
    transition: border-color 0.2s ease;
}

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

.form-submit-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 600;
    margin-top: 8px;
}

.modal-success-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-dark);
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 16px;
}

.modal-success-state h4 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--primary);
}

.modal-success-state p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Responsive Styles */
@media (max-width: 1100px) {
    .article-layout-wrapper {
        gap: 32px;
    }
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 840px) {
    .blog-layout-wrapper,
    .article-layout-wrapper {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 100px 0 64px;
    }
    
    /* Hide entire sidebar on single post page on mobile */
    .single .blog-sidebar {
        display: none !important;
    }
    
    /* On list/home viewports, hide all widgets except the Categories (Рубрики) */
    .blog-sidebar .sidebar-search,
    .blog-sidebar .deadline-widget,
    .blog-sidebar .sidebar-app-box,
    .blog-sidebar .limits-widget {
        display: none !important;
    }
    
    .blog-sidebar {
        position: static;
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .sidebar-categories {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 0;
    }
    
    /* Hide QR code on all tablets and mobile screens */
    .feed-promo-banner {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 24px !important;
        margin: 32px 0 !important;
    }
    .feed-promo-banner .promo-visual {
        display: none !important;
    }
    
    .sidebar-app-box {
        display: none; /* Hide app box on mobile sidebar since it's already top */
    }
    
    .post-row {
        grid-template-columns: 1fr 120px;
        gap: 24px;
        padding: 28px 0;
    }
    
    .post-row .post-title {
        font-size: 18px;
    }
    
    .post-row .post-excerpt {
        font-size: 13.5px;
    }
}

@media (max-width: 768px) {
    .nav-actions .nav-link {
        display: none;
    }
    .nav-actions {
        gap: 16px;
    }
    .article-wrap {
        padding: 96px 0 64px;
    }
    .article-header {
        margin-bottom: 28px;
    }
    .article-title {
        font-size: 26px;
    }
    .article-featured-img {
        margin-bottom: 28px;
        border-radius: 12px;
    }
    .share-box {
        margin-top: 36px;
        padding-top: 20px;
    }
    .share-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .share-btn {
        justify-content: center;
        padding: 12px;
        font-size: 13px;
        min-height: 44px;
    }
}

@media (max-width: 560px) {
    .feed-promo-banner .promo-actions {
        width: 100% !important;
    }
    .feed-promo-banner .promo-btn {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .post-row {
        grid-template-columns: 1fr;
    }
    
    .post-row-img-container {
        order: -1;
        aspect-ratio: 16/9;
        margin-bottom: 16px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    
    .footer-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Stack author box on mobile */
    .author-box {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
        gap: 16px;
    }
    .author-avatar {
        width: 80px;
        height: 80px;
    }

    /* Stack single post navigation on mobile */
    .post-navigation-wrap {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .btn-text-desktop {
        display: none;
    }
    .btn-text-mobile {
        display: inline;
    }
    .container {
        padding: 0 16px;
    }
}

/* Entrance Animations for Posts */
@keyframes feedEntrance {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-row, .post-row {
    animation: feedEntrance 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.featured-row { animation-delay: 0.05s; }
.post-row:nth-of-type(1) { animation-delay: 0.15s; }
.post-row:nth-of-type(2) { animation-delay: 0.2s; }
.post-row:nth-of-type(3) { animation-delay: 0.25s; }
.post-row:nth-of-type(4) { animation-delay: 0.3s; }

/* Sidebar Widgets General */
.sidebar-widget {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border-solid);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Deadline Widget */
.deadline-widget {
    background: #18181B; /* Dark Zinc theme */
    border-color: #27272A;
    color: #FFFFFF;
}

.deadline-carousel {
    position: relative;
    margin-bottom: 12px;
}

.deadline-slides {
    position: relative;
    min-height: 92px; /* Prevents layout shifting/jumping when transitioning between slides of varying text length */
}

.deadline-slide {
    animation: fadeInSlide 0.3s ease-in-out;
}

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.carousel-dots {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    margin-bottom: 4px;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.carousel-dot.active {
    background: #34D399;
    transform: scale(1.2);
}

/* Feed Post Metadata Overrides (resolves single page centering conflict) */
.featured-row .post-meta-mono,
.post-row .post-meta-mono {
    display: flex !important;
    justify-content: flex-start !important;
}


.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.widget-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.1);
    color: #A1A1AA;
    padding: 2px 6px;
    border-radius: 4px;
}

.deadline-days {
    font-size: 11px;
    font-weight: 700;
    color: #34D399; /* Light Emerald */
    background: rgba(52, 211, 153, 0.1);
    padding: 2px 8px;
    border-radius: 100px;
}

.deadline-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 4px;
}

.deadline-date {
    font-size: 11px;
    color: #A1A1AA;
    margin-bottom: 12px;
}

.widget-link {
    font-size: 11.5px;
    font-weight: 600;
    color: #34D399;
}

.widget-link:hover {
    color: #6EE7B7;
}

/* Limits Widget */
.limits-widget {
    background: rgba(255, 255, 255, 0.7);
}

.limits-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.limit-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.limit-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.limit-group {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.limit-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    line-height: 1.4;
}

.limit-row span {
    color: var(--text-muted);
}

.limit-row strong {
    color: var(--text);
    font-weight: 600;
}

.limit-esv {
    background: rgba(16, 185, 129, 0.03);
    border: 1px solid rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-sm);
    padding: 8px;
    margin-top: 4px;
}

.limit-esv .limit-row {
    font-size: 12px;
}

/* Templates Widget */
.templates-widget {
    background: rgba(255, 255, 255, 0.7);
}

.template-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.template-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: transparent;
    transition: all 0.2s ease;
}

.template-link:hover {
    color: var(--primary);
    background: rgba(24, 24, 27, 0.04);
}

.template-icon {
    font-size: 16px;
}

.template-name {
    flex: 1;
}

/* Inline App Promo Banner */
.feed-promo-banner {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 32px;
    background: linear-gradient(135deg, #18181B 0%, #27272A 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    color: #FFFFFF;
    margin: 48px 0;
    align-items: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid #3F3F46;
}

.feed-promo-banner::before {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.promo-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #34D399;
    background: rgba(52, 211, 153, 0.1);
    padding: 4px 8px;
    border-radius: 100px;
    display: inline-block;
    margin-bottom: 12px;
}

.promo-badge.text-badge {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: #A1A1AA !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    display: inline-flex !important;
    align-items: center !important;
    margin-bottom: 10px !important;
}

.promo-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.promo-text {
    font-size: 13.5px;
    color: #A1A1AA;
    line-height: 1.55;
    margin-bottom: 20px;
}

.promo-btn {
    background: #FFFFFF;
    color: #18181B;
}

.promo-btn:hover {
    background: #E4E4E7;
    color: #18181B;
}

.promo-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.promo-qr-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 170px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.promo-qr-container:hover {
    transform: translateY(-2px);
}

.promo-qr-img {
    border-radius: 8px;
    border: 4px solid #FFFFFF;
    display: block;
}

.promo-qr-label {
    font-size: 11px;
    font-weight: 600;
    color: #A1A1AA;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Status Widget */
.status-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 4px;
}

.status-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-online {
    background-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

/* Share Box inside Post */
.share-box {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px dashed var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.share-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--primary);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn svg {
    flex-shrink: 0;
}

.share-btn:hover {
    transform: translateY(-2px) scale(1.02);
}

.share-btn:active {
    transform: translateY(0) scale(0.97);
}

.share-tg:hover {
    color: #0088cc;
    border-color: #0088cc;
    background: #f0f9ff;
    box-shadow: 0 4px 14px rgba(0, 136, 204, 0.15);
}

.share-fb:hover {
    color: #1877f2;
    border-color: #1877f2;
    background: #f0f7ff;
    box-shadow: 0 4px 14px rgba(24, 119, 242, 0.15);
}

.share-viber:hover {
    color: #7360f2;
    border-color: #7360f2;
    background: #f5f3ff;
    box-shadow: 0 4px 14px rgba(115, 96, 242, 0.15);
}

.share-copy:hover {
    color: var(--accent-dark);
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

.share-btn.copied {
    background: #DCFCE7 !important;
    border-color: #34D399 !important;
    color: #065F46 !important;
    box-shadow: 0 4px 14px rgba(52, 211, 153, 0.2) !important;
}

/* Button text toggles */
.btn-text-mobile {
    display: none;
}
.btn-text-desktop {
    display: inline;
}

/* Article Inline Leaderboard QR Promo Banner (728x90 style) */
.article-inline-promo-banner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
    padding: 16px 24px !important;
    margin: 36px 0 !important;
    min-height: 104px !important;
    grid-template-columns: none !important;
}

.article-inline-promo-banner .promo-content {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    margin: 0 !important;
    padding: 0 !important;
}

.article-inline-promo-banner .inline-badge {
    margin: 0 0 6px 0 !important;
    padding: 0 !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #A1A1AA !important;
    background: none !important;
    border: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    display: inline-flex !important;
    align-items: center !important;
}

.article-inline-promo-banner .inline-title {
    font-size: 16px !important;
    margin: 0 0 4px 0 !important;
    font-weight: 700 !important;
    color: #FFFFFF !important;
    line-height: 1.25 !important;
}

.article-inline-promo-banner .inline-text {
    font-size: 12px !important;
    margin: 0 !important;
    line-height: 1.4 !important;
}

.article-inline-promo-banner .promo-btn.inline-btn {
    padding: 8px 16px !important;
    font-size: 12px !important;
    border-radius: 100px !important;
}

@media (max-width: 768px) {
    .article-inline-promo-banner {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 14px !important;
        padding: 16px 20px !important;
        min-height: auto !important;
    }
    .article-inline-promo-banner .promo-actions-wrap {
        width: 100% !important;
    }
    .article-inline-promo-banner .promo-btn.inline-btn {
        width: 100% !important;
        text-align: center !important;
        justify-content: center !important;
    }
}
