/* ============================================
   TFPP Theme — Main Stylesheet
   Mobile-first, < 500KB target
   ============================================ */

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

:root {
    --tfpp-dark: #0a0f1e;
    --tfpp-gold: #c9a227;
    --tfpp-gold-light: #d4b44a;
    --tfpp-white: #ffffff;
    --tfpp-gray-50: #f8f9fa;
    --tfpp-gray-100: #f0f1f3;
    --tfpp-gray-200: #e2e4e8;
    --tfpp-gray-400: #9ca3af;
    --tfpp-gray-600: #6b7280;
    --tfpp-gray-800: #1f2937;
    --tfpp-red: #cc2222;
    --tfpp-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --tfpp-font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --tfpp-container: 1200px;
    --tfpp-radius: 4px;
    --tfpp-header-h: 64px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--tfpp-font-body);
    color: var(--tfpp-gray-800);
    background: var(--tfpp-gray-50);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.screen-reader-text {
    clip: rect(1px,1px,1px,1px);
    position: absolute;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* --- Container --- */
.tfpp-container {
    width: 100%;
    max-width: var(--tfpp-container);
    margin: 0 auto;
    padding: 0 1rem;
}
.tfpp-container--narrow { max-width: 780px; }

/* --- Breaking Banner --- */
.tfpp-breaking {
    background: var(--tfpp-red);
    color: var(--tfpp-white);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    z-index: 1000;
}
.tfpp-breaking__inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.tfpp-breaking__badge {
    background: rgba(0,0,0,0.3);
    padding: 0.125rem 0.5rem;
    border-radius: 2px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
}
.tfpp-breaking__link {
    color: var(--tfpp-white);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tfpp-breaking__link:hover { text-decoration: underline; }
.tfpp-breaking__close {
    background: none;
    border: none;
    color: var(--tfpp-white);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 0.25rem;
    opacity: 0.8;
    flex-shrink: 0;
}
.tfpp-breaking__close:hover { opacity: 1; }
.tfpp-breaking--hidden { display: none; }

/* --- Header --- */
.tfpp-header {
    background: var(--tfpp-dark);
    position: sticky;
    top: 0;
    z-index: 900;
    height: var(--tfpp-header-h);
    border-bottom: 1px solid rgba(201,162,39,0.15);
}
.tfpp-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}
.tfpp-header__logo { flex-shrink: 0; }
.tfpp-logo-text {
    font-family: var(--tfpp-font-display);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--tfpp-gold);
    letter-spacing: 0.01em;
}
.tfpp-logo-text--footer { font-size: 1.2rem; }

/* Hamburger */
.tfpp-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 950;
}
.tfpp-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--tfpp-white);
    transition: transform 0.3s, opacity 0.3s;
}
.tfpp-hamburger.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tfpp-hamburger.is-active span:nth-child(2) { opacity: 0; }
.tfpp-hamburger.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav */
.tfpp-nav {
    display: none;
    position: fixed;
    top: var(--tfpp-header-h);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--tfpp-dark);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 899;
}
.tfpp-nav.is-open { display: block; }

.tfpp-nav__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.tfpp-nav__list li a {
    display: block;
    color: var(--tfpp-white);
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.85rem;
    transition: color 0.2s;
}
.tfpp-nav__list li a:hover,
.tfpp-nav__list li.current-menu-item a,
.tfpp-nav__list li.current-cat a {
    color: var(--tfpp-gold);
}

.tfpp-nav__search {
    margin-top: 1rem;
}
.tfpp-nav__search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--tfpp-radius);
    background: rgba(255,255,255,0.05);
    color: var(--tfpp-white);
    font-size: 0.9rem;
    font-family: var(--tfpp-font-body);
}
.tfpp-nav__search input::placeholder { color: var(--tfpp-gray-400); }

