:root {
    --dark: #2c2c25;
    --muted: #6a6a6a;
    --teal: #00A499;
    --teal-light: #9CDBD9;
    --white: #ffffff;
    --soft: #faf9f5;
}

/* ============================================================
   BASE TYPOGRAPHY & SECTION SHELL
   ============================================================ */

section {
    width: 100%;
    padding: 48px 20px;
    text-align: center;
}

section > * {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

section:nth-of-type(even) {
    background: var(--soft);
}

h1, h2, h3 {
    font-weight: 800;
    color: var(--dark);
}

p, li {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--muted);
}

@media (min-width: 768px) {
    section {
        padding: 60px 32px;
    }

    p, li {
        font-size: 1.05rem;
    }
}

@media (min-width: 1024px) {
    section {
        padding: 70px 32px;
    }
}

/* ============================================================
   SHARED SECTION LABELS
   ============================================================ */

.nc-section-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
    margin-bottom: 0.5rem;
}

.nc-section-intro {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .nc-section-intro {
        margin-bottom: 2.5rem;
    }
}

/* ============================================================
   CTA BUTTONS
   ============================================================ */

.nc-cta {
    display: inline-block;
    padding: 12px 24px;
    background: var(--teal);
    color: var(--white);
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.25s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.nc-cta:hover {
    background: var(--teal-light);
}

.nc-cta--outline {
    background: transparent;
    color: var(--teal);
    border: 2px solid var(--teal);
}

.nc-cta--outline:hover {
    background: var(--teal);
    color: var(--white);
}

@media (min-width: 768px) {
    .nc-cta {
        padding: 14px 30px;
    }
}

/* ============================================================
   TAGS
   ============================================================ */

.nc-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.nc-tag--system   { background: var(--teal-light); color: var(--dark); }
.nc-tag--type     { background: #e8f5e9; color: #2e7d32; }
.nc-tag--topic    { background: #f3eefb; color: #6a3aa8; }
.nc-tag--neurolens { background: #eef3fb; color: #3a5fa8; }
.nc-tag--author-type { background: #fef6e6; color: #a87b00; font-size: 0.72rem; }

/* ============================================================
   SECTION 2 — FEATURED ARTICLES
   Mobile: 1 col → md: 2 col → lg: 3 col
   ============================================================ */

.nc-featured {
    background: var(--white);
}

.nc-article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    text-align: left;
}

.nc-article-card {
    border: 1px solid #e0e0d8;
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    display: flex;
    flex-direction: column;
}

.nc-article-card__image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--teal-light);
    flex-shrink: 0;
}

.nc-article-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nc-article-card__body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--white);
}

.nc-article-card__tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.nc-article-card__title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.nc-article-card__excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.nc-article-card__reading-time {
    color: #aaa;
    font-size: 0.82rem;
    white-space: nowrap;
}

.nc-article-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: auto;
    padding-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.nc-article-card__author-sep {
    color: #ccc;
    align-self: center;
}

.nc-article-card__body .nc-cta {
    display: block;
    text-align: center;
}

.nc-no-articles {
    color: var(--muted);
    font-style: italic;
    padding: 2rem 0;
}

@media (min-width: 768px) {
    .nc-article-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .nc-article-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   SECTION 3 — SEARCH & FILTER
   ============================================================ */

.nc-filters-section {
    background: var(--white);
}

/* Search row: stacked on mobile, side-by-side on md+ */
.nc-search-row {
    max-width: 1100px;
    margin: 0 auto 24px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nc-search-bar {
    flex: 1;
}

.nc-search-bar input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid rgba(0, 164, 153, 0.3);
    font-size: 1rem;
    font-size: 16px; /* prevent iOS zoom */
    box-sizing: border-box;
}

.nc-sort {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nc-sort__label {
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
}

.nc-sort__select {
    flex: 1;
    padding: 12px 36px 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 164, 153, 0.3);
    font-size: 0.95rem;
    color: var(--dark);
    background: var(--white);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236a6a6a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.nc-sort__select:focus {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

@media (min-width: 768px) {
    .nc-search-row {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        margin-bottom: 30px;
    }

    .nc-sort {
        flex-shrink: 0;
    }

    .nc-sort__select {
        flex: unset;
    }
}

/* Filter actions (Select All button) */
.nc-filter-actions {
    max-width: 1100px;
    margin: 0 auto 12px;
    display: flex;
    justify-content: flex-end;
}

.nc-toggle-all-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--teal);
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nc-toggle-all-btn:hover { color: var(--dark); }

.nc-toggle-all-btn:focus {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Filter grid: 1 col → sm: 2 col → lg: 4 col */
.nc-filter-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.nc-filter-block h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: var(--dark);
    text-align: left;
}

@media (min-width: 480px) {
    .nc-filter-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .nc-filter-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 26px;
    }
}

/* ============================================================
   DROPDOWN COMPONENT
   ============================================================ */

.nc-dropdown {
    position: relative;
    width: 100%;
}

.nc-dropdown__trigger {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 164, 153, 0.3);
    font-size: 0.95rem;
    color: var(--muted);
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
}

