/* ============================================================
   DustBot.org — Circuit Board Theme (cb-)
   Main Stylesheet
   ============================================================ */

/* ─── Header ─── */
.cb-header {
    background: var(--cb-charcoal);
    position: sticky;
    top: 0;
    z-index: 100;
}
.cb-header__inner {
    max-width: var(--cb-container);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 64px;
}
.cb-logo {
    font-family: var(--cb-font-mono);
    color: var(--cb-primary);
    font-size: 22px;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.cb-logo__img {
    height: 36px;
    width: auto;
    display: block;
}
.cb-logo span { color: var(--cb-muted); }
.cb-logo:hover { color: var(--cb-primary); text-decoration: none; }

.cb-nav ul {
    display: flex;
    gap: 32px;
    list-style: none;
}
.cb-nav a,
.cb-nav .menu-item a {
    color: var(--cb-nav-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.3px;
}
.cb-nav a:hover,
.cb-nav .current-menu-item a,
.cb-nav .current-menu-ancestor a {
    color: var(--cb-white);
    text-decoration: none;
}
.cb-nav .current-menu-item a {
    border-bottom: 2px solid var(--cb-primary);
    padding-bottom: 4px;
}

/* Search in header */
.cb-search-form { display: flex; }
.cb-search-form__input {
    background: var(--cb-charcoal-light);
    border: none;
    color: var(--cb-nav-text);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    width: 200px;
    font-family: var(--cb-font-body);
}
.cb-search-form__input::placeholder { color: var(--cb-slate-light); }
.cb-search-form__input:focus {
    outline: 1px solid var(--cb-primary);
    color: var(--cb-white);
}

/* Mobile nav toggle */
.cb-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.cb-nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--cb-nav-text);
    margin: 5px 0;
    transition: 0.3s;
}

