/* ==========================================================================
   OnMSFT Template Styles
   ==========================================================================
   Covers: homepage (index), archive, category, search, page, 404, author,
   and the reusable content-card component.

   Agent 2 should enqueue this file in functions.php or merge into style.css:
     wp_enqueue_style( 'onmsft-templates', get_template_directory_uri() . '/css/templates.css', array(), '1.0' );
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design Tokens (inherit or define)
   -------------------------------------------------------------------------- */
:root {
    /* OnMSFT teal brand colors (replaces generic blue) */
    --onmsft-blue:       #217178;   /* OnMSFT Teal - primary brand accent */
    --onmsft-blue-dark:  #1a5b61;   /* Darker teal for hover states */
    --onmsft-blue-light: #e6f3f4;   /* Light teal tint for backgrounds */
    --onmsft-text:       #3a3a3a;   /* OnMSFT primary text color */
    --onmsft-text-muted: #6e6e6e;
    --onmsft-bg:         #fbfbfb;   /* OnMSFT alternate background */
    --onmsft-white:      #ffffff;
    --onmsft-border:     #e8e8e8;
    --onmsft-radius:     6px;
    --onmsft-radius-lg:  10px;
    --onmsft-shadow:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --onmsft-shadow-lg:  0 6.4px 14.4px 0 rgba(0,0,0,.132), 0 1.2px 3.6px 0 rgba(0,0,0,.108);
    --onmsft-transition: 0.25s cubic-bezier(.4,0,.2,1);
    --onmsft-container:  1200px;
    --onmsft-gap:        24px;
}

/* --------------------------------------------------------------------------
   Layout: Container
   -------------------------------------------------------------------------- */
.onmsft-container {
    max-width: var(--onmsft-container);
    margin-inline: auto;
    padding-inline: 20px;
}
.onmsft-container--narrow {
    max-width: 780px;
}

/* --------------------------------------------------------------------------
   Layout: Responsive Grid
   -------------------------------------------------------------------------- */
.onmsft-grid {
    display: grid;
    gap: var(--onmsft-gap);
}
.onmsft-grid--3col {
    grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 960px) {
    .onmsft-grid--3col {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .onmsft-grid--3col {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------------------------------------
   Section Header
   -------------------------------------------------------------------------- */
.onmsft-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--onmsft-border);
}
.onmsft-section-header__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--onmsft-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.onmsft-section-header__icon {
    color: var(--onmsft-blue);
}

/* ==========================================================================
   COMPONENT: Post Card (template-parts/content-card.php)
   ========================================================================== */
.onmsft-card {
    background: var(--onmsft-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--onmsft-border);
}
.onmsft-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}
.onmsft-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}
.onmsft-card__image-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--onmsft-bg);
}
.onmsft-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.onmsft-card:hover .onmsft-card__image {
    transform: scale(1.06);
}
.onmsft-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--onmsft-border);
}
.onmsft-card__badge {
    position: absolute;
    bottom: 0;
    left: 0;
    padding: 5px 14px;
    border-radius: 0 8px 0 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: var(--onmsft-blue);
    z-index: 1;
    backdrop-filter: blur(4px);
}
.onmsft-card__body {
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.onmsft-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px;
    color: var(--onmsft-text);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.onmsft-card:hover .onmsft-card__title {
    color: var(--onmsft-blue);
}
.onmsft-card__excerpt {
    font-size: 0.86rem;
    line-height: 1.6;
    color: var(--onmsft-text-muted);
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.onmsft-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--onmsft-text-muted);
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--onmsft-border);
}
.onmsft-card__author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.onmsft-card__avatar {
    border-radius: 50%;
    width: 22px;
    height: 22px;
}
.onmsft-card__sep {
    opacity: 0.3;
}

/* ==========================================================================
   HOMEPAGE — Hero
   ========================================================================== */
.onmsft-hero {
    padding: 32px 0;
    background: var(--onmsft-bg);
}
.onmsft-hero__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.onmsft-hero__inner {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 32px;
    background: var(--onmsft-white);
    border-radius: var(--onmsft-radius-lg);
    overflow: hidden;
    box-shadow: var(--onmsft-shadow-lg);
    transition: box-shadow var(--onmsft-transition);
}
.onmsft-hero__link:hover .onmsft-hero__inner {
    box-shadow: 0 14px 35px rgba(0,0,0,.12), 0 6px 14px rgba(0,0,0,.08);
}
.onmsft-hero__image-wrap {
    position: relative;
    overflow: hidden;
    min-height: 340px;
}
.onmsft-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--onmsft-transition);
}
.onmsft-hero__link:hover .onmsft-hero__image {
    transform: scale(1.03);
}
.onmsft-hero__image--placeholder {
    background: linear-gradient(135deg, var(--onmsft-blue-light), var(--onmsft-bg));
    width: 100%;
    height: 100%;
}
.onmsft-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 36px 36px 36px 0;
}
.onmsft-hero__badge {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    margin-bottom: 14px;
}
.onmsft-hero__title {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--onmsft-text);
    margin: 0 0 14px;
}
.onmsft-hero__excerpt {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--onmsft-text-muted);
    margin: 0 0 20px;
}
.onmsft-hero__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--onmsft-text-muted);
}
.onmsft-hero__avatar {
    border-radius: 50%;
    width: 32px;
    height: 32px;
}
.onmsft-hero__sep {
    opacity: 0.4;
}

@media (max-width: 768px) {
    .onmsft-hero__inner {
        grid-template-columns: 1fr;
    }
    .onmsft-hero__image-wrap {
        min-height: 220px;
        aspect-ratio: 16/9;
    }
    .onmsft-hero__content {
        padding: 24px;
    }
    .onmsft-hero__title {
        font-size: 1.4rem;
    }
}

/* ==========================================================================
   HOMEPAGE — Category Quick-Links Bar
   ========================================================================== */
.onmsft-categories-bar {
    background: var(--onmsft-white);
    border-bottom: 1px solid var(--onmsft-border);
    padding: 0;
}
.onmsft-categories-bar__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.onmsft-categories-bar__list::-webkit-scrollbar {
    display: none;
}
.onmsft-categories-bar__item {
    flex: none;
}
.onmsft-categories-bar__link {
    display: block;
    padding: 14px 22px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--onmsft-text-muted);
    border-bottom: 3px solid transparent;
    transition: color var(--onmsft-transition), border-color var(--onmsft-transition);
    white-space: nowrap;
}
.onmsft-categories-bar__link:hover {
    color: var(--cat-color, var(--onmsft-blue));
    border-bottom-color: var(--cat-color, var(--onmsft-blue));
}

/* ==========================================================================
   HOMEPAGE — Trending Section
   ========================================================================== */