.nc-dropdown__trigger:focus {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.nc-dropdown__chevron {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--muted);
    transition: transform 0.2s ease;
}

.nc-dropdown.is-open .nc-dropdown__chevron {
    transform: rotate(180deg);
}

.nc-dropdown__panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid rgba(0, 164, 153, 0.3);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    padding: 6px 0;
    text-align: left;
}

.nc-dropdown.is-open .nc-dropdown__panel {
    display: block;
}

.nc-dropdown__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.92rem;
    color: var(--dark);
    transition: background 0.15s ease;
    user-select: none;
}

.nc-dropdown__option:hover {
    background: rgba(0, 164, 153, 0.08);
}

.nc-dropdown__option input[type="checkbox"] {
    display: none;
}

.nc-checkbox-mark {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border: 2px solid rgba(0, 164, 153, 0.4);
    border-radius: 3px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.nc-dropdown__option.is-checked .nc-checkbox-mark,
.nc-cascade__parent-label.is-checked .nc-checkbox-mark {
    background: var(--teal);
    border-color: var(--teal);
}

.nc-dropdown__option.is-checked .nc-checkbox-mark::after,
.nc-cascade__parent-label.is-checked .nc-checkbox-mark::after {
    content: '';
    display: block;
    width: 4px;
    height: 8px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.nc-cascade__parent-label.is-indeterminate .nc-checkbox-mark {
    background: var(--teal);
    border-color: var(--teal);
}

.nc-cascade__parent-label.is-indeterminate .nc-checkbox-mark::after {
    content: '';
    display: block;
    width: 8px;
    height: 2px;
    background: white;
    margin: auto;
}

/* Cascade accordion */
.nc-cascade__group-header {
    display: flex;
    align-items: center;
}

.nc-cascade__parent-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--dark);
    user-select: none;
    transition: background 0.15s ease;
    text-align: left;
}

.nc-cascade__parent-label:hover {
    background: rgba(0, 164, 153, 0.08);
}

.nc-cascade__toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: var(--muted);
}

.nc-cascade__toggle-btn:focus {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

.nc-cascade__group-arrow {
    font-size: 0.6rem;
    color: var(--muted);
    transition: transform 0.2s ease;
    display: block;
}

.nc-cascade__group.is-open .nc-cascade__group-arrow {
    transform: rotate(90deg);
}

.nc-cascade__subs {
    display: none;
}

.nc-cascade__group.is-open .nc-cascade__subs {
    display: block;
}

.nc-cascade__subs .nc-dropdown__option {
    padding-left: 28px;
}

/* ============================================================
   RESULTS LIST
   Mobile: image on top, stacked → md: image on left, horizontal
   ============================================================ */

.nc-results {
    max-width: 1100px;
    margin: 2.5rem auto 0;
    text-align: left;
}

.nc-results--loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s;
}

.nc-results__count {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.nc-list-item {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0d8;
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    margin-bottom: 1rem;
}

.nc-list-item__image {
    width: 100%;
    height: 180px;
    flex-shrink: 0;
    overflow: hidden;
}

.nc-list-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nc-list-item__body {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.nc-list-item__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.nc-list-item__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

.nc-list-item__excerpt {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--muted);
    margin: 0;
}

.nc-list-item__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: auto;
}

