/*
Theme Name: KapCai Malaya
Theme URI: https://kapcaimalaya.com
Author: KapCai Malaya™
Author URI: https://kapcaimalaya.com
Description: Portal media lifestyle dan komuniti rider kapcai terbesar di Malaysia. The Art of KapCai Lifestyle.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kapcaimalaya
Tags: news, magazine, blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ─────────────────────────────────────────
   CSS Variables
───────────────────────────────────────── */
:root {
  --bg: #f5f2ed;
  --dark: #0d0d0d;
  --card: #ffffff;
  --red: #d42b2b;
  --red2: #ff3a2d;
  --grey: #888888;
  --lightgrey: #e8e4df;
  --ink: #1a1a1a;
  --accent: #f0a500;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

/* ─────────────────────────────────────────
   Typography
───────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  line-height: 1.2;
  color: var(--ink);
}

/* ─────────────────────────────────────────
   Top Bar
───────────────────────────────────────── */
.kcm-topbar {
  background: var(--dark);
  color: #aaa;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kcm-topbar-links { display: flex; gap: 24px; }
.kcm-topbar-links a { color: #aaa; transition: color 0.2s; }
.kcm-topbar-links a:hover { color: var(--red); }
.kcm-topbar-socials { display: flex; gap: 16px; }
.kcm-topbar-socials a { color: #666; font-size: 0.75rem; letter-spacing: 1px; transition: color 0.2s; }
.kcm-topbar-socials a:hover { color: var(--red); }

/* ─────────────────────────────────────────
   Header
───────────────────────────────────────── */
.kcm-header {
  background: var(--bg);
  border-bottom: 1px solid var(--lightgrey);
  padding: 0 40px;
  position: sticky;
  top: 0;
  z-index: 200;
}

.kcm-header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 3px solid var(--dark);
}

.kcm-logo { display: flex; flex-direction: column; line-height: 1; }
.kcm-logo-main {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3.2rem;
  letter-spacing: 6px;
  color: var(--dark);
}
.kcm-logo-main span { color: var(--red); }
.kcm-logo-tagline {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 4px;
  color: var(--grey);
  text-transform: uppercase;
  margin-top: 2px;
}

/* ─────────────────────────────────────────
   Navigation
───────────────────────────────────────── */
.kcm-nav {
  display: flex;
  align-items: center;
  overflow-x: auto;
}

.kcm-nav ul { display: flex; gap: 0; }

.kcm-nav ul li a {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 14px 18px;
  color: var(--ink);
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.kcm-nav ul li a:hover,
.kcm-nav ul li.current-menu-item a { color: var(--red); border-bottom-color: var(--red); }

/* ─────────────────────────────────────────
   Search
───────────────────────────────────────── */
.kcm-search-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 18px;
}
.kcm-search-wrap input {
  border: 1px solid var(--lightgrey);
  background: none;
  padding: 6px 12px;
  font-family: 'Barlow', sans-serif;
  font-size: 0.82rem;
  outline: none;
  width: 160px;
  transition: border-color 0.2s;
}
.kcm-search-wrap input:focus { border-color: var(--red); }
.kcm-search-wrap button {
  background: var(--red);
  color: white;
  border: none;
  padding: 7px 14px;
  cursor: pointer;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 0.8rem;
}

/* ─────────────────────────────────────────
   Breaking News Ticker
───────────────────────────────────────── */
.kcm-ticker {
  background: var(--red);
  color: white;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 36px;
}
.kcm-ticker-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 3px;
  background: var(--dark);
  color: var(--accent);
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.kcm-ticker-track {
  display: flex;
  animation: kcmTicker 30s linear infinite;
  white-space: nowrap;
}
.kcm-ticker-track span {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 1px;
  padding: 0 40px;
}
.kcm-ticker-track span::before { content: '● '; opacity: 0.6; margin-right: 8px; }
@keyframes kcmTicker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─────────────────────────────────────────
   Main Container
───────────────────────────────────────── */
.kcm-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px;
}

/* ─────────────────────────────────────────
   Section Header
───────────────────────────────────────── */
.kcm-sec-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--dark);
}
.kcm-sec-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 4px;
  color: var(--dark);
}
.kcm-sec-title span { color: var(--red); }
.kcm-sec-more {
  margin-left: auto;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 5px 14px;
  transition: all 0.2s;
}
.kcm-sec-more:hover { background: var(--red); color: white; }

/* ─────────────────────────────────────────
   Hero / Featured Post
───────────────────────────────────────── */
.kcm-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  margin-bottom: 40px;
  background: var(--dark);
}