.onmsft-trending {
    padding: 40px 0;
    background: var(--onmsft-white);
    border-bottom: 1px solid var(--onmsft-border);
}
.onmsft-trending__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
@media (max-width: 960px) {
    .onmsft-trending__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .onmsft-trending__grid {
        grid-template-columns: 1fr;
    }
}
.onmsft-trending__item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    border-radius: var(--onmsft-radius);
    text-decoration: none;
    color: inherit;
    transition: background var(--onmsft-transition);
}
.onmsft-trending__item:hover {
    background: var(--onmsft-bg);
}
.onmsft-trending__rank {
    font-size: 2rem;
    font-weight: 800;
    color: var(--onmsft-blue-light);
    line-height: 1;
    flex: none;
    min-width: 40px;
}
.onmsft-trending__body {
    flex: 1;
    min-width: 0;
}
.onmsft-trending__cat {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.onmsft-trending__title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 4px 0 6px;
    color: var(--onmsft-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.onmsft-trending__date {
    font-size: 0.75rem;
    color: var(--onmsft-text-muted);
}

/* ==========================================================================
   HOMEPAGE — Latest Posts Section
   ========================================================================== */
.onmsft-latest {
    padding: 48px 0 60px;
    background: var(--onmsft-bg);
}

/* ==========================================================================
   PAGINATION — Shared across all templates
   ========================================================================== */
.onmsft-pagination {
    margin-top: 48px;
    text-align: center;
}
.onmsft-pagination .page-numbers {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.onmsft-pagination .page-numbers li {
    display: inline-flex;
}
.onmsft-pagination .page-numbers a,
.onmsft-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--onmsft-radius);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--onmsft-text-muted);
    background: var(--onmsft-white);
    border: 1px solid var(--onmsft-border);
    transition: all var(--onmsft-transition);
}
.onmsft-pagination .page-numbers a:hover {
    color: var(--onmsft-blue);
    border-color: var(--onmsft-blue);
    background: var(--onmsft-blue-light);
}
.onmsft-pagination .page-numbers .current {
    color: #fff;
    background: var(--onmsft-blue);
    border-color: var(--onmsft-blue);
}
.onmsft-pagination .page-numbers .dots {
    border: none;
    background: none;
    min-width: auto;
    padding: 0 4px;
}

/* ==========================================================================
   ARCHIVE / CATEGORY — Header
   ========================================================================== */
.archive .site-content,
.search .site-content {
    padding-top: 0;
}
.onmsft-archive-header {
    padding: 56px 0 48px;
    background: linear-gradient(135deg, #1a2a2c 0%, #217178 60%, #159689 100%);
    text-align: left;
    position: relative;
    overflow: hidden;
}
.onmsft-archive-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(21, 150, 137, 0.3) 0%, transparent 60%);
    pointer-events: none;
}
.onmsft-archive-header .onmsft-container {
    position: relative;
    z-index: 1;
}
.onmsft-archive-header__label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px 12px;
    border-radius: 20px;
}
.onmsft-archive-header__title {
    font-size: 2.6rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 14px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.onmsft-archive-header--category .onmsft-archive-header__title {
    border-bottom: none;
    display: block;
    padding-bottom: 0;
    border-left: 4px solid var(--cat-accent, #1ec9b8);
    padding-left: 16px;
}
.onmsft-archive-header__desc {
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin: 0 0 12px;
}
.onmsft-archive-header__count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}
.onmsft-archive-header__count strong {
    color: #ffffff;
}
.onmsft-archive-header__author {
    display: flex;
    align-items: center;
    gap: 14px;
}
.onmsft-archive-header__avatar {
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
}
.onmsft-archive-header__bio {
    color: rgba(255, 255, 255, 0.75);
}
.onmsft-archive-content {
    padding: 48px 0 60px;
    background: var(--onmsft-bg);
}

/* ==========================================================================
   CATEGORY — Featured Post (first post displayed large)
   ========================================================================== */
.onmsft-cat-featured {
    padding: 40px 0;
    background: var(--onmsft-bg);
}
.onmsft-cat-featured__link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.onmsft-cat-featured__inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    background: var(--onmsft-white);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--onmsft-border);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.onmsft-cat-featured__link:hover .onmsft-cat-featured__inner {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    border-color: transparent;
}
.onmsft-cat-featured__image-wrap {
    position: relative;
    overflow: hidden;
    min-height: 320px;
}
.onmsft-cat-featured__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.onmsft-cat-featured__link:hover .onmsft-cat-featured__image {
    transform: scale(1.04);
}
.onmsft-cat-featured__image--placeholder {
    background: linear-gradient(135deg, #1a3a3e, var(--onmsft-bg));
    width: 100%;
    height: 100%;
}
.onmsft-cat-featured__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 36px;
}
.onmsft-cat-featured__badge {
    align-self: flex-start;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 16px;
}
.onmsft-cat-featured__title {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0 0 14px;
    color: var(--onmsft-text);
    letter-spacing: -0.01em;
}
.onmsft-cat-featured__link:hover .onmsft-cat-featured__title {
    color: var(--onmsft-blue);
}
.onmsft-cat-featured__excerpt {
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--onmsft-text-muted);
    margin: 0 0 22px;
}
.onmsft-cat-featured__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--onmsft-text-muted);
    padding-top: 18px;
    border-top: 1px solid var(--onmsft-border);
}
.onmsft-cat-featured__avatar {
    border-radius: 50%;
    width: 28px;
    height: 28px;
}
.onmsft-cat-featured__author {
    font-weight: 600;
}
.onmsft-cat-featured__sep {
    opacity: 0.3;
}
@media (max-width: 768px) {
    .onmsft-cat-featured__inner {
        grid-template-columns: 1fr;
    }
    .onmsft-cat-featured__image-wrap {
        min-height: 200px;
        aspect-ratio: 16/9;
    }
    .onmsft-cat-featured__content {
        padding: 24px;
    }
    .onmsft-cat-featured__title {
        font-size: 1.3rem;
    }
}

/* ==========================================================================
   SEARCH — Header
   ========================================================================== */
.onmsft-search-header {
    padding: 48px 0 36px;
    background: var(--onmsft-white);
    border-bottom: 1px solid var(--onmsft-border);
    text-align: center;
}
.onmsft-search-header__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--onmsft-text-muted);
    margin-bottom: 6px;
}
.onmsft-search-header__title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--onmsft-text);
    margin: 0 0 10px;
}
.onmsft-search-header__count {
    font-size: 0.88rem;
    color: var(--onmsft-text-muted);
    margin: 0 0 24px;
}
.onmsft-search-header__form {
    display: flex;
    max-width: 520px;
    margin: 0 auto;
}
.onmsft-search-header__input {
    flex: 1;
    padding: 12px 18px;
    font-size: 0.95rem;
    border: 2px solid var(--onmsft-border);
    border-right: none;
    border-radius: var(--onmsft-radius) 0 0 var(--onmsft-radius);
    outline: none;
    transition: border-color var(--onmsft-transition);
    background: var(--onmsft-bg);
}
.onmsft-search-header__input:focus {
    border-color: var(--onmsft-blue);
    background: var(--onmsft-white);
}
.onmsft-search-header__submit {
    padding: 0 18px;
    background: var(--onmsft-blue);
    color: #fff;
    border: 2px solid var(--onmsft-blue);
    border-radius: 0 var(--onmsft-radius) var(--onmsft-radius) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background var(--onmsft-transition);
}
.onmsft-search-header__submit:hover {
    background: var(--onmsft-blue-dark);
    border-color: var(--onmsft-blue-dark);
}
.onmsft-search-content {
    padding: 48px 0 60px;
    background: var(--onmsft-bg);
}

/* ==========================================================================
   PAGE — Static Page Layout
   ========================================================================== */
.onmsft-page {
    background: var(--onmsft-bg);
}
.onmsft-page__header {
    padding: 56px 0 36px;
    background: var(--onmsft-white);
    border-bottom: 1px solid var(--onmsft-border);
}
.onmsft-page__title {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--onmsft-text);
    margin: 0;
    line-height: 1.2;
}
.onmsft-page__featured-image {
    margin-top: -1px;
    background: var(--onmsft-white);
    padding-bottom: 32px;
}
.onmsft-page__image {
    width: 100%;
    height: auto;
    border-radius: var(--onmsft-radius-lg);
    display: block;
}
.onmsft-page__content {
    padding: 48px 0 60px;
}
.onmsft-page__content > .onmsft-container--narrow {
    background: var(--onmsft-white);
    padding: 48px 48px;
    border-radius: var(--onmsft-radius-lg);
    box-shadow: var(--onmsft-shadow);
}
@media (max-width: 600px) {
    .onmsft-page__title {
        font-size: 1.7rem;
    }
    .onmsft-page__content > .onmsft-container--narrow {
        padding: 28px 20px;
    }
}
/* Page content typography */
.onmsft-page__content h2,
.onmsft-page__content h3,
.onmsft-page__content h4 {
    color: var(--onmsft-text);
    margin-top: 1.8em;
    margin-bottom: 0.6em;
}
.onmsft-page__content p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--onmsft-text);
    margin-bottom: 1.2em;
}
.onmsft-page__content a {
    color: var(--onmsft-blue);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}