/* --- Hero --- */
.tfpp-hero {
    position: relative;
    min-height: 50vh;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
    background-color: var(--tfpp-dark);
}
.tfpp-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,15,30,0.95) 0%, rgba(10,15,30,0.4) 50%, rgba(10,15,30,0.2) 100%);
}
.tfpp-hero__inner { position: relative; z-index: 1; padding: 2rem 1rem; width: 100%; }
.tfpp-hero__content { max-width: 700px; }
.tfpp-hero__category {
    display: inline-block;
    background: var(--tfpp-gold);
    color: var(--tfpp-dark);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    margin-bottom: 0.75rem;
}
.tfpp-hero__title {
    font-family: var(--tfpp-font-display);
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--tfpp-white);
    margin-bottom: 0.75rem;
}
.tfpp-hero__title a { color: inherit; }
.tfpp-hero__title a:hover { color: var(--tfpp-gold-light); }
.tfpp-hero__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tfpp-gray-400);
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}
.tfpp-hero__excerpt {
    color: var(--tfpp-gray-200);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* --- Section Title --- */
.tfpp-section-title {
    font-family: var(--tfpp-font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--tfpp-dark);
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--tfpp-gold);
    display: inline-block;
}

/* --- Grid --- */
.tfpp-grid-section { padding: 2.5rem 0 3rem; }
.tfpp-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* --- Article Card --- */
.tfpp-card {
    background: var(--tfpp-white);
    border-radius: var(--tfpp-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}
.tfpp-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.tfpp-card__image-link { display: block; }
.tfpp-card__image-link img {
    width: 100%;
    aspect-ratio: 1200/630;
    object-fit: cover;
}
.tfpp-card__body { padding: 1rem; }
.tfpp-card__category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--tfpp-gold);
    margin-bottom: 0.4rem;
}
.tfpp-card__category:hover { text-decoration: underline; }
.tfpp-card__title {
    font-family: var(--tfpp-font-display);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}
.tfpp-card__title a:hover { color: var(--tfpp-gold); }
.tfpp-card__excerpt {
    font-size: 0.875rem;
    color: var(--tfpp-gray-600);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}
.tfpp-card__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--tfpp-gray-400);
}

/* --- Single Article --- */
.tfpp-single__header {
    background: var(--tfpp-dark);
    padding: 2.5rem 0 2rem;
}
.tfpp-single__category {
    display: inline-block;
    background: var(--tfpp-gold);
    color: var(--tfpp-dark);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    margin-bottom: 0.75rem;
}
.tfpp-single__title {
    font-family: var(--tfpp-font-display);
    font-size: 1.75rem;
    font-weight: 900;
    line-height: 1.2;
    color: var(--tfpp-white);
    margin-bottom: 0.75rem;
}
.tfpp-single__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tfpp-gray-400);
    font-size: 0.85rem;
}
.tfpp-single__separator { color: var(--tfpp-gray-400); }
.tfpp-single__image {
    margin-top: -1rem;
    margin-bottom: 2rem;
}
.tfpp-single__image img {
    width: 100%;
    border-radius: var(--tfpp-radius);
    aspect-ratio: 1200/630;
    object-fit: cover;
}
.tfpp-single__body { padding: 0 0 3rem; }
.tfpp-single__layout { position: relative; }

/* Prose */
.tfpp-prose {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--tfpp-gray-800);
}
.tfpp-prose p { margin-bottom: 1.25rem; }
.tfpp-prose h2, .tfpp-prose h3 {
    font-family: var(--tfpp-font-display);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}
.tfpp-prose h2 { font-size: 1.5rem; }
.tfpp-prose h3 { font-size: 1.2rem; }
.tfpp-prose blockquote {
    border-left: 3px solid var(--tfpp-gold);
    padding: 0.5rem 1rem;
    margin: 1.5rem 0;
    color: var(--tfpp-gray-600);
    font-style: italic;
}
.tfpp-prose a { color: var(--tfpp-gold); text-decoration: underline; }
.tfpp-prose a:hover { color: var(--tfpp-gold-light); }
.tfpp-prose ul, .tfpp-prose ol { margin-bottom: 1.25rem; padding-left: 1.5rem; }
.tfpp-prose li { margin-bottom: 0.4rem; }
.tfpp-prose img { border-radius: var(--tfpp-radius); margin: 1.5rem 0; }

/* TFPP Angle Box */
.tfpp-angle-box {
    background: var(--tfpp-dark);
    border-left: 4px solid var(--tfpp-gold);
    border-radius: var(--tfpp-radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}
.tfpp-angle-box__label {
    font-family: var(--tfpp-font-display);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--tfpp-gold);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}
