/*
 * SMK Vokasi Modern - Main Layout Stylesheet
 * Standardized CSS for WordPress Theme & Live Preview
 */

/* 1. Base Reset & Defaults */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
}

img, svg, video {
  max-width: 100%;
  height: auto;
}

.font-script {
  font-family: 'Caveat', cursive, sans-serif;
}

/* 2. Container Standards */
.smk-container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .smk-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .smk-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* 3. Screen Reader Text & Accessibility */
.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 !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #0b2545;
  border-radius: 6px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #ffffff;
  display: block;
  font-size: 0.875rem;
  font-weight: 700;
  height: auto;
  left: 8px;
  line-height: normal;
  padding: 12px 18px;
  text-decoration: none;
  top: 8px;
  width: auto;
  z-index: 100000;
}

/* 4. Complete Navigation & Dropdowns System (.smkv-* & WordPress standard) */
.smkv-header,
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  width: 100%;
  transition: all 0.25s ease;
}

.smkv-main-header {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.smkv-brand,
.site-branding {
  flex-shrink: 0;
  min-width: 220px;
  max-width: 340px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.smkv-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  cursor: pointer;
}
.smkv-brand-logo {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
}
.smkv-brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.smkv-brand-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #0a2540;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.smkv-brand-subtitle {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1565c0;
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.smkv-brand-region {
  font-size: 0.625rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.06em;
  padding-top: 0.125rem;
  white-space: nowrap;
}

.smkv-primary-nav,
#site-navigation {
  display: none;
}

@media (min-width: 1024px) {
  .smkv-primary-nav,
  #site-navigation {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
  }
}

.smkv-primary-menu,
#site-navigation > ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
  flex-wrap: nowrap;
}

.smkv-menu-item,
#site-navigation > ul > li {
  position: relative;
  display: inline-flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Top-level Menu Links */
.smkv-nav-link,
#site-navigation > ul > li > a,
.smk-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  line-height: 1.25;
  white-space: nowrap;
  transition: all 0.15s ease;
  cursor: pointer;
}

.smkv-nav-link:hover,
#site-navigation > ul > li > a:hover,
.smk-nav-link:hover {
  color: #1d4ed8;
  background-color: #eff6ff;
}

/* Active Menu Item */
.smkv-nav-link.is-active,
#site-navigation > ul > li.current-menu-item > a,
#site-navigation > ul > li.current_page_item > a,
.smk-nav-link.is-active {
  color: #1d4ed8;
  font-weight: 700;
  border-bottom: 2px solid #2563eb;
}

/* PPDB Pill Button in Nav */
.smkv-nav-ppdb,
.smk-nav-ppdb {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid rgba(245, 158, 11, 0.2);
  cursor: pointer;
}

.smkv-nav-ppdb:hover,
.smk-nav-ppdb:hover {
  background-color: #f59e0b;
  color: #ffffff;
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.smkv-nav-ppdb .badge-new,
.smk-nav-ppdb .badge-new {
  font-size: 0.625rem;
  font-weight: 800;
  background-color: #f59e0b;
  color: #ffffff;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

.smkv-nav-ppdb:hover .badge-new,
.smk-nav-ppdb:hover .badge-new {
  background-color: #ffffff;
  color: #d97706;
}

/* Dropdown Caret for WordPress Menus with Children */
.smkv-menu-item-has-children > a::after,
#site-navigation .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  margin-left: 0.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  transition: transform 0.2s ease;
}

.smkv-menu-item-has-children:hover > a::after,
#site-navigation .menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%231d4ed8' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
}

/* Dropdown Panels (.smkv-submenu, .sub-menu & .smk-dropdown-menu) */
.smkv-submenu,
.smk-dropdown-menu,
#site-navigation ul ul.sub-menu {
  display: none !important;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background-color: #ffffff;
  border-radius: 0.875rem;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  border: 1px solid #f1f5f9;
  padding: 0.5rem;
  z-index: 100;
  margin-top: 0.25rem;
  list-style: none;
}

/* Hover buffer to avoid dropdown disappearing */
.smkv-submenu::before,
.smk-dropdown-menu::before,
#site-navigation ul ul.sub-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
  background: transparent;
}

/* Explicit triggers to show dropdown */
.smkv-menu-item-has-children:hover > .smkv-submenu,
.smkv-menu-item-has-children:focus-within > .smkv-submenu,
.smkv-menu-item-has-children.is-open > .smkv-submenu,
.smkv-menu-item:hover > .smkv-submenu,
.smkv-menu-item:focus-within > .smkv-submenu,
.smkv-menu-item.is-open > .smkv-submenu,
#site-navigation ul li:hover > ul.sub-menu,
#site-navigation ul li:focus-within > ul.sub-menu,
#site-navigation ul li.is-open > ul.sub-menu,
.group:hover > .smk-dropdown-menu,
.smk-has-dropdown:hover > .smk-dropdown-menu,
.smk-has-dropdown.is-open > .smk-dropdown-menu {
  display: block !important;
  animation: smkDropdownFade 0.18s ease-out;
}

/* Dropdown Item Styling */
.smkv-submenu li,
#site-navigation ul ul.sub-menu li,
.smk-dropdown-menu .smk-dropdown-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.smkv-dropdown-item,
.smkv-submenu li a,
#site-navigation ul ul.sub-menu li a,
.smk-dropdown-menu .smk-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  color: #334155;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.4;
  cursor: pointer;
  background: transparent;
  border: none;
}

.smkv-dropdown-item:hover,
.smkv-submenu li a:hover,
#site-navigation ul ul.sub-menu li a:hover,
.smk-dropdown-menu .smk-dropdown-item:hover {
  background-color: #eff6ff;
  color: #1d4ed8;
  padding-left: 0.875rem;
}

@keyframes smkDropdownFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header Actions */
.smkv-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.smkv-search-toggle {
  padding: 0.5rem;
  border-radius: 9999px;
  color: #475569;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.smkv-search-toggle:hover {
  color: #1d4ed8;
  background-color: #eff6ff;
}

.smkv-ppdb-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background-color: #f59e0b;
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.smkv-ppdb-button:hover {
  background-color: #fbbf24;
  transform: translateY(-1px);
}

.smkv-mobile-toggle {
  padding: 0.5rem;
  color: #334155;
  border-radius: 0.75rem;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.smkv-mobile-toggle:hover {
  color: #1d4ed8;
  background-color: #f1f5f9;
}

@media (min-width: 1024px) {
  .smkv-mobile-toggle {
    display: none !important;
  }
}

/* Mobile Menu Overlay & Drawer */
.smkv-mobile-menu,
#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(11, 23, 48, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.2s ease;
}

.smkv-mobile-menu.hidden,
#mobile-menu.hidden {
  display: none !important;
}

@media (min-width: 1024px) {
  .smkv-mobile-menu,
  #mobile-menu {
    display: none !important;
  }
}

.smkv-mobile-drawer,
.mobile-menu-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  max-width: 320px;
  background-color: #ffffff;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  animation: smkDrawerSlide 0.22s ease-out;
}

@keyframes smkDrawerSlide {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Mobile Accordions */
.mobile-accordion-toggle {
  cursor: pointer;
}

.mobile-accordion-content.is-open {
  display: block !important;
}

/* 5. Card Elevations & Transitions */
.smk-card {
  background-color: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smk-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* 6. Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}