/*
AfriGo Design System - Component Styles
Based on the AfriGo Design Document
*/

/* #region ---- Global Reset & Base ---- */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
}

/* #endregion */

/* #region ---- Buttons ---- */

.btn-brand {
  background: var(--palette-brand-core);
  color: #ffffff;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: var(--radius-button);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-hover);
}

.btn-brand:hover {
  background: #f28d57;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.btn-brand:focus {
  box-shadow: var(--shadow-focus);
  outline: none;
}

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

.btn-secondary {
  background: var(--surface-light);
  color: var(--palette-text-primary);
  border: 1px solid var(--palette-border);
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: var(--radius-button);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--surface-sand-white);
}

.btn-accent {
  background: var(--palette-brand-secondary);
  color: #ffffff;
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: var(--radius-button);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-accent:hover {
  background: #3a8a62;
}

/* #endregion */

/* #region ---- Cards ---- */

.afrigo-card {
  background: var(--surface-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  outline: 1px solid rgba(0,0,0,0.04);
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.afrigo-card__image {
  width: 100%;
  height: auto;
  aspect-ratio: 16/10;
  object-fit: cover;
  display: block;
}

.afrigo-card__image img {
  border-radius: var(--radius-image) var(--radius-image) 0 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.afrigo-card__content {
  padding: var(--spacing-lg);
}

.afrigo-card__title {
  font-family: var(--font-primary);
  font-size: 1.5rem;  /* 24px */
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.40px;
  color: var(--palette-text-primary);
  margin: 0 0 var(--spacing-sm) 0;
}

.afrigo-card__text {
  font-size: 1rem;  /* 16px */
  font-weight: 400;
  line-height: 1.5;
  color: var(--palette-text-secondary);
  margin: 0 0 var(--spacing-md) 0;
}

.afrigo-card__label {
  font-size: 0.875rem;  /* 14px */
  font-weight: 500;
  line-height: 1.4;
  color: var(--palette-text-secondary);
}

/* Card Grid Layout */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-xl);
  padding: var(--spacing-2xl) 0;
}

@media (min-width: 550px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 950px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1128px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* #endregion */

/* #region ---- Listing Card ---- */

.listing-card {
  display: flex;
  flex-direction: row;
  padding: var(--spacing-md);
  background: var(--surface-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  text-decoration: none;
}

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

.listing-card__image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  border-radius: var(--radius-image);
  overflow: hidden;
}

.listing-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.listing-card:hover .listing-card__image img {
  transform: scale(1.05);
}

.listing-card__content {
  margin-left: var(--spacing-md);
  flex: 1;
}

.listing-card__title {
  font-family: var(--font-primary);
  font-size: 1.125rem;  /* 18px */
  font-weight: 600;
  line-height: 1.33;
  color: var(--palette-brand-core);
  margin: 0 0 var(--spacing-xs) 0;
}

.listing-card:hover .listing-card__title {
  color: #f28d57;
}

.listing-card__meta {
  font-size: 0.875rem;  /* 14px */
  color: var(--palette-text-secondary);
  margin: 0;
}

@media (min-width: 768px) {
  .listing-card__image {
    width: 180px;
    height: 180px;
  }
  
  .listing-card__content {
    margin-left: var(--spacing-xl);
  }
  
  .listing-card__title {
    font-size: 1.25rem;  /* 20px */
  }
}

/* #endregion */

/* #region ---- Location Card ---- */

.location-card {
  background: var(--surface-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
}

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

.location-card__image {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
}

.location-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.location-card:hover .location-card__image img {
  transform: scale(1.08);
}

.location-card__content {
  padding: var(--spacing-lg);
}

.location-card__title {
  font-family: var(--font-primary);
  font-size: 1.5rem;  /* 24px */
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.40px;
  color: var(--palette-brand-core);
  margin: 0 0 var(--spacing-sm) 0;
}

.location-card__text {
  font-size: 1rem;  /* 16px */
  line-height: 1.5;
  color: var(--palette-text-secondary);
  margin: 0;
}

/* #endregion */

/* #region ---- Picture Card ---- */

.picture-card {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
}

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

.picture-card__image {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
}

.picture-card__image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  pointer-events: none;
}

.picture-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.picture-card:hover .picture-card__image img {
  transform: scale(1.08);
}

.picture-card__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-xl);
  z-index: 1;
}

.picture-card__title {
  font-family: var(--font-primary);
  font-size: 1.5rem;  /* 24px */
  font-weight: 600;
  line-height: 1.25;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Portrait orientation */
.picture-card--portrait .picture-card__image {
  aspect-ratio: 3/4;
}

/* #endregion */

/* #region ---- Blog Listing Card ---- */

.blog-listing-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  margin-bottom: var(--spacing-xl);
}

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

.blog-listing-card__image {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.blog-listing-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-listing-card:hover .blog-listing-card__image img {
  transform: scale(1.05);
}

.blog-listing-card__content {
  padding: var(--spacing-xl);
}

.blog-listing-card__title {
  font-family: var(--font-primary);
  font-size: 1.5rem;  /* 24px */
  font-weight: 600;
  line-height: 1.25;
  color: var(--palette-brand-core);
  margin: 0 0 var(--spacing-sm) 0;
}

.blog-listing-card:hover .blog-listing-card__title {
  color: #f28d57;
}

.blog-listing-card__intro {
  font-size: 1rem;  /* 16px */
  line-height: 1.5;
  color: var(--palette-text-secondary);
  margin: 0 0 var(--spacing-md) 0;
}

.blog-listing-card__meta {
  font-size: 0.875rem;  /* 14px */
  color: var(--palette-text-muted);
  margin: 0;
}

@media (min-width: 768px) {
  .blog-listing-card {
    flex-direction: row;
  }
  
  .blog-listing-card__image {
    width: 40%;
    flex-shrink: 0;
  }
  
  .blog-listing-card__content {
    flex: 1;
    padding: var(--spacing-2xl);
  }
}

/* #endregion */

/* #region ---- Search Bar & Pills ---- */

.afrigo-search-bar {
  background: var(--surface-light);
  border-radius: 30px;
  padding: var(--spacing-xs);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  max-width: 600px;
  margin: 0 auto;
}

.afrigo-search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: var(--spacing-md) var(--spacing-lg);
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--palette-text-primary);
  outline: none;
}

