/*
Theme Name: SwiftCore
Description: Ultra-lightweight, high-performance WordPress theme. 95+ PageSpeed. Fully responsive + WPBakery ready.
Author: Websharks
Version: 1.6.3
Text Domain: swiftcore
*/

/* ====================== VARIABLES ====================== */
:root {
  --primary-color: #0073aa;
  --header-height: 80px;
  --box-width: 1200px;
  --sidebar-width: 300px;
  --gap: 40px;
  --subheader-height: 120px;
  --subheader-bg: #f8f8f8;
  --subheader-color: #222222;
  --subheader-size: 36px;
  --subheader-font: system-ui, sans-serif;
}

/* ====================== RESET ====================== */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.6; color: #333; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-color); }

/* ====================== HEADER ====================== */
.header {
  height: var(--header-height);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.sticky-header { position: sticky; top: 0; box-shadow: 0 4px 20px rgba(0,0,0,0.1); }

/* ====================== MAIN MENU ====================== */
.main-menu ul {
  display: flex;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: var(--menu-align, center);
  align-items: center;
  flex-wrap: wrap;
}
.main-menu li {
  position: relative;
  padding-right: 30px;
  margin: 0;
}

/* Prevent header from clipping dropdowns */
.header {
  overflow: visible;
}
.main-menu {
  overflow: visible;
}
.main-menu ul {
  overflow: visible;
}
.main-menu a {
  color: #222;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.main-menu li:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 18px;
  background: var(--menu-separator-color, #e0e0e0);
}

/* ---- Dropdown submenu ---- */
.main-menu ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid #eee;
  border-top: 3px solid var(--primary-color);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  z-index: 9999;
  flex-direction: column;
  gap: 0;
  /* Use padding-top as the visual gap so hover area stays connected */
  padding: 0 0 6px 0;
  margin-top: 0;
}

/* Invisible bridge fills the space between menu bar and dropdown */
.main-menu ul ul::before {
  content: '';
  display: block;
  height: 12px;
}

/* Show on hover / keyboard focus */
.main-menu li:hover > ul,
.main-menu li:focus-within > ul {
  display: flex;
}

/* Submenu list items */
.main-menu ul ul li {
  padding: 0;
  margin: 0;
  width: 100%;
}

/* Remove pipeline separator inside dropdowns */
.main-menu ul ul li::after { display: none !important; }

.main-menu ul ul a {
  display: block;
  padding: 10px 18px;
  color: #333;
  font-weight: 400;
  font-size: 14px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.main-menu ul ul a:hover {
  background: #f5f8ff;
  color: var(--primary-color);
}

/* Caret on parent items */
.main-menu li:has(> ul) > a::after {
  content: ' ▾';
  font-size: 11px;
  opacity: 0.55;
}

/* Third-level: fly out to the right */
.main-menu ul ul ul {
  top: -9px;
  left: 100%;
  border-top: 3px solid var(--primary-color);
  padding: 0 0 6px 0;
}
.main-menu ul ul ul::before {
  display: none;
}

.mobile-menu-toggle {
  display: none;
  font-size: 28px;
  cursor: pointer;
  background: none;
  border: none;
}

/* ====================== SUBHEADER ====================== */
.subheader {
  min-height: var(--subheader-height, 120px);
  background-color: var(--subheader-bg, #f8f8f8);
  display: flex;
  align-items: center;
  padding: 30px 20px;
}
.subheader-inner {
  max-width: var(--box-width);
  width: 100%;
  margin: 0 auto;
}
.subheader-title {
  font-family: var(--subheader-font);
  font-size: var(--subheader-size, 36px);
  color: var(--subheader-color, #222);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}
.subheader-breadcrumbs {
  font-size: 14px;
  color: #777;
}
.subheader-breadcrumbs a {
  color: var(--primary-color);
  text-decoration: none;
}
.subheader-breadcrumbs .sep {
  margin: 0 6px;
  color: #aaa;
}

/* ====================== SITE CONTAINER ====================== */
.site-container {
  max-width: var(--box-width);
  margin: 0 auto;
  padding: 40px 20px;
}

/* ====================== CONTENT WRAPPER (SIDEBAR LAYOUT) ====================== */
.content-wrapper {
  display: flex;
  gap: var(--gap);
  align-items: flex-start;
}

/* Right sidebar — content left, sidebar right */
.content-wrapper.layout-right {
  flex-direction: row;
}
.content-wrapper.layout-right .main-content {
  flex: 1;
  min-width: 0;
}
.content-wrapper.layout-right .sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* Left sidebar — sidebar left, content right */
.content-wrapper.layout-left {
  flex-direction: row-reverse;
}
.content-wrapper.layout-left .main-content {
  flex: 1;
  min-width: 0;
}
.content-wrapper.layout-left .sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* Full width / no sidebar */
.content-wrapper.layout-full-width,
.content-wrapper.layout-none {
  display: block;
}
.main-content--full {
  max-width: 100%;
}

/* ====================== SIDEBAR WIDGETS ====================== */
.sidebar .widget {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 28px;
}
.sidebar .widget-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color);
  color: #222;
}
.sidebar .widget ul {
  list-style: none;
  padding: 0;
}
.sidebar .widget ul li {
  padding: 6px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
.sidebar .widget ul li:last-child { border-bottom: none; }
.sidebar .widget a { color: #333; text-decoration: none; }
.sidebar .widget a:hover { color: var(--primary-color); }

/* ====================== MAIN CONTENT ====================== */
.main-content {
  max-width: var(--box-width);
  margin: 0 auto;
  padding: 0;
}

/* Article / Entry */
.entry-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
  color: #111;
}
.entry-meta {
  font-size: 13px;
  color: #888;
  margin-bottom: 20px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.entry-meta a { color: #888; text-decoration: none; }
.entry-meta a:hover { color: var(--primary-color); }
.entry-thumbnail {
  margin-bottom: 28px;
  border-radius: 8px;
  overflow: hidden;
}
.entry-thumbnail img { width: 100%; height: auto; }
.entry-content { line-height: 1.8; }
.entry-content h2,
.entry-content h3 { margin: 28px 0 14px; }
.entry-content p { margin-bottom: 20px; }
.entry-content ul,
.entry-content ol { margin: 0 0 20px 24px; }
.entry-tags { margin-top: 24px; font-size: 14px; }
.entry-tags a { background: #f0f0f0; padding: 4px 10px; border-radius: 4px; margin-right: 6px; color: #555; text-decoration: none; }
.entry-tags a:hover { background: var(--primary-color); color: #fff; }

/* ====================== POST CARDS (index.php) ====================== */
.posts-loop { display: flex; flex-direction: column; gap: 36px; }

.post-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.post-card__thumbnail img { width: 100%; height: 220px; object-fit: cover; }
.post-card__body { padding: 24px; }
.post-card__meta { font-size: 12px; color: #999; margin-bottom: 10px; display: flex; gap: 12px; }
.post-card__meta a { color: #999; text-decoration: none; }
.post-card__title { font-size: 22px; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.post-card__title a { color: #111; text-decoration: none; }
.post-card__title a:hover { color: var(--primary-color); }
.post-card__excerpt { font-size: 15px; color: #555; margin-bottom: 16px; line-height: 1.7; }
.post-card__readmore { font-size: 14px; font-weight: 600; color: var(--primary-color); text-decoration: none; }
.post-card__readmore:hover { text-decoration: underline; }

/* Pagination */
.nav-links { display: flex; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.nav-links a, .nav-links span {
  padding: 8px 14px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  color: #333;
}
.nav-links .current { background: var(--primary-color); color: #fff; border-color: var(--primary-color); }

/* ====================== POST NAVIGATION ====================== */
.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid #eee;
  font-size: 14px;
}
.post-navigation a { color: var(--primary-color); text-decoration: none; }

/* ====================== FOOTER ====================== */
.site-footer {
  background: #111;
  color: #ccc;
  padding: 40px 20px;
  text-align: center;
  margin-top: 60px;
}
.footer-inner {
  max-width: var(--box-width);
  margin: 0 auto;
}
.footer-menu ul {
  display: flex;
  justify-content: center;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.footer-menu a { color: #aaa; text-decoration: none; font-size: 14px; }
.footer-menu a:hover { color: #fff; }
.footer-copy { font-size: 14px; color: #777; }
.footer-copy a { color: #aaa; text-decoration: none; }
.footer-copy a:hover { color: #fff; }

/* ====================== SLIDER FULL-BLEED FIX ====================== */
.main-content > .vc_row:first-child,
.main-content > .vc_row:first-of-type {
  margin-top: 0 !important;
  padding-top: 0 !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  width: 100vw !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 1024px) {
  .header { height: auto; padding: 15px 20px; flex-wrap: wrap; overflow: visible; }
  .main-menu ul { display: none; flex-direction: column; width: 100%; background: #fff; padding: 10px 0; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
  .main-menu.active ul { display: flex; }
  .mobile-menu-toggle { display: block; }

  /* Mobile dropdowns: stack inline, no absolute positioning */
  .main-menu ul ul {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--primary-color);
    border-top: none;
    border-radius: 0;
    padding: 0;
    margin: 0 0 0 16px;
    min-width: 0;
    width: 100%;
    display: flex !important; /* always visible on mobile */
    flex-direction: column;
  }
  .main-menu ul ul a { padding: 8px 16px; font-size: 14px; }
  .main-menu li:has(> ul) > a::after { content: ''; }

  .content-wrapper.layout-right,
  .content-wrapper.layout-left { flex-direction: column; }
  .sidebar { width: 100% !important; }
  :root { --sidebar-width: 100%; }

  .subheader { margin-top: 0; }
}

@media (max-width: 768px) {
  .site-container { padding: 24px 16px; }
  .entry-title { font-size: 24px; }
  .post-card__title { font-size: 18px; }
  .subheader-title { font-size: 26px; }
}

@media (max-width: 480px) {
  .main-menu li { padding-right: 0; }
  .main-menu li:not(:last-child)::after { display: none; }
  .post-navigation { flex-direction: column; }
}