/* ─── Hero ─── */
.cb-hero {
    background: linear-gradient(to right, rgba(30,30,30,0.92) 40%, rgba(30,30,30,0.55) 100%),
                url('../img/hero.jpg') center/cover no-repeat;
    padding: 80px 24px;
    position: relative;
    overflow: hidden;
}
.cb-hero__inner {
    max-width: var(--cb-container);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.cb-hero__badge {
    font-family: var(--cb-font-mono);
    font-size: 12px;
    color: var(--cb-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}
.cb-hero h1 {
    font-family: var(--cb-font-heading);
    font-size: 48px;
    color: var(--cb-white);
    line-height: 1.2;
    max-width: 640px;
    margin-bottom: 16px;
    font-weight: 400;
}
.cb-hero__text,
.cb-hero__text p {
    color: var(--cb-muted);
    font-size: 18px;
    max-width: 540px;
    line-height: 1.6;
    margin-bottom: 32px;
}
.cb-hero__cta {
    display: inline-block;
    background: var(--cb-primary);
    color: var(--cb-white);
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}
.cb-hero__cta:hover { background: #00796B; color: var(--cb-white); text-decoration: none; }

/* ─── Sections ─── */
.cb-section {
    max-width: var(--cb-container);
    margin: 0 auto;
    padding: 64px 24px;
}
.cb-section--no-top { padding-top: 0; }
.cb-section__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 32px;
}
.cb-section__title {
    font-family: var(--cb-font-heading);
    font-size: 28px;
    font-weight: 400;
    color: var(--cb-text);
}
.cb-section__link {
    color: var(--cb-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.cb-section__link:hover { text-decoration: underline; }

/* ─── Grid Layouts ─── */
.cb-grid { display: grid; gap: 24px; }
.cb-grid--3 { grid-template-columns: repeat(3, 1fr); }
.cb-grid--2 { grid-template-columns: repeat(2, 1fr); }

/* ─── Cards ─── */
.cb-card {
    background: var(--cb-white);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.cb-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.cb-card__img {
    width: 100%;
    height: 180px;
    overflow: hidden;
}
.cb-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cb-card__img--placeholder {
    background: linear-gradient(135deg, var(--cb-mint) 0%, #B2DFDB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cb-primary);
    font-size: 48px;
}
.cb-card__body { padding: 20px; }
.cb-card__title {
    font-family: var(--cb-font-heading);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 8px;
}
.cb-card__title a { color: var(--cb-text); text-decoration: none; }
.cb-card__title a:hover { color: var(--cb-primary); }
.cb-card__excerpt {
    font-size: 14px;
    color: var(--cb-slate);
    line-height: 1.6;
}
.cb-card__meta { margin-top: 12px; }

/* ─── Tags ─── */
.cb-tag {
    font-family: var(--cb-font-mono);
    font-size: 11px;
    color: var(--cb-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    background: var(--cb-mint);
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
}
.cb-tag--link:hover {
    background: var(--cb-primary);
    color: var(--cb-white);
    text-decoration: none;
}

/* ─── Meta ─── */
.cb-meta {
    font-size: 12px;
    color: var(--cb-muted);
    font-family: var(--cb-font-mono);
}

/* ─── Featured Article ─── */
.cb-featured {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 32px;
    margin-bottom: 48px;
    background: var(--cb-white);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius);
    overflow: hidden;
}
.cb-featured__img {
    min-height: 320px;
    overflow: hidden;
}
.cb-featured__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cb-featured__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--cb-charcoal) 0%, var(--cb-charcoal-light) 50%, var(--cb-primary) 100%);
    color: var(--cb-mint);
    font-size: 72px;
}
.cb-featured__body {
    padding: 40px 32px 40px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.cb-featured__title {
    font-family: var(--cb-font-heading);
    font-size: 28px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 12px;
}
.cb-featured__title a { color: var(--cb-text); text-decoration: none; }
.cb-featured__title a:hover { color: var(--cb-primary); }
.cb-featured__excerpt {
    font-size: 15px;
    color: var(--cb-slate);
    line-height: 1.6;
}

/* ─── Robot Cards ─── */
.cb-robot-card {
    background: var(--cb-white);
    border: 1px solid var(--cb-border);
    border-radius: var(--cb-radius);
    padding: 24px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: box-shadow 0.2s;
}
.cb-robot-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.cb-robot-card__icon {
    width: 72px;
    height: 72px;
    background: var(--cb-mint);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    flex-shrink: 0;
    overflow: hidden;
}
.cb-robot-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}
.cb-robot-card__info h3 {
    font-family: var(--cb-font-heading);
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 4px;
}
.cb-robot-card__info h3 a { color: var(--cb-text); text-decoration: none; }
.cb-robot-card__info h3 a:hover { color: var(--cb-primary); }
.cb-robot-card__meta {
    font-size: 13px;
    color: var(--cb-slate-light);
}

/* Robot Status Badge */
.cb-robot-status {
    font-family: var(--cb-font-mono);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    display: inline-block;
    margin-top: 6px;
}
.cb-robot-status--historical { background: #FFF3E0; color: #E65100; }
.cb-robot-status--active { background: var(--cb-mint); color: #00695C; }
.cb-robot-status--prototype { background: #E8EAF6; color: #283593; }

/* ─── Research Section ─── */
.cb-research-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--cb-border);
}
.cb-research-item:last-child { border-bottom: none; }
.cb-research-item__title {
    font-family: var(--cb-font-heading);
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 4px;
}
.cb-research-item__title a { color: var(--cb-text); text-decoration: none; }
.cb-research-item__title a:hover { color: var(--cb-primary); }
.cb-research-item__authors {
    font-size: 13px;
    color: var(--cb-slate-light);
    margin-bottom: 4px;
}
.cb-research-item__venue {
    font-family: var(--cb-font-mono);
    font-size: 12px;
    color: var(--cb-primary);
}

/* ─── About Bar ─── */
.cb-about-bar {
    background: var(--cb-mint);
    padding: 48px 24px;
}
.cb-about-bar__inner {
    max-width: var(--cb-container);
    margin: 0 auto;
    display: flex;
    gap: 32px;
    align-items: center;
}
.cb-about-bar__avatar {
    width: 80px;
    height: 80px;
    background: var(--cb-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cb-white);
    font-family: var(--cb-font-heading);
    font-size: 32px;
    flex-shrink: 0;
}
.cb-about-bar__text h3 {
    font-family: var(--cb-font-heading);
    font-size: 20px;
    font-weight: 400;
    margin-bottom: 4px;
    color: var(--cb-text);
}
.cb-about-bar__text p {
    font-size: 14px;
    color: var(--cb-slate);
    line-height: 1.6;
}

/* ─── Footer ─── */
.cb-footer {
    background: var(--cb-charcoal);
    color: var(--cb-muted);
    padding: 48px 24px;
}
.cb-footer__inner {
    max-width: var(--cb-container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}
.cb-footer h4 {
    color: var(--cb-white);
    font-family: var(--cb-font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    font-weight: 500;
}
.cb-footer p {
    font-size: 14px;
    line-height: 1.6;
}
.cb-footer ul { list-style: none; }
.cb-footer ul li { margin-bottom: 8px; }
.cb-footer a,
.cb-footer ul a {
    color: var(--cb-muted);
    text-decoration: none;
    font-size: 14px;
}
.cb-footer a:hover { color: var(--cb-white); text-decoration: none; }
.cb-footer__bottom {
    max-width: var(--cb-container);
    margin: 24px auto 0;
    padding-top: 24px;
    border-top: 1px solid var(--cb-charcoal-light);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
}

/* ─── Article Layout (single.php) ─── */
.cb-article__layout {
    max-width: var(--cb-container);
    margin: 0 auto;
    padding: 48px 24px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 48px;
}
.cb-article__header { margin-bottom: 32px; }
.cb-article__header h1 {
    font-size: 36px;
    color: var(--cb-text);
    margin-bottom: 12px;
}
.cb-article__meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.cb-article__thumbnail {
    margin-bottom: 32px;
    border-radius: var(--cb-radius);
    overflow: hidden;
}
.cb-article__thumbnail img { width: 100%; height: auto; display: block; }
.cb-article__tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--cb-border);
}
.cb-article__nav {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--cb-border);
}
.cb-article__nav .nav-links {
    display: flex;
    justify-content: space-between;
}
.cb-article__nav .nav-previous a,
.cb-article__nav .nav-next a {
    color: var(--cb-text);
    text-decoration: none;
    display: flex;
    flex-direction: column;
}
.cb-article__nav .nav-previous a:hover,
.cb-article__nav .nav-next a:hover { color: var(--cb-primary); }

/* ─── Prose (article content) ─── */
.cb-prose h2 { font-size: 28px; margin-top: 48px; margin-bottom: 16px; color: var(--cb-text); }
.cb-prose h3 { font-size: 22px; margin-top: 32px; margin-bottom: 12px; color: var(--cb-text); }
.cb-prose h4 { font-size: 18px; margin-top: 24px; margin-bottom: 8px; color: var(--cb-text); }
.cb-prose p { margin-bottom: 16px; line-height: 1.7; }
.cb-prose ul, .cb-prose ol { margin-bottom: 16px; padding-left: 24px; }
.cb-prose li { margin-bottom: 8px; }
.cb-prose blockquote {
    border-left: 3px solid var(--cb-primary);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--cb-mint);
    border-radius: 0 var(--cb-radius) var(--cb-radius) 0;
}
.cb-prose code {
    font-family: var(--cb-font-mono);
    font-size: 14px;
    background: var(--cb-mint);
    padding: 2px 6px;
    border-radius: 3px;
}
.cb-prose pre {
    background: var(--cb-charcoal);
    color: var(--cb-mint);
    padding: 20px;
    border-radius: var(--cb-radius);
    overflow-x: auto;
    margin-bottom: 24px;
}
.cb-prose pre code { background: none; padding: 0; color: inherit; }
.cb-prose img {
    border-radius: var(--cb-radius);
    margin: 24px 0;
}
.cb-prose table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}
.cb-prose th, .cb-prose td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cb-border);
    text-align: left;
}
.cb-prose th {
    font-family: var(--cb-font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cb-slate-light);
}

