/* ============================================
   Miwnix Tech — Blog Shared Styles
   ============================================ */



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Kanit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.8;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
header {
    position: sticky;
    padding: 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    top: 0;
    z-index: 100;
    background: rgba(5, 5, 5, 0.8);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Ensure container in header behaves like flex row */
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    color: var(--primary);
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

/* --- Article Header --- */
.article-header {
    padding: 80px 0 40px;
    text-align: center;
}

.article-header h1 {
    font-size: 2.5rem;
    line-height: 1.3;
}

.meta-info {
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}


.meta-info time {
    color: inherit;
}

.reading-time {
    display: inline-block;
    margin-left: 10px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
}

.reading-time i {
    margin-right: 4px;
}

/* --- Gradient Text --- */
.gradient-text {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Content --- */
.content h2 {
    color: var(--primary);
    margin-top: 40px;
    border-left: 4px solid var(--secondary);
    padding-left: 15px;
    font-size: 1.8rem;
}

.content p {
    margin: 15px 0;
}

.content ul {
    margin: 15px 0 15px 20px;
}

.content li {
    margin-bottom: 8px;
}

.code-snippet {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    font-family: monospace;
    color: var(--primary);
    border: 1px solid rgba(0, 242, 255, 0.2);
    margin: 20px 0;
    overflow-x: auto;
}

.featured-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Footer --- */
footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px;
    color: var(--text-muted);
    background: transparent;
}

/* --- Share Section --- */
.share-section {
    margin: 60px 0 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.share-section h3 {
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.share-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    transform: translateY(-3px);
}

.fb {
    background: #1877f2;
}

.tw {
    background: #1da1f2;
}

.ln {
    background: #0077b5;
}

.cp {
    background: #333;
}

.cp:active {
    background: #28a745;
}

/* --- Related Articles --- */
.related-section {
    margin-top: 80px;
}

.related-title {
    font-size: 1.5rem;
    margin-bottom: 30px;
    border-left: 4px solid var(--primary);
    padding-left: 15px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Blog card styles */
.blog-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.blog-card a {
    text-decoration: none;
    color: inherit;
}

.blog-img {
    height: 180px;
    overflow: hidden;
    position: relative;
}

.blog-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: #000;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.blog-content {
    padding: 15px;
}

.blog-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: white;
}

/* ============================================
   Reading Progress Bar
   ============================================ */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.5);
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 242, 255, 0.15);
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 90;
    backdrop-filter: blur(10px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.4);
    transform: translateY(-3px);
}

/* --- Arrow List Styling --- */
ul.arrow-list {
    list-style: none;
    padding-left: 0;
    margin: 20px 0;
}

ul.arrow-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 15px;
    line-height: 1.6;
}

ul.arrow-list li::before {
    content: "\f061";
    /* FontAwesome Arrow Right */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 2px;
    color: var(--primary);
}

/* --- Read Next List (Bullet + Arrow) --- */
.read-next-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.read-next-list li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.read-next-list li:hover {
    transform: translateX(10px);
}

.read-next-list a {
    color: var(--light-text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.read-next-list a::before {
    content: "\f061";
    /* Arrow Icon */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--primary);
    font-size: 0.9em;
}

.read-next-list a:hover {
    color: var(--primary);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .article-header {
        padding: 40px 0 20px;
    }

    /* Center Header on Mobile */
    header .container {
        flex-direction: column;
        gap: 15px;
    }

    .logo,
    .back-link {
        justify-content: center;
        width: 100%;
        text-align: center;
    }

    /* Reduce font size on mobile */
    .article-header h1 {
        font-size: 1.8rem;
    }

    .content h2 {
        font-size: 1.5rem;
    }
}

/* --- Mobile Slider (Read Next) --- */
@media (max-width: 768px) {
    .related-section .grid-2 {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
    }

    .related-section .blog-card {
        flex: 0 0 80%;
        min-width: 260px;
        scroll-snap-align: start;
    }

    .related-section .grid-2::-webkit-scrollbar {
        display: none;
    }
}