/* ============================================================
   JUANCOX THEME - Main Stylesheet
   ============================================================ */

/* === VARIABLES === */
:root {
    --primary: #e8212a;
    --header-bg: #1a1a2e;
    --dark: #0f0f23;
    --dark2: #16213e;
    --accent: #f5a623;
    --text: #1a1a1a;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg: #f8f9fa;
    --white: #ffffff;
    --border: #e5e7eb;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
    --transition: 0.25s ease;
    --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); font-size: 15px; color: var(--text); background: var(--bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* === CONTAINER === */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header { position: sticky; top: 0; z-index: 1000; }

.header-topbar { background: var(--dark); padding: 6px 0; font-size: 12px; color: #9ca3af; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; }
.topbar-date { }
.topbar-nav { display: flex; gap: 20px; }
.topbar-nav a { color: #9ca3af; font-size: 12px; }
.topbar-nav a:hover { color: var(--primary); }

.header-brand { background: var(--header-bg); padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand-text-logo { display: flex; flex-direction: column; }
.brand-name { font-size: 26px; font-weight: 800; color: var(--white); letter-spacing: -0.5px; }
.brand-tagline { font-size: 11px; color: #6b7280; margin-top: 2px; }
.custom-logo { height: 50px; width: auto; }

.header-search { display: flex; }
.header-search input { padding: 9px 16px; border: none; background: rgba(255,255,255,.1); color: var(--white); border-radius: var(--radius) 0 0 var(--radius); font-size: 13px; width: 260px; outline: none; }
.header-search input::placeholder { color: #6b7280; }
.header-search button { background: var(--primary); color: var(--white); padding: 9px 14px; border-radius: 0 var(--radius) var(--radius) 0; display: flex; align-items: center; }
.header-search button:hover { background: #c41920; }

.main-nav { background: var(--primary); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.main-nav-menu { display: flex; }
.main-nav-menu > li > a { display: block; padding: 13px 16px; color: var(--white); font-weight: 600; font-size: 14px; }
.main-nav-menu > li > a:hover, .main-nav-menu > li.current-menu-item > a { background: rgba(0,0,0,.15); }
.nav-toggle { display: none; padding: 12px; color: var(--white); flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--white); transition: var(--transition); border-radius: 2px; }

/* === BREADCRUMB === */
.breadcrumb { background: var(--white); padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.breadcrumb .container { }
.breadcrumb ul { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.breadcrumb li { display: flex; align-items: center; gap: 6px; }
.breadcrumb li:not(:last-child)::after { content: '/'; color: var(--border); }
.breadcrumb a { color: var(--primary); }
.breadcrumb li:last-child { color: var(--text-light); }

/* ============================================================
   LAYOUT
   ============================================================ */
.site-content { padding: 24px 0; }
.layout-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin-top: 24px; }
.layout-main { min-width: 0; }

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-wrap { display: grid; grid-template-columns: 3fr 2fr; gap: 4px; height: 460px; border-radius: var(--radius-lg); overflow: hidden; }
.hero-main { position: relative; overflow: hidden; }
.hero-main-link { display: block; height: 100%; }
.hero-main-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.hero-main:hover .hero-main-img { transform: scale(1.04); }
.hero-main-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 50%, transparent 100%); padding: 28px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-main-title { color: var(--white); font-size: 24px; font-weight: 800; line-height: 1.3; margin-top: 10px; }
.hero-main-meta { display: flex; gap: 12px; margin-top: 8px; font-size: 12px; color: rgba(255,255,255,.75); }

.hero-sub-grid { display: grid; grid-template-rows: repeat(2, 1fr); gap: 4px; }
.hero-sub-item { position: relative; overflow: hidden; display: block; }
.hero-sub-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.hero-sub-item:hover .hero-sub-img { transform: scale(1.05); }
.hero-sub-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.8), transparent 60%); padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-sub-title { color: var(--white); font-size: 13px; font-weight: 700; line-height: 1.3; margin-top: 6px; }

/* === CATEGORY PILL === */
.cat-pill { display: inline-block; background: var(--primary); color: var(--white); font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.cat-pill.small { font-size: 9px; padding: 2px 6px; }
.cat-pill:hover { background: #c41920; }

/* ============================================================
   SECTION
   ============================================================ */
.section-block { margin-top: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--border); position: relative; }
.section-head::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 50px; height: 2px; background: var(--primary); }
.section-heading { font-size: 18px; font-weight: 800; color: var(--text); }
.section-more { font-size: 12px; color: var(--primary); font-weight: 600; border: 1px solid var(--primary); padding: 4px 12px; border-radius: 20px; }
.section-more:hover { background: var(--primary); color: var(--white); }

/* ============================================================
   POST CARD (3-column grid)
   ============================================================ */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card { background: var(--white); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform var(--transition), box-shadow var(--transition); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.post-card-thumb { display: block; position: relative; aspect-ratio: 16/10; overflow: hidden; }
.post-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.post-card:hover .post-card-img { transform: scale(1.06); }
.post-card-thumb .cat-pill { position: absolute; top: 10px; left: 10px; z-index: 1; }
.post-card-placeholder { width: 100%; height: 100%; min-height: 180px; background: linear-gradient(135deg, var(--dark2) 0%, var(--primary) 100%); }
.post-card-body { padding: 16px; }
.post-card-title { font-size: 15px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt { font-size: 13px; color: var(--text-light); line-height: 1.6; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-muted); }
.post-card-read { color: var(--primary); font-weight: 600; }
.read-more-btn { color: var(--primary); font-weight: 600; font-size: 12px; }

/* ============================================================
   POST ROW (category section - 3 col)
   ============================================================ */
.post-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.post-row-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.post-row-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; }
.post-row-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.post-row-card:hover .post-row-img { transform: scale(1.05); }
.post-row-body { padding: 12px; }
.post-row-title { font-size: 13px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-row-title a:hover { color: var(--primary); }
.post-row-date { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { }
.widget-box { background: var(--white); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 24px; box-shadow: var(--shadow); }
.widget-title { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.widget-title span { border-left: 3px solid var(--primary); padding-left: 10px; }

.popular-item { display: flex; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.popular-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.popular-num { font-size: 24px; font-weight: 900; color: var(--border); min-width: 30px; line-height: 1; }
.popular-body { display: flex; gap: 8px; align-items: flex-start; flex: 1; }
.popular-img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.popular-title { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.popular-title:hover { color: var(--primary); }
.popular-date { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

.sidebar-cat-list { display: flex; flex-direction: column; gap: 2px; }
.sidebar-cat-list a { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--text); transition: background var(--transition); }
.sidebar-cat-list a:hover { background: var(--bg); color: var(--primary); }
.cat-badge { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1px 8px; font-size: 11px; color: var(--text-muted); }

.sidebar-recent-item { display: flex; gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.sidebar-recent-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.recent-img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.recent-title { font-size: 12px; font-weight: 600; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-title:hover { color: var(--primary); }
.recent-date { font-size: 11px; color: var(--text-muted); display: block; margin-top: 4px; }

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-article { background: var(--white); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.single-header { margin-bottom: 24px; }
.single-title { font-size: 30px; font-weight: 900; line-height: 1.3; color: var(--text); margin: 12px 0; }
.single-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); margin-top: 12px; }
.single-meta span { display: flex; align-items: center; gap: 5px; }
.single-featured { border-radius: var(--radius); overflow: hidden; margin-bottom: 28px; }
.single-featured img { width: 100%; max-height: 480px; object-fit: cover; }
.single-content { font-size: 16px; line-height: 1.85; color: #374151; }
.single-content h2 { font-size: 24px; font-weight: 800; color: var(--text); margin: 32px 0 14px; }
.single-content h3 { font-size: 20px; font-weight: 700; color: var(--text); margin: 24px 0 12px; }
.single-content p { margin-bottom: 18px; }
.single-content ul, .single-content ol { padding-left: 26px; margin-bottom: 18px; }
.single-content li { margin-bottom: 8px; }
.single-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.single-content strong { font-weight: 700; }
.single-content blockquote { border-left: 4px solid var(--primary); padding: 14px 20px; margin: 20px 0; background: var(--bg); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic; }
.single-content img { border-radius: var(--radius); margin: 16px 0; }
.single-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.single-tags { font-size: 13px; color: var(--text-muted); }
.single-tags a { color: var(--primary); margin: 0 4px; }

/* === SOCIAL SHARE === */
.social-share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.share-label { font-size: 13px; font-weight: 600; color: var(--text-light); }
.share-btn { display: inline-block; padding: 7px 16px; border-radius: 20px; font-size: 12px; font-weight: 700; color: var(--white); }
.share-fb { background: #1877f2; }
.share-tw { background: #1da1f2; }
.share-wa { background: #25d366; }
.share-btn:hover { opacity: 0.88; }

/* === RELATED POSTS === */
.related-section { margin-top: 32px; }

/* ============================================================
   ARCHIVE / SEARCH
   ============================================================ */
.archive-header { margin-bottom: 24px; padding: 20px; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.archive-title { font-size: 22px; font-weight: 800; color: var(--text); border-left: 4px solid var(--primary); padding-left: 14px; }
.archive-desc { margin-top: 8px; font-size: 14px; color: var(--text-light); padding-left: 18px; }

/* ============================================================
   NOT FOUND / 404
   ============================================================ */
.not-found-wrap { text-align: center; padding: 80px 20px; }
.not-found-code { font-size: 120px; font-weight: 900; color: var(--primary); line-height: 1; }
.not-found-wrap h1, .not-found-wrap h2 { font-size: 28px; font-weight: 800; margin: 16px 0 12px; }
.not-found-wrap p { color: var(--text-light); margin-bottom: 24px; }
.btn-primary { display: inline-block; background: var(--primary); color: var(--white); padding: 12px 28px; border-radius: 24px; font-weight: 700; font-size: 14px; }
.btn-primary:hover { background: #c41920; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-wrap { margin-top: 32px; display: flex; justify-content: center; }
.page-numbers { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin: 0 3px; border-radius: 8px; background: var(--white); color: var(--text); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); transition: var(--transition); }
.page-numbers.current, .page-numbers:hover { background: var(--primary); color: var(--white); }
.page-numbers.dots { background: none; box-shadow: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--dark); color: #9ca3af; margin-top: 48px; }
.footer-top { padding: 48px 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; }
.footer-logo-text { font-size: 22px; font-weight: 800; color: var(--white); display: block; margin-bottom: 12px; }
.footer-about p { font-size: 13px; line-height: 1.7; }
.footer-widget-title { font-size: 13px; font-weight: 800; color: var(--white); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 16px; }
.footer-post-item { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.07); }
.footer-post-item a { font-size: 13px; color: #9ca3af; display: block; margin-bottom: 4px; line-height: 1.4; }
.footer-post-item a:hover { color: var(--primary); }
.footer-post-item span { font-size: 11px; color: #6b7280; }
.footer-cat-list { display: flex; flex-direction: column; gap: 8px; }
.footer-cat-list a { font-size: 13px; color: #9ca3af; display: flex; align-items: center; gap: 6px; }
.footer-cat-list a:hover { color: var(--primary); }
.footer-cat-list span { color: #6b7280; font-size: 11px; }
.footer-bottom { background: rgba(0,0,0,.35); padding: 16px 0; }
.footer-bottom-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.footer-bottom-inner a { color: var(--primary); }
.footer-nav { display: flex; gap: 16px; }
.footer-nav a { color: #6b7280; font-size: 12px; }
.footer-nav a:hover { color: var(--primary); }

/* ============================================================
   BACK TO TOP
   ============================================================ */
#back-to-top { position: fixed; bottom: 28px; right: 28px; width: 42px; height: 42px; background: var(--primary); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity var(--transition), transform var(--transition); box-shadow: 0 4px 16px rgba(232,33,42,.35); z-index: 999; }
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { transform: translateY(-3px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .hero-wrap { grid-template-columns: 1fr 1fr; height: 400px; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .post-row { grid-template-columns: repeat(2, 1fr); }
    .layout-wrap { grid-template-columns: 1fr 280px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .hero-wrap { grid-template-columns: 1fr; height: auto; }
    .hero-sub-grid { grid-template-rows: auto; grid-template-columns: repeat(2, 1fr); }
    .layout-wrap { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .main-nav-menu { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--primary); z-index: 999; }
    .main-nav-menu.open { display: flex; }
    .nav-toggle { display: flex; }
    .main-nav { position: relative; }
    .single-title { font-size: 24px; }
    .hero-main-title { font-size: 18px; }
    .brand-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
    .header-search input { width: 100%; }
    .header-search-wrap { width: 100%; }
    .header-search { width: 100%; }
}

@media (max-width: 480px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-row { grid-template-columns: 1fr; }
    .hero-sub-grid { grid-template-columns: 1fr; }
    .hero-wrap { height: auto; }
    .footer-grid { grid-template-columns: 1fr; }
    .single-article { padding: 20px; }
    .footer-bottom-inner { flex-direction: column; text-align: center; }
    .not-found-code { font-size: 80px; }
}