/* ─── Sidebar ─── */
.cb-sidebar { position: sticky; top: 88px; }
.cb-widget { margin-bottom: 32px; }
.cb-widget__title {
    font-family: var(--cb-font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--cb-slate-light);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--cb-primary);
}

/* Table of Contents */
.cb-toc__nav a {
    display: block;
    padding: 4px 0;
    font-size: 14px;
    color: var(--cb-slate);
    text-decoration: none;
    border-left: 2px solid var(--cb-border);
    padding-left: 12px;
    transition: border-color 0.2s, color 0.2s;
}
.cb-toc__nav a:hover,
.cb-toc__nav a.cb-toc--active {
    color: var(--cb-primary);
    border-left-color: var(--cb-primary);
}
.cb-toc__nav a[data-level="3"] { padding-left: 24px; font-size: 13px; }

/* Related Articles */
.cb-related__list { list-style: none; }
.cb-related__list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--cb-border);
}
.cb-related__list li:last-child { border-bottom: none; }
.cb-related__list a {
    color: var(--cb-text);
    font-size: 14px;
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
}
.cb-related__list a:hover { color: var(--cb-primary); }

/* ─── Robot Profile (single-robot.php) ─── */
.cb-robot-profile { padding: 48px 0; }
.cb-robot-profile__header {
    display: flex;
    gap: 24px;
    align-items: center;
    margin-bottom: 32px;
}
.cb-robot-profile__icon {
    width: 80px;
    height: 80px;
    background: var(--cb-mint);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    flex-shrink: 0;
}
.cb-robot-profile__header h1 {
    font-size: 36px;
    color: var(--cb-text);
    margin-bottom: 8px;
}
.cb-robot-profile__image {
    margin-bottom: 32px;
    border-radius: var(--cb-radius);
    overflow: hidden;
}
.cb-robot-profile__image img { width: 100%; display: block; }
.cb-robot-profile__specs { margin-bottom: 32px; }
.cb-robot-profile__specs h2 {
    font-size: 22px;
    color: var(--cb-text);
    margin-bottom: 16px;
}
.cb-specs-table {
    width: 100%;
    border-collapse: collapse;
}
.cb-specs-table th,
.cb-specs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--cb-border);
    text-align: left;
}
.cb-specs-table th {
    font-family: var(--cb-font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cb-slate-light);
    width: 180px;
}
.cb-robot-profile__taxonomies {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cb-robot-profile__tax { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cb-robot-profile__content { margin-bottom: 48px; }
.cb-robot-profile__nav {
    padding-top: 24px;
    border-top: 1px solid var(--cb-border);
}

/* ─── Page / Legal ─── */
.cb-page { padding: 64px 0; }
.cb-page__thumbnail { margin-bottom: 32px; border-radius: 8px; overflow: hidden; }
.cb-page__thumbnail img { width: 100%; height: auto; display: block; }
.cb-page__article h1,
.cb-legal__article h1 {
    font-size: 36px;
    color: var(--cb-text);
    margin-bottom: 32px;
}
.cb-legal { padding: 64px 0; }
.cb-legal__updated {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--cb-border);
    color: var(--cb-slate-light);
}

/* ─── 404 ─── */
.cb-404 { padding: 80px 0; text-align: center; }
.cb-404__icon { font-size: 64px; margin-bottom: 16px; }
.cb-404 h1 {
    font-family: var(--cb-font-mono);
    font-size: 72px;
    color: var(--cb-primary);
    margin-bottom: 8px;
}
.cb-404 h2 {
    font-size: 28px;
    color: var(--cb-text);
    margin-bottom: 16px;
}
.cb-404 p { color: var(--cb-slate); margin-bottom: 24px; }
.cb-404__search { margin-bottom: 24px; }
.cb-404__search .cb-search-form__input {
    background: var(--cb-white);
    border: 1px solid var(--cb-border);
    color: var(--cb-text);
    width: 320px;
    max-width: 100%;
    padding: 12px 20px;
    border-radius: 6px;
}

/* ─── Buttons ─── */
.cb-btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: var(--cb-primary);
    color: var(--cb-white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s;
}
.cb-btn:hover { background: #00796B; color: var(--cb-white); text-decoration: none; }

/* ─── Pagination ─── */
.cb-pagination { margin-top: 48px; text-align: center; }
.cb-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.cb-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--cb-border);
    border-radius: 6px;
    color: var(--cb-text);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}