.onmsft-page__content a:hover {
    color: var(--onmsft-blue-dark);
}
.onmsft-page__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--onmsft-radius);
}

.onmsft-page-links {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--onmsft-border);
    font-size: 0.88rem;
    color: var(--onmsft-text-muted);
}
.onmsft-page-links__label {
    font-weight: 700;
    margin-right: 8px;
}
.onmsft-page-links__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    margin: 0 4px;
    padding: 0 8px;
    border-radius: 4px;
    background: var(--onmsft-bg);
    color: var(--onmsft-text);
    font-weight: 600;
}

.onmsft-page__comments {
    padding: 0 0 60px;
}

/* ==========================================================================
   404 — Not Found
   ========================================================================== */
.onmsft-404 {
    padding: 80px 0 100px;
    background: var(--onmsft-bg);
    text-align: center;
}
.onmsft-404__inner {
    max-width: 600px;
    margin: 0 auto;
}
.onmsft-404__graphic {
    margin-bottom: 32px;
    color: var(--onmsft-border);
    position: relative;
}
.onmsft-404__code {
    display: block;
    font-size: 6rem;
    font-weight: 900;
    line-height: 1;
    color: var(--onmsft-blue-light);
    margin-bottom: 16px;
}
.onmsft-404__title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--onmsft-text);
    margin: 0 0 12px;
}
.onmsft-404__message {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--onmsft-text-muted);
    margin: 0 0 32px;
}
.onmsft-404__search {
    display: flex;
    max-width: 480px;
    margin: 0 auto 40px;
}
.onmsft-404__search-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 1rem;
    border: 2px solid var(--onmsft-border);
    border-right: none;
    border-radius: var(--onmsft-radius) 0 0 var(--onmsft-radius);
    outline: none;
    background: var(--onmsft-white);
    transition: border-color var(--onmsft-transition);
}
.onmsft-404__search-input:focus {
    border-color: var(--onmsft-blue);
}
.onmsft-404__search-btn {
    padding: 0 20px;
    background: var(--onmsft-blue);
    color: #fff;
    border: 2px solid var(--onmsft-blue);
    border-radius: 0 var(--onmsft-radius) var(--onmsft-radius) 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background var(--onmsft-transition);
}
.onmsft-404__search-btn:hover {
    background: var(--onmsft-blue-dark);
    border-color: var(--onmsft-blue-dark);
}
.onmsft-404__categories {
    margin-bottom: 40px;
}
.onmsft-404__categories-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--onmsft-text);
    margin: 0 0 18px;
}
.onmsft-404__categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 500px) {
    .onmsft-404__categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.onmsft-404__cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 12px;
    background: var(--onmsft-white);
    border-radius: var(--onmsft-radius);
    border: 1px solid var(--onmsft-border);
    text-decoration: none;
    color: var(--onmsft-text);
    transition: all var(--onmsft-transition);
}
.onmsft-404__cat-card:hover {
    border-color: var(--cat-color, var(--onmsft-blue));
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    transform: translateY(-2px);
}
.onmsft-404__cat-icon {
    color: var(--cat-color, var(--onmsft-blue));
    display: flex;
}
.onmsft-404__cat-label {
    font-size: 0.82rem;
    font-weight: 600;
}
.onmsft-404__home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   AUTHOR — Header
   ========================================================================== */
.onmsft-author-header {
    padding: 48px 0 40px;
    background: var(--onmsft-white);
    border-bottom: 1px solid var(--onmsft-border);
}
.onmsft-author-header__inner {
    display: flex;
    align-items: center;
    gap: 32px;
}
@media (max-width: 600px) {
    .onmsft-author-header__inner {
        flex-direction: column;
        text-align: center;
    }
}
.onmsft-author-header__avatar-wrap {
    flex: none;
}
.onmsft-author-header__avatar {
    border-radius: 50%;
    width: 128px;
    height: 128px;
    object-fit: cover;
    border: 4px solid var(--onmsft-blue-light);
}
.onmsft-author-header__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--onmsft-blue);
    margin-bottom: 4px;
}
.onmsft-author-header__name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--onmsft-text);
    margin: 0 0 10px;
}
.onmsft-author-header__bio {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--onmsft-text-muted);
    margin: 0 0 14px;
    max-width: 560px;
}
.onmsft-author-header__meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.85rem;
    color: var(--onmsft-text-muted);
}
@media (max-width: 600px) {
    .onmsft-author-header__meta {
        justify-content: center;
    }
}
.onmsft-author-header__stat {
    display: flex;
    align-items: center;
    gap: 6px;
}
.onmsft-author-header__link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--onmsft-blue);
    text-decoration: none;
    font-weight: 600;
}
.onmsft-author-header__link:hover {
    text-decoration: underline;
}
.onmsft-author-content {
    padding: 48px 0 60px;
    background: var(--onmsft-bg);
}

/* ==========================================================================
   SHARED — Empty State
   ========================================================================== */
.onmsft-empty {
    text-align: center;
    padding: 60px 20px;
}
.onmsft-empty__icon {
    color: var(--onmsft-border);
    margin-bottom: 20px;
}
.onmsft-empty h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--onmsft-text);
    margin: 0 0 10px;
}
.onmsft-empty p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--onmsft-text-muted);
    max-width: 480px;
    margin: 0 auto 24px;
}
.onmsft-empty__categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}
.onmsft-empty__cat-link {
    display: inline-block;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--onmsft-blue);
    background: var(--onmsft-blue-light);
    border-radius: 20px;
    transition: all var(--onmsft-transition);
}
.onmsft-empty__cat-link:hover {
    background: var(--onmsft-blue);
    color: #fff;
}

/* ==========================================================================
   SHARED — Button
   ========================================================================== */
.onmsft-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--onmsft-radius);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--onmsft-transition);
    border: none;
}
.onmsft-btn--primary {
    background: var(--onmsft-blue);
    color: #fff;
}
.onmsft-btn--primary:hover {
    background: var(--onmsft-blue-dark);
}


/* ==========================================================================
   BREADCRUMBS (inc/template-helpers.php: onmsft_breadcrumbs)
   ========================================================================== */
.breadcrumbs {
    padding: 14px 0;
}
.breadcrumbs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 0.82rem;
    color: var(--onmsft-text-muted);
}
.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
}
.breadcrumbs__separator {
    display: inline-flex;
    align-items: center;
    margin: 0 6px;
    opacity: 0.5;
}
.breadcrumbs__link {
    color: var(--onmsft-blue);
    text-decoration: none;
    transition: color var(--onmsft-transition);
}
.breadcrumbs__link:hover {
    color: var(--onmsft-blue-dark);
    text-decoration: underline;
}
.breadcrumbs__current {
    color: var(--onmsft-text-muted);
    font-weight: 500;
}


/* ==========================================================================
   SINGLE POST — single.php
   ========================================================================== */

/* Breadcrumbs wrapper */
.single-breadcrumbs {
    background: var(--onmsft-white);
    border-bottom: 1px solid var(--onmsft-border);
}

/* Featured Image Hero */
.article-hero {
    position: relative;
    width: 100%;
    max-height: 560px;
    overflow: hidden;
    background: #e8e8e8;
}
.article-hero__image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 560px;
}
.article-hero__badge {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
    z-index: 2;
    transition: opacity var(--onmsft-transition);
}
.article-hero__badge:hover {
    opacity: 0.9;
    color: #fff;
}

