/*
Theme Name: Astra Child - WBGF
Description: Child theme for Astra - World Backgammon Federation website
Author: WBGF Development Team
Version: 1.0.0
Template: astra
*/

/* Import Tailwind CSS */
@import url('https://cdn.tailwindcss.com');

/* Custom CSS Variables for WBGF Brand Colors */
:root {
  --wbgf-primary: #05164C;
  --wbgf-primary-50: #f0f2ff;
  --wbgf-primary-100: #e4e7ff;
  --wbgf-primary-200: #cdd3ff;
  --wbgf-primary-300: #a6b1ff;
  --wbgf-primary-400: #7885ff;
  --wbgf-primary-500: #4f5eff;
  --wbgf-primary-600: #05164C;
  --wbgf-primary-700: #041242;
  --wbgf-primary-800: #030e38;
  --wbgf-primary-900: #020a2e;
  --wbgf-primary-950: #010624;
  
  --wbgf-secondary: #dbeafe;
  --wbgf-secondary-50: #f8fafc;
  --wbgf-secondary-100: #f1f5f9;
  --wbgf-secondary-200: #e2e8f0;
  --wbgf-secondary-300: #cbd5e1;
  --wbgf-secondary-400: #94a3b8;
  --wbgf-secondary-500: #64748b;
  --wbgf-secondary-600: #475569;
  --wbgf-secondary-700: #334155;
  --wbgf-secondary-800: #1e293b;
  --wbgf-secondary-900: #0f172a;
}

/* Override Astra's default styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Custom animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-slideIn {
  animation: slideIn 0.3s ease-out;
}

/* Custom utility classes */
.text-balance {
  text-wrap: balance;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Floating triangle shapes */
.floating-triangle {
  position: fixed;
  pointer-events: none;
  z-index: 5;
}

/* Hero slider styles */
.hero-slider {
  position: relative;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide:not(.active) {
  opacity: 0;
}

/* Navigation dropdown styles */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.5rem;
  width: 12rem;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease-in-out;
  z-index: 100;
}

.nav-group:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu styles */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 20rem;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 6px -1px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease-in-out;
  z-index: 1000;
}

.mobile-menu.open {
  right: 0;
}

.mobile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease-in-out;
  z-index: 999;
}

.mobile-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease-in-out;
}

.card-hover:hover {
  transform: scale(1.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Button styles */
.btn-primary {
  background-color: var(--wbgf-primary-600);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: var(--wbgf-primary-700);
  transform: scale(1.05);
}

.btn-outline {
  background-color: transparent;
  color: var(--wbgf-primary-600);
  border: 1px solid var(--wbgf-primary-600);
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.btn-outline:hover {
  background-color: var(--wbgf-primary-50);
  transform: scale(1.05);
}

/* Form styles */
.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-input:focus {
  outline: none;
  border-color: var(--wbgf-primary-500);
  box-shadow: 0 0 0 3px rgba(79, 94, 255, 0.1);
}

.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--wbgf-primary-500);
  box-shadow: 0 0 0 3px rgba(79, 94, 255, 0.1);
}

/* Badge styles */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
}

.badge-primary {
  background-color: var(--wbgf-primary-100);
  color: var(--wbgf-primary-900);
}

.badge-red {
  background-color: #dc2626;
  color: white;
}

/* Responsive design */
@media (max-width: 768px) {
  .mobile-menu {
    width: 100%;
  }
  
  .nav-dropdown {
    width: 100%;
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    background: transparent;
  }
}

/* News page specific styles */
.news-card {
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease-in-out;
  overflow: hidden;
}

/* News grid card specific styles */
.news-grid article {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-grid .image-container {
  position: relative;
  height: 28rem; /* h-112 equivalent */
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

.news-grid .image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.news-grid .card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 0; /* Prevent content from growing */
}

.news-grid .card-title {
  height: 3rem; /* h-12 equivalent */
  display: flex;
  align-items: center;
  overflow: hidden;
}

.news-grid .card-title a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  max-height: 3rem; /* Ensure exactly 2 lines */
}

/* Newsletter form improvements */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  max-width: 28rem;
  margin: 0 auto;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  height: 3rem;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--wbgf-primary-500);
  box-shadow: 0 0 0 3px rgba(79, 94, 255, 0.1);
}

