/* FB Downloader Pro Theme - Main Styles */
:root {
  --color-primary: #6366f1;
  --color-accent: #a855f7;
  --color-bg: #ffffff;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-card: rgba(255, 255, 255, 0.8);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-text: #f1f5f9;
  --color-muted: #94a3b8;
  --color-border: #334155;
  --color-card: rgba(255, 255, 255, 0.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-card);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  position: relative;
  gap: 12px;
}

.site-title {
  font-size: 1.25rem; font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-menu { display: flex; gap: 24px; list-style: none; }
.nav-menu a { text-decoration: none; color: var(--color-text); font-weight: 500; font-size: 0.9rem; transition: color 0.2s; }
.nav-menu a:hover { color: var(--color-primary); }

.theme-toggle, .mobile-menu-toggle {
  background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 8px;
}

.mobile-menu-toggle { display: none; flex-direction: column; gap: 4px; }
.mobile-menu-toggle span { display: block; width: 24px; height: 2px; background: var(--color-text); }

/* Hero */
.hero-section {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(168,85,247,0.08));
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-muted);
  max-width: 600px;
  margin: 0 auto 40px;
}

.hero-download-form { max-width: 640px; margin: 0 auto; width: 100%; }

.hero-download-form .fbdl-download-form {
  margin: 0 auto;
  max-width: 100%;
}

/* Features */
.features-section { padding: 60px 0; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }

.feature-card {
  padding: 32px;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s;
}

.feature-card:hover { transform: translateY(-4px); }
.feature-icon { font-size: 2rem; display: block; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--color-muted); font-size: 0.9rem; }

/* Content */
.content-area { padding: 40px 0; }
.post-thumbnail img { width: 100%; border-radius: var(--radius); margin-bottom: 20px; }

/* Footer */
.site-footer {
  padding: 40px 0 24px;
  border-top: 1px solid var(--color-border);
  margin-top: 60px;
}

.footer-bottom { text-align: center; color: var(--color-muted); font-size: 0.85rem; margin-top: 24px; }
.footer-legal { margin-top: 8px; font-size: 0.75rem; }
.footer-menu { display: flex; justify-content: center; gap: 16px; list-style: none; margin-top: 12px; }
.footer-menu a { color: var(--color-muted); text-decoration: none; font-size: 0.85rem; }

/* Responsive */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  .site-header { position: sticky; top: 0; }

  .header-inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .site-branding { flex: 1; min-width: 0; }

  .site-title {
    font-size: 1.05rem;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-navigation { order: 4; width: 100%; }

  .nav-menu {
    display: none;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 12px 0 4px;
    border-top: 1px solid var(--color-border);
    margin-top: 8px;
  }

  .nav-menu.is-open { display: flex; }

  .mobile-menu-toggle { display: flex; }

  .theme-toggle { padding: 6px; font-size: 1.1rem; }

  .hero-section { padding: 40px 0 32px; }

  .hero-title { font-size: clamp(1.75rem, 8vw, 2.5rem); }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 24px;
    padding: 0 4px;
  }

  .features-section { padding: 40px 0; }

  .features-grid { grid-template-columns: 1fr; gap: 16px; }

  .feature-card { padding: 24px 20px; }

  .site-footer { padding: 32px 0 20px; margin-top: 40px; }

  .footer-menu { flex-wrap: wrap; justify-content: center; }

  .footer-widgets-grid { grid-template-columns: 1fr 1fr; gap: 24px; }

  .content-area-with-sidebar { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-section { padding: 32px 0 24px; }
  .footer-widgets-grid { grid-template-columns: 1fr; }
}

.site-branding .custom-logo-link img { max-height: 48px; width: auto; }

.site-tagline {
  font-size: 0.75rem;
  color: var(--color-muted);
  margin-top: 2px;
}

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute; width: 1px; word-wrap: normal !important;
}

.screen-reader-text:focus {
  background: var(--color-bg); clip: auto !important; clip-path: none;
  color: var(--color-text); display: block; font-size: 1rem;
  height: auto; left: 8px; line-height: normal; padding: 12px 16px;
  text-decoration: none; top: 8px; width: auto; z-index: 100000;
}

/* Breadcrumbs */
.fbdl-breadcrumbs {
  font-size: 0.85rem; color: var(--color-muted); margin-bottom: 20px;
}
.fbdl-breadcrumbs a { color: var(--color-muted); text-decoration: none; }
.fbdl-breadcrumbs a:hover { color: var(--color-primary); }
.fbdl-breadcrumbs .sep { margin: 0 6px; opacity: 0.5; }

