/*
Theme Name: FiveThirtyEight
Theme URI: https://example.com/fivethirtyeight-starter
Author: Custom
Author URI: https://example.com
Description: Data-driven blog theme inspired by FiveThirtyEight. Clear typography, bold orange accents, statistics-focused design.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fivethirtyeight
Tags: blog, news, data, statistics, analytics
*/

/* === CSS Variables === */
:root {
    --fte-primary: #ed713a;
    --fte-secondary: #222222;
    --fte-accent: #3ea8ff;
    --fte-bg: #ffffff;
    --fte-bg-alt: #f5f5f5;
    --fte-text: #222222;
    --fte-text-light: #666666;
    --fte-border: #ddd;
    --fte-link: var(--fte-primary);
    --fte-font-heading: 'Roboto', -apple-system, sans-serif;
    --fte-font-body: 'Roboto', -apple-system, sans-serif;
    --fte-font-mono: 'Roboto Mono', monospace;
    --fte-max-width: 1200px;
    --fte-content-width: 720px;
    --fte-transition: 0.15s ease;
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--fte-font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--fte-text);
    background: var(--fte-bg);
}

a {
    color: var(--fte-link);
    text-decoration: none;
    transition: color var(--fte-transition);
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--fte-font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: var(--fte-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin: 0 0 1.25rem;
}

blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--fte-bg-alt);
    border-left: 4px solid var(--fte-primary);
    font-style: normal;
}