.cb-pagination .page-numbers:hover { background: var(--cb-mint); }
.cb-pagination .page-numbers.current {
    background: var(--cb-primary);
    color: var(--cb-white);
    border-color: var(--cb-primary);
}

/* ─── Archive Header ─── */
.cb-archive__header { margin-bottom: 32px; }
.cb-archive__header h1 { font-size: 36px; color: var(--cb-text); }
.cb-archive__desc {
    color: var(--cb-slate);
    font-size: 16px;
    margin-top: 8px;
    max-width: 640px;
}

.cb-no-results { color: var(--cb-slate); text-align: center; padding: 48px 0; }

/* ─── WP Alignment Classes ─── */
.alignleft { float: left; margin-right: 24px; margin-bottom: 16px; }
.alignright { float: right; margin-left: 24px; margin-bottom: 16px; }
.aligncenter { display: block; margin: 24px auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--cb-slate-light); text-align: center; margin-top: 8px; }

/* ============================================================
   Responsive Breakpoints
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
    .cb-article__layout {
        grid-template-columns: 1fr;
    }
    .cb-sidebar {
        position: static;
        border-top: 1px solid var(--cb-border);
        padding-top: 32px;
    }
    .cb-footer__inner {
        grid-template-columns: 1fr 1fr;
    }
    .cb-featured {
        grid-template-columns: 1fr;
    }
    .cb-featured__body {
        padding: 24px;
    }
}

/* Tablet Small */
@media (max-width: 768px) {
    .cb-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .cb-grid--2 { grid-template-columns: 1fr; }
    .cb-hero h1 { font-size: 36px; }
    .cb-hero { padding: 60px 24px; }
    .cb-section { padding: 40px 24px; }
    .cb-about-bar__inner { flex-direction: column; text-align: center; }

    /* Show mobile nav toggle */
    .cb-nav-toggle { display: block; }
    .cb-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--cb-charcoal);
        padding: 16px 24px;
        border-top: 1px solid var(--cb-charcoal-light);
    }
    .cb-nav--open { display: block; }
    .cb-nav ul {
        flex-direction: column;
        gap: 12px;
    }
    .cb-header .cb-search-form { display: none; }
    .cb-header__inner { position: relative; }
}

/* Mobile */
@media (max-width: 480px) {
    .cb-grid--3 { grid-template-columns: 1fr; }
    .cb-hero h1 { font-size: 28px; }
    .cb-section__header { flex-direction: column; gap: 8px; }
    .cb-footer__inner { grid-template-columns: 1fr; }
    .cb-footer__bottom { flex-direction: column; gap: 8px; }
    .cb-featured__title { font-size: 22px; }
    .cb-article__header h1 { font-size: 28px; }
}
