:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary: #64748b;
  --accent: #f43f5e;
  
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 500px; /* User requirement */
  object-fit: cover;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}

/* Layout */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  line-height: 1.2;
  color: var(--text-main);
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-main);
  letter-spacing: -0.025em;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: 4rem;
  display: flex;
  align-items: center;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--primary);
}

.brand img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a {
  color: var(--text-muted);
}

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

/* Hero */
.hero {
  padding: 5rem 0;
  background-color: var(--bg-surface);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero-image {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 500px;
  width: auto;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

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

.btn:not(.ghost):hover {
  background-color: var(--primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.btn.ghost:hover {
  background-color: var(--bg-subtle);
}

.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
}

.btn.ghost .btn-icon {
  filter: none;
}

/* Features */
.features, .posts, .promotions, .comments, .gallery, .article {
  padding: 5rem 0;
}

.feature-grid, .comment-grid, .gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card, .comment-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 2rem;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.feature-card:hover, .comment-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.feature-title, .comment-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.feature-desc, .comment-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Gallery */
.gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  justify-content: center;
}

.gallery-img {
  width: 100%;
  height: 500px; /* User requirement: limit height to 500px */
  border-radius: var(--radius-md);
  object-fit: cover;
  transition: transform 0.3s;
  box-shadow: var(--shadow-sm);
}

.gallery-img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* Transformed Carousels to Grids (Display All Data) */
.carousel-container {
  position: relative;
}

.carousel-track-container {
  overflow: visible;
}

.carousel-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  padding: 0;
  margin: 0;
  list-style: none;
  justify-content: center;
}

.carousel-slide {
  width: 100%;
  flex: none;
}

.carousel-btn {
  display: none; /* Hide buttons as we show all */
}

/* Post Cards */
.post-card {
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  padding: 1.5rem;
}

.post-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.post-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.post-title a {
  text-decoration: none;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.post-summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.post-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: auto;
  text-align: right;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-subtle);
}

/* Promotions / Links */
.promotions .carousel-track {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.promotion-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background-color: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.promotion-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.promotion-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
}

.promotion-title {
  font-size: 1rem;
  font-weight: 600;
}

/* CTA */
.cta {
  background-color: var(--bg-subtle);
}

.cta-card {
  background-color: var(--primary);
  border-radius: var(--radius-lg);
  padding: 4rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg);
}

.cta-title {
  color: white;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cta-desc {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  max-width: 500px;
}

.cta-buttons .btn {
  background-color: white;
  color: var(--primary);
}

.cta-buttons .btn:hover {
  background-color: var(--bg-subtle);
}

/* Footer */
.footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  text-align: center;
  color: var(--text-muted);
}

/* Article */
.article-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: var(--shadow-sm);
  max-width: 800px;
  margin: 0 auto;
  border: 1px solid var(--border-color);
}

.article-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.article-meta {
  color: var(--text-light);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.article-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-main);
}

.article-content img {
  margin: 2rem auto;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
}

.article-content h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.article-content p {
  margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-actions {
    justify-content: center;
  }
  
  .nav-links {
    display: none; /* Mobile menu needed but keeping simple for now */
  }
  
  .cta-card {
    padding: 2rem;
    flex-direction: column;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .article-card {
    padding: 1.5rem;
  }
}