/* === Layout === */
.fte-container {
    max-width: var(--fte-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.fte-container--narrow {
    max-width: var(--fte-content-width);
}

/* === Skip Link === */
.fte-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    background: var(--fte-primary);
    color: #fff;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
}

.fte-skip:focus {
    left: 0;
}

/* === Header === */
.fte-header {
    background: var(--fte-secondary);
    padding: 0;
}

.fte-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.fte-logo {
    display: flex;
    align-items: center;
}

.fte-logo img {
    height: 32px;
    width: auto;
}

.fte-site-name {
    font-family: var(--fte-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fte-site-name a {
    color: #fff;
}

.fte-site-name a:hover {
    text-decoration: none;
    color: var(--fte-primary);
}

/* === Navigation === */
.fte-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fte-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0;
}

.fte-menu li {
    position: relative;
}

.fte-menu a {
    display: block;
    padding: 0 1rem;
    line-height: 60px;
    font-family: var(--fte-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.05em;
}

.fte-menu a:hover,
.fte-menu .current-menu-item a {
    background: var(--fte-primary);
    text-decoration: none;
}

.fte-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-family: var(--fte-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.5rem 1rem;
}

.fte-search-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
}

.fte-search-btn:hover {
    color: var(--fte-primary);
}

/* === Main Content === */
.fte-main {
    padding: 2rem 0;
    min-height: 60vh;
}

/* === Article Grid === */
.fte-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

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

/* === Article Card === */
.fte-card {
    background: var(--fte-bg);
    border: 1px solid var(--fte-border);
    transition: box-shadow var(--fte-transition);
}

.fte-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fte-card--featured {
    grid-column: span 2;
}

.fte-card--sticky {
    border-color: var(--fte-primary);
    border-width: 2px;
}

.fte-card__image {
    position: relative;
    overflow: hidden;
}

.fte-card__image img {
    width: 100%;
    transition: transform var(--fte-transition);
}

.fte-card:hover .fte-card__image img {
    transform: scale(1.03);
}

.fte-card__cat {
    position: absolute;
    top: 0;
    left: 0;
    background: var(--fte-primary);
    color: #fff;
    font-family: var(--fte-font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    letter-spacing: 0.05em;
}

.fte-card__body {
    padding: 1.25rem;
}

.fte-card__title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.fte-card__title a {
    color: var(--fte-secondary);
}

.fte-card__title a:hover {
    color: var(--fte-primary);
    text-decoration: none;
}

.fte-card--featured .fte-card__title {
    font-size: 1.5rem;
}

.fte-card__meta {
    font-family: var(--fte-font-mono);
    font-size: 0.7rem;
    color: var(--fte-text-light);
    text-transform: uppercase;
}

.fte-card__meta span {
    margin-right: 1rem;
}

.fte-card__excerpt {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--fte-text-light);
}

.fte-card__badge {
    display: inline-block;
    background: var(--fte-primary);
    color: #fff;
    font-family: var(--fte-font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    margin: 0.75rem;
    letter-spacing: 0.05em;
}

.fte-sticky-badge {
    display: inline-block;
    background: var(--fte-primary);
    color: #fff;
    font-family: var(--fte-font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

/* === Single Post === */
.fte-single {
    max-width: var(--fte-content-width);
    margin: 0 auto;
}

.fte-single__header {
    margin-bottom: 2rem;
}

.fte-single__cat {
    display: inline-block;
    background: var(--fte-primary);
    color: #fff;
    font-family: var(--fte-font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.fte-single__title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.fte-single__meta {
    font-family: var(--fte-font-mono);
    font-size: 0.75rem;
    color: var(--fte-text-light);
    text-transform: uppercase;
}

.fte-single__meta span {
    margin-right: 1.5rem;
}

.fte-single__featured {
    margin: 2rem 0;
}

.fte-single__featured img {
    width: 100%;
}

.fte-single__content {
    font-size: 1.1rem;
    line-height: 1.75;
}

.fte-single__content h2 {
    margin-top: 2.5rem;
}

.fte-single__content h3 {
    margin-top: 2rem;
}

.fte-single__content ul,
.fte-single__content ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.fte-single__content li {
    margin-bottom: 0.5rem;
}

/* Tags */
.fte-tags {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fte-border);
}

.fte-tags__title {
    font-family: var(--fte-font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fte-text-light);
    margin-bottom: 0.75rem;
}

.fte-tags a {
    display: inline-block;
    background: var(--fte-bg-alt);
    font-family: var(--fte-font-mono);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    margin: 0 0.25rem 0.5rem 0;
    color: var(--fte-text);
}

.fte-tags a:hover {
    background: var(--fte-primary);
    color: #fff;
    text-decoration: none;
}

/* Author */
.fte-author {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--fte-bg-alt);
    display: flex;
    gap: 1.5rem;
}

.fte-author__avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.fte-author__name {
    font-family: var(--fte-font-heading);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.fte-author__bio {
    font-size: 0.9rem;
    color: var(--fte-text-light);
    margin: 0;
}

/* Post Navigation */
.fte-post-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fte-border);
}

.fte-post-nav__item {
    flex: 1;
}

.fte-post-nav__item--next {
    text-align: right;
}

.fte-post-nav__label {
    font-family: var(--fte-font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fte-text-light);
    display: block;
    margin-bottom: 0.25rem;
}

.fte-post-nav__title {
    font-family: var(--fte-font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fte-secondary);
}

.fte-post-nav__title:hover {
    color: var(--fte-primary);
    text-decoration: none;
}

/* Related */
.fte-related {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--fte-border);
}

.fte-related__title {
    font-family: var(--fte-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fte-text-light);
    margin-bottom: 1.5rem;
}

.fte-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.fte-related__item-title {
    font-family: var(--fte-font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
}

.fte-related__item-title a {
    color: var(--fte-secondary);
}

.fte-related__item-title a:hover {
    color: var(--fte-primary);
    text-decoration: none;
}

/* === Page === */
.fte-page {
    max-width: var(--fte-content-width);
    margin: 0 auto;
}

.fte-page__title {
    font-size: 2.25rem;
    margin-bottom: 2rem;
}

.fte-page__content {
    font-size: 1.1rem;
    line-height: 1.75;
}

/* === Archive === */
.fte-archive__header {
    padding: 2rem 0;
    background: var(--fte-bg-alt);
    margin-bottom: 2rem;
}

.fte-archive__label {
    font-family: var(--fte-font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--fte-text-light);
    display: block;
    margin-bottom: 0.5rem;
}

.fte-archive__title {
    font-size: 2rem;
    margin: 0;
}

/* === Search === */
.fte-search-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.fte-search-form input[type="search"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--fte-border);
    border-right: none;
    font-family: var(--fte-font-body);
    font-size: 1rem;
}

.fte-search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--fte-primary);
}

.fte-search-form button {
    padding: 0.75rem 1.5rem;
    background: var(--fte-primary);
    color: #fff;
    border: none;
    font-family: var(--fte-font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.fte-search-form button:hover {
    background: var(--fte-secondary);
}

.fte-search-results {
    text-align: center;
    margin-bottom: 2rem;
}

.fte-search-results__count {
    font-family: var(--fte-font-mono);
    font-size: 0.8rem;
    color: var(--fte-text-light);
}

/* === 404 === */
.fte-404 {
    text-align: center;
    padding: 4rem 0;
}

.fte-404__title {
    font-size: 6rem;
    color: var(--fte-primary);
    margin-bottom: 1rem;
}

.fte-404__text {
    font-size: 1.25rem;
    color: var(--fte-text-light);
    margin-bottom: 2rem;
}

.fte-404__home {
    display: inline-block;
    background: var(--fte-primary);
    color: #fff;
    font-family: var(--fte-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.75rem 2rem;
}

.fte-404__home:hover {
    background: var(--fte-secondary);
    text-decoration: none;
}

/* === Comments === */
.fte-comments {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--fte-border);
}

.fte-comments__title {
    font-family: var(--fte-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fte-text-light);
    margin-bottom: 1.5rem;
}

.fte-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fte-comment {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--fte-border);
}

.fte-comment__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.fte-comment__avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.fte-comment__author {
    font-family: var(--fte-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.fte-comment__date {
    font-family: var(--fte-font-mono);
    font-size: 0.7rem;
    color: var(--fte-text-light);
}

.fte-comment__body {
    font-size: 0.95rem;
}

.fte-comment__reply a {
    font-family: var(--fte-font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fte-text-light);
}

.fte-comment__reply a:hover {
    color: var(--fte-primary);
    text-decoration: none;
}

.fte-comment-form input,
.fte-comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--fte-border);
    font-family: var(--fte-font-body);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.fte-comment-form input:focus,
.fte-comment-form textarea:focus {
    outline: none;
    border-color: var(--fte-primary);
}

.fte-comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.fte-comment-form button {
    background: var(--fte-primary);
    color: #fff;
    border: none;
    padding: 0.75rem 2rem;
    font-family: var(--fte-font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.fte-comment-form button:hover {
    background: var(--fte-secondary);
}

/* === Breadcrumbs === */
.fte-breadcrumbs {
    padding: 1rem 0;
    background: var(--fte-bg-alt);
}

.fte-breadcrumbs__inner {
    font-family: var(--fte-font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--fte-text-light);
}

.fte-breadcrumbs a {
    color: var(--fte-text-light);
}

.fte-breadcrumbs a:hover {
    color: var(--fte-primary);
    text-decoration: none;
}

.fte-breadcrumbs__sep {
    margin: 0 0.5rem;
}

/* === Pagination === */
.fte-pagination {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-top: 2rem;
}

.fte-pagination a,
.fte-pagination span {
    font-family: var(--fte-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    color: var(--fte-secondary);
}

.fte-pagination a:hover {
    background: var(--fte-primary);
    color: #fff;
    text-decoration: none;
}

.fte-pagination .current {
    background: var(--fte-secondary);
    color: #fff;
}

/* === Sidebar === */
.fte-sidebar {
    padding-top: 2rem;
}

.fte-widget {
    margin-bottom: 2rem;
}

.fte-widget__title {
    font-family: var(--fte-font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--fte-text-light);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--fte-primary);
    margin-bottom: 1rem;
}

.fte-widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fte-widget li {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--fte-border);
}

.fte-widget a {
    color: var(--fte-text);
    font-size: 0.9rem;
}

.fte-widget a:hover {
    color: var(--fte-primary);
    text-decoration: none;
}

/* === Footer === */
.fte-footer {
    background: var(--fte-secondary);
    color: #fff;
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.fte-footer__widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.fte-footer .fte-widget__title {
    color: #fff;
    border-bottom-color: var(--fte-primary);
}

.fte-footer .fte-widget li {
    border-bottom-color: rgba(255,255,255,0.1);
}

.fte-footer .fte-widget a {
    color: rgba(255,255,255,0.7);
}

.fte-footer .fte-widget a:hover {
    color: var(--fte-primary);
}

.fte-footer__bottom {
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fte-footer__copy {
    font-family: var(--fte-font-mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
}

.fte-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.fte-footer-menu a {
    font-family: var(--fte-font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}

.fte-footer-menu a:hover {
    color: var(--fte-primary);
    text-decoration: none;
}

/* === Scroll to Top === */
.fte-scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--fte-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--fte-transition), visibility var(--fte-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.fte-scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.fte-scroll-top:hover {
    background: var(--fte-secondary);
}

/* === Utility === */
.fte-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Media Queries === */
@media (max-width: 1024px) {
    .fte-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fte-card--featured {
        grid-column: span 2;
    }

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

@media (max-width: 768px) {
    .fte-header__inner {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem 0;
    }

    .fte-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        background: var(--fte-secondary);
    }

    .fte-menu.open {
        display: flex;
    }

    .fte-menu a {
        line-height: normal;
        padding: 1rem;
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .fte-menu-btn {
        display: block;
    }

    .fte-grid {
        grid-template-columns: 1fr;
    }

    .fte-card--featured {
        grid-column: span 1;
    }

    .fte-single__title {
        font-size: 1.75rem;
    }

    .fte-related__grid {
        grid-template-columns: 1fr;
    }

    .fte-post-nav {
        flex-direction: column;
        gap: 1.5rem;
    }

    .fte-post-nav__item--next {
        text-align: left;
    }

    .fte-author {
        flex-direction: column;
        text-align: center;
    }

    .fte-footer__widgets {
        grid-template-columns: 1fr;
    }

    .fte-footer__bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .fte-footer-menu {
        justify-content: center;
    }
}

/* Interlinking Section */
.five-interlinking {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}
.five-interlinking-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}
.five-interlinking-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.five-interlinking-list li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
}
.five-interlinking-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--five-color-primary, #333);
}
.five-interlinking-list a {
    color: var(--five-color-primary, #333);
    text-decoration: none;
}
.five-interlinking-list a:hover {
    text-decoration: underline;
}

/* === Grid Layouts === */
.fte-grid.grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.fte-grid.grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}
.fte-grid.grid-list {
    display: block;
}
.fte-grid.grid-list .fte-card {
    margin-bottom: 30px;
}
@media (max-width: 1024px) {
    .fte-grid.grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    .fte-grid.grid-3col,
    .fte-grid.grid-2col {
        grid-template-columns: 1fr;
    }
}
