/* =============================================================================
   TILES LAYOUT STYLES - Grid layout for article tiles on index page
   ============================================================================= */

   .tiles-container {
    max-width: 1400px;
    margin: 1.5rem auto;
    padding: 0 1rem;
  }
  
  .tiles-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
  }
  
  .article-tile {
    background: var(--bg-primary);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
  }
  
  .article-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
  }
  
  .tile-link {
    display: block;
    text-decoration: none;
    color: inherit;
  }
  
  .tile-image {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
  }
  
  .tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .article-tile:hover .tile-image img:not(.tile-has-video) {
    transform: scale(1.05);
  }

  /* Tile video — overlays the image, hidden until hover */
  .tile-video {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
  }

  /* Play badge shown on tiles with video */
  .tile-video-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    z-index: 4;
    transition: opacity 0.2s ease;
    pointer-events: none;
  }
  /* Position variants */
  .tile-video-badge.pos-TL { top: 0.5rem;  left: 0.5rem;  right: auto;   bottom: auto; }
  .tile-video-badge.pos-TR { top: 0.5rem;  right: 0.5rem; left: auto;    bottom: auto; }
  .tile-video-badge.pos-C  { top: 50%;     left: 50%;     right: auto;   bottom: auto;
                              transform: translate(-50%, -50%); }
  .tile-video-badge.pos-BL { bottom: 0.5rem; left: 0.5rem;  right: auto; top: auto; }
  .tile-video-badge.pos-BR { bottom: 0.5rem; right: 0.5rem; left: auto;  top: auto; }

  /* Overlay sits above video */
  .tile-overlay {
    z-index: 3;
  }
  
  .tile-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.75) 30%,
      rgba(0, 0, 0, 0.45) 60%,
      rgba(0, 0, 0, 0.15) 85%,
      transparent 100%
    );
    padding: 1.5rem 1.0rem 1.0rem;
    color: white; /* Force white text in overlay */
  }
  
  .tile-title {
    font-family: "RubikDoodleShadow", cursive;
    font-size: 1.5rem;
    font-weight: normal;
    line-height: 1.2;
    margin: 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 1px rgba(0, 0, 0, 1);
  }
  
  .tile-info {
    padding: 0.75rem;
    background: var(--gradient-primary);
    transition: background-color 0.3s ease;
  }
  
  [data-theme="dark"] .tile-info {
    background: var(--bg-primary);
  }
  
  .tile-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-tertiary);
  }
  
  /* Responsive Design for Tiles */
  @media (max-width: 1200px) {
    .tiles-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  
  @media (max-width: 1024px) {
    .tiles-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 1.5rem;
    }
  }
  
  @media (max-width: 900px) {
    .tiles-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @media (max-width: 768px) {
    .tiles-grid {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
  }
  
  @media (max-width: 600px) {
    .tiles-grid {
      grid-template-columns: 1fr;
    }
  
    .tile-title {
      font-family: "RubikDoodleShadow", cursive;
      font-size: 1.25rem;
    }
  }
  
  @media (max-width: 480px) {
    .tiles-container {
      padding: 0 0.5rem;
    }
  
    .tile-info {
      padding: 0.75rem;
    }
  
    .tile-title {
      font-family: "RubikDoodleShadow", cursive;
      font-size: 1.1rem;
    }
  
    .tile-meta {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.5rem;
    }
  }
  