.tfpp-angle-box__content {
    color: var(--tfpp-gray-200);
    font-size: 0.95rem;
    line-height: 1.6;
}
.tfpp-angle-box__content p:last-child { margin-bottom: 0; }

/* Share Buttons */
.tfpp-share {
    display: flex;
    gap: 0.5rem;
}
.tfpp-share__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--tfpp-gray-200);
    background: var(--tfpp-white);
    color: var(--tfpp-gray-600);
    cursor: pointer;
    transition: all 0.2s;
}
.tfpp-share__btn:hover {
    border-color: var(--tfpp-gold);
    color: var(--tfpp-gold);
}
.tfpp-share__btn--facebook:hover { color: #1877f2; border-color: #1877f2; }
.tfpp-share__btn--twitter:hover { color: #000; border-color: #000; }
.tfpp-share__btn--telegram:hover { color: #0088cc; border-color: #0088cc; }

/* Desktop: floating share */
.tfpp-single__share-bottom { margin-top: 2rem; }

/* Mobile fixed bottom share */
@media (max-width: 767px) {
    .tfpp-single__layout > .tfpp-share { display: none; }
    .tfpp-single__share-bottom .tfpp-share {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--tfpp-white);
        border-top: 1px solid var(--tfpp-gray-200);
        padding: 0.5rem;
        justify-content: center;
        z-index: 800;
        gap: 1rem;
    }
}
@media (min-width: 768px) {
    .tfpp-single__share-bottom { display: none; }
    .tfpp-single__layout > .tfpp-share {
        position: sticky;
        top: calc(var(--tfpp-header-h) + 1.5rem);
        flex-direction: column;
        float: left;
        margin-left: -60px;
        margin-top: 0;
    }
}

/* --- Related --- */
.tfpp-related {
    background: var(--tfpp-gray-100);
    padding: 2.5rem 0 3rem;
}

/* --- Archive --- */
.tfpp-archive__header {
    background: var(--tfpp-dark);
    padding: 2rem 0;
}
.tfpp-archive__title {
    font-family: var(--tfpp-font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tfpp-white);
}
.tfpp-archive__desc {
    color: var(--tfpp-gray-400);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}
.tfpp-archive__list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 0;
}
.tfpp-no-results {
    text-align: center;
    padding: 3rem 0;
    color: var(--tfpp-gray-600);
}

/* --- Pagination --- */
.tfpp-pagination { padding: 0 0 3rem; text-align: center; }
.tfpp-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.tfpp-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid var(--tfpp-gray-200);
    border-radius: var(--tfpp-radius);
    font-size: 0.85rem;
    color: var(--tfpp-gray-800);
    background: var(--tfpp-white);
    transition: all 0.2s;
}
.tfpp-pagination .page-numbers:hover,
.tfpp-pagination .page-numbers.current {
    background: var(--tfpp-gold);
    color: var(--tfpp-dark);
    border-color: var(--tfpp-gold);
}

/* --- 404 --- */
.tfpp-404 {
    text-align: center;
    padding: 4rem 0;
}
.tfpp-404 h1 {
    font-family: var(--tfpp-font-display);
    font-size: 5rem;
    color: var(--tfpp-gold);
    line-height: 1;
    margin-bottom: 0.5rem;
}
.tfpp-404 p {
    color: var(--tfpp-gray-600);
    margin-bottom: 1.5rem;
}
.tfpp-btn {
    display: inline-block;
    background: var(--tfpp-gold);
    color: var(--tfpp-dark);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.6rem 1.5rem;
    border-radius: var(--tfpp-radius);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.2s;
    margin-bottom: 1.5rem;
}
.tfpp-btn:hover { background: var(--tfpp-gold-light); }