.afrigo-search-bar input::placeholder {
  color: var(--palette-text-secondary);
}

.afrigo-search-bar input:focus {
  box-shadow: var(--shadow-focus);
}

.afrigo-search-bar button {
  background: var(--palette-brand-core);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.afrigo-search-bar button:hover {
  background: #f28d57;
}

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  padding: var(--spacing-lg) 0;
}

.pill {
  background: var(--surface-sand-white);
  color: var(--palette-text-primary);
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.875rem;  /* 14px */
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill:hover {
  background: var(--palette-brand-core);
  color: #ffffff;
}

.pill--active {
  background: var(--palette-brand-core);
  color: #ffffff;
}

/* #endregion */

/* #region ---- Hero Section ---- */

.hero-section {
  position: relative;
  width: 100%;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-section__image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-section__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.4), rgba(0,0,0,0.2));
  z-index: 1;
}

.hero-section__content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #ffffff;
  padding: var(--spacing-3xl);
}

.hero-section__title {
  font-family: var(--font-primary);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--spacing-md) 0;
  text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.hero-section__subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
  margin: 0 0 var(--spacing-xl) 0;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* #endregion */

/* #region ---- Section Headers ---- */

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-3xl);
  padding: var(--spacing-3xl) 0;
}

.section-header__title {
  font-family: var(--font-primary);
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.30px;
  color: var(--palette-text-primary);
  margin: 0 0 var(--spacing-md) 0;
}

.section-header__subtitle {
  font-size: 1.25rem;  /* 20px */
  font-weight: 600;
  line-height: 1.35;
  color: var(--palette-text-secondary);
  margin: 0;
}

/* #endregion */

/* #region ---- Alerts & Messages ---- */

.afrigo-alert {
  background: var(--surface-light);
  border-left: 4px solid var(--palette-brand-core);
  border-radius: var(--radius-card);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--spacing-xl);
}

.afrigo-alert__title {
  font-family: var(--font-primary);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--palette-text-primary);
  margin: 0 0 var(--spacing-sm) 0;
}

.afrigo-alert__message {
  font-size: 1rem;
  color: var(--palette-text-secondary);
  margin: 0;
}

/* #endregion */

/* #region ---- Forms ---- */

.afrigo-form .form-group {
  margin-bottom: var(--spacing-lg);
}

.afrigo-form label {
  display: block;
  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 0.875rem;  /* 14px */
  color: var(--palette-text-secondary);
  margin-bottom: var(--spacing-xs);
}

.afrigo-form input[type="text"],
.afrigo-form input[type="email"],
.afrigo-form input[type="password"],
.afrigo-form input[type="tel"],
.afrigo-form textarea,
.afrigo-form select {
  width: 100%;
  padding: var(--spacing-md);
  border: 1px solid var(--palette-border);
  border-radius: var(--radius-button);
  font-family: var(--font-primary);
  font-size: 1rem;
  color: var(--palette-text-primary);
  background: var(--surface-light);
  transition: all 0.2s ease;
}

.afrigo-form input:focus,
.afrigo-form textarea:focus,
.afrigo-form select:focus {
  outline: none;
  border-color: var(--palette-brand-core);
  box-shadow: var(--shadow-focus);
}

.afrigo-form .form-text {
  font-size: 0.875rem;
  color: var(--palette-text-muted);
  margin-top: var(--spacing-xs);
}

/* Card-style form container */
.form-card {
  background: var(--surface-light);
  border: 1px solid var(--palette-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--spacing-2xl);
  max-width: 600px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .form-card {
    padding: var(--spacing-3xl);
  }
}

/* #endregion */

/* #region ---- Utilities ---- */

.text-primary { color: var(--palette-text-primary); }
.text-secondary { color: var(--palette-text-secondary); }
.text-muted { color: var(--palette-text-muted); }
.text-brand { color: var(--palette-brand-core); }

.bg-sand { background: var(--surface-sand-white); }
.bg-light { background: var(--surface-light); }
.bg-warm { background: var(--surface-warm-sand); }

.rounded-card { border-radius: var(--radius-card); }
.rounded-button { border-radius: var(--radius-button); }
.rounded-image { border-radius: var(--radius-image); }

.shadow-card { box-shadow: var(--shadow-card); }
.shadow-hover { box-shadow: var(--shadow-hover); }

/* #endregion */

/* #region ---- Responsive Breakpoints ---- */

/*
Mobile Small: <375px
Mobile: 375–550px
Tablet Small: 550–744px
Tablet: 744–950px
Desktop Small: 950–1128px
Desktop: 1128–1440px
Large Desktop: >1440px
*/

/* #endregion */

/* Activity detail sticky meta sidebar */
.activity-detail__meta {
  position: sticky;
  top: 150px;
  align-self: flex-start;
}