/* Entry / Blog */
.entry-header { margin-bottom: 20px; }
.entry-title { font-size: clamp(1.5rem, 4vw, 2.25rem); line-height: 1.25; margin-bottom: 8px; }
.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { color: var(--color-primary); }
.entry-meta { font-size: 0.85rem; color: var(--color-muted); }
.entry-content { font-size: 1rem; line-height: 1.75; }
.entry-content p { margin-bottom: 1em; }
.entry-content img { max-width: 100%; height: auto; border-radius: var(--radius); }

.content-area-with-sidebar {
  display: grid; grid-template-columns: 1fr 320px; gap: 40px; align-items: start;
}

.posts-grid { display: grid; gap: 24px; }

.entry-card {
  background: var(--color-card); border: 1px solid var(--color-border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.entry-card-thumb img { display: block; width: 100%; height: auto; }
.entry-card-body { padding: 20px; }
.read-more, .button-link {
  display: inline-block; margin-top: 12px; color: var(--color-primary);
  font-weight: 600; text-decoration: none;
}
.read-more:hover, .button-link:hover { text-decoration: underline; }

.sidebar .widget { margin-bottom: 24px; }
.widget-title, .footer-widget-title { font-size: 1rem; margin-bottom: 12px; }

/* Footer columns */
.footer-widgets-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px;
  margin-bottom: 32px; text-align: left;
}
.footer-widget { font-size: 0.9rem; color: var(--color-muted); }
.footer-widget-title { color: var(--color-text); font-size: 1rem; margin-bottom: 12px; }
.footer-widget ul { list-style: none; padding: 0; }
.footer-widget li { margin-bottom: 8px; }
.footer-widget a { color: var(--color-muted); text-decoration: none; }
.footer-widget a:hover { color: var(--color-primary); }

.footer-social, .social-links {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
  margin-bottom: 16px;
}
.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--color-border); border-radius: 999px;
  color: var(--color-text); text-decoration: none; font-size: 0.8rem; font-weight: 600;
}
.social-link:hover { border-color: var(--color-primary); color: var(--color-primary); }

.footer-tagline { text-align: center; color: var(--color-muted); margin-bottom: 12px; font-size: 0.9rem; }
.footer-copyright { margin-bottom: 4px; }

.archive-header, .search-header, .error-404 { margin-bottom: 24px; }
.archive-title, .search-title, .page-title { font-size: clamp(1.5rem, 4vw, 2rem); }

.search-form {
  display: flex; gap: 8px; max-width: 480px; margin-top: 16px;
}
.search-field {
  flex: 1; padding: 12px 14px; border: 1px solid var(--color-border);
  border-radius: 10px; font-size: 1rem; background: var(--color-bg); color: var(--color-text);
}
.search-submit {
  padding: 12px 18px; border: none; border-radius: 10px; cursor: pointer;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent)); color: #fff; font-weight: 600;
}

/* Legal pages */
.content-area-legal { max-width: 820px; }
.entry-legal .entry-header { margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.legal-content { font-size: 0.98rem; line-height: 1.8; color: var(--color-text); }
.legal-content .legal-updated { color: var(--color-muted); font-size: 0.9rem; margin-bottom: 24px; }
.legal-content h2 {
  font-size: 1.15rem; margin: 28px 0 12px; color: var(--color-text);
}
.legal-content p { margin-bottom: 14px; }
.legal-content ul { margin: 0 0 16px 1.25rem; }
.legal-content li { margin-bottom: 8px; }
.legal-content a { color: var(--color-primary); text-decoration: underline; }
.legal-content a:hover { color: var(--color-accent); }
.legal-content strong { font-weight: 600; }

.nav-menu .sub-menu {
  list-style: none; padding-left: 16px; margin-top: 8px;
}

/* Elementor compatibility */
.elementor-page .site-main { padding: 0; }
.elementor-page .hero-section { display: none; }
.elementor-location-header + .site-main { padding-top: 0; }
.elementor-default .entry-content { max-width: none; }
body.elementor-page .fbdl-download-form { margin-left: auto; margin-right: auto; }

/* Rank Math / Yoast — keep theme breadcrumbs hidden when plugin renders */
.rank-math-breadcrumb + .fbdl-breadcrumbs { display: none; }