.newsletter-form .btn-primary {
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

@media (min-width: 640px) {
  .newsletter-form {
    flex-direction: row;
  }
}

/* Hero slider styles */
.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

/* Tab content styles */
.tab-content {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Line clamp utility for text truncation */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.news-card .card-content {
  padding: 1.5rem;
}

/* Pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.pagination li {
  margin: 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.375rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
  min-width: 2.5rem;
  height: 2.5rem;
}

.pagination a {
  color: #6b7280;
  background-color: white;
  border: 1px solid #d1d5db;
}

.pagination a:hover {
  background-color: #f9fafb;
  color: var(--wbgf-primary-600);
}

.pagination .current {
  color: white;
  background-color: var(--wbgf-primary-600);
  border: 1px solid var(--wbgf-primary-600);
}

.pagination .prev,
.pagination .next {
  font-weight: 600;
}

/* Featured post styles */
.featured-post {
  background: linear-gradient(135deg, var(--wbgf-primary-50) 0%, #dbeafe 100%);
  border: 1px solid var(--wbgf-primary-200);
  border-radius: 0.5rem;
  padding: 2rem;
  margin-bottom: 4rem;
}

.featured-post .featured-badge {
  background-color: #dc2626;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 1rem;
}

/* Category badge styles */
.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
  text-transform: capitalize;
}

/* Responsive improvements for news grid */
@media (max-width: 768px) {
  .news-card .card-content {
    padding: 1rem;
  }
  
  .featured-post {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .pagination ul {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Single post page styles */
.single-post .prose {
  color: #374151;
  line-height: 1.7;
}

.single-post .prose h1,
.single-post .prose h2,
.single-post .prose h3,
.single-post .prose h4,
.single-post .prose h5,
.single-post .prose h6 {
  color: var(--wbgf-primary-900);
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.single-post .prose h2 {
  font-size: 1.875rem;
  border-bottom: 2px solid var(--wbgf-primary-200);
  padding-bottom: 0.5rem;
}

.single-post .prose h3 {
  font-size: 1.5rem;
}

.single-post .prose p {
  margin-bottom: 1.5rem;
}

.single-post .prose ul,
.single-post .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.single-post .prose li {
  margin-bottom: 0.5rem;
}

.single-post .prose blockquote {
  border-left: 4px solid var(--wbgf-primary-600);
  background-color: var(--wbgf-primary-50);
  padding: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: var(--wbgf-primary-800);
}

.single-post .prose a {
  color: var(--wbgf-primary-600);
  text-decoration: underline;
  text-decoration-color: var(--wbgf-primary-300);
  text-underline-offset: 2px;
  transition: all 0.2s ease-in-out;
}

.single-post .prose a:hover {
  color: var(--wbgf-primary-800);
  text-decoration-color: var(--wbgf-primary-600);
}

.single-post .prose img {
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}

.single-post .prose code {
  background-color: #f3f4f6;
  color: #e11d48;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.single-post .prose pre {
  background-color: #1f2937;
  color: #f9fafb;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 2rem 0;
}

.single-post .prose pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

/* Breadcrumb styles */
.breadcrumb {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: #94a3b8;
}

.breadcrumb a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.breadcrumb a:hover {
  color: white;
}

.breadcrumb svg {
  margin: 0 0.5rem;
  flex-shrink: 0;
}

/* Post meta styles */
.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: #94a3b8;
  flex-wrap: wrap;
  justify-content: center;
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-meta-item svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Author bio styles */
.author-bio {
  background: linear-gradient(135deg, var(--wbgf-primary-50) 0%, #f8fafc 100%);
  border: 1px solid var(--wbgf-primary-200);
  border-radius: 0.75rem;
  padding: 2rem;
  margin: 3rem 0;
}

.author-bio .author-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Related posts styles */
.related-posts {
  background: linear-gradient(135deg, #f8fafc 0%, var(--wbgf-primary-50) 100%);
}

/* Post navigation styles */
.post-navigation {
  background: white;
  border-top: 1px solid #e5e7eb;
}

.post-nav-item {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--wbgf-primary-600);
  transition: all 0.2s ease-in-out;
  padding: 1rem;
  border-radius: 0.5rem;
}

.post-nav-item:hover {
  color: var(--wbgf-primary-800);
  background-color: var(--wbgf-primary-50);
}

.post-nav-item svg {
  transition: transform 0.2s ease-in-out;
}

.post-nav-item:hover svg {
  transform: translateX(-0.25rem);
}

.post-nav-item.post-nav-next:hover svg {
  transform: translateX(0.25rem);
}

/* Responsive adjustments for single post */
@media (max-width: 768px) {
  .single-post .prose {
    font-size: 1rem;
  }
  
  .single-post .prose h1 {
    font-size: 2rem;
  }
  
  .single-post .prose h2 {
    font-size: 1.5rem;
  }
  
  .post-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .author-bio {
    padding: 1.5rem;
  }
  
  .post-navigation {
    padding: 1rem 0;
  }
  
  .post-nav-item {
    padding: 0.75rem;
  }
}

/* Print styles */
@media print {
  .floating-triangle,
  .mobile-menu,
  .mobile-overlay {
    display: none !important;
  }
}