/*
Theme Name: FAN STEM
Theme URI: https://fanstem.com
Author: FAN STEM
Author URI: https://fanstem.com
Description: Custom multi-sport news magazine theme for Formula 1, Soccer, UFC, Darts, Tennis and more.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fanstem
*/

:root {
  --fs-red: #E53935;
  --fs-dark: #0D0D0D;
  --fs-dark-alt: #141414;
  --fs-dark-surface: #1C1C1C;
  --fs-white: #FFFFFF;
  --fs-off-white: #F5F5F5;
  --fs-gray-50: #FAFAFA;
  --fs-gray-100: #F0F0F0;
  --fs-gray-200: #E2E2E2;
  --fs-gray-300: #BDBDBD;
  --fs-gray-400: #8A8A8A;
  --fs-gray-500: #616161;
  --fs-gray-600: #424242;
  --fs-gray-700: #2C2C2C;
  --fs-gray-800: #1A1A1A;
  --cat-f1: #E53935;
  --cat-soccer: #1565C0;
  --cat-ufc: #D4850A;
  --cat-darts: #00897B;
  --cat-tennis: #5E35B1;
  --cat-betting: #757575;
  --font-display: 'Barlow Condensed', 'Impact', sans-serif;
  --font-heading: 'Barlow', 'Helvetica Neue', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --container-max: 1180px;
  --gap: 12px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--fs-gray-700); background: var(--fs-off-white); line-height: 1.55; }
a { color: inherit; text-decoration: none; transition: color 0.12s; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 16px; }

/* TOPBAR */
.topbar { background: var(--fs-dark); color: var(--fs-gray-400); font-size: 11px; padding: 5px 0; letter-spacing: 0.3px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar a { color: var(--fs-gray-400); font-weight: 500; }
.topbar a:hover { color: var(--fs-white); }
.topbar__langs { display: flex; gap: 10px; }

/* HEADER */
.site-header { background: var(--fs-dark-alt); position: sticky; top: 0; z-index: 100; border-bottom: 3px solid var(--fs-red); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 54px; }
.site-logo { font-family: var(--font-display); font-size: 32px; font-weight: 800; letter-spacing: 1px; color: var(--fs-white); text-transform: uppercase; }
.site-logo span { color: var(--fs-red); }
.main-nav { display: flex; gap: 0; }
.main-nav a { display: flex; align-items: center; padding: 0 14px; height: 54px; font-family: var(--font-heading); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--fs-gray-300); border-bottom: 3px solid transparent; margin-bottom: -3px; transition: all 0.12s; }
.main-nav a:hover { color: var(--fs-white); background: rgba(255,255,255,0.04); }
.main-nav a.current { color: var(--fs-white); border-bottom-color: var(--fs-red); }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--fs-white); margin: 4px 0; border-radius: 1px; }

/* BADGES */
.badge { display: inline-block; font-family: var(--font-heading); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.8px; padding: 3px 7px; border-radius: 2px; color: var(--fs-white); background: var(--fs-gray-500); line-height: 1; }
.badge--f1 { background: var(--cat-f1); }
.badge--soccer { background: var(--cat-soccer); }
.badge--ufc { background: var(--cat-ufc); }
.badge--darts { background: var(--cat-darts); }
.badge--tennis { background: var(--cat-tennis); }
.badge--betting { background: var(--cat-betting); }

