/* ========================================
   GREENWALKER CARD DESIGN SYSTEM
   Bootstrap 5 + Custom Styles
   ======================================== */

/* ========================================
   BASE CARD CONTAINER
   ======================================== */

.gw-card {
  background: #fff;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gw-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.gw-card:focus-within {
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1),
              0 8px 16px rgba(0, 0, 0, 0.12);
  outline: none;
}

/* ========================================
   CARD IMAGE CONTAINER
   Image is always 1:1 aspect ratio
   ======================================== */

.gw-card-image {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 1:1 aspect ratio */
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(135deg, #f5f5f5 0%, #efefef 100%);
}

.gw-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gw-card:hover .gw-card-image img {
  transform: scale(1.05);
}

/* ========================================
   CARD BADGE (Featured, Popular, New, etc.)
   ======================================== */

.gw-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.gw-card-badge.badge-featured {
  background: rgba(76, 175, 80, 0.95);
  color: #fff;
}

.gw-card-badge.badge-popular {
  background: rgba(255, 152, 0, 0.95);
  color: #fff;
}

.gw-card-badge.badge-new {
  background: rgba(33, 150, 243, 0.95);
  color: #fff;
}

.gw-card-badge.badge-pick {
  background: rgba(156, 39, 176, 0.95);
  color: #fff;
}

.gw-card-badge.badge-category {
  background: rgba(76, 175, 80, 0.85);
  color: #fff;
}

/* ========================================
   CARD BODY (Title, Description, Meta)
   ======================================== */

.gw-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  gap: 0.5rem;
}

/* Card Category or Meta Tag */
.gw-card-category {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4caf50;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

/* Card Title */
.gw-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.gw-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.gw-card-title a:hover {
  color: #4caf50;
}

/* Card Description / Short Text */
.gw-card-description {
  font-size: 0.92rem;
  color: #666;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
  min-height: 3.6em;
}

/* Card Meta Info (Date, Author, Views) */
.gw-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #999;
  flex-wrap: wrap;
  padding-top: 0.5rem;
}

.gw-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gw-card-meta-item i {
  color: #4caf50;
  font-size: 0.9rem;
}

/* ========================================
   CARD FOOTER (Buttons)
   Always aligned at bottom, equal height
   ======================================== */

.gw-card-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

