/* ==========================================================================
   DebuggedIt — public site styles
   Minimalist, "dev/terminal" tone. No decorative fluff.
   ========================================================================== */

:root {
    --color-navy: #0F172A;
    --color-teal: #2DD4BF;
    --color-text: #1A1A1A;
    --color-text-secondary: #6B7280;
    --color-bg: #F8F9FA;
    --color-card-bg: #FFFFFF;
    --color-border: #E5E7EB;
    --color-code-bg: #F1F1F3;
    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --radius: 8px;
    --max-width: 1120px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-navy);
    text-decoration: none;
}

a:hover {
    color: var(--color-teal);
}

img { max-width: 100%; }

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

/* ---------------------------------------------------------------------- */
/* Header / nav                                                            */
/* ---------------------------------------------------------------------- */

.site-header {
    background: var(--color-navy);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.site-logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.site-logo span { color: var(--color-teal); }

.site-nav { display: flex; gap: 28px; }

.site-nav a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    font-weight: 500;
}

.site-nav a:hover { color: var(--color-teal); }

.site-header__right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 2px 4px 2px 14px;
}

.site-search input {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.85rem;
    width: 160px;
    padding: 6px 0;
}

.site-search input::placeholder { color: rgba(255, 255, 255, 0.5); }
.site-search input:focus { outline: none; }

.site-search button {
    background: var(--color-teal);
    border: none;
    color: var(--color-navy);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.site-search button:hover { background: #25c4b0; }

/* ---------------------------------------------------------------------- */
/* Hero                                                                     */
/* ---------------------------------------------------------------------- */

.hero {
    background: var(--color-navy);
    padding: 88px 0 96px;
}

.hero__inner {
    text-align: center;
    max-width: 720px;
}

.hero__title {
    font-family: var(--font-mono);
    font-size: 2.75rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.hero__title span { color: var(--color-teal); }

.hero__subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.125rem;
    margin: 0 auto 32px;
    max-width: 560px;
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                  */
/* ---------------------------------------------------------------------- */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--color-border);
    background: var(--color-card-bg);
    color: var(--color-text);
    cursor: pointer;
}

.btn:hover { border-color: var(--color-teal); color: var(--color-navy); }

.btn--accent {
    background: var(--color-teal);
    border-color: var(--color-teal);
    color: var(--color-navy);
}

.btn--accent:hover { background: #25c4b0; color: var(--color-navy); }

.btn--primary {
    background: var(--color-navy);
    border-color: var(--color-navy);
    color: #fff;
}

.btn--primary:hover { background: #1a2540; color: #fff; }

.btn--ghost {
    background: transparent;
}

.btn--block { display: block; width: 100%; text-align: center; }
.btn--sm { padding: 8px 14px; font-size: 0.85rem; }

/* ---------------------------------------------------------------------- */
/* Sections / headings                                                     */
/* ---------------------------------------------------------------------- */

.section { padding: 64px 0; }

.section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section__header h2 { margin: 0; font-size: 1.5rem; }

.section__link { font-size: 0.9rem; font-weight: 600; color: var(--color-navy); }

.breadcrumbs { margin-bottom: 24px; }

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.breadcrumbs li { display: flex; align-items: center; gap: 6px; }

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    color: var(--color-border);
    margin-left: 6px;
}

.breadcrumbs a { color: var(--color-text-secondary); font-weight: 500; }
.breadcrumbs a:hover { color: var(--color-navy); }
.breadcrumbs span[aria-current] { color: var(--color-text); font-weight: 600; }

.page-heading { margin-bottom: 40px; }

.page-heading h1,
.page-heading h2 { margin: 0 0 8px; font-size: 2rem; }

.page-heading p { color: var(--color-text-secondary); margin: 0; }

.related-posts { max-width: 1120px; padding-top: 40px; border-top: 1px solid var(--color-border); }
.related-posts .page-heading h2 { font-size: 1.5rem; }

.page-heading__eyebrow {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    color: var(--color-teal);
    font-weight: 700;
    margin: 0 0 8px;
}

/* ---------------------------------------------------------------------- */
/* Post grid + cards                                                       */
/* ---------------------------------------------------------------------- */

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.post-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
    border-color: var(--color-teal);
    transform: translateY(-2px);
}

.post-card__image-link {
    display: block;
    margin: -24px -24px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
}

.post-card__image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.post-card__category {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    color: var(--color-navy);
    background: rgba(45, 212, 191, 0.15);
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
    align-self: flex-start;
}

.post-card__title {
    font-size: 1.125rem;
    margin: 0 0 10px;
    line-height: 1.4;
}

.post-card__title a { color: var(--color-text); }

.post-card__excerpt {
    color: var(--color-text-secondary);
    font-size: 0.925rem;
    flex-grow: 1;
    margin: 0 0 16px;
}

.post-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border);
    padding-top: 12px;
}

