/*
Theme Name: CapCut Cloud
Theme URI: https://capcutapk.cloud
Author: CapCut Cloud Team
Author URI: https://capcutapk.cloud
Description: A clean, fast, AdSense-optimized theme for video editing tutorials and tech guides.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: capcutcloud
Tags: blog, custom-colors, custom-menu, featured-images, two-columns, right-sidebar
*/

/* ============================================
   RESET & BASE
============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --accent: #fbbc04;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #e8eaed;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 17px;
  --line-height: 1.75;
  --max-width: 1200px;
}

html { font-size: var(--font-size-base); scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg);
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }

/* ============================================
   LAYOUT
============================================ */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.content-area { flex: 1; }

.main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  padding: 40px 0;
}
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ============================================
   HEADER
============================================ */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.site-logo span { color: var(--primary); }
.site-logo:hover { text-decoration: none; color: var(--text); }

/* Nav */
.main-nav ul { list-style: none; display: flex; gap: 8px; }
.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s;
}
.main-nav a:hover, .main-nav .current-menu-item a {
  background: var(--bg-light);
  color: var(--primary);
  text-decoration: none;
}

/* Mobile toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.2rem;
}
@media (max-width: 700px) {
  .menu-toggle { display: block; }
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 12px 20px; }
  .main-nav.open ul { flex-direction: column; }
}

/* ============================================
   HERO / BANNER AD AREA
============================================ */
.header-ad-bar {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  text-align: center;
}

/* ============================================
   HERO
============================================ */
.site-hero {
  background: linear-gradient(135deg, #1a73e8 0%, #0d47a1 100%);
  color: white;
  padding: 60px 0;
  text-align: center;
}
.site-hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 14px; line-height: 1.2; }
.site-hero p { font-size: 1.1rem; opacity: 0.88; max-width: 580px; margin: 0 auto 28px; }
.hero-search {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  background: white;
  border-radius: 50px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-search input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-size: 1rem;
  color: var(--text);
  outline: none;
}
.hero-search button {
  background: var(--accent);
  color: var(--text);
  border: none;
  padding: 14px 24px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}