/* 70/30 Layout — single.php uses .content-sidebar-wrap,
   index/archive/category/search use .onmsft-layout--with-sidebar */
.content-sidebar-wrap,
.onmsft-layout--with-sidebar {
    display: grid;
    grid-template-columns: 1fr minmax(0, 340px);
    gap: 40px;
    align-items: start;
}
.content-sidebar-wrap {
    padding-top: 8px;
    padding-bottom: 60px;
}
.onmsft-layout--with-sidebar {
    padding-bottom: 40px;
}

/* Prevent grid blowout from wide images/content */
.content-sidebar-wrap .main-content,
.onmsft-layout__content {
    min-width: 0;
    overflow: hidden;
}
.content-sidebar-wrap .sidebar-area,
.onmsft-layout__sidebar {
    min-width: 0;
}

/* Article Header */
.article-header {
    padding: 32px 0 8px;
}
.article-header__category {
    margin-bottom: 12px;
}
.article-header__cat-link {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: opacity var(--onmsft-transition);
}
.article-header__cat-link:hover {
    opacity: 0.8;
}
.article-title {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1.2;
    color: #201f1e;
    margin: 0;
}

/* Meta Bar */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    padding: 16px 0 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--onmsft-border);
    font-size: 0.88rem;
    color: var(--onmsft-text-muted);
}
.article-meta__author {
    display: flex;
    align-items: center;
    gap: 10px;
}
.article-meta__avatar-img {
    border-radius: 50%;
    width: 36px;
    height: 36px;
}
.article-meta__author-name a {
    color: var(--onmsft-text);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--onmsft-transition);
}
.article-meta__author-name a:hover {
    color: var(--onmsft-blue);
}
.article-meta__date,
.article-meta__reading-time {
    display: flex;
    align-items: center;
    gap: 5px;
}
.article-meta__icon {
    opacity: 0.6;
    flex-shrink: 0;
}

/* Article Content Typography */
.article-content {
    font-size: 1.06rem;
    line-height: 1.78;
    color: var(--onmsft-text);
}
.article-content p {
    margin-bottom: 1.4em;
}
.article-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #201f1e;
    margin: 2.2em 0 0.7em;
    line-height: 1.3;
}
.article-content h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #201f1e;
    margin: 2em 0 0.6em;
    line-height: 1.3;
}
.article-content h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #201f1e;
    margin: 1.8em 0 0.5em;
}
.article-content h5,
.article-content h6 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #201f1e;
    margin: 1.6em 0 0.5em;
}
.article-content a {
    color: var(--onmsft-blue);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color var(--onmsft-transition);
}
.article-content a:hover {
    color: var(--onmsft-blue-dark);
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--onmsft-radius);
    margin: 1em 0;
}
.article-content figure {
    margin: 1.5em 0;
}
.article-content figcaption {
    font-size: 0.85rem;
    color: var(--onmsft-text-muted);
    text-align: center;
    margin-top: 8px;
}
.article-content blockquote {
    margin: 1.8em 0;
    padding: 20px 24px;
    border-left: 4px solid #217178;
    background: #e6f3f4;
    border-radius: 0 var(--onmsft-radius) var(--onmsft-radius) 0;
    font-style: italic;
    color: var(--onmsft-text);
}
.article-content blockquote p:last-child {
    margin-bottom: 0;
}
.article-content blockquote cite {
    display: block;
    margin-top: 8px;
    font-size: 0.88rem;
    font-style: normal;
    font-weight: 600;
    color: var(--onmsft-text-muted);
}
.article-content pre {
    background: #201f1e;
    color: #f0f0f0;
    padding: 20px 24px;
    border-radius: var(--onmsft-radius);
    overflow-x: auto;
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 1.5em 0;
}
.article-content code {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}
.article-content :not(pre) > code {
    background: #f3f3f3;
    padding: 2px 6px;
    border-radius: 3px;
    color: #217178;
}
.article-content ul,
.article-content ol {
    margin: 1em 0 1.4em;
    padding-left: 1.6em;
}
.article-content li {
    margin-bottom: 0.4em;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}
.article-content th,
.article-content td {
    padding: 10px 14px;
    border: 1px solid var(--onmsft-border);
    text-align: left;
}
.article-content th {
    background: #f3f3f3;
    font-weight: 700;
    color: #201f1e;
}
.article-content tr:nth-child(even) td {
    background: var(--onmsft-bg);
}
.article-content hr {
    border: none;
    border-top: 1px solid var(--onmsft-border);
    margin: 2em 0;
}
/* Wide/Full alignment (Gutenberg) */
.article-content .alignwide {
    margin-left: -40px;
    margin-right: -40px;
    max-width: calc(100% + 80px);
}
.article-content .alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* Page Links */
.page-links {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--onmsft-border);
    font-size: 0.88rem;
    color: var(--onmsft-text-muted);
}
.page-links-label {
    font-weight: 700;
    margin-right: 8px;
}
.page-link-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    margin: 0 3px;
    padding: 0 8px;
    border-radius: 4px;
    background: var(--onmsft-bg);
    color: var(--onmsft-text);
    font-weight: 600;
    text-decoration: none;
}

/* Share Buttons */
.article-share {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 0;
    border-top: 1px solid var(--onmsft-border);
    border-bottom: 1px solid var(--onmsft-border);
    margin-top: 8px;
}
.article-share__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--onmsft-text);
    white-space: nowrap;
}
.article-share__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
}
.social-icon {
    list-style: none;
}
.social-icon a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--onmsft-bg);
    color: var(--onmsft-text-muted);
    text-decoration: none;
    transition: all var(--onmsft-transition);
}
.social-icon a:hover {
    background: #217178;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33,113,120,.25);
}

/* Tags Section (Pills) */
.article-tags {
    padding: 24px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
}
.article-tags__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--onmsft-text);
    white-space: nowrap;
}
.article-tags__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.article-tags__pill {
    display: inline-block;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #217178;
    background: #e6f3f4;
    border-radius: 20px;
    text-decoration: none;
    transition: all var(--onmsft-transition);
}
.article-tags__pill:hover {
    background: #217178;
    color: #fff;
}

/* Author Bio Box */
.author-bio-box {
    display: flex;
    gap: 20px;
    padding: 28px;
    margin: 32px 0;
    background: var(--onmsft-bg);
    border-radius: var(--onmsft-radius-lg);
    border: 1px solid var(--onmsft-border);
}
.author-bio-box__avatar-img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}
.author-bio-box__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--onmsft-blue);
    margin-bottom: 2px;
}
.author-bio-box__name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 8px;
}
.author-bio-box__name a {
    color: #201f1e;
    text-decoration: none;
    transition: color var(--onmsft-transition);
}
.author-bio-box__name a:hover {
    color: var(--onmsft-blue);
}
.author-bio-box__bio {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--onmsft-text-muted);
    margin: 0;
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 32px 0;
}
.post-navigation__link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px;
    background: var(--onmsft-bg);
    border-radius: var(--onmsft-radius);
    border: 1px solid var(--onmsft-border);
    text-decoration: none;
    transition: all var(--onmsft-transition);
}
.post-navigation__link:hover {
    border-color: var(--onmsft-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.post-navigation__link--next {
    text-align: right;
}
.post-navigation__label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--onmsft-blue);
}
.post-navigation__link--next .post-navigation__label {
    justify-content: flex-end;
}
.post-navigation__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--onmsft-text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Related Posts */
.related-posts {
    margin: 40px 0;
    padding-top: 32px;
    border-top: 2px solid var(--onmsft-border);
}
.related-posts__heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--onmsft-text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 24px;
}
.related-posts__heading svg {
    color: var(--onmsft-blue);
}
.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.related-posts__card {
    text-decoration: none;
    color: inherit;
    background: var(--onmsft-white);
    border-radius: var(--onmsft-radius);
    overflow: hidden;
    border: 1px solid var(--onmsft-border);
    transition: all var(--onmsft-transition);
}
.related-posts__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    border-color: var(--onmsft-blue);
}
.related-posts__image-wrap {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e8e8e8;
}
.related-posts__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--onmsft-transition);
}
.related-posts__card:hover .related-posts__image {
    transform: scale(1.04);
}
.related-posts__image--placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--onmsft-blue-light), var(--onmsft-bg));
}
.related-posts__body {
    padding: 14px 16px 16px;
}
.related-posts__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--onmsft-text);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-posts__date {
    font-size: 0.78rem;
    color: var(--onmsft-text-muted);
}


