/* --------------------------------------------------
   Base Styles & Variables
-------------------------------------------------- */
:root {
    --bg: #ffffff;
    --text: #222222;
    --subtext: #555555;
    --accent: #0066ff;
    --accent-hover: #004fcc;
    --card-bg: #f7f9fc;
    --border: #e3e6ea;
    --radius: 10px;
    --max-width: 1200px;
    --transition: 0.25s ease;
    --shadow: 0 4px 12px rgba(0,0,0,0.06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --text: #f1f1f1;
        --subtext: #c7c7c7;
        --card-bg: #1a1d22;
        --border: #2a2d33;
        --shadow: 0 4px 14px rgba(0,0,0,0.4);
    }
}

/* --------------------------------------------------
   Layout Containers
-------------------------------------------------- */
section.hub-categories {
    padding: 0;
    margin: auto;
    background-color: var(--green);
}

h1, h2, h3, h4 {
    margin-top: 0;
    margin: 24px 0 8px;
    font: 700 30px Georgia, serif;
}

h2 {
    font: 700 clamp(26px, 2.8vw, 30px) / 1.05 Georgia, serif;
    letter-spacing: -.035em;
    color: #fff;
}

h3{
    font-size:22px;
}

h4 {
    font-size: 20px;
    margin-top:0;
}

summary h4{
    display:inline;
    text-decoration:underline;
}

summary{
    padding-bottom:10px;
}
/* --------------------------------------------------
   Hero Section
-------------------------------------------------- */
.hub-hero {
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 7% 10%, rgba(149, 186, 54, .18), transparent 25%), radial-gradient(circle at 92% 85%, rgba(231, 174, 88, .2), transparent 26%), linear-gradient(135deg, #faf8f1, #edf2e6);
    border-bottom: 1px solid rgba(25, 67, 46, .1);
    padding: 30px 0;
}

    .hub-hero .hero-content {
        margin: auto;
    }

.hero-cta {
    height: 48px;
    padding: 0 23px;
    border: 0;
    border-radius: 11px;
    background: var(--green);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    display:inline-block;
    line-height:48px;
    text-decoration:none;
}

    .hero-cta:hover {
        background: #e9eefc;
    }

/* --------------------------------------------------
   Category Grid
-------------------------------------------------- */
.category-grid {
    display: grid;
    gap: 24px;
    margin-top: 30px;
}

@media (min-width: 700px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1000px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.category-card {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position:relative;
}

    .category-card h3 {
        margin-bottom: 10px;
    }

    .category-card p {
        margin-bottom: 1.4rem;
    }

.category-link {
    display: block;
    position: absolute;
    bottom: 20px;
    color: var(--green);
    font-size: 12px;
    font-weight: bold;
}

    .category-link:hover {
        color: var(--accent-hover);
    }

/* --------------------------------------------------
   Featured Guides Grid
-------------------------------------------------- */
section.featured-guides {
    background: var(--paper);
}

    section.featured-guides h2 {
        color: var(--ink);
    }

.featured-grid {
    display: grid;
    gap: 24px;
    margin-top: 30px;
}

@media (min-width: 800px) {
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.featured-card {
    background: var(--lime);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    position:relative;
}

    .featured-card  p{
        padding-bottom:25px;
    }

.featured-link {
    display: block;
    position: relative;
    color: var(--ink);
    text-decoration:none;
}

    .featured-link:hover {
        color: #000;
    }

.more-link {
    position: absolute;
    display: block;
    bottom: 0;
    color: var(--green);
    font-size: 12px;
    font-weight: bold;
}

/* --------------------------------------------------
   Newsletter Section
-------------------------------------------------- */
.hub-newsletter {
    text-align: center;
}

.newsletter-form {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

    .newsletter-form input {
        padding: 12px;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        font-size: 16px;
    }

    .newsletter-form button {
        padding: 12px;
        background: var(--accent);
        color: #fff;
        border: none;
        border-radius: var(--radius);
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: var(--transition);
    }

        .newsletter-form button:hover {
            background: var(--accent-hover);
        }

/* --------------------------------------------------
   Utility Classes
-------------------------------------------------- */
.image-wrap{
    background-color:var(--paper);
}

.full-width {
    width: 100%;
}

.half-width {
    width: 49%;
    margin-right:1%;
    float:left;
}

@media (min-width: 768px) {

    .half-width {
        width: 49%;
        margin-right: 1%;
    }
}

.article-content figure {
    margin:0;
}

.article-content figcaption {
    padding: 10px;
}

.responsive-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.hub-about {
    background-color:#ece8dd;
}

    .hub-about h2 {
        color: var(--ink);
    }

.article-content{
    margin-top:-45px;
}

    .article-content h2 {
        color: var(--ink);
    }

/* Digital Logic educational guides */
.logic-guide {
    max-width: 920px;
    margin: 18px auto 48px;
    color: #d9e6ee;
}

.logic-guide .guide-hero,
.logic-guide .guide-section,
.logic-guide .guide-cta {
    margin-bottom: 18px;
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid rgba(103, 232, 249, .15);
    border-radius: 18px;
    background: #142f43;
    box-shadow: 0 16px 34px rgba(2, 12, 22, .2);
}

.logic-guide .guide-hero {
    background: radial-gradient(circle at 92% 8%, rgba(34, 211, 238, .16), transparent 32%), linear-gradient(145deg, #07111f, #12324a);
}

.logic-guide h1,
.logic-guide h2,
.logic-guide h3 {
    color: #f8fbff;
}

.logic-guide h1 {
    margin: 6px 0 14px;
    font: 700 clamp(2rem, 5vw, 3.6rem)/1.03 Georgia, serif;
}

.logic-guide h2 {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.logic-guide h3 {
    font-size: 1.2rem;
}

.logic-guide p,
.logic-guide li {
    color: #bfd0dc;
    line-height: 1.75;
}

.logic-guide .eyebrow,
.logic-guide a {
    color: #67e8f9;
}

.logic-guide .guide-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #91aabd;
    font-size: .9rem;
}

.logic-guide .guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.logic-guide .guide-card,
.logic-guide .logic-result {
    padding: 18px;
    border: 1px solid rgba(103, 232, 249, .14);
    border-radius: 12px;
    background: #0e2639;
}

.logic-guide table {
    width: 100%;
    border-collapse: collapse;
}

.logic-guide th,
.logic-guide td {
    padding: 9px;
    border: 1px solid #456075;
    text-align: center;
}

.logic-guide th {
    background: #0b2133;
    color: #a5f3fc;
}

.logic-guide code {
    color: #a5f3fc;
}

.logic-guide .guide-button {
    display: inline-flex;
    margin: 6px 8px 6px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: #0e7490;
    color: #fff;
    font-weight: 750;
    text-decoration: none;
}

.logic-guide .guide-button:hover {
    background: #0891b2;
}

.logic-guide .mistake {
    border-left: 4px solid #f59e0b;
}

.article-learning-link {
    margin: 24px 0;
    padding: 18px 20px;
    border: 1px solid var(--net-line, #b9cad8);
    border-radius: 12px;
    background: #e6eef4;
}

.article-learning-link h2 {
    margin-top: 0;
}

@media (max-width: 700px) {
    .logic-guide .guide-grid {
        grid-template-columns: 1fr;
    }
}