/* HERO */
.hero { display: grid; grid-template-columns: 1fr 380px; background: var(--fs-dark); }
.hero__main { position: relative; min-height: 420px; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px 28px 24px; overflow: hidden; }
.hero__main-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.45; transition: opacity 0.4s, transform 0.4s; }
.hero__main:hover .hero__main-img { opacity: 0.55; transform: scale(1.02); }
.hero__main::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 40%, transparent 70%); z-index: 1; }
.hero__main-content { position: relative; z-index: 2; }
.hero__main-title { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1.08; color: var(--fs-white); margin: 10px 0 8px; text-transform: uppercase; letter-spacing: 0.3px; max-width: 600px; }
.hero__main-title a { color: var(--fs-white); }
.hero__main-title a:hover { color: var(--fs-red); }
.hero__main .meta { color: var(--fs-gray-300); font-size: 12px; }
.hero__sidebar { display: flex; flex-direction: column; }
.hero__sidebar-item { flex: 1; padding: 16px 18px; background: var(--fs-dark-surface); border-bottom: 1px solid rgba(255,255,255,0.06); display: flex; flex-direction: column; justify-content: center; transition: background 0.15s; }
.hero__sidebar-item:last-child { border-bottom: none; }
.hero__sidebar-item:hover { background: var(--fs-gray-700); }
.hero__sidebar-title { font-family: var(--font-heading); font-size: 14px; font-weight: 700; line-height: 1.25; color: var(--fs-white); margin: 6px 0 4px; }
.hero__sidebar-title a { color: var(--fs-white); }
.hero__sidebar-title a:hover { color: var(--fs-red); }
.hero__sidebar .meta { color: var(--fs-gray-400); font-size: 11px; }

/* META */
.meta { font-size: 11px; color: var(--fs-gray-400); font-weight: 500; letter-spacing: 0.1px; }
.meta__author { font-weight: 700; color: var(--fs-gray-600); }

/* SECTIONS */
.section-block { margin-bottom: 28px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; border-left: 4px solid var(--fs-red); padding-left: 12px; border-radius: 0; }
.section-header--f1 { border-left-color: var(--cat-f1); }
.section-header--soccer { border-left-color: var(--cat-soccer); }
.section-header--ufc { border-left-color: var(--cat-ufc); }
.section-header--darts { border-left-color: var(--cat-darts); }
.section-header--tennis { border-left-color: var(--cat-tennis); }
.section-title { font-family: var(--font-display); font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--fs-dark); }
.section-more { font-family: var(--font-heading); font-size: 12px; font-weight: 700; color: var(--fs-red); text-transform: uppercase; letter-spacing: 0.5px; }
.section-more:hover { text-decoration: underline; }

/* POST CARDS */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.post-card { background: var(--fs-white); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--fs-gray-200); transition: transform 0.15s, box-shadow 0.15s; }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.post-card__img-wrap { position: relative; overflow: hidden; }
.post-card__img { width: 100%; aspect-ratio: 16/9.5; object-fit: cover; transition: transform 0.35s; background: var(--fs-gray-100); display: block; }
.post-card:hover .post-card__img { transform: scale(1.04); }
.post-card__body { padding: 12px 14px 14px; }
.post-card__body .badge { margin-bottom: 6px; }
.post-card__title { font-family: var(--font-heading); font-size: 14px; font-weight: 700; line-height: 1.28; margin-bottom: 5px; color: var(--fs-dark); }
.post-card__title a:hover { color: var(--fs-red); }

/* TRENDING */
.trending { background: var(--fs-dark); padding: 28px 0; margin-bottom: 28px; }
.trending .section-header { border-left-color: var(--fs-red); margin-bottom: 16px; }
.trending .section-title { color: var(--fs-white); }
.trending-list { display: flex; flex-direction: column; }
.trending-item { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.07); transition: background 0.12s; color: var(--fs-white); }
.trending-item:last-child { border-bottom: none; }
.trending-item:hover { background: rgba(255,255,255,0.03); }
.trending-num { font-family: var(--font-display); font-size: 32px; font-weight: 800; color: rgba(255,255,255,0.12); min-width: 40px; line-height: 1; }
.trending-title { font-family: var(--font-heading); font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--fs-gray-200); margin-top: 2px; }
.trending-item:hover .trending-title { color: var(--fs-white); }
.trending .meta { color: var(--fs-gray-500); }

/* ADS */
.ad-slot { padding: 14px 0; text-align: center; }
.ad-slot__placeholder { background: var(--fs-gray-100); border: 1px dashed var(--fs-gray-300); padding: 10px; font-size: 11px; color: var(--fs-gray-400); border-radius: 3px; }