.nc-list-item__action {
    padding: 0 1rem 1rem;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nc-list-item--hidden {
    display: none;
}

.nc-load-more-wrap {
    text-align: center;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .nc-list-item {
        flex-direction: row;
        align-items: center;
        gap: 1.25rem;
        padding: 0;
    }

    .nc-list-item__image {
        width: 180px;
        min-width: 180px;
        height: 130px;
    }

    .nc-list-item__body {
        padding: 1rem 0.75rem 1rem 0;
    }

    .nc-list-item__action {
        padding: 1rem;
        flex-direction: column;
        justify-content: flex-end;
        align-self: stretch;
        align-items: center;
    }
}

/* ============================================================
   SECTION 4 — CONTRIBUTE
   ============================================================ */

.nc-contribute {
    background: var(--soft);
}

/* Ecosystem split reused in contribute section */
.nc-ecosystem__subtitle {
    max-width: 780px;
    margin: 0 auto 32px;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-weight: 600;
    color: var(--muted);
    text-align: center;
}

.nc-ecosystem__inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto 40px;
}

.nc-ecosystem__content {
    flex: 1;
    text-align: left;
    background: var(--soft);
    border: 2px solid var(--teal);
    border-radius: 14px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.nc-ecosystem__intro {
    font-size: 1rem;
    margin: 0 0 16px;
    color: var(--muted);
    line-height: 1.7;
}

.nc-ecosystem__img {
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    min-height: 240px;
}

.nc-ecosystem__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 1024px) {
    .nc-ecosystem__inner {
        flex-direction: row;
        gap: 3rem;
        align-items: stretch;
    }

    .nc-ecosystem__content {
        padding: 3.5rem;
    }

    .nc-ecosystem__img {
        flex: 1.3;
        min-height: unset;
    }

    .nc-ecosystem__intro {
        font-size: 1.1rem;
    }
}

/* Contribute cards: 1 col → md: 2 col → lg: 3 col */
.nc-contribute-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto 40px;
    text-align: left;
}

.nc-contribute-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.nc-contribute-card h3 {
    font-size: 1.05rem;
    color: var(--dark);
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0, 164, 153, 0.25);
}

.nc-contribute-card p {
    color: var(--muted);
    margin-bottom: 10px;
    line-height: 1.6;
}

.nc-contribute-card ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    flex-grow: 1;
}

.nc-contribute-card li {
    margin-bottom: 8px;
    color: var(--muted);
}

.nc-contribute-ctas {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .nc-contribute-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }

    .nc-contribute-ctas {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (min-width: 1024px) {
    .nc-contribute-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   DOT LIST
   ============================================================ */

.nc-dot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nc-dot-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 10px;
}

.nc-dot-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin-top: 2px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.nc-dot-list li:hover .nc-dot-icon {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.nc-dot-list li span {
    flex: 1;
    line-height: 1.6;
}

/* ============================================================
   FADE DIVIDER
   ============================================================ */

.nc-fade-divider {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1100px;
    margin: 2rem auto;
}

.nc-fade-divider__line {
    flex: 1;
    height: 2px;
}

.nc-fade-divider__line:first-child {
    background: linear-gradient(to left, transparent, var(--teal));
}

.nc-fade-divider__line:last-child {
    background: linear-gradient(to right, transparent, var(--teal));
}

/* ============================================================
   SECTION 5 — STAY CONNECTED
   Mobile: 1 col → md: 2 col
   ============================================================ */

.nc-connected {
    background: var(--white);
    padding: 60px 20px;
}

.nc-connected .nc-section-title {
    margin-bottom: 2rem;
}

.nc-connected-boxes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.nc-connected-box {
    border: 1px solid #e0e0d8;
    border-top: 4px solid var(--teal);
    border-radius: 10px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
}

.nc-connected-box__title {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.nc-connected-box p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
    flex-grow: 1;
}

@media (min-width: 768px) {
    .nc-connected {
        padding: 100px 32px;
    }

    .nc-connected .nc-section-title {
        margin-bottom: 3rem;
    }

    .nc-connected-boxes {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .nc-connected-box {
        padding: 2rem;
    }
}