.kcm-hero-main {
  grid-row: 1 / 3;
  position: relative;
  overflow: hidden;
  min-height: 460px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  cursor: pointer;
}
.kcm-hero-main .kcm-post-thumb {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.kcm-hero-main::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
  z-index: 1;
}
.kcm-hero-main .kcm-hero-content { position: relative; z-index: 2; }

.kcm-hero-side {
  background: #181818;
  padding: 20px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}
.kcm-hero-side:hover { background: #1f1f1f; }
.kcm-hero-side .kcm-post-thumb {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: 0.3;
}
.kcm-hero-side::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 70%);
  z-index: 1;
}
.kcm-hero-side .kcm-hero-content { position: relative; z-index: 2; }

.kcm-cat-badge {
  display: inline-block;
  background: var(--red);
  color: white;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 4px 12px;
  margin-bottom: 12px;
}
.kcm-hero-main .kcm-post-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 900;
  color: white;
  line-height: 1.2;
  margin-bottom: 10px;
}
.kcm-hero-side .kcm-post-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  color: white;
  line-height: 1.3;
  letter-spacing: 0.5px;
}
.kcm-post-excerpt {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 12px;
}
.kcm-post-meta {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  display: flex;
  gap: 12px;
  align-items: center;
}
.kcm-post-meta .kcm-author { color: var(--accent); }

/* ─────────────────────────────────────────
   Category Strip
───────────────────────────────────────── */
.kcm-cat-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  margin-bottom: 48px;
  background: var(--dark);
}
.kcm-cat-item {
  background: #181818;
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.kcm-cat-item:hover { background: var(--red); }
.kcm-cat-item:hover .kcm-cat-name { color: white; }
.kcm-cat-icon { font-size: 1.8rem; }
.kcm-cat-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #aaa;
  transition: color 0.2s;
}
.kcm-cat-count { font-size: 0.65rem; color: #555; font-family: 'Barlow Condensed', sans-serif; }

/* ─────────────────────────────────────────
   Articles Grid
───────────────────────────────────────── */
.kcm-articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.kcm-article-card { cursor: pointer; transition: transform 0.2s; }
.kcm-article-card:hover { transform: translateY(-3px); }

.kcm-article-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  margin-bottom: 12px;
  background: var(--dark);
}
.kcm-article-cat {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}
.kcm-article-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 8px;
}
.kcm-article-card:hover .kcm-article-title { color: var(--red); }
.kcm-article-excerpt {
  font-size: 0.82rem;
  color: var(--grey);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kcm-article-meta {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: #aaa;
  text-transform: uppercase;
}

/* ─────────────────────────────────────────
   Two Column Layout
───────────────────────────────────────── */
.kcm-two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

/* List Articles */
.kcm-list-articles { display: flex; flex-direction: column; }
.kcm-list-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--lightgrey);
  cursor: pointer;
}
.kcm-list-item:first-child { border-top: 1px solid var(--lightgrey); }
.kcm-list-item:hover .kcm-list-title { color: var(--red); }
.kcm-list-thumb { width: 100px; height: 70px; object-fit: cover; background: var(--dark); flex-shrink: 0; }
.kcm-list-cat {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 4px;
}
.kcm-list-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.3;
  transition: color 0.2s;
}
.kcm-list-meta {
  font-size: 0.7rem;
  color: #bbb;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 4px;
}

/* ─────────────────────────────────────────
   Sidebar
───────────────────────────────────────── */
.kcm-sidebar { display: flex; flex-direction: column; gap: 28px; }
.kcm-sidebar-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 3px;
  border-left: 4px solid var(--red);
  padding-left: 12px;
  margin-bottom: 14px;
}

.kcm-trending-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--lightgrey);
  cursor: pointer;
  align-items: flex-start;
}
.kcm-trending-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: var(--lightgrey);
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  transition: color 0.2s;
}
.kcm-trending-item:hover .kcm-trending-num { color: var(--red); }
.kcm-trending-cat {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 3px;
}
.kcm-trending-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
}

/* ─────────────────────────────────────────
   Video Grid
───────────────────────────────────────── */
.kcm-video-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}
.kcm-video-card { cursor: pointer; }
.kcm-video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  position: relative;
  background: var(--dark);
  display: block;
}
.kcm-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.kcm-video-card:hover .kcm-video-overlay { background: rgba(212,43,43,0.6); }
.kcm-play-btn {
  width: 44px; height: 44px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding-left: 3px;
}
.kcm-video-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 10px;
  color: var(--ink);
}
.kcm-video-meta { font-size: 0.7rem; color: var(--grey); margin-top: 4px; font-family: 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: 1px; }