/* SINGLE POST */
.single-post__header { max-width: 760px; margin: 28px auto 20px; }
.single-post__title { font-family: var(--font-display); font-size: 40px; font-weight: 800; line-height: 1.05; text-transform: uppercase; letter-spacing: 0.3px; margin: 10px 0 12px; color: var(--fs-dark); }
.single-post__featured { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--radius); margin-bottom: 24px; }
.single-post__content { max-width: 700px; margin: 0 auto; font-size: 16px; line-height: 1.75; }
.single-post__content p { margin-bottom: 1.4em; }
.single-post__content h2 { font-family: var(--font-heading); font-size: 22px; font-weight: 800; margin: 1.8em 0 0.5em; color: var(--fs-dark); }
.single-post__content h3 { font-family: var(--font-heading); font-size: 18px; font-weight: 700; margin: 1.4em 0 0.4em; }
.single-post__content blockquote { border-left: 4px solid var(--fs-red); padding: 14px 20px; margin: 1.5em 0; background: var(--fs-gray-50); font-style: italic; color: var(--fs-gray-600); border-radius: 0; }
.single-post__content ul, .single-post__content ol { margin: 1em 0; padding-left: 22px; }
.single-post__content li { margin-bottom: 0.4em; list-style: disc; }
.single-post__content ol li { list-style: decimal; }
.author-box { display: flex; gap: 14px; align-items: center; padding: 18px; background: var(--fs-gray-50); border-radius: var(--radius); margin: 36px auto; max-width: 700px; border: 1px solid var(--fs-gray-200); }
.author-box__avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--fs-gray-200); flex-shrink: 0; }
.author-box__name { font-family: var(--font-heading); font-weight: 700; font-size: 14px; }
.author-box__bio { font-size: 12px; color: var(--fs-gray-500); margin-top: 2px; }

/* ARCHIVE */
.archive-header { padding: 24px 0 16px; margin-bottom: 20px; border-left: 5px solid var(--fs-red); padding-left: 16px; border-radius: 0; }
.archive-title { font-family: var(--font-display); font-size: 36px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.archive-desc { font-size: 14px; color: var(--fs-gray-500); margin-top: 4px; }

/* PAGINATION */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 28px 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--fs-gray-200); border-radius: 3px; font-family: var(--font-heading); font-size: 13px; font-weight: 700; background: var(--fs-white); transition: 0.12s; }
.pagination a:hover { background: var(--fs-red); color: var(--fs-white); border-color: var(--fs-red); }
.pagination .current { background: var(--fs-red); color: var(--fs-white); border-color: var(--fs-red); }

/* FOOTER */
.site-footer { background: var(--fs-dark); color: var(--fs-gray-400); padding: 36px 0 16px; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; margin-bottom: 28px; }
.footer-col__title { font-family: var(--font-heading); font-size: 12px; font-weight: 800; color: var(--fs-white); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 13px; color: var(--fs-gray-400); padding: 3px 0; }
.footer-col a:hover { color: var(--fs-white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.06); padding-top: 16px; display: flex; justify-content: space-between; font-size: 11px; color: var(--fs-gray-500); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; }
  .hero__main { min-height: 300px; }
  .hero__main-title { font-size: 24px; }
  .hero__sidebar { flex-direction: column; }
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav { display: none; }
  .main-nav.open { display: flex; flex-direction: column; position: absolute; top: 54px; left: 0; right: 0; background: var(--fs-dark-alt); z-index: 99; }
  .main-nav.open a { height: 44px; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .menu-toggle { display: block; }
  .single-post__title { font-size: 28px; }
}
@media (max-width: 480px) {
  .posts-grid { grid-template-columns: 1fr; }
  .hero__main-title { font-size: 22px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr 300px; }
	/* ========================================
   AUTOPUBLISHER IMAGE FIX
   Forces consistent aspect ratios for API-uploaded images
   that don't have WordPress-generated thumbnails.
   Add this to the bottom of your style.css via Theme Editor.
   ======================================== */

/* Homepage hero image */
.hero__main-img,
.hero__main img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

/* Homepage card images — force 16:9 ratio */
.post-card__image,
.post-card .post-card__image-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.post-card__image img,
.post-card .post-card__image-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Sidebar cards — smaller, tighter */
.hero__sidebar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Single article featured image */
.single-post__image img,
.single-post .wp-post-image,
.entry-content img.wp-post-image,
article .post-thumbnail img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    object-position: center center;
    border-radius: 4px;
}

/* Archive/category page cards */
.archive .post-card__image img,
.category .post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
}