.gw-card-footer-single {
  padding: 0.9rem 1rem;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

/* ========================================
   CARD BUTTONS
   ======================================== */

.gw-card .btn {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
  cursor: pointer;
}

.gw-card .btn i {
  font-size: 0.95rem;
}

.gw-card .btn-success {
  background: #4caf50;
  color: #fff;
}

.gw-card .btn-success:hover {
  background: #45a049;
  color: #fff;
  transform: translateY(-2px);
}

.gw-card .btn-outline-success {
  border: 1.5px solid #4caf50;
  color: #4caf50;
  background: #fff;
}

.gw-card .btn-outline-success:hover {
  background: #4caf50;
  color: #fff;
  transform: translateY(-2px);
}

.gw-card .btn-secondary {
  background: #f5f5f5;
  color: #333;
  border: 1px solid #e0e0e0;
}

.gw-card .btn-secondary:hover {
  background: #efefef;
  border-color: #d0d0d0;
  transform: translateY(-2px);
}

/* Button Dropdown */
.gw-card .dropdown-toggle::after {
  border: none;
  content: '\f078';
  font-family: 'bootstrap-icons';
  font-size: 0.75rem;
  margin-left: auto;
}

.gw-card .dropdown-menu {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0.5rem;
}

.gw-card .dropdown-item {
  border-radius: 4px;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gw-card .dropdown-item:hover {
  background: #f5f5f5;
  color: #4caf50;
}

.gw-card .dropdown-item i {
  font-size: 1rem;
  color: #4caf50;
}

/* ========================================
   RESPONSIVE GRID
   Desktop: 3 cards
   Tablet: 2 cards
   Mobile: 1 card
   ======================================== */

@media (max-width: 1200px) {
  .gw-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .gw-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .gw-card-body {
    padding: 0.95rem;
  }

  .gw-card-footer {
    padding: 0.85rem;
  }

  .gw-card-footer-single {
    padding: 0.85rem;
  }
}

@media (max-width: 576px) {
  .gw-cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .gw-card-body {
    padding: 0.9rem;
  }

  .gw-card-footer {
    padding: 0.85rem;
    flex-direction: column;
    align-items: stretch;
  }

  .gw-card-footer .btn {
    width: 100%;
  }

  .gw-card-footer-single {
    padding: 1rem;
  }

  .gw-card-footer-single .btn {
    width: 100%;
  }

  .gw-card-title {
    font-size: 1rem;
  }

  .gw-card-description {
    font-size: 0.9rem;
  }

  .gw-card-meta {
    font-size: 0.8rem;
    gap: 0.75rem;
  }
}

/* Footer button layout: share left (flexible), read more right (auto) */
.gw-card-footer {
  align-items: center;
}

.gw-card-footer .gw-share {
  flex: 1 1 0;
}

.gw-card-footer .gw-share .btn-group .btn {
  width: auto; /* allow natural sizing on desktop */
  justify-content: center;
}

.gw-card-footer .gw-readmore {
  flex: 0 0 auto;
}

/* Ensure both buttons look balanced on wider screens */

/* Homepage collection tiles & showcase cards - tighter layout to match product-card */
.collection-tile {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.collection-tile:hover { transform: translateY(-6px); box-shadow: 0 8px 22px rgba(0,0,0,0.08); }
.collection-tile img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.collection-tile .tile-content {
  padding: 0.9rem 1rem;
}
.collection-tile h4 { margin: 0 0 6px 0; font-size: 1rem; }
.collection-tile .item-count { font-size: 0.85rem; color: #6b7280; }
.collection-tile .tile-link { font-size: 0.9rem; font-weight:600; }

.showcase-card { border-radius:8px; overflow:hidden; background:#fff; box-shadow:0 2px 10px rgba(0,0,0,0.04); }
.card-visual img { width:100%; height:220px; object-fit:cover; display:block; }
.card-details { padding: 0.9rem 1rem; }
.card-details h4 { margin: 0 0 6px 0; font-size: 1rem; }
.pricing { margin-top: 6px; }

@media (min-width: 577px) {
  .gw-card-footer .gw-share { margin-right: 0.75rem; }
}

/* On very small screens ensure share and readmore stack */
@media (max-width: 576px) {
  .gw-card-footer .gw-share, .gw-card-footer .gw-readmore { width: 100%; }
  .gw-card-footer .gw-readmore { margin-top: .5rem; }
  .gw-card-footer .gw-share .btn-group .btn { width: 100%; }
}

/* ========================================
   LEAD/FEATURED CARD (Magazine Style)
   Used for the first featured article
   ======================================== */

.gw-lead-card {
  background: #fff;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gw-lead-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.gw-lead-image {
  position: relative;
  width: 100%;
  padding-bottom: 66.66%;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f5 0%, #efefef 100%);
  border-radius: 12px;
}

.gw-lead-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gw-lead-card:hover .gw-lead-image img {
  transform: scale(1.05);
}

.gw-lead-body {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gw-lead-category {
  font-size: 0.85rem;
  font-weight: 600;
  color: #4caf50;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gw-lead-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  margin: 0;
}

.gw-lead-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.gw-lead-title a:hover {
  color: #4caf50;
}

.gw-lead-description {
  font-size: 1rem;
  color: #666;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gw-lead-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  color: #999;
  flex-wrap: wrap;
}

.gw-lead-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gw-lead-meta-item i {
  color: #4caf50;
}

.gw-lead-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #4caf50;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
}

.gw-lead-button:hover {
  background: #45a049;
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

/* ========================================
   ACCESSIBILITY & FOCUS STATES
   ======================================== */

.gw-card a,
.gw-card button {
  outline: none;
}

.gw-card a:focus,
.gw-card button:focus {
  outline: 2px solid #4caf50;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.gw-text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gw-text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gw-aspect-1-1 {
  aspect-ratio: 1;
  overflow: hidden;
}

.gw-aspect-3-2 {
  aspect-ratio: 3/2;
  overflow: hidden;
}

.gw-aspect-16-9 {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.gw-shadow-light {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

.gw-shadow-medium {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.gw-shadow-hover {
  transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gw-shadow-hover:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12) !important;
}
