/* Cards Online Safety Resource - Responsive Slider */

.cards-online-safety-resource {
  margin: 2rem 0;
  padding: 0;
}

/* Header Section */
.cards-header {
  margin-bottom: 2rem;
}

.cards-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #000;
  line-height: 1.2;
}

.cards-description {
  font-size: 1rem;
  color: #555;
  margin: 0;
  line-height: 1.6;
}

/* Slider Container */
.cards-slider-wrapper {
  position: relative;
  width: 100%;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  list-style: none;
  transition: all 0.3s ease;
}

.cards-container[data-cards-per-row="1"] {
  grid-template-columns: 1fr;
}

.cards-container[data-cards-per-row="2"] {
  grid-template-columns: repeat(2, 1fr);
}

.cards-container[data-cards-per-row="3"] {
  grid-template-columns: repeat(3, 1fr);
}

.cards-container[data-cards-per-row="4"] {
  grid-template-columns: repeat(4, 1fr);
}

/* Individual Card */
.card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  height: 100%;
}

.card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  transform: translateY(-4px);
}

.card:focus-within {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* Card Image Container */
.card-image-container {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: #f0f0f0;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.card:hover .card-image {
  transform: scale(1.05);
}

/* Card Video Container */
.card-video-container {
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  position: relative;
  background: #000;
  height: 0;
}

.card-video-iframe,
.card-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Card Content */
.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #000;
  line-height: 1.3;
}

.card-description {
  font-size: 0.95rem;
  color: #666;
  margin: 0 0 1rem 0;
  line-height: 1.5;
  flex-grow: 1;
}

/* Article Content */
.card-article-content {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card-article-content p {
  margin: 0 0 0.5rem 0;
}

.card-article-content p:last-child {
  margin-bottom: 0;
}

.card-article-content ul,
.card-article-content ol {
  margin: 0.5rem 0 0.5rem 1.5rem;
  padding: 0;
}

.card-article-content li {
  margin-bottom: 0.25rem;
}

/* Card Link/Button */
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #0066cc;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  align-self: flex-start;
  cursor: pointer;
}

.card-link:hover {
  color: #0052a3;
  background-color: #f0f7ff;
  text-decoration: underline;
}

.card-link:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
  background-color: #f0f7ff;
}

.card-link:active {
  transform: scale(0.98);
}

.card-link-icon {
  font-size: 1.2em;
  transition: transform 0.2s ease;
}

.card-link:hover .card-link-icon {
  transform: translateX(4px);
}

/* Navigation Buttons */
.cards-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #ddd;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #000;
  transition: all 0.2s ease;
  z-index: 10;
  padding: 0;
}

.cards-nav:hover {
  background: #fff;
  border-color: #0066cc;
  color: #0066cc;
}

.cards-nav:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.cards-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cards-nav-prev {
  left: -60px;
}

.cards-nav-next {
  right: -60px;
}

/* Responsive Design */

/* Tablet */
@media (max-width: 1024px) {
  .cards-container {
    gap: 1.25rem;
  }

  .cards-container[data-cards-per-row="3"] {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards-container[data-cards-per-row="4"] {
    grid-template-columns: repeat(2, 1fr);
  }

  .card-title {
    font-size: 1.1rem;
  }

  .cards-nav-prev {
    left: -50px;
  }

  .cards-nav-next {
    right: -50px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .cards-container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .cards-container[data-cards-per-row="2"],
  .cards-container[data-cards-per-row="3"],
  .cards-container[data-cards-per-row="4"] {
    grid-template-columns: 1fr;
  }

  .card {
    margin-bottom: 0.5rem;
  }

  .card-image-container {
    height: 150px;
  }

  .card-content {
    padding: 1rem;
  }

  .card-title {
    font-size: 1.1rem;
  }

  .card-description {
    font-size: 0.9rem;
  }

  .cards-title {
    font-size: 1.5rem;
  }

  /* Hide nav buttons on mobile, show scroll instead */
  .cards-nav {
    display: none;
  }

  .cards-slider-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cards-container {
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    min-width: min-content;
  }

  .cards-container[data-cards-per-row="1"] {
    grid-template-columns: 1fr;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .cards-header {
    margin-bottom: 1rem;
  }

  .cards-title {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }

  .cards-description {
    font-size: 0.9rem;
  }

  .card-content {
    padding: 0.75rem;
  }

  .card-image-container {
    height: 120px;
  }

  .card-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .card-description {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  .card-link {
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .cards-online-safety-resource {
    background-color: #1a1a1a;
    color: #e0e0e0;
  }

  .cards-title {
    color: #fff;
  }

  .cards-description {
    color: #b0b0b0;
  }

  .card {
    background: #2a2a2a;
    border-color: #444;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  }

  .card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  }

  .card-image-container {
    background: #444;
  }

  .card-title {
    color: #fff;
  }

  .card-description,
  .card-article-content {
    color: #b0b0b0;
  }

  .card-link {
    color: #5eb3ff;
  }

  .card-link:hover {
    color: #7ec9ff;
    background-color: #1a3a52;
  }

  .card-link:focus {
    background-color: #1a3a52;
  }

  .cards-nav {
    background: rgba(42, 42, 42, 0.95);
    border-color: #555;
    color: #e0e0e0;
  }

  .cards-nav:hover {
    background: #2a2a2a;
    border-color: #5eb3ff;
    color: #5eb3ff;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .card,
  .card-image,
  .card-link,
  .cards-nav {
    transition: none;
  }
}

/* Print Styles */
@media print {
  .cards-nav {
    display: none;
  }

  .cards-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    page-break-inside: avoid;
  }
}
