/**
 * Highlights Section - About page
 * Desktop: Carousel with navigation arrows and pagination (matching Featured Works)
 * Mobile: Horizontal scroll-snap carousel with pagination
 */

/* ==========================================================================
   HIGHLIGHTS SECTION
   ========================================================================== */

.section--highlights {
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
  background: var(--bg-primary);
}

.highlights__header {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.highlights__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--font-regular);
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  letter-spacing: var(--tracking-tight);
}

.highlights__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin: 0;
  font-weight: var(--font-regular);
}

/* ==========================================================================
   DESKTOP CAROUSEL LAYOUT (matching Featured Works)
   ========================================================================== */

@media (min-width: 768px) {
  .highlights__carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0 3rem; /* Space for nav arrows */
    margin: 2rem 0;
  }

  .highlights__carousel-track {
    display: flex;
    gap: 1.5rem;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
  }

  /* Responsive card sizing */
  .highlights__carousel-track .highlight-card {
    flex: 0 0 calc(50% - 0.75rem); /* 2 cards on tablet/medium desktop */
    min-width: 0;
  }

  @media (min-width: 1280px) {
    .highlights__carousel-track .highlight-card {
      flex: 0 0 calc(33.333% - 1rem); /* 3 cards on large desktop */
    }
  }
}

/* ==========================================================================
   MOBILE SCROLL CAROUSEL
   ========================================================================== */

@media (max-width: 767px) {
  .highlights__grid {
    display: flex;
    flex-direction: row;
    gap: var(--space-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
    margin-left: calc(-1 * clamp(1rem, 5vw, 2rem));
    margin-right: calc(-1 * clamp(1rem, 5vw, 2rem));
    padding-left: clamp(1rem, 5vw, 2rem);
    padding-right: clamp(1rem, 5vw, 2rem);
  }

  /* Hide scrollbar but keep functionality */
  .highlights__grid::-webkit-scrollbar {
    display: none;
  }

  .highlights__grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .highlight-card {
    flex: 0 0 85%;
    scroll-snap-align: start;
    min-width: 0;
  }
}

/* ==========================================================================
   HIGHLIGHT CARD
   ========================================================================== */

.highlight-card {
  position: relative;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-smooth),
              box-shadow var(--duration-normal) var(--ease-smooth);
  box-shadow: 0 1px 3px rgba(26, 24, 22, 0.04),
              0 1px 2px rgba(26, 24, 22, 0.03);
  border: 1px solid var(--border-subtle);
}

.highlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(26, 24, 22, 0.08),
              0 2px 4px rgba(26, 24, 22, 0.06);
}

/* Card link wrapper */
.highlight-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.highlight-card__link:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   CARD IMAGE
   ========================================================================== */

.highlight-card__image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 62.5%; /* 8:5 aspect ratio - editorial */
  overflow: hidden;
  background: var(--bg-secondary);
}

.highlight-card__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slower) var(--ease-smooth);
}

.highlight-card:hover .highlight-card__image {
  transform: scale(1.03);
}

/* ==========================================================================
   CARD CONTENT
   ========================================================================== */

.highlight-card__content {
  padding: var(--space-5);
}

/* Meta information (source • date) */
.highlight-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: var(--font-medium);
}

.highlight-card__meta-separator {
  width: 3px;
  height: 3px;
  background: var(--text-tertiary);
  border-radius: 50%;
  opacity: 0.5;
}

/* Title */
.highlight-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin: 0 0 var(--space-2) 0;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

/* Subtitle */
.highlight-card__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: 0 0 var(--space-3) 0;
  line-height: var(--leading-normal);
  font-weight: var(--font-regular);
}

/* Description */
.highlight-card__description {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0;
  line-height: var(--leading-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   EXTERNAL LINK INDICATOR
   ========================================================================== */

.highlight-card__link-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-top: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--accent-primary);
  font-weight: var(--font-medium);
  transition: gap var(--duration-fast) var(--ease-smooth);
}

.highlight-card:hover .highlight-card__link-indicator {
  gap: var(--space-2);
}

.highlight-card__link-icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* ==========================================================================
   NAVIGATION ARROWS (Desktop only)
   ========================================================================== */

@media (min-width: 768px) {
  .highlights__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 2px solid var(--border-default);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
    z-index: 10;
    box-shadow: var(--shadow-md);
  }

  .highlights__nav--prev {
    left: 0;
  }

  .highlights__nav--next {
    right: 0;
  }

  .highlights__nav:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
  }

  .highlights__nav:hover:not(:disabled) svg {
    color: var(--text-inverse);
  }

  .highlights__nav:active:not(:disabled) {
    transform: translateY(-50%) scale(0.95);
  }

  .highlights__nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
  }

  .highlights__nav svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--text-primary);
    transition: color var(--duration-normal) var(--ease-smooth);
  }

  /* Tablet adjustments */
  @media (max-width: 1024px) {
    .highlights__carousel {
      padding: 0 2.5rem;
    }

    .highlights__nav {
      width: 2.5rem;
      height: 2.5rem;
    }

    .highlights__nav svg {
      width: 1.25rem;
      height: 1.25rem;
    }
  }
}

/* ==========================================================================
   PAGINATION DOTS
   ========================================================================== */

.highlights__pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Desktop dots - unified styling */
@media (min-width: 768px) {
  .highlights__dot {
    width: 0.75rem;
    height: 0.75rem;
    padding: 0;
    background: var(--border-default);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
  }

  .highlights__dot:hover {
    background: var(--accent-primary);
    transform: scale(1.2);
  }

  .highlights__dot.is-active {
    width: 2rem;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
  }

  .highlights__dot:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
  }
}

/* Mobile pagination adjustments */
@media (max-width: 767px) {
  /* REMOVED: Mobile dot styling now handled by unified carousel CSS in mobile-ux-improvements.css */
  /* This ensures Highlights dots match Featured Works dots exactly */
  /* The unified CSS uses ::before pseudo-elements for crisp 6px dots and 22×6px active pills */
}

/* ==========================================================================
   DARK THEME
   ========================================================================== */

[data-theme="dark"] .highlight-card {
  background: var(--bg-secondary);
  border-color: var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2),
              0 1px 2px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .highlight-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
              0 2px 4px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
  [data-theme="dark"] .highlights__nav {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-strong);
  }

  [data-theme="dark"] .highlights__nav:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
  }
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.highlights__empty {
  text-align: center;
  padding: var(--space-16) var(--space-8);
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* ==========================================================================
   ACCESSIBILITY - REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .highlights__carousel-track {
    transition: none;
  }

  .highlight-card,
  .highlight-card__image,
  .highlight-card__link-indicator,
  .highlights__dot {
    transition: none;
  }

  .highlight-card:hover {
    transform: none;
  }

  .highlight-card:hover .highlight-card__image {
    transform: none;
  }

  .highlights__nav {
    transition: background 0.2s ease, border-color 0.2s ease;
  }

  .highlights__nav:hover:not(:disabled) {
    transform: translateY(-50%);
  }

  .highlights__nav:active:not(:disabled) {
    transform: translateY(-50%);
  }

  .highlights__dot:hover {
    transform: none;
  }

  .highlights__grid {
    scroll-behavior: auto;
  }
}