/* ==========================================================================
   SIDEBAR — sidebar.php
   ========================================================================== */
.sidebar-area {
    position: relative;
    min-width: 0;
    max-width: 340px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.sidebar__inner {
    position: sticky;
    top: 84px;  /* 64px header + 20px gap */
    max-width: 100%;
}
/* Widget cards — subtle shadow instead of hard border */
.sidebar-area .widget {
    margin-bottom: 24px;
    padding: 24px 22px;
    background: var(--onmsft-white);
    border-radius: var(--onmsft-radius-lg);
    border: 1px solid rgba(0,0,0,.04);
    box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 0 1px rgba(0,0,0,.08);
    transition: box-shadow var(--onmsft-transition);
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.sidebar-area .widget:last-child {
    margin-bottom: 0;
}
.sidebar-area .widget:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.08), 0 0 1px rgba(0,0,0,.1);
}

/* Widget title — teal underline, 3px with rounded ends */
.sidebar-area .widget-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--onmsft-text);
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: relative;
}
.sidebar-area .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: #217178;
    border-radius: 3px;
}

/* Widget lists */
.sidebar-area .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-area .widget li {
    padding: 9px 0;
    border-bottom: 1px solid rgba(0,0,0,.05);
    font-size: 0.88rem;
    line-height: 1.5;
}
.sidebar-area .widget li:first-child {
    padding-top: 0;
}
.sidebar-area .widget li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Widget links — smooth hover */
.sidebar-area .widget a {
    color: var(--onmsft-text);
    text-decoration: none;
    transition: color var(--onmsft-transition), padding-left var(--onmsft-transition);
}
.sidebar-area .widget a:hover {
    color: #217178;
    padding-left: 2px;
}

/* Modern search widget — pill shape with search icon */
.sidebar-area .widget_search .widget-title {
    display: none; /* Hide title, the input placeholder is enough */
}

.sidebar-area .widget_search .search-form {
    position: relative;
    display: block;
}

.sidebar-area .widget_search .search-form::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%236e6e6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 18px 18px;
    opacity: 0.6;
    pointer-events: none;
    z-index: 1;
}

.sidebar-area .widget_search .search-field {
    width: 100%;
    padding: 13px 50px 13px 44px;
    border: 1px solid var(--onmsft-border, #e0e0e0);
    border-radius: 24px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--onmsft-bg, #f5f5f5);
    color: var(--onmsft-text, #3a3a3a);
    outline: none;
    box-sizing: border-box;
    transition: border-color var(--onmsft-transition), box-shadow var(--onmsft-transition), background var(--onmsft-transition);
}

.sidebar-area .widget_search .search-field::placeholder {
    color: var(--onmsft-text-muted, #6e6e6e);
    opacity: 0.7;
}

.sidebar-area .widget_search .search-field:focus {
    border-color: #217178;
    background: var(--onmsft-white, #ffffff);
    box-shadow: 0 0 0 3px rgba(33,113,120,.12);
}

.sidebar-area .widget_search .search-submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--onmsft-blue, #217178);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--onmsft-transition);
}

.sidebar-area .widget_search .search-submit:hover {
    background: var(--onmsft-blue-dark, #1a5b61);
}

/* Tag cloud in sidebar */
.sidebar-area .tagcloud a {
    display: inline-block;
    padding: 5px 14px;
    margin: 3px 2px;
    font-size: 0.8rem !important;
    background: var(--onmsft-bg);
    border-radius: 20px;
    border: 1px solid var(--onmsft-border);
    color: var(--onmsft-text-muted);
    transition: all var(--onmsft-transition);
}
.sidebar-area .tagcloud a:hover {
    background: #217178;
    color: #fff;
    border-color: #217178;
    transform: translateY(-1px);
}

/* Collapsible widget toggle — archive, categories, recent comments
   Uses ::before for the arrow since ::after is already the teal underline */
.widget-title--collapsible {
    position: relative;
    padding-right: 28px;
    user-select: none;
    cursor: pointer;
}

.widget-title--collapsible::before {
    content: '';
    position: absolute;
    right: 0;
    top: calc(50% - 6px); /* offset to account for padding-bottom */
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.3s ease;
}

.widget:not(.is-collapsed) .widget-title--collapsible::before {
    transform: translateY(-50%) rotate(180deg);
}

.widget-collapse-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Recent posts widget — post titles */
.sidebar-area .widget_recent_entries li a,
.sidebar-area .widget_onmsft_recent_posts li a {
    font-weight: 500;
    line-height: 1.45;
}
.sidebar-area .widget_recent_entries .post-date {
    display: block;
    font-size: 0.78rem;
    color: var(--onmsft-text-muted);
    margin-top: 3px;
}

/* Categories widget — post count badge */
.sidebar-area .widget_categories li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.sidebar-area .widget_categories li a {
    flex: 1;
}
.sidebar-area .widget_categories .count,
.sidebar-area .widget_categories li > span {
    font-size: 0.75rem;
    color: var(--onmsft-text-muted);
    background: var(--onmsft-bg);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 8px;
    flex-shrink: 0;
}


/* ==========================================================================
   COMMENTS — comments.php
   ========================================================================== */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid var(--onmsft-border);
}
.comments-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--onmsft-text);
    margin: 0 0 28px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comments-title__icon {
    color: var(--onmsft-blue);
    flex-shrink: 0;
}

/* Comment List */
.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.comment-list .comment {
    margin-bottom: 0;
}
.comment-list .comment-body {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--onmsft-border);
}
.comment-list .children {
    list-style: none;
    padding-left: 32px;
    margin: 0;
    border-left: 2px solid #e6f3f4;
}

/* Comment Avatar */
.comment-avatar {
    flex-shrink: 0;
}
.comment-avatar img {
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

/* Comment Content */
.comment-content-wrapper {
    flex: 1;
    min-width: 0;
}
.comment-author.vcard .fn {
    font-weight: 700;
    color: var(--onmsft-text);
    font-size: 0.92rem;
}
.comment-author.vcard .fn a {
    color: var(--onmsft-text);
    text-decoration: none;
}
.comment-author.vcard .fn a:hover {
    color: var(--onmsft-blue);
}
.comment-metadata {
    font-size: 0.78rem;
    color: var(--onmsft-text-muted);
    margin-top: 2px;
}
.comment-metadata a {
    color: var(--onmsft-text-muted);
    text-decoration: none;
}
.comment-metadata a:hover {
    color: var(--onmsft-blue);
}
.comment-metadata .edit-link {
    margin-left: 10px;
}
.comment-awaiting-moderation {
    font-size: 0.85rem;
    color: #d83b01;
    font-style: italic;
    margin: 8px 0 4px;
}
.comment-content {
    margin-top: 10px;
    font-size: 0.95rem;
    line-height: 1.65;
    color: var(--onmsft-text);
}
.comment-content p {
    margin: 0 0 0.8em;
}
.comment-content p:last-child {
    margin-bottom: 0;
}
.reply {
    margin-top: 8px;
}
.reply-link .comment-reply-link,
.reply .comment-reply-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--onmsft-blue);
    text-decoration: none;
    transition: color var(--onmsft-transition);
}
.reply-link .comment-reply-link:hover,
.reply .comment-reply-link:hover {
    color: var(--onmsft-blue-dark);
    text-decoration: underline;
}