.post-card__link { font-weight: 600; color: var(--color-navy); }

/* ---------------------------------------------------------------------- */
/* Category grid                                                           */
/* ---------------------------------------------------------------------- */

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.category-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    display: block;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.category-card:hover { border-color: var(--color-teal); transform: translateY(-2px); }

.category-card__name { font-size: 1.2rem; margin: 0 0 8px; color: var(--color-text); }

.category-card__description {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin: 0 0 16px;
}

.category-card__count {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-navy);
}

/* ---------------------------------------------------------------------- */
/* Single post                                                             */
/* ---------------------------------------------------------------------- */

.post-single { max-width: 760px; padding-top: 24px; padding-bottom: 72px; }

.post-single__header { margin-bottom: 32px; }

.post-single__header h1 { font-size: 2.1rem; line-height: 1.3; margin: 12px 0; }

.post-single__meta { color: var(--color-text-secondary); font-size: 0.9rem; }

.post-single__featured-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: 0 0 32px;
}

.post-single__content { font-size: 1.05rem; }

.post-single__content h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.post-single__content h3 { font-size: 1.2rem; margin: 32px 0 12px; }

.post-single__content p { margin: 0 0 20px; }

.post-single__content ul,
.post-single__content ol { margin: 0 0 20px; padding-left: 24px; }

.post-single__content li { margin-bottom: 8px; }

.post-single__content pre {
    background: var(--color-code-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    overflow-x: auto;
    margin: 0 0 24px;
    border: 1px solid var(--color-border);
}

.post-single__content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--color-code-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.post-single__content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.post-single__content blockquote {
    border-left: 3px solid var(--color-teal);
    margin: 0 0 24px;
    padding: 4px 20px;
    color: var(--color-text-secondary);
}

.post-single__content img {
    border-radius: var(--radius);
    margin: 8px 0 24px;
}

.post-single__footer { margin-top: 48px; border-top: 1px solid var(--color-border); padding-top: 24px; }

/* ---------------------------------------------------------------------- */
/* Pagination                                                               */
/* ---------------------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.pagination__link,
.pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    background: var(--color-card-bg);
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.pagination__link:hover,
.pagination__page:hover { border-color: var(--color-teal); color: var(--color-navy); }

.pagination__page--current {
    background: var(--color-navy);
    border-color: var(--color-navy);
    color: #fff;
}

.pagination__link--disabled {
    color: var(--color-text-secondary);
    opacity: 0.5;
    cursor: default;
}

.pagination__pages { display: flex; gap: 8px; flex-wrap: wrap; }

.pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 40px;
    color: var(--color-text-secondary);
    font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */

.site-footer {
    background: var(--color-navy);
    margin-top: 64px;
    padding: 32px 0;
}

.site-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.site-footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: 0;
}

.site-footer__nav { display: flex; gap: 20px; }

.site-footer__nav a { color: rgba(255, 255, 255, 0.75); font-size: 0.85rem; }
.site-footer__nav a:hover { color: var(--color-teal); }

/* ---------------------------------------------------------------------- */
/* Misc                                                                     */
/* ---------------------------------------------------------------------- */

.empty-state {
    color: var(--color-text-secondary);
    background: var(--color-card-bg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
}

.not-found { text-align: center; padding: 96px 0; }
.not-found h1 { font-size: 4rem; margin: 0; color: var(--color-navy); font-family: var(--font-mono); }

/* ---------------------------------------------------------------------- */
/* Responsive                                                               */
/* ---------------------------------------------------------------------- */

@media (max-width: 900px) {
    .post-grid,
    .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .post-grid,
    .category-grid { grid-template-columns: 1fr; }

    .site-header__inner {
        flex-wrap: wrap;
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 10px;
    }

    .site-header__right {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 10px;
    }

    .site-nav { gap: 14px; }

    .site-search {
        flex: 1 1 100%;
        order: 3;
    }
    .site-search input { width: auto; flex-grow: 1; min-width: 0; }

    .hero { padding: 64px 0 72px; }
    .hero__title { font-size: 2rem; }

    .section__header { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Pagination: drop the first/last page number and its "…" on small
       screens, leaving just Previous, the 3-number core, and Next. */
    .pagination__page--edge { display: none; }
}
