/* Reusable Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  line-height: 1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--gradient-accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: white;
}

/* Cards */
.card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition-base);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--color-surface);
}

.card-content {
  padding: var(--space-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.card-text {
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-lighter);
  margin-top: auto;
}

.card-link {
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.card-link:hover {
  gap: var(--space-sm);
}

/* Blog Cards */
.blog-card {
  background: var(--color-background);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.blog-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.blog-card-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: var(--gradient-primary);
}

.blog-card-content {
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
}

.blog-card-title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.blog-card-excerpt {
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
  flex: 1;
  line-height: var(--leading-relaxed);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--color-text-lighter);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

.blog-card-tags {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.blog-card-tags a {
  color: var(--color-primary);
  font-weight: var(--weight-medium);
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-sm) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-logo svg {
  height: 40px;
  width: auto;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-xs);
  z-index: var(--z-fixed);
}

.hamburger,
.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--transition-fast);
}

.hamburger::before {
  transform: translateY(-6px);
}

.hamburger::after {
  transform: translateY(4px);
}

.nav-toggle.active .hamburger {
  background: transparent;
}

.nav-toggle.active .hamburger::before {
  transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
  transform: rotate(-45deg) translateY(6px);
}

.nav-menu {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-link {
  font-weight: var(--weight-medium);
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--color-primary);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
}

.nav-link:hover::after {
  width: 80%;
}

.nav-youtube {
  background: var(--gradient-accent);
  color: white;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
}

.nav-youtube:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.nav-youtube::after {
  display: none;
}

/* Dark mode nav */
@media (prefers-color-scheme: dark) {
  .nav {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--color-border);
  }
}

/* Mobile navigation */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--color-background);
    flex-direction: column;
    padding: var(--space-3xl) var(--space-lg);
    box-shadow: var(--shadow-2xl);
    transition: right var(--transition-base);
    align-items: flex-start;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    width: 100%;
    padding: var(--space-sm);
  }
}

/* Footer */
.site-footer {
  background: var(--color-surface);
  padding: var(--space-3xl) var(--space-lg) var(--space-xl);
  margin-top: var(--space-3xl);
  border-top: 1px solid var(--color-border);
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
}

.footer-section h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: var(--color-text-light);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  max-width: var(--container-max);
  margin: var(--space-xl) auto 0;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border-light);
  text-align: center;
  color: var(--color-text-lighter);
  font-size: var(--text-sm);
}

/* Video Embed (Responsive 16:9) */
.video-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin: var(--space-lg) 0;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: var(--radius-lg);
}

/* Tags */
.tag {
  display: inline-block;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: all var(--transition-fast);
}

.tag:hover {
  background: var(--color-primary);
  color: white;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