/* Comment Pagination */
.comment-pagination {
    margin: 24px 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.comment-pagination a,
.comment-pagination span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--onmsft-radius);
    text-decoration: none;
    color: var(--onmsft-text-muted);
    background: var(--onmsft-bg);
    border: 1px solid var(--onmsft-border);
    transition: all var(--onmsft-transition);
}
.comment-pagination a:hover {
    color: var(--onmsft-blue);
    border-color: var(--onmsft-blue);
}

/* Closed comments notice */
.no-comments {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--onmsft-text-muted);
    font-style: italic;
    padding: 16px 0;
}

/* Comment Form */
.comment-respond {
    margin-top: 36px;
    padding-top: 28px;
    border-top: 1px solid var(--onmsft-border);
}
.comment-reply-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--onmsft-text);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-reply-title small {
    font-size: 0.78rem;
    font-weight: 400;
}
.comment-reply-title small a {
    color: var(--onmsft-blue);
    text-decoration: none;
}
.comment-reply-title small a:hover {
    text-decoration: underline;
}
.comment-notes {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--onmsft-text-muted);
    margin: 0 0 20px;
}
.comment-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--onmsft-text);
    margin-bottom: 6px;
}
.comment-form .required {
    color: #e81123;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    color: var(--onmsft-text);
    background: var(--onmsft-white);
    border: 2px solid var(--onmsft-border);
    border-radius: var(--onmsft-radius);
    outline: none;
    transition: border-color var(--onmsft-transition), box-shadow var(--onmsft-transition);
}
.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
    border-color: #217178;
    box-shadow: 0 0 0 3px rgba(33,113,120,.12);
}
.comment-form textarea {
    resize: vertical;
    min-height: 140px;
}
.comment-form p {
    margin: 0 0 16px;
}
.comment-form .form-submit {
    margin-top: 8px;
}
.comment-form-cookies-consent {
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-form-cookies-consent input[type="checkbox"] {
    width: auto;
    accent-color: #217178;
}
.comment-form-cookies-consent label {
    display: inline;
    font-weight: 400;
}
.logged-in-as {
    font-size: 0.85rem;
    color: var(--onmsft-text-muted);
    margin-bottom: 16px;
}
.logged-in-as a {
    color: var(--onmsft-blue);
    text-decoration: none;
}
.logged-in-as a:hover {
    text-decoration: underline;
}

/* Page breadcrumbs wrapper */
.onmsft-page__breadcrumbs {
    background: var(--onmsft-white);
}

/* Author breadcrumbs wrapper */
.onmsft-author__breadcrumbs {
    background: var(--onmsft-white);
}


/* ==========================================================================
   RESPONSIVE: Tablet (max-width: 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .content-sidebar-wrap,
    .onmsft-layout--with-sidebar {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .sidebar-area {
        border-top: 2px solid var(--onmsft-border);
        padding-top: 32px;
        max-width: none;
    }
    .sidebar__inner {
        position: static;
    }
    .onmsft-layout__sidebar {
        border-top: 2px solid var(--onmsft-border);
        padding-top: 32px;
    }
    .article-content .alignwide {
        margin-left: -10px;
        margin-right: -10px;
        max-width: calc(100% + 20px);
    }
}


/* ==========================================================================
   RESPONSIVE: Mobile (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Single article */
    .article-title {
        font-size: 1.6rem;
    }
    .article-hero {
        max-height: 320px;
    }
    .article-hero__badge {
        top: 12px;
        left: 12px;
        font-size: 0.68rem;
        padding: 4px 12px;
    }
    .article-meta {
        gap: 10px;
        font-size: 0.82rem;
    }
    .article-share {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    /* Author bio box */
    .author-bio-box {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Post navigation */
    .post-navigation {
        grid-template-columns: 1fr;
    }
    .post-navigation__link--next {
        text-align: left;
    }
    .post-navigation__link--next .post-navigation__label {
        justify-content: flex-start;
    }

    /* Related posts */
    .related-posts__grid {
        grid-template-columns: 1fr;
    }

    /* Comments */
    .comment-list .children {
        padding-left: 16px;
    }
    .comment-list .comment-body {
        gap: 12px;
    }
    .comment-avatar img {
        width: 36px;
        height: 36px;
    }

    /* Author page */
    .onmsft-author-header__avatar {
        width: 96px;
        height: 96px;
    }
    .onmsft-author-header__name {
        font-size: 1.5rem;
    }

    /* Sidebar */
    .sidebar-area .widget {
        padding: 20px;
    }

    /* 404 */
    .onmsft-404 {
        padding: 50px 0 70px;
    }
    .onmsft-404__code {
        font-size: 4rem;
    }
    .onmsft-404__title {
        font-size: 1.4rem;
    }
}


/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}
.screen-reader-text:focus {
    background-color: var(--onmsft-bg);
    clip: auto !important;
    clip-path: none;
    color: var(--onmsft-text);
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}


/* ==========================================================================
   DARK MODE — Template Element Overrides
   ========================================================================== */

/* --- Design Token Overrides --- */
[data-theme="dark"] {
    --onmsft-blue-light: #1a3a3e;
    --onmsft-text:       #d4d4d8;
    --onmsft-text-muted: #9e9ea8;
    --onmsft-bg:         #121218;
    --onmsft-white:      #1a1a24;
    --onmsft-border:     #2a2a38;
    --onmsft-shadow:     0 1px 3px rgba(0,0,0,.25), 0 1px 2px rgba(0,0,0,.2);
    --onmsft-shadow-lg:  0 6.4px 14.4px 0 rgba(0,0,0,.35), 0 1.2px 3.6px 0 rgba(0,0,0,.28);
}

/* --- Section Headers --- */
[data-theme="dark"] .onmsft-section-header {
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .onmsft-section-header__title {
    color: var(--onmsft-text);
}

/* --- Post Cards (content-card.php) --- */
[data-theme="dark"] .onmsft-card {
    background: var(--onmsft-white);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}
[data-theme="dark"] .onmsft-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: transparent;
}
[data-theme="dark"] .onmsft-card__image-wrap {
    background: #2a2a38;
}
[data-theme="dark"] .onmsft-card__title {
    color: var(--onmsft-text);
}
[data-theme="dark"] .onmsft-card:hover .onmsft-card__title {
    color: #1ec9b8;
}
[data-theme="dark"] .onmsft-card__excerpt {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .onmsft-card__meta {
    color: var(--onmsft-text-muted);
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* --- Hero Section --- */
[data-theme="dark"] .onmsft-hero {
    background: var(--onmsft-bg);
}
[data-theme="dark"] .onmsft-hero__inner {
    background: var(--onmsft-white);
    box-shadow: var(--onmsft-shadow-lg);
}
[data-theme="dark"] .onmsft-hero__link:hover .onmsft-hero__inner {
    box-shadow: 0 14px 35px rgba(0,0,0,.35), 0 6px 14px rgba(0,0,0,.25);
}
[data-theme="dark"] .onmsft-hero__image--placeholder {
    background: linear-gradient(135deg, #1a3a3e, var(--onmsft-bg));
}
[data-theme="dark"] .onmsft-hero__title {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-hero__excerpt {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .onmsft-hero__meta {
    color: var(--onmsft-text-muted);
}

/* --- Categories Bar --- */
[data-theme="dark"] .onmsft-categories-bar {
    background: var(--onmsft-white);
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .onmsft-categories-bar__link {
    color: var(--onmsft-text-muted);
}

/* --- Trending Section --- */
[data-theme="dark"] .onmsft-trending {
    background: var(--onmsft-white);
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .onmsft-trending__item:hover {
    background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .onmsft-trending__rank {
    color: #1a3a3e;
}
[data-theme="dark"] .onmsft-trending__title {
    color: var(--onmsft-text);
}
[data-theme="dark"] .onmsft-trending__date {
    color: var(--onmsft-text-muted);
}

/* --- Latest Posts Section --- */
[data-theme="dark"] .onmsft-latest {
    background: var(--onmsft-bg);
}

/* --- Pagination --- */
[data-theme="dark"] .onmsft-pagination .page-numbers a,
[data-theme="dark"] .onmsft-pagination .page-numbers span {
    color: var(--onmsft-text-muted);
    background: var(--onmsft-white);
    border-color: var(--onmsft-border);
}
[data-theme="dark"] .onmsft-pagination .page-numbers a:hover {
    color: var(--onmsft-blue);
    border-color: var(--onmsft-blue);
    background: rgba(33, 113, 120, 0.1);
}
[data-theme="dark"] .onmsft-pagination .page-numbers .current {
    color: #fff;
    background: var(--onmsft-blue);
    border-color: var(--onmsft-blue);
}

/* --- Archive / Category Headers --- */
[data-theme="dark"] .onmsft-archive-header {
    background: linear-gradient(135deg, #0d1b1d 0%, #143538 60%, #1a4a4e 100%);
}
[data-theme="dark"] .onmsft-archive-header::before {
    background: radial-gradient(ellipse at 80% 20%, rgba(30, 201, 184, 0.15) 0%, transparent 60%);
}
[data-theme="dark"] .onmsft-archive-header__title {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-archive-header__desc {
    color: rgba(240, 240, 242, 0.7);
}
[data-theme="dark"] .onmsft-archive-content {
    background: var(--onmsft-bg);
}

/* --- Category Featured Post --- */
[data-theme="dark"] .onmsft-cat-featured {
    background: var(--onmsft-bg);
}
[data-theme="dark"] .onmsft-cat-featured__inner {
    background: var(--onmsft-white);
    border-color: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .onmsft-cat-featured__link:hover .onmsft-cat-featured__inner {
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.35);
    border-color: transparent;
}
[data-theme="dark"] .onmsft-cat-featured__image--placeholder {
    background: linear-gradient(135deg, #1a3a3e, var(--onmsft-bg));
}
[data-theme="dark"] .onmsft-cat-featured__title {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-cat-featured__link:hover .onmsft-cat-featured__title {
    color: #1ec9b8;
}
[data-theme="dark"] .onmsft-cat-featured__excerpt {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .onmsft-cat-featured__meta {
    color: var(--onmsft-text-muted);
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* --- Search Header --- */
[data-theme="dark"] .onmsft-search-header {
    background: var(--onmsft-white);
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .onmsft-search-header__title {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-search-header__count {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .onmsft-search-header__input {
    background: var(--onmsft-bg);
    border-color: var(--onmsft-border);
    color: var(--onmsft-text);
}
[data-theme="dark"] .onmsft-search-header__input:focus {
    border-color: var(--onmsft-blue);
    background: var(--onmsft-white);
}
[data-theme="dark"] .onmsft-search-content {
    background: var(--onmsft-bg);
}

/* --- Page Template --- */
[data-theme="dark"] .onmsft-page {
    background: var(--onmsft-bg);
}
[data-theme="dark"] .onmsft-page__header {
    background: var(--onmsft-white);
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .onmsft-page__title {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-page__featured-image {
    background: var(--onmsft-white);
}
[data-theme="dark"] .onmsft-page__content > .onmsft-container--narrow {
    background: var(--onmsft-white);
    box-shadow: var(--onmsft-shadow);
}
[data-theme="dark"] .onmsft-page__content h2,
[data-theme="dark"] .onmsft-page__content h3,
[data-theme="dark"] .onmsft-page__content h4 {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-page__content p {
    color: var(--onmsft-text);
}
[data-theme="dark"] .onmsft-page__content a {
    color: var(--onmsft-blue);
}
[data-theme="dark"] .onmsft-page-links {
    border-top-color: var(--onmsft-border);
}
[data-theme="dark"] .onmsft-page-links__number {
    background: var(--onmsft-bg);
    color: var(--onmsft-text);
}

/* --- 404 Page --- */
[data-theme="dark"] .onmsft-404 {
    background: var(--onmsft-bg);
}
[data-theme="dark"] .onmsft-404__code {
    color: #1a3a3e;
}
[data-theme="dark"] .onmsft-404__title {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-404__message {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .onmsft-404__search-input {
    background: var(--onmsft-white);
    border-color: var(--onmsft-border);
    color: var(--onmsft-text);
}
[data-theme="dark"] .onmsft-404__search-input:focus {
    border-color: var(--onmsft-blue);
}
[data-theme="dark"] .onmsft-404__cat-card {
    background: var(--onmsft-white);
    border-color: var(--onmsft-border);
    color: var(--onmsft-text);
}
[data-theme="dark"] .onmsft-404__cat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* --- Author Header --- */
[data-theme="dark"] .onmsft-author-header {
    background: var(--onmsft-white);
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .onmsft-author-header__avatar {
    border-color: #1a3a3e;
}
[data-theme="dark"] .onmsft-author-header__name {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-author-header__bio {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .onmsft-author-header__meta {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .onmsft-author-content {
    background: var(--onmsft-bg);
}

/* --- Empty State --- */
[data-theme="dark"] .onmsft-empty h2 {
    color: #f0f0f2;
}
[data-theme="dark"] .onmsft-empty p {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .onmsft-empty__cat-link {
    color: var(--onmsft-blue);
    background: rgba(33, 113, 120, 0.12);
}
[data-theme="dark"] .onmsft-empty__cat-link:hover {
    background: var(--onmsft-blue);
    color: #fff;
}

/* --- Breadcrumbs --- */
[data-theme="dark"] .breadcrumbs__list {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .breadcrumbs__link {
    color: var(--onmsft-blue);
}
[data-theme="dark"] .breadcrumbs__current {
    color: var(--onmsft-text-muted);
}

/* --- Single Post — Breadcrumbs wrapper --- */
[data-theme="dark"] .single-breadcrumbs {
    background: var(--onmsft-white);
    border-bottom-color: var(--onmsft-border);
}

/* --- Single Post — Article hero --- */
[data-theme="dark"] .article-hero {
    background: #2a2a38;
}

/* --- Single Post — Content sidebar wrap --- */
[data-theme="dark"] .content-sidebar-wrap {
    background: transparent;
}

/* --- Single Post — Article content overrides (templates.css versions) --- */
[data-theme="dark"] .article-content {
    color: var(--onmsft-text);
}
[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4,
[data-theme="dark"] .article-content h5,
[data-theme="dark"] .article-content h6 {
    color: #f0f0f2;
}
[data-theme="dark"] .article-content a {
    color: var(--onmsft-blue);
}
[data-theme="dark"] .article-content a:hover {
    color: #1ec9b8;
}
[data-theme="dark"] .article-content blockquote {
    border-left-color: #217178;
    background: rgba(33, 113, 120, 0.08);
    color: var(--onmsft-text);
}
[data-theme="dark"] .article-content pre {
    background: #0d0d14;
}
[data-theme="dark"] .article-content :not(pre) > code {
    background: #1e1e28;
    color: #e8b84e;
}
[data-theme="dark"] .article-content th {
    background: #1e1e28;
    color: #f0f0f2;
}
[data-theme="dark"] .article-content tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}
[data-theme="dark"] .article-content hr {
    border-top-color: var(--onmsft-border);
}

/* --- Article Meta --- */
[data-theme="dark"] .article-meta {
    border-bottom-color: var(--onmsft-border);
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .article-meta__author-name a {
    color: var(--onmsft-text);
}
[data-theme="dark"] .article-meta__author-name a:hover {
    color: var(--onmsft-blue);
}
[data-theme="dark"] .article-title {
    color: #f0f0f2;
}

/* --- Share Buttons --- */
[data-theme="dark"] .article-share {
    border-top-color: var(--onmsft-border);
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .article-share__label {
    color: var(--onmsft-text);
}
[data-theme="dark"] .social-icon a {
    background: var(--onmsft-bg);
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .social-icon a:hover {
    background: #217178;
    color: #fff;
    box-shadow: 0 4px 8px rgba(33,113,120,.2);
}

/* --- Tags Pills --- */
[data-theme="dark"] .article-tags__label {
    color: var(--onmsft-text);
}
[data-theme="dark"] .article-tags__pill {
    color: #1ec9b8;
    background: rgba(33, 113, 120, 0.12);
}
[data-theme="dark"] .article-tags__pill:hover {
    background: #217178;
    color: #fff;
}

/* --- Author Bio Box --- */
[data-theme="dark"] .author-bio-box {
    background: var(--onmsft-bg);
    border-color: var(--onmsft-border);
}
[data-theme="dark"] .author-bio-box__name a {
    color: #f0f0f2;
}
[data-theme="dark"] .author-bio-box__name a:hover {
    color: var(--onmsft-blue);
}
[data-theme="dark"] .author-bio-box__bio {
    color: var(--onmsft-text-muted);
}

/* --- Post Navigation --- */
[data-theme="dark"] .post-navigation__link {
    background: var(--onmsft-bg);
    border-color: var(--onmsft-border);
}
[data-theme="dark"] .post-navigation__link:hover {
    border-color: var(--onmsft-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
[data-theme="dark"] .post-navigation__title {
    color: var(--onmsft-text);
}

/* --- Related Posts --- */
[data-theme="dark"] .related-posts {
    border-top-color: var(--onmsft-border);
}
[data-theme="dark"] .related-posts__heading {
    color: var(--onmsft-text);
}
[data-theme="dark"] .related-posts__card {
    background: var(--onmsft-white);
    border-color: var(--onmsft-border);
}
[data-theme="dark"] .related-posts__card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    border-color: var(--onmsft-blue);
}
[data-theme="dark"] .related-posts__image-wrap {
    background: #2a2a38;
}
[data-theme="dark"] .related-posts__image--placeholder {
    background: linear-gradient(135deg, #1a3a3e, var(--onmsft-bg));
}
[data-theme="dark"] .related-posts__title {
    color: var(--onmsft-text);
}
[data-theme="dark"] .related-posts__date {
    color: var(--onmsft-text-muted);
}

/* --- Sidebar (templates.css scope) --- */
[data-theme="dark"] .sidebar-area .widget {
    background: var(--onmsft-white);
    border-color: var(--onmsft-border);
}
[data-theme="dark"] .sidebar-area .widget-title {
    color: var(--onmsft-text);
}
[data-theme="dark"] .sidebar-area .widget li {
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .sidebar-area .widget a {
    color: var(--onmsft-text);
}
[data-theme="dark"] .sidebar-area .widget a:hover {
    color: var(--onmsft-blue);
}
[data-theme="dark"] .sidebar-area .widget_search .search-field {
    border-color: var(--onmsft-border);
    background: var(--onmsft-bg);
    color: var(--onmsft-text);
}
[data-theme="dark"] .sidebar-area .widget_search .search-field:focus {
    background: var(--onmsft-white);
}
[data-theme="dark"] .sidebar-area .widget_search .search-form::before {
    opacity: 0.5;
}
[data-theme="dark"] .sidebar-area .widget_search .search-submit {
    background: var(--onmsft-blue);
}
[data-theme="dark"] .sidebar-area .widget_search .search-submit:hover {
    background: var(--onmsft-blue-dark);
}
[data-theme="dark"] .sidebar-area .tagcloud a {
    background: var(--onmsft-bg);
    border-color: var(--onmsft-border);
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .sidebar-area .tagcloud a:hover {
    background: var(--onmsft-blue);
    color: #fff;
    border-color: var(--onmsft-blue);
}

/* --- Comments (templates.css scope) --- */
[data-theme="dark"] .comments-area {
    border-top-color: var(--onmsft-border);
}
[data-theme="dark"] .comments-title {
    color: var(--onmsft-text);
}
[data-theme="dark"] .comment-list .comment-body {
    border-bottom-color: var(--onmsft-border);
}
[data-theme="dark"] .comment-list .children {
    border-left-color: #1a3a3e;
}
[data-theme="dark"] .comment-author.vcard .fn,
[data-theme="dark"] .comment-author.vcard .fn a {
    color: #f0f0f2;
}
[data-theme="dark"] .comment-author.vcard .fn a:hover {
    color: var(--onmsft-blue);
}
[data-theme="dark"] .comment-metadata {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .comment-metadata a {
    color: var(--onmsft-text-muted);
}
[data-theme="dark"] .comment-metadata a:hover {
    color: var(--onmsft-blue);
}
[data-theme="dark"] .comment-content {
    color: var(--onmsft-text);
}
[data-theme="dark"] .comment-respond {
    border-top-color: var(--onmsft-border);
}
[data-theme="dark"] .comment-reply-title {
    color: var(--onmsft-text);
}
[data-theme="dark"] .comment-form label {
    color: var(--onmsft-text);
}
[data-theme="dark"] .comment-form input[type="text"],
[data-theme="dark"] .comment-form input[type="email"],
[data-theme="dark"] .comment-form input[type="url"],
[data-theme="dark"] .comment-form textarea {
    color: var(--onmsft-text);
    background: var(--onmsft-bg);
    border-color: var(--onmsft-border);
}
[data-theme="dark"] .comment-form input[type="text"]:focus,
[data-theme="dark"] .comment-form input[type="email"]:focus,
[data-theme="dark"] .comment-form input[type="url"]:focus,
[data-theme="dark"] .comment-form textarea:focus {
    border-color: #217178;
    box-shadow: 0 0 0 3px rgba(33,113,120,.2);
}
[data-theme="dark"] .comment-pagination a,
[data-theme="dark"] .comment-pagination span {
    color: var(--onmsft-text-muted);
    background: var(--onmsft-bg);
    border-color: var(--onmsft-border);
}
[data-theme="dark"] .comment-pagination a:hover {
    color: var(--onmsft-blue);
    border-color: var(--onmsft-blue);
}

/* --- Page breadcrumbs wrappers --- */
[data-theme="dark"] .onmsft-page__breadcrumbs {
    background: var(--onmsft-white);
}
[data-theme="dark"] .onmsft-author__breadcrumbs {
    background: var(--onmsft-white);
}

/* --- Page Links (multi-page) --- */
[data-theme="dark"] .page-links {
    border-top-color: var(--onmsft-border);
}
[data-theme="dark"] .page-link-number {
    background: var(--onmsft-bg);
    color: var(--onmsft-text);
}


/* ==========================================================================
   PRINT STYLES
   ========================================================================== */
@media print {
    .sidebar-area,
    .article-share,
    .post-navigation,
    .related-posts,
    .comments-area,
    .onmsft-404__search,
    .onmsft-404__categories,
    .breadcrumbs,
    .onmsft-btn {
        display: none !important;
    }
    .content-sidebar-wrap,
    .onmsft-layout--with-sidebar {
        grid-template-columns: 1fr !important;
    }
    .article-content a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}