/* ─────────────────────────────────────────
   Merch Strip
───────────────────────────────────────── */
.kcm-merch-strip {
  background: var(--dark);
  padding: 32px 40px;
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 48px;
}
.kcm-merch-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  letter-spacing: 4px;
  color: white;
  line-height: 1;
}
.kcm-merch-title span { color: var(--accent); }
.kcm-merch-sub { color: #666; font-size: 0.85rem; margin-top: 6px; }
.kcm-merch-cta {
  background: var(--red);
  color: white;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 3px;
  padding: 14px 28px;
  cursor: pointer;
  transition: opacity 0.2s;
  display: inline-block;
  margin-left: auto;
  white-space: nowrap;
}
.kcm-merch-cta:hover { opacity: 0.85; }

/* ─────────────────────────────────────────
   Widgets
───────────────────────────────────────── */
.widget { margin-bottom: 28px; }
.widget-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 3px;
  border-left: 4px solid var(--red);
  padding-left: 12px;
  margin-bottom: 14px;
  color: var(--dark);
}

/* ─────────────────────────────────────────
   Footer
───────────────────────────────────────── */
.kcm-footer { background: var(--dark); color: #aaa; padding: 48px 40px 24px; }
.kcm-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.kcm-footer-brand p { font-size: 0.82rem; line-height: 1.7; color: #555; margin: 12px 0 16px; }
.kcm-footer-socials { display: flex; gap: 12px; flex-wrap: wrap; }
.kcm-footer-social {
  background: #1a1a1a;
  color: #aaa;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 8px 14px;
  transition: all 0.2s;
}
.kcm-footer-social:hover { background: var(--red); color: white; }
.kcm-footer-col h4 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 3px;
  color: white;
  margin-bottom: 16px;
  border-bottom: 1px solid #222;
  padding-bottom: 8px;
}
.kcm-footer-col ul li { padding: 6px 0; font-size: 0.82rem; color: #555; cursor: pointer; transition: color 0.2s; }
.kcm-footer-col ul li:hover { color: var(--red); }
.kcm-footer-bottom {
  border-top: 1px solid #1a1a1a;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #333;
}

/* ─────────────────────────────────────────
   Single Post
───────────────────────────────────────── */
.kcm-single-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px;
}
.kcm-post-header { margin-bottom: 24px; }
.kcm-post-header .kcm-cat-badge { margin-bottom: 16px; }
.kcm-post-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
}
.kcm-post-header .kcm-post-meta { color: var(--grey); margin-bottom: 24px; }
.kcm-post-featured-img { width: 100%; margin-bottom: 32px; }
.kcm-post-content { font-size: 1rem; line-height: 1.8; color: var(--ink); }
.kcm-post-content p { margin-bottom: 20px; }
.kcm-post-content h2 { font-size: 1.5rem; margin: 32px 0 16px; }
.kcm-post-content h3 { font-size: 1.2rem; margin: 24px 0 12px; }
.kcm-post-content blockquote {
  border-left: 4px solid var(--red);
  padding: 16px 24px;
  background: var(--lightgrey);
  font-style: italic;
  margin: 24px 0;
}

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */
@media (max-width: 1024px) {
  .kcm-articles-grid { grid-template-columns: 1fr 1fr; }
  .kcm-video-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .kcm-topbar, .kcm-header, .kcm-wrap, .kcm-merch-strip, .kcm-footer { padding-left: 20px; padding-right: 20px; }
  .kcm-hero { grid-template-columns: 1fr; }
  .kcm-hero-main { grid-row: auto; min-height: 280px; }
  .kcm-articles-grid { grid-template-columns: 1fr; }
  .kcm-two-col { grid-template-columns: 1fr; }
  .kcm-cat-strip { grid-template-columns: repeat(3, 1fr); }
  .kcm-footer-grid { grid-template-columns: 1fr 1fr; }
  .kcm-single-wrap { grid-template-columns: 1fr; padding: 20px; }
  .kcm-logo-main { font-size: 2.2rem; }
}

@media (max-width: 480px) {
  .kcm-articles-grid { grid-template-columns: 1fr; }
  .kcm-video-grid { grid-template-columns: 1fr; }
  .kcm-cat-strip { grid-template-columns: repeat(2, 1fr); }
  .kcm-footer-grid { grid-template-columns: 1fr; }
}
