/* 1. GLOBAL VARIABLES & RESET */
:root {
    --maxw: 1320px;
    --bg: #fbfbfd;
    --card: #ffffff;
    --muted: #6b7280;
    --accent: #0f172a;
    --primary: #7c3aed;
    --accent2: #06b6d4;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(12, 15, 20, 0.06);
}

/* Reset & base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

ul {
    margin-left: 30px;
}

body {
    margin: 0;
    line-height: 1.65;
    color: var(--accent);
    background: linear-gradient(180deg, var(--bg), #fff);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
}

/* Layout */
#header {
    max-width: var(--maxw);
    margin: 0 auto;
}

.container {
    max-width: var(--maxw);
    margin: -28px auto;
    padding: 20px;
}

header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

main {
    display: grid;
    gap: 18px;
}

.highlight,
.blog-suggest-card {
    margin: 36px 0;
    padding: 18px 20px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.08), rgba(6, 182, 212, 0.08));
    border-left: 5px solid #7c3aed;
}

.highlight strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #0f172a;
}

.highlight a {
    font-size: 15px;
    font-weight: 600;
    color: #7c3aed;
    text-decoration: none;
}

.highlight p {
    margin: 0 0 10px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #0f172a;
}

@media (min-width: 920px) {
    main {
        grid-template-columns: 1fr 320px;
    }
}

/* Media */
.hero-image {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(12, 15, 20, 0.06);
}

.hero-image img {
    display: block;
    width: 100%;
    height: auto;
}

/* Typography */
h1 {
    margin: 8px 0 0;
    font-size: clamp(20px, 3.6vw, 34px);
}

h2 {
    margin-top: 0;
}

.byline,
.lead,
.card-desc,
footer {
    color: var(--muted);
}

.byline {
    font-size: 14px;
    margin-top: 6px;
}

.lead {
    margin: 10px 0 18px;
}

footer {
    margin-top: 18px;
    font-size: 13px;
    text-align: center;
}

/* Content */

.ghost {
    display: none;
}

.excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* number of lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: calc(1.5em * 2);
    color: #494949;
}

.btn-row {
    margin-top: 10px;
}

article,
.sidebar-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 6px 20px rgba(12, 15, 20, 0.05);
}

article {
    padding: 18px;
}

aside {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section {
    margin-top: 14px;
}

/* Cards */
ol.cards {
    margin: 10px 0;
    padding-left: 20px;
}

li.card {
    margin: 12px 0;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(15, 23, 42, 0.04);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), transparent);
}

.card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title h3 {
    margin: 0;
    font-size: 16px;
}

.card-desc {
    font-size: 14px;
    margin-top: 6px;
}

.message {
    margin-top: 8px;
    font-style: italic;
    color: #0f172a;
}

/* Tables */
.seo-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

.seo-table th,
.seo-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #e6e6e9;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(90deg, var(--primary), #06b6d4);
}

/* Code blocks */
pre.keywords {
    padding: 12px;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 13px;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #eef2ff;
    border-radius: 8px;
}

code {
    padding: 2px 6px;
    font-size: 13px;
    background: #f1f5f9;
    border-radius: 6px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 2. LAYOUT WRAPPERS */
.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

main.grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 22px;
    margin-top: 28px;
}

/* 3. NAVIGATION BAR (In header.html) */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left a {
    font-weight: 800;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.nav-right a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-right a:hover {
    color: var(--primary);
}

.nav-right a.active {
    color: var(--primary);
    font-weight: 700;
}

/* 4. PAGE HEADER & TITLES */
header.page-head {
    padding-top: 40px;
    margin-bottom: 30px;
}

.page-title {
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 8px;
    line-height: 1.2;
}

.subtitle {
    color: var(--muted);
    font-size: 16px;
    max-width: 700px;
}

/* 5. CAROUSEL SYSTEM */
.carousel {
    position: relative;
    margin-bottom: 30px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--card);
    border: 1px solid #7c3aed;
}

.slides {
    display: flex;
    transition: transform 450ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.slide {
    min-width: 100%;
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 24px 24px 44px 24px;
}

.slide img {
    width: 45%;
    height: 240px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.slide .info {
    flex: 1;
}

.slide h3 {
    font-size: 22px;
    margin-bottom: 12px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.pagination button {
    min-width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    color: var(--accent);
    transition: all 0.2s ease;
}

.pagination button:hover {
    background: #f1f5f9;
}

.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.carousel button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-prev {
    left: 15px;
}
.btn-next {
    right: 15px;
}

.dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.dot.active {
    background: var(--primary);
    width: 20px;
    border-radius: 4px;
}

/* 6. CONTENT CARDS & BLOG POSTS */

.carousel {
    position: relative;
    margin-bottom: 30px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--card);
}

/* This targets the <div class="controls"> container */
.controls {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none; /* Allows clicking through the container */
    z-index: 20;
}

/* This targets your specific IDs: #prevBtn and #nextBtn */
#prevBtn,
#nextBtn {
    pointer-events: auto; /* Re-enables clicking for the buttons */
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
    transition: all 0.2s ease;
    margin: 0 15px; /* Adds spacing from the edges */
}

#prevBtn:hover,
#nextBtn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}
.carousel {
    position: relative;
    margin-bottom: 30px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--card);
}

/* Fixes the missing buttons by targeting IDs */
#prevBtn,
#nextBtn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    width: 44px;
    height: 44px;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

#prevBtn:hover,
#nextBtn:hover {
    background: var(--primary);
    color: white;
}

#prevBtn {
    left: 15px;
}
#nextBtn {
    right: 15px;
}

/* 8. SIDEBAR STYLES (Supports Home & Individual Blogs) */
.big-sidebar,
.sidebar-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 90px;
    align-self: start; /* Prevents stretching */
}

/* Individual Blog Sidebar Links */
.sidebar-card p {
    margin-bottom: 12px;
}
.sidebar-card a {
    text-decoration: none;
    color: var(--accent);
    font-size: 14px;
    display: block;
    line-height: 1.4;
    transition: color 0.2s;
}
.sidebar-card a:hover {
    color: var(--primary);
}

/* Home Page Recent Items */
.recent-item {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
}
.post-meta {
    font-size: 12px;
}

.content-card {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.content-card:hover {
    transform: translateY(-3px);
}

.list-item {
    display: flex;
    gap: 20px;
}

.list-item .thumb {
    width: 240px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
}

.tag {
    display: inline-block;
    background: #f3e8ff;
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
}

/* 7. BUTTONS */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary), var(--accent2));
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
    border: none;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.ghost {
    padding: 9px 19px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

/* 8. SIDEBAR */
.big-sidebar {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 90px;
}

.recent-item {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
}

.recent-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

/* 9. FOOTER */
footer {
    margin-top: 60px;
    padding: 40px 20px;
    border-top: 1px solid #eee;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

/* 10. RESPONSIVE DESIGN */
@media (max-width: 980px) {
    main.grid {
        grid-template-columns: 1fr;
    }
    .big-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .slide {
        flex-direction: column;
        text-align: center;
    }
    .slide img {
        width: 100%;
        height: 180px;
    }
    .list-item {
        flex-direction: column;
    }
    .list-item .thumb {
        width: 100%;
        height: 200px;
    }
    .nav-right {
        display: none;
    } /* Mobile menu could be added here */
}
