/* ============================================================
   NYT-Inspired Homepage Editorial Grid
   ============================================================ */

/* ---- Main Grid Container ---- */
.nyt-homepage {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 0;
}

/* ---- Top Headline (full-width) ---- */
.nyt-homepage__headline {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--nyt-border, #e2e2e2);
    margin-bottom: 0;
}

.nyt-homepage__headline-title {
    font-family: 'Playfair Display', 'nyt-cheltenham', Georgia, 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 0 auto;
    max-width: 800px;
}

.nyt-homepage__headline-title a {
    color: var(--nyt-text-primary, #121212);
    text-decoration: none;
}

.nyt-homepage__headline-title a:hover {
    color: var(--nyt-accent, #567b95);
}

/* ---- Three-Column Grid ---- */
.nyt-homepage__grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr 1fr;
    border-bottom: 1px solid var(--nyt-border, #e2e2e2);
}

/* Columns */
.nyt-homepage__col-left,
.nyt-homepage__col-center,
.nyt-homepage__col-right {
    padding: 20px 0;
}

.nyt-homepage__col-left {
    border-right: 1px solid var(--nyt-border, #e2e2e2);
    padding-right: 24px;
}

.nyt-homepage__col-center {
    padding-left: 24px;
    padding-right: 24px;
    display: flex;
    flex-direction: column;
}

.nyt-homepage__col-right {
    border-left: 1px solid var(--nyt-border, #e2e2e2);
    padding-left: 24px;
}

/* ---- NUCLEAR Reset: Kill ALL parent theme card/post backgrounds ---- */
.nyt-homepage,
.nyt-homepage *,
.nyt-homepage article,
.nyt-homepage .nyt-story-text,
.nyt-homepage .nyt-story-side,
.nyt-homepage .nyt-story-bottom,
.nyt-homepage .nyt-center-story,
.nyt-homepage .nyt-hero,
.nyt-homepage .xpost-item,
.nyt-homepage .xpost-text,
.nyt-homepage .post,
.nyt-homepage .type-post,
.nyt-homepage .status-publish,
.nyt-homepage .hentry,
.nyt-homepage .list-blog-item,
.nyt-homepage [class*="post-"],
.nyt-homepage [class*="entry-"] {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Kill pseudo-element overlays from parent theme */
.nyt-homepage *::before,
.nyt-homepage *::after {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
}

/* Force all titles/links inside homepage grid to use proper colors */
.nyt-homepage a {
    color: var(--nyt-text-primary, #121212);
    text-decoration: none;
}

.nyt-homepage a:hover {
    color: var(--nyt-accent, #567b95);
}

.nyt-homepage .nyt-story-side__category a {
    color: var(--nyt-accent, #567b95);
}

[data-theme="dark"] .nyt-homepage a {
    color: var(--nyt-text-primary, #e8e8e8);
}

[data-theme="dark"] .nyt-homepage a:hover {
    color: var(--nyt-accent, #7eb8da);
}

[data-theme="dark"] .nyt-homepage .nyt-story-side__category a {
    color: var(--nyt-accent, #7eb8da);
}

/* ---- Text-Only Story (Left Column) ---- */
.nyt-story-text {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--nyt-border, #e2e2e2);
    background: transparent;
}

.nyt-story-text:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.nyt-story-text__title {
    font-family: 'Playfair Display', 'nyt-cheltenham', Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 8px 0;
}

.nyt-story-text__title a {
    color: var(--nyt-text-primary, #121212);
    text-decoration: none;
}

.nyt-story-text__title a:hover {
    color: var(--nyt-accent, #567b95);
}

.nyt-story-text__excerpt {
    font-family: 'nyt-imperial', Georgia, 'Times New Roman', serif;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--nyt-text-secondary, #5a5a5a);
    margin: 0 0 8px 0;
}

.nyt-story-text__excerpt p {
    margin: 0;
}

.nyt-story-text__reading-time {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--nyt-text-muted, #999);
}

/* ---- Hero Image (Center Column) ---- */
.nyt-hero {
    display: flex;
    flex-direction: column;
    background: transparent;
}

.nyt-hero__image {
    width: 100%;
    display: block;
}

.nyt-hero__image img {
    width: 100%;
    height: auto;
    display: block;
}

.nyt-hero__caption {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.72rem;
    color: var(--nyt-text-muted, #999);
    margin-top: 8px;
    line-height: 1.4;
    text-align: right;
}

/* ---- Center Column Sub-Stories (below hero image) ---- */
.nyt-center-stories {
    margin-top: 20px;
    border-top: 1px solid var(--nyt-border, #e2e2e2);
    padding-top: 20px;
    flex: 1;
}

.nyt-center-story {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--nyt-border, #e2e2e2);
    background: transparent !important;
}

.nyt-center-story:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.nyt-center-story__content {
    flex: 1;
    min-width: 0;
}

.nyt-center-story__title {
    font-family: 'Playfair Display', 'nyt-cheltenham', Georgia, 'Times New Roman', serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 6px 0;
}

.nyt-center-story__title a {
    color: var(--nyt-text-primary, #121212);
    text-decoration: none;
}

.nyt-center-story__title a:hover {
    color: var(--nyt-accent, #567b95);
}

.nyt-center-story__excerpt {
    font-family: 'nyt-imperial', Georgia, 'Times New Roman', serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--nyt-text-secondary, #5a5a5a);
    margin: 0 0 6px 0;
}

.nyt-center-story__excerpt p {
    margin: 0;
}

.nyt-center-story__reading-time {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--nyt-text-muted, #999);
}

.nyt-center-story__thumb {
    flex: 0 0 100px;
}

.nyt-center-story__thumb img {
    width: 100px;
    height: 68px;
    object-fit: cover;
    display: block;
}

/* ---- Side Story with Thumbnail (Right Column) ---- */
.nyt-story-side {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--nyt-border, #e2e2e2);
    background: transparent;
}

.nyt-story-side:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.nyt-story-side__category {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.nyt-story-side__category a {
    color: var(--nyt-accent, #567b95);
    text-decoration: none;
}

.nyt-story-side__category a:hover {
    text-decoration: underline;
}

.nyt-story-side__title {
    font-family: 'Playfair Display', 'nyt-cheltenham', Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 8px 0;
}

.nyt-story-side__title a {
    color: var(--nyt-text-primary, #121212);
    text-decoration: none;
}

.nyt-story-side__title a:hover {
    color: var(--nyt-accent, #567b95);
}

.nyt-story-side__excerpt {
    font-family: 'nyt-imperial', Georgia, 'Times New Roman', serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--nyt-text-secondary, #5a5a5a);
    margin: 0 0 8px 0;
}

.nyt-story-side__excerpt p {
    margin: 0;
}

.nyt-story-side__reading-time {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--nyt-text-muted, #999);
    margin-bottom: 10px;
}

.nyt-story-side__image {
    margin-top: 12px;
    display: block;
}

.nyt-story-side__image img {
    width: 100%;
    height: auto;
    display: block;
}

.nyt-story-side__image-caption {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.68rem;
    color: var(--nyt-text-muted, #999);
    margin-top: 4px;
    text-align: right;
}

/* ---- Bottom Row ---- */
.nyt-homepage__bottom {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 20px 0;
    border-bottom: 1px solid var(--nyt-border, #e2e2e2);
}

.nyt-story-bottom {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 0 20px;
    border-right: 1px solid var(--nyt-border, #e2e2e2);
    background: transparent !important;
}

.nyt-story-bottom:first-child {
    padding-left: 0;
}

.nyt-story-bottom:last-child {
    border-right: none;
    padding-right: 0;
}

.nyt-story-bottom__content {
    flex: 1;
    min-width: 0;
}

.nyt-story-bottom__title {
    font-family: 'Playfair Display', 'nyt-cheltenham', Georgia, 'Times New Roman', serif;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 6px 0;
}

.nyt-story-bottom__title a {
    color: var(--nyt-text-primary, #121212);
    text-decoration: none;
}

.nyt-story-bottom__title a:hover {
    color: var(--nyt-accent, #567b95);
}

.nyt-story-bottom__reading-time {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--nyt-text-muted, #999);
}

.nyt-story-bottom__thumb {
    flex: 0 0 120px;
}

.nyt-story-bottom__thumb img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    display: block;
}

/* ---- Remaining Posts (Standard List below the grid) ---- */
.nyt-homepage__more {
    padding-top: 24px;
}

.nyt-homepage__more-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nyt-text-primary, #121212);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--nyt-text-primary, #121212);
}

/* ---- Pagination within homepage ---- */
.nyt-homepage .navigation.pagination {
    border-top: none;
    padding-top: 16px;
    margin-top: 8px;
}

/* ============================================================
   Dark Mode
   ============================================================ */

[data-theme="dark"] .nyt-homepage__headline-title a {
    color: var(--nyt-text-primary, #e8e8e8);
}

[data-theme="dark"] .nyt-homepage__headline-title a:hover {
    color: var(--nyt-accent, #7eb8da);
}

[data-theme="dark"] .nyt-homepage__headline {
    border-bottom-color: #333;
}

[data-theme="dark"] .nyt-homepage__grid {
    border-bottom-color: #333;
}

[data-theme="dark"] .nyt-homepage__col-left {
    border-right-color: #333;
}

[data-theme="dark"] .nyt-homepage__col-right {
    border-left-color: #333;
}

[data-theme="dark"] .nyt-story-text {
    border-bottom-color: #333;
}

[data-theme="dark"] .nyt-story-text__title a {
    color: var(--nyt-text-primary, #e8e8e8);
}

[data-theme="dark"] .nyt-story-text__title a:hover {
    color: var(--nyt-accent, #7eb8da);
}

[data-theme="dark"] .nyt-story-text__excerpt {
    color: var(--nyt-text-secondary, #999);
}

[data-theme="dark"] .nyt-center-stories {
    border-top-color: #333;
}

[data-theme="dark"] .nyt-center-story {
    border-bottom-color: #333;
}

[data-theme="dark"] .nyt-center-story__title a {
    color: var(--nyt-text-primary, #e8e8e8);
}

[data-theme="dark"] .nyt-center-story__title a:hover {
    color: var(--nyt-accent, #7eb8da);
}

[data-theme="dark"] .nyt-center-story__excerpt {
    color: var(--nyt-text-secondary, #999);
}

[data-theme="dark"] .nyt-story-side {
    border-bottom-color: #333;
}

[data-theme="dark"] .nyt-story-side__title a {
    color: var(--nyt-text-primary, #e8e8e8);
}

[data-theme="dark"] .nyt-story-side__title a:hover {
    color: var(--nyt-accent, #7eb8da);
}

[data-theme="dark"] .nyt-story-side__excerpt {
    color: var(--nyt-text-secondary, #999);
}

[data-theme="dark"] .nyt-homepage__bottom {
    border-bottom-color: #333;
}

[data-theme="dark"] .nyt-story-bottom {
    border-right-color: #333;
}

[data-theme="dark"] .nyt-story-bottom__title a {
    color: var(--nyt-text-primary, #e8e8e8);
}

[data-theme="dark"] .nyt-story-bottom__title a:hover {
    color: var(--nyt-accent, #7eb8da);
}

[data-theme="dark"] .nyt-homepage__more-title {
    color: var(--nyt-text-primary, #e8e8e8);
    border-bottom-color: #e8e8e8;
}

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

@media (max-width: 1024px) {
    .nyt-homepage__grid {
        grid-template-columns: 1fr 1fr;
    }

    .nyt-homepage__col-right {
        grid-column: 1 / -1;
        border-left: none;
        border-top: 1px solid var(--nyt-border, #e2e2e2);
        padding-left: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 24px;
    }

    [data-theme="dark"] .nyt-homepage__col-right {
        border-top-color: #333;
    }

    .nyt-homepage__col-right .nyt-story-side:nth-child(odd) {
        border-right: 1px solid var(--nyt-border, #e2e2e2);
        padding-right: 24px;
    }

    [data-theme="dark"] .nyt-homepage__col-right .nyt-story-side:nth-child(odd) {
        border-right-color: #333;
    }

    .nyt-homepage__bottom {
        grid-template-columns: repeat(2, 1fr);
    }

    .nyt-story-bottom:nth-child(2) {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .nyt-homepage {
        padding: 20px 16px 0;
    }

    .nyt-homepage__headline-title {
        font-size: 1.85rem;
    }

    .nyt-homepage__grid {
        grid-template-columns: 1fr;
    }

    .nyt-homepage__col-left {
        border-right: none;
        border-bottom: 1px solid var(--nyt-border, #e2e2e2);
        padding-right: 0;
    }

    [data-theme="dark"] .nyt-homepage__col-left {
        border-bottom-color: #333;
    }

    .nyt-homepage__col-center {
        padding-left: 0;
        padding-right: 0;
        border-bottom: 1px solid var(--nyt-border, #e2e2e2);
    }

    [data-theme="dark"] .nyt-homepage__col-center {
        border-bottom-color: #333;
    }

    .nyt-homepage__col-right {
        grid-template-columns: 1fr;
        border-left: none;
        padding-left: 0;
    }

    .nyt-homepage__col-right .nyt-story-side:nth-child(odd) {
        border-right: none;
        padding-right: 0;
    }

    .nyt-homepage__bottom {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .nyt-story-bottom {
        padding: 16px 0;
        border-right: none;
        border-bottom: 1px solid var(--nyt-border, #e2e2e2);
    }

    [data-theme="dark"] .nyt-story-bottom {
        border-bottom-color: #333;
    }

    .nyt-story-bottom:last-child {
        border-bottom: none;
    }

    .nyt-center-story__thumb {
        flex: 0 0 80px;
    }

    .nyt-center-story__thumb img {
        width: 80px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .nyt-homepage__headline-title {
        font-size: 1.55rem;
    }

    .nyt-story-bottom__thumb {
        flex: 0 0 90px;
    }

    .nyt-story-bottom__thumb img {
        width: 90px;
        height: 60px;
    }
}

/* ---- More Stories List (Posts 13+) ---- */
.nyt-homepage__more {
    margin-top: 60px;
    border-top: 1px solid var(--nyt-border, #e2e2e2);
    padding-top: 40px;
}

.nyt-homepage__more-title {
    font-family: var(--nyt-sans, 'Manrope', sans-serif);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--nyt-text-primary, #121212);
    margin-bottom: 24px;
    border-bottom: 1px solid var(--nyt-border, #e2e2e2);
    padding-bottom: 12px;
}

.nyt-story-list {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 0;
    border-bottom: 1px solid var(--nyt-border, #e2e2e2);
    gap: 24px;
}

.nyt-story-list:last-child {
    border-bottom: none;
}

.nyt-story-list__content {
    flex: 1;
    min-width: 0;
}

.nyt-story-list__category {
    font-family: var(--nyt-sans, 'Manrope', sans-serif);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--nyt-text-primary, #121212);
    margin-bottom: 8px;
}

.nyt-story-list__category a {
    color: inherit;
    text-decoration: none;
}

.nyt-story-list__title {
    font-family: var(--nyt-serif, 'Playfair Display', serif);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
}

.nyt-story-list__title a {
    color: var(--nyt-text-primary, #121212);
    text-decoration: none;
}

.nyt-story-list__title a:hover {
    color: var(--nyt-accent, #567b95);
}

.nyt-story-list__excerpt {
    font-family: var(--nyt-serif, 'Playfair Display', serif);
    font-size: 15px;
    line-height: 1.5;
    color: var(--nyt-text-secondary, #5a5a5a);
    margin-bottom: 12px;
}

.nyt-story-list__meta {
    font-family: var(--nyt-sans, 'Manrope', sans-serif);
    font-size: 11px;
    color: var(--nyt-text-muted, #999999);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nyt-story-list__thumb {
    flex-shrink: 0;
    width: 250px;
}

.nyt-story-list__thumb img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 3/2;
}

/* Dark Mode Support for More Stories */
[data-theme="dark"] .nyt-story-list__category {
    color: var(--nyt-text-primary, #e8e8e8);
}
[data-theme="dark"] .nyt-story-list__title a {
    color: var(--nyt-text-primary, #e8e8e8);
}
[data-theme="dark"] .nyt-story-list__excerpt {
    color: var(--nyt-text-secondary, #b3b3b3);
}
[data-theme="dark"] .nyt-homepage__more-title {
    color: var(--nyt-text-primary, #e8e8e8);
}

/* Responsive */
@media (max-width: 768px) {
    .nyt-story-list {
        flex-direction: column-reverse;
        gap: 16px;
    }
    .nyt-story-list__thumb {
        width: 100%;
    }
    .nyt-story-list__title {
        font-size: 20px;
    }
}



/* ---- Mobile Hero Image Fix ---- */
.nyt-homepage__mobile-hero {
    display: none;
}

@media (max-width: 768px) {
    .nyt-homepage__mobile-hero {
        display: block;
        margin-top: 16px;
    }
    .nyt-homepage__col-center > .nyt-hero {
        display: none !important;
    }

}

/* ---- Advertisement Block (Universal) ---- */
.nyt-ad-block {
    display: block;
    margin-bottom: 24px;
    text-align: center;
}
.nyt-ad-block__label {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nyt-text-muted, #999);
    margin-bottom: 8px;
}
.nyt-ad-block__content {
    background-color: #f4f4f4;
    border: 1px solid var(--nyt-border, #e2e2e2);
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}
[data-theme="dark"] .nyt-ad-block__content {
    background-color: #1a1a1a;
}
.nyt-ad-block__placeholder-text {
    font-family: 'nyt-franklin', sans-serif;
    font-size: 0.9rem;
    color: var(--nyt-text-muted, #999);
}
.nyt-ad-block__link {
    display: block;
    width: 100%;
}
.nyt-ad-block__image {
    width: 85%;
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--nyt-border, #e2e2e2);
}