/* ============================================
   AD UNITS
============================================ */
.ad-unit {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  padding: 12px;
  margin: 28px 0;
  overflow: hidden;
  position: relative;
}
.ad-unit::before {
  content: 'Advertisement';
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.ad-unit-horizontal { min-height: 90px; }
.ad-unit-rectangle { min-height: 250px; }
.ad-unit-in-content { min-height: 280px; max-width: 580px; margin: 32px auto; }

/* ============================================
   CATEGORY PILLS
============================================ */
.category-bar { padding: 20px 0; border-bottom: 1px solid var(--border); }
.category-bar-inner { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.category-bar-label { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.cat-pill {
  display: inline-block;
  padding: 6px 16px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
  transition: all 0.2s;
}
.cat-pill:hover { background: var(--primary); color: white; border-color: var(--primary); text-decoration: none; }

/* ============================================
   POST CARDS
============================================ */
.posts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
@media (max-width: 600px) { .posts-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.post-card-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #e8f0fe, #c5d8fb);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card-thumb-placeholder { font-size: 3rem; opacity: 0.35; }

.post-card-body { padding: 18px; }
.post-card-cat {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--primary);
  margin-bottom: 8px;
}
.post-card h2 { font-size: 1rem; font-weight: 700; line-height: 1.4; margin-bottom: 10px; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { color: var(--primary); text-decoration: none; }
.post-card-excerpt { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 14px; }
.post-card-meta { font-size: 0.8rem; color: var(--text-secondary); display: flex; gap: 12px; align-items: center; }
.read-more { font-size: 0.85rem; font-weight: 600; color: var(--primary); }

/* Featured post */
.post-card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
.post-card.featured .post-card-thumb { aspect-ratio: auto; min-height: 220px; }
.post-card.featured .post-card-body { padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.post-card.featured h2 { font-size: 1.4rem; }
@media (max-width: 600px) { .post-card.featured { grid-template-columns: 1fr; } }

/* ============================================
   SINGLE POST
============================================ */
.post-header { margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.post-title { font-size: 2rem; font-weight: 800; line-height: 1.25; margin-bottom: 14px; }
.post-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 0.88rem; color: var(--text-secondary); }
.post-meta .cat-badge {
  background: var(--primary);
  color: white;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.post-featured-image { border-radius: var(--radius); overflow: hidden; margin-bottom: 32px; }
.post-featured-image img { width: 100%; }

/* Post content */
.post-content { max-width: 720px; }
.post-content h2 { font-size: 1.5rem; font-weight: 700; margin: 36px 0 14px; color: var(--text); }
.post-content h3 { font-size: 1.2rem; font-weight: 600; margin: 28px 0 12px; }
.post-content p { margin-bottom: 20px; }
.post-content ul, .post-content ol { margin: 16px 0 20px 24px; }
.post-content li { margin-bottom: 8px; }
.post-content strong { font-weight: 700; }
.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  background: var(--bg-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-secondary);
}
.post-content code {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: monospace;
  font-size: 0.9em;
}
.post-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 0.9rem;
}

/* ============================================
   SIDEBAR
============================================ */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-light);
}
.widget-body { padding: 16px 18px; }

/* Recent posts widget */
.recent-post-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.recent-post-item:last-child { border-bottom: none; }
.recent-post-thumb {
  width: 70px;
  height: 50px;
  border-radius: 6px;
  background: var(--bg-light);
  flex-shrink: 0;
  overflow: hidden;
}
.recent-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-post-info h4 { font-size: 0.85rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.recent-post-info h4 a { color: var(--text); }
.recent-post-info h4 a:hover { color: var(--primary); text-decoration: none; }
.recent-post-info span { font-size: 0.75rem; color: var(--text-secondary); }

/* Sidebar ad widget */
.widget-ad { padding: 0; border: none; background: transparent; }

/* ============================================
   BREADCRUMBS
============================================ */
.breadcrumbs {
  padding: 14px 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs span { margin: 0 6px; }

/* ============================================
   PAGINATION
============================================ */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 32px 0; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  transition: all 0.2s;
}
.pagination a:hover, .pagination .current {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  text-decoration: none;
}

/* ============================================
   FOOTER
============================================ */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.75);
  padding: 48px 0 24px;
  margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }

.footer-brand .site-logo { color: white; font-size: 1.2rem; }
.footer-brand p { font-size: 0.88rem; margin-top: 12px; line-height: 1.7; }

.footer-col h4 { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: white; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 0.88rem; color: rgba(255,255,255,0.65); }
.footer-col a:hover { color: white; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: rgba(255,255,255,0.5); }
.footer-links a:hover { color: white; text-decoration: none; }

/* ============================================
   UTILITY
============================================ */
.section-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--border);
}

.tag { display: inline-block; padding: 4px 10px; background: var(--bg-light); border: 1px solid var(--border); border-radius: 4px; font-size: 0.78rem; color: var(--text-secondary); }
.tag:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

.author-box {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--bg-light);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 40px 0;
}
.author-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}
.author-info h4 { font-weight: 700; margin-bottom: 6px; }
.author-info p { font-size: 0.88rem; color: var(--text-secondary); }

/* Related posts */
.related-posts { margin-top: 48px; }
.related-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 16px; }
@media (max-width: 600px) { .related-posts-grid { grid-template-columns: 1fr; } }

/* Table of contents */
.toc {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}
.toc-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 12px; }
.toc ol { margin-left: 20px; }
.toc li { margin-bottom: 6px; font-size: 0.9rem; }
.toc a { color: var(--primary); }

/* Notice/info boxes */
.info-box {
  border-left: 4px solid var(--primary);
  background: #e8f0fe;
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
  font-size: 0.95rem;
}
.tip-box { border-color: #34a853; background: #e6f4ea; }
.warn-box { border-color: #fbbc04; background: #fef9e3; }
