/* =========================================
   1. GLOBAL RESET & VARIABLES
========================================= */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

:root {
  --bg:          #0f0f0f;
  --surface:     #181818;
  --surface2:    #222222;
  --border:      #2e2e2e;
  --accent:      #e8ff47;
  --accent2:     #ff4757;
  --accent3:     #00d2d3;
  --text:        #f0f0f0;
  --muted:       #888;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Barlow', sans-serif;
  --font-cond:    'Barlow Condensed', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

/* Clickable Card Magic */
.hero-main, .side-article, .card, .number-card, .trending-item { position: relative; }
.card-link { text-decoration: none; color: inherit; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.cat-tag, .card-meta a { position: relative; z-index: 2; }


/* =========================================
   2. SITE NAVIGATION & HEADER
========================================= */
.ticker-wrap {
  background: var(--accent);
  color: #000;
  overflow: hidden;
  padding: 7px 0;
  font-family: var(--font-cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ticker-inner { display: flex; gap: 60px; white-space: nowrap; animation: ticker 35s linear infinite; }
.ticker-inner span { flex-shrink: 0; }
.ticker-dot { color: var(--accent2); margin-right: 8px; font-size: 16px; vertical-align: middle; }

@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.top-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.top-bar .inner {
  max-width: 1280px;
  margin: auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-bar a { color: var(--muted); text-decoration: none; transition: color .2s; }
.top-bar a:hover { color: var(--accent); }
.top-bar .links { display: flex; gap: 20px; }

header {
  background: var(--bg);
  border-bottom: 3px solid var(--accent);
  padding: 18px 24px;
}
.header-inner {
  max-width: 1280px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -.03em;
  line-height: 1;
}
.logo span { color: var(--accent); }

.header-search {
  display: flex;
  align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  flex: 0 0 280px;
}
.header-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 14px;
  width: 100%;
}
.header-search button {
  background: var(--accent);
  border: none;
  cursor: pointer;
  padding: 9px 14px;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  transition: background .2s;
}
.header-search button:hover { background: #d4e840; }

.header-actions { display: flex; gap: 12px; }
.btn-outline, .btn-solid {
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  border-radius: 3px;
  transition: all .2s;
}
.btn-outline { border: 1.5px solid var(--border); background: none; color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-solid { background: var(--accent); color: #000; font-weight: 700; border: none; }
.btn-solid:hover { background: #d4e840; transform: translateY(-1px); }

nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.nav-inner {
  max-width: 1280px;
  margin: auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-inner a {
  text-decoration: none;
  color: var(--muted);
  font-family: var(--font-cond);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 14px 14px;
  border-bottom: 3px solid transparent;
  transition: all .2s;
  white-space: nowrap;
}
.nav-inner a:hover, .nav-inner a.active { color: var(--accent); border-bottom-color: var(--accent); }


/* =========================================
   3. HOMEPAGE LAYOUT & CARDS
========================================= */
.hero {
  max-width: 1280px;
  margin: 36px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-rows: auto auto;
  gap: 20px;
}
.hero-main { grid-row: 1 / 3; overflow: hidden; border-radius: 6px; transition: transform .25s, box-shadow .25s; }
.hero-main:hover { box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.hero-main img { width: 100%; height: 520px; object-fit: cover; display: block; transition: transform .5s ease; }
.hero-main:hover img { transform: scale(1.03); }
.hero-main .overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.3) 55%, transparent 100%);
}
.hero-main .content { position: absolute; bottom: 0; left: 0; right: 0; padding: 28px; }
.hero-main h1 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; line-height: 1.15; color: #fff; margin-bottom: 12px; }
.hero-main .meta { color: rgba(255,255,255,.65); font-size: 12px; font-weight: 500; letter-spacing: .05em; }
.hero-main .meta span { color: var(--accent); }

.hero-side { display: flex; flex-direction: column; gap: 0; }
.side-article {
  display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); transition: background .2s;
}
.side-article:first-child { padding-top: 0; }
.side-article:last-child { border-bottom: none; }
.side-article:hover { background: rgba(232,255,71,.04); margin: 0 -8px; padding-left: 8px; padding-right:8px; }
.side-article img { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; }
.side-article h3 { font-family: var(--font-display); font-size: 1rem; font-weight: 700; line-height: 1.25; color: var(--text); }
.side-article .meta { margin-top: 6px; color: var(--muted); font-size: 11px; }

.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.section-header h2 { font-family: var(--font-cond); font-size: 1.4rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text); }
.section-header .line { flex: 1; height: 1px; background: var(--border); }
.section-header a { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s; }
.section-header a:hover { border-bottom-color: var(--accent); }

.main-wrap {
  max-width: 1280px;
  margin: 0 auto 60px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
}

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 40px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,.5); border-color: var(--accent); }
.card img { width: 100%; height: 180px; object-fit: cover; display: block; transition: transform .4s; }
.card:hover img { transform: scale(1.04); }
.card-img-wrap { overflow: hidden; }
.card-body { padding: 16px; }
.card-body h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; line-height: 1.3; color: var(--text); margin-bottom: 8px; }
.card-body p { font-size: 13px; color: var(--muted); line-height: 1.55; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); padding-top: 10px; border-top: 1px solid var(--border); }
.card-meta .author { font-weight: 600; color: var(--text); }
.card-meta .read-time { background: var(--surface2); padding: 2px 8px; border-radius: 10px; }

.card-wide { grid-column: 1 / -1; display: grid; grid-template-columns: 300px 1fr; }
.card-wide .card-img-wrap { width: 300px; }
.card-wide img { height: 100% !important; min-height: 200px; }
.card-wide .card-body { padding: 20px 24px; display: flex; flex-direction: column; justify-content: center; }
.card-wide .card-body h3 { font-size: 1.35rem; }
.card-wide .card-body p { -webkit-line-clamp: 3; }

/* Category Tags */
.cat-tag, .hero-main .cat-tag, .number-card .cat-tag, .side-article .cat-tag {
  display: inline-block;
  font-family: var(--font-cond);
  font-weight: 800;
  text-transform: uppercase;
  text-decoration: none;
}
.hero-main .cat-tag { background: var(--accent); color: #000; font-size: 11px; letter-spacing: .12em; padding: 4px 10px; border-radius: 2px; margin-bottom: 12px; }
.card-body .cat-tag { font-size: 10px; letter-spacing: .12em; padding: 3px 8px; border-radius: 2px; margin-bottom: 10px; }
.side-article .cat-tag { font-size: 10px; letter-spacing: .1em; color: var(--accent3); margin-bottom: 6px; }
.number-card .cat-tag { font-size: 10px; letter-spacing: .12em; margin-bottom: 10px; }

.cat-productivity { background: rgba(232,255,71,.15); color: var(--accent); }
.cat-tech        { background: rgba(0,210,211,.15);  color: var(--accent3); }
.cat-money       { background: rgba(255,71,87,.15);  color: var(--accent2); }
.cat-health      { background: rgba(100,200,100,.15);color: #6dc47a; }
.cat-travel      { background: rgba(180,100,255,.15);color: #c47aff; }
.cat-food        { background: rgba(255,180,50,.15); color: #ffb432; }


/* =========================================
   4. SINGLE ARTICLE LAYOUT (TWO-COLUMN)
========================================= */
.page-layout-wrapper {
  display: grid;
  grid-template-columns: 1fr 350px; /* Article on left, Sidebar on right */
  gap: 60px;
  max-width: 1280px; /* Matched to homepage width */
  margin: 40px auto 60px;
  padding: 0 24px;
  align-items: start; /* Prevents sidebar stretching */
}

/* Forces article to fill the left grid column properly */
.article-container {
  width: 100%;
  margin: 0;
  padding: 0;
}

.article-header { text-align: center; margin-bottom: 2.5rem; }
.article-header h1 { font-size: 2.8rem; line-height: 1.2; margin: 1rem 0; color: #ffffff; font-weight: 800; }
.article-meta { color: #a0a0a0; font-size: 0.95rem; margin-top: 1rem; }

#article-image {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 3rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.article-content { font-size: 1.15rem; line-height: 1.8; color: #e0e0e0; }
.article-content h2 { font-size: 1.8rem; color: #ffffff; margin: 3rem 0 1rem; line-height: 1.3; }
.article-content h3 { font-size: 1.4rem; color: #ffffff; margin: 2rem 0 1rem; }
.article-content p { margin-bottom: 1.5rem; }
.article-content a { color: #66b3ff; text-decoration: underline; font-weight: 500; transition: color 0.2s ease; }
.article-content a:hover { color: #99ccff; }
.article-content ul, .article-content ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content strong { color: #ffffff; font-weight: 700; }
.article-content blockquote {
  border-left: 4px solid #66b3ff; background: #1a1a1a; padding: 1.5rem; margin: 2rem 0;
  border-radius: 0 8px 8px 0; font-style: italic; color: #cccccc;
}

/* Sidebar Specifics */
.sidebar, .sidebar-container { display: flex; flex-direction: column; width: 100%; gap: 32px; }
.sidebar-title { color: #fff; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.5rem; }

.sidebar-card { display: flex; gap: 15px; margin-bottom: 25px; align-items: center; }
.sidebar-card img { width: 110px; height: 80px; object-fit: cover; border-radius: 6px; }
.sidebar-card h4 { font-size: 1rem; line-height: 1.4; margin: 5px 0 0 0; }
.sidebar-card a { color: #e0e0e0; text-decoration: none; transition: color 0.2s ease; }
.sidebar-card a:hover { color: #66b3ff; }

.sidebar-widget { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.widget-header { background: var(--accent); padding: 10px 16px; font-family: var(--font-cond); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: #000; }
.widget-body { padding: 16px; }


/* =========================================
   5. MISC COMPONENTS & WIDGETS
========================================= */
.number-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px; }
.number-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 20px; transition: border-color .25s, transform .25s; overflow: hidden; }
.number-card::before { content: attr(data-num); position: absolute; top: -10px; right: -5px; font-family: var(--font-display); font-size: 5rem; font-weight: 900; color: rgba(232,255,71,.06); line-height: 1; pointer-events: none; }
.number-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.number-card h4 { font-family: var(--font-display); font-size: .95rem; font-weight: 700; line-height: 1.3; color: var(--text); }
.number-card .meta { margin-top: 12px; font-size: 11px; color: var(--muted); }

.trending-list { display: flex; flex-direction: column; }
.trending-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); transition: background .2s; }
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-item:hover { margin: 0 -16px; padding-left: 16px; padding-right: 16px; background: rgba(232,255,71,.04); }
.trending-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; color: var(--border); line-height: 1; min-width: 28px; }
.trending-item:hover .trending-num { color: var(--accent); }
.trending-title { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text); }
.trending-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }

.cat-strip { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.cat-strip .inner { max-width: 1280px; margin: auto; padding: 0 24px; display: grid; grid-template-columns: repeat(6, 1fr); }
.cat-strip-item { text-decoration: none; display: block; padding: 18px 14px; text-align: center; border-right: 1px solid var(--border); transition: background .2s; }
.cat-strip-item:last-child { border-right: none; }
.cat-strip-item:hover { background: var(--surface2); }
.cat-strip-item .icon { width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.cat-strip-item .label { font-family: var(--font-cond); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cat-strip-item:hover .label { color: var(--text); }


/* =========================================
   6. FOOTER & FORMS
========================================= */
.newsletter-full { background: var(--accent); padding: 60px 24px; text-align: center; margin-bottom: 0; }
.newsletter-full h2 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 900; color: #000; margin-bottom: 10px; }
.newsletter-full p { color: rgba(0,0,0,.6); font-size: 15px; margin-bottom: 24px; }
.newsletter-form { display: flex; max-width: 480px; margin: auto; gap: 0; }
.newsletter-form input { flex: 1; background: #fff; border: none; outline: none; font-family: var(--font-body); font-size: 14px; padding: 14px 18px; border-radius: 4px 0 0 4px; }
.newsletter-form button { background: #000; color: var(--accent); border: none; font-family: var(--font-cond); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 14px 24px; cursor: pointer; border-radius: 0 4px 4px 0; transition: background .2s; }
.newsletter-form button:hover { background: #222; }

footer { background: var(--surface); border-top: 1px solid var(--border); }
.footer-main { max-width: 1280px; margin: auto; padding: 48px 24px; display: grid; grid-template-columns: 260px 1fr; gap: 48px; }
.footer-brand .logo { font-size: 1.8rem; display: block; margin-bottom: 14px; }
.footer-brand p { font-size: 13px; color: var(--muted); line-height: 1.7; margin-bottom: 20px; }
.social-links { display: flex; gap: 10px; }
.social-btn { width: 34px; height: 34px; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 700; }
.social-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }

.footer-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-col h4 { font-family: var(--font-cond); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--text); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.footer-col a { display: block; color: var(--muted); text-decoration: none; font-size: 13px; padding: 4px 0; transition: color .2s; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom { border-top: 1px solid var(--border); padding: 16px 24px; max-width: 1280px; margin: auto; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.footer-bottom a { color: var(--muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }

/* Animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .6s ease both; }
.delay-1 { animation-delay: .1s; } .delay-2 { animation-delay: .2s; }


/* =========================================
   7. RESPONSIVE DESIGN (MEDIA QUERIES)
========================================= */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { grid-row: auto; }
  .hero-side { grid-template-columns: repeat(2, 1fr); display: grid; gap: 16px; }
  .side-article { padding: 0; border: 1px solid var(--border); border-radius: 6px; }
  .side-article img { width: 100%; height: 120px; border-radius: 4px 4px 0 0; }
  .main-wrap { grid-template-columns: 1fr; }
  
  /* Article Page Grid collapses slightly earlier than mobile for readability */
  .page-layout-wrapper { grid-template-columns: 1fr; gap: 40px; }
  
  .footer-main { grid-template-columns: 1fr; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
  .cat-strip .inner { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .hero-main h1 { font-size: 1.6rem; }
  .card-grid { grid-template-columns: 1fr; }
  .card-wide { grid-template-columns: 1fr; }
  .card-wide .card-img-wrap { width: 100%; }
  .number-cards { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .header-search { flex: 1; min-width: 200px; }
  .cat-strip .inner { grid-template-columns: repeat(2, 1fr); }
  .newsletter-form { flex-direction: column; }
  .newsletter-form input { border-radius: 4px; margin-bottom: 8px; }
  .newsletter-form button { border-radius: 4px; }
}

/* === 1. DEFAULT/MOBILE: Swipeable Scrolling === */
.cat-strip .inner {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cat-strip .inner::-webkit-scrollbar {
    display: none;
}

.cat-strip-item {
    flex: 0 0 auto; /* Stays fixed size, no stretching */
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* === 2. DESKTOP/LARGE SCREENS: Stretch to Fill === */
/* Kicks in only when the screen is wider than 800px */
@media (min-width: 800px) {
    .cat-strip .inner {
        overflow-x: visible; /* Turn off scrolling to prevent Safari bugs */
        width: 100%;
        justify-content: space-between;
    }
    
    .cat-strip-item {
        flex: 1 1 0; /* Safely stretch evenly across the screen */
    }
}