/* --- Search Form --- */
.tfpp-search-form {
    display: flex;
    max-width: 400px;
    margin: 1rem auto 0;
}
.tfpp-search-form__input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--tfpp-gray-200);
    border-radius: var(--tfpp-radius) 0 0 var(--tfpp-radius);
    font-size: 0.9rem;
    font-family: var(--tfpp-font-body);
}
.tfpp-search-form__btn {
    padding: 0.5rem 0.75rem;
    background: var(--tfpp-gold);
    color: var(--tfpp-dark);
    border: 1px solid var(--tfpp-gold);
    border-radius: 0 var(--tfpp-radius) var(--tfpp-radius) 0;
    cursor: pointer;
}

/* --- Footer --- */
.tfpp-footer {
    background: var(--tfpp-dark);
    padding: 2.5rem 0 0;
    color: var(--tfpp-gray-400);
}
.tfpp-footer__inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
.tfpp-footer__tagline {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 0.5rem;
}
.tfpp-footer__social {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}
.tfpp-footer__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--tfpp-gray-400);
    transition: all 0.2s;
}
.tfpp-footer__social a:hover {
    color: var(--tfpp-gold);
    border-color: var(--tfpp-gold);
}
.tfpp-footer__col h3 {
    font-family: var(--tfpp-font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--tfpp-white);
    margin-bottom: 0.75rem;
}
.tfpp-footer__nav {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1rem;
}
.tfpp-footer__nav li a {
    font-size: 0.85rem;
    color: var(--tfpp-gray-400);
    transition: color 0.2s;
}
.tfpp-footer__nav li a:hover { color: var(--tfpp-gold); }

/* Newsletter form */
.tfpp-footer__newsletter p {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}
.tfpp-newsletter-form {
    display: flex;
    gap: 0;
}
.tfpp-newsletter-form input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--tfpp-radius) 0 0 var(--tfpp-radius);
    background: rgba(255,255,255,0.05);
    color: var(--tfpp-white);
    font-size: 0.85rem;
    font-family: var(--tfpp-font-body);
}
.tfpp-newsletter-form input::placeholder { color: var(--tfpp-gray-400); }
.tfpp-newsletter-form button {
    padding: 0.5rem 1rem;
    background: var(--tfpp-gold);
    color: var(--tfpp-dark);
    font-weight: 700;
    font-size: 0.8rem;
    border: none;
    border-radius: 0 var(--tfpp-radius) var(--tfpp-radius) 0;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.2s;
}
.tfpp-newsletter-form button:hover { background: var(--tfpp-gold-light); }

.tfpp-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 1rem 0;
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 480px) {
    .tfpp-grid { grid-template-columns: repeat(2, 1fr); }
    .tfpp-archive__list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    :root { --tfpp-header-h: 72px; }

    .tfpp-hamburger { display: none; }

    .tfpp-nav {
        display: flex !important;
        position: static;
        background: none;
        padding: 0;
        overflow: visible;
        align-items: center;
        gap: 0.25rem;
    }
    .tfpp-nav__list {
        flex-direction: row;
        gap: 0;
    }
    .tfpp-nav__list li a {
        padding: 0.4rem 0.6rem;
        border-bottom: none;
        font-size: 0.75rem;
    }
    .tfpp-nav__search {
        margin-top: 0;
        margin-left: 0.5rem;
    }
    .tfpp-nav__search input {
        width: 140px;
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }

    .tfpp-hero { min-height: 55vh; }
    .tfpp-hero__inner { padding: 3rem 1rem; }
    .tfpp-hero__title { font-size: 2.5rem; }

    .tfpp-single__title { font-size: 2.25rem; }

    .tfpp-footer__inner { grid-template-columns: 2fr 1fr 1.5fr; }
}

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

    .tfpp-hero__title { font-size: 3rem; }
    .tfpp-hero { min-height: 60vh; }

    .tfpp-single__header { padding: 3rem 0 2.5rem; }
    .tfpp-single__title { font-size: 2.5rem; }

    .tfpp-nav__list li a {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* --- WordPress core alignment classes --- */
.alignleft { float: left; margin-right: 1rem; margin-bottom: 0.5rem; }
.alignright { float: right; margin-left: 1rem; margin-bottom: 0.5rem; }
.aligncenter { display: block; margin: 0 auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.8rem; color: var(--tfpp-gray-400); margin-top: 0.25rem; }

/* Admin bar offset */
body.admin-bar .tfpp-header { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .tfpp-header { top: 46px; }
}
