/* ============================================================
   ARTICLES LANDING PAGE — MOBILE-FIRST
   Premium luxury aesthetic for electrical contractor website.
   All variables referenced from var.css — no redefinitions.
   Classes use the existing "articles-" prefix from the HTML.

   Key update: Cards now include images and the container within
   .articles-list is overridden to full width so 4 cards sit
   evenly on one row at desktop breakpoints.
   ============================================================ */

/* -----------------------------------------------------------
   1. INTRO SECTION
   ----------------------------------------------------------- */
.articles-intro {
  padding: 2rem 0;
  background-color: var(--bg-primary);
}

.articles-title-main {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.articles-intro-text {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 42rem;
}

/* -----------------------------------------------------------
   2. ARTICLES LIST SECTION
   ----------------------------------------------------------- */
.articles-list {
  padding: 2rem 0 4rem;
  background-color: var(--bg-secondary);
}

/* Override .container inside .articles-list to full width
   so the grid stretches edge-to-edge on larger screens.
   This targets only the direct child container of this section. */
.articles-list > .container {
  max-width: none;
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* -----------------------------------------------------------
   3. ARTICLES GRID — MOBILE (single column, stacked cards)
   ----------------------------------------------------------- */
.articles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

/* -----------------------------------------------------------
   4. ARTICLES CARD — MOBILE
   Card now houses an image, title, teaser, and link.
   Image sits at the top with a subtle zoom on hover.
   ----------------------------------------------------------- */
.articles-card {
  flex: 0 0 100%;
  background-color: var(--bg-primary);
  border: 1px solid var(--gray-100);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease;
  position: relative;
}

/* Subtle top accent line that reveals on hover */
.articles-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-red) 0%,
    var(--red-light) 100%
  );
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s ease;
  z-index: 2;
}

.articles-card:hover::before {
  transform: scaleX(1);
}

.articles-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: var(--gray-200);
}

/* -----------------------------------------------------------
   5. CARD IMAGE / MEDIA CONTAINER
   Fixed aspect ratio container that clips the image.
   Image scales slightly on card hover for a living, premium feel.
   ----------------------------------------------------------- */
.articles-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--gray-200);
  position: relative;
}

.articles-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

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

/* -----------------------------------------------------------
   6. CARD BODY — Title, teaser, link
   Padded area below the image. Flex column so the link
   always sits at the bottom regardless of teaser length.
   ----------------------------------------------------------- */
/* Since there's no explicit .articles-card-body in the HTML,
   we target the direct children after .articles-card-media.
   The title, teaser, and link are padded via the card itself,
   but we need to exclude the media from that padding.
   A cleaner approach: apply padding to the card, then remove
   it from the media wrapper. */

.articles-card {
  padding: 0; /* reset — padding applied to children instead */
}

.articles-card-media {
  padding: 0;
}

/* Wrap text content in a virtual "body" using sibling selector logic.
   Since there's no wrapper, we pad the card and let the image
   sit flush at the top with border-radius matching the card. */
.articles-card {
  padding: 0;
}

.articles-card-media {
  border-radius: 6px 6px 0 0;
}

/* Title, teaser, and link get their own padding */
.articles-card-title {
  padding: 1.25rem 1.25rem 0 1.25rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  color: var(--text-primary);
}

.articles-card-teaser {
  padding: 0.6rem 1.25rem 0 1.25rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  flex-grow: 1;
}

.articles-card-link {
  padding: 0.75rem 1.25rem 1.25rem 1.25rem;
}

/* Title link styling */
.articles-card-title-link {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.25s ease;
  background: linear-gradient(
    to right,
    var(--primary-red),
    var(--primary-red)
  );
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition:
    color 0.25s ease,
    background-size 0.35s ease;
}

.articles-card:hover .articles-card-title-link {
  color: var(--primary-red);
  background-size: 100% 1px;
}

/* "Read the article" link */
.articles-card-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-red);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition:
    color 0.2s ease,
    gap 0.25s ease;
  align-self: flex-start;
}

.articles-card-link::after {
  content: "→";
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 0.9rem;
}

.articles-card-link:hover {
  color: var(--red-dark);
  gap: 0.55rem;
}

.articles-card-link:hover::after {
  transform: translateX(3px);
}

/* -----------------------------------------------------------
   7. TABLET — 600px and up
   Two cards per row. Images still prominent.
   ----------------------------------------------------------- */
@media (min-width: 600px) {
  .articles-intro {
    padding: 3rem 0;
  }

  .articles-title-main {
    font-size: 2rem;
  }

  .articles-intro-text {
    font-size: 1.05rem;
  }

  .articles-list {
    padding: 2.5rem 0 5rem;
  }

  .articles-list > .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .articles-grid {
    gap: 1.5rem;
  }

  .articles-card {
    flex: 0 0 calc(50% - 0.75rem);
  }
}

/* -----------------------------------------------------------
   8. DESKTOP — 960px and up
   Four cards in a single row. Container is full-width so
   cards stretch evenly across the viewport.
   ----------------------------------------------------------- */
@media (min-width: 960px) {
  .articles-intro {
    padding: 4rem 0 3rem;
  }

  .articles-title-main {
    font-size: 2.25rem;
  }

  .articles-list {
    padding: 3rem 0 6rem;
  }

  .articles-list > .container {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .articles-grid {
    gap: 1.5rem;
  }

  /* Four cards per row, equal width */
  .articles-card {
    flex: 0 0 calc(25% - 1.125rem);
  }

  .articles-card-title {
    font-size: 1.05rem;
    padding: 1.25rem 1.25rem 0 1.25rem;
  }

  .articles-card-teaser {
    font-size: 0.9rem;
    padding: 0.5rem 1.25rem 0 1.25rem;
  }
}

/* -----------------------------------------------------------
   9. LARGE DESKTOP — 1200px and up
   Generous padding so cards breathe on wide screens.
   ----------------------------------------------------------- */
@media (min-width: 1200px) {
  .articles-intro {
    padding: 5rem 0 3.5rem;
  }

  .articles-list {
    padding: 3.5rem 0 7rem;
  }

  .articles-list > .container {
    padding-left: 3rem;
    padding-right: 3rem;
  }

  .articles-grid {
    gap: 2rem;
  }

  .articles-card {
    flex: 0 0 calc(25% - 1.5rem);
  }

  .articles-card-title {
    font-size: 1.1rem;
    padding: 1.5rem 1.5rem 0 1.5rem;
  }

  .articles-card-teaser {
    font-size: 0.95rem;
    padding: 0.6rem 1.5rem 0 1.5rem;
  }

  .articles-card-link {
    padding: 0.75rem 1.5rem 1.5rem 1.5rem;
  }
}

/* -----------------------------------------------------------
   10. EXTRA LARGE — 1600px and up
   Max-width container so cards don't stretch absurdly wide.
   ----------------------------------------------------------- */
@media (min-width: 1600px) {
  .articles-list > .container {
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* -----------------------------------------------------------
   11. REDUCED MOTION — Accessibility
   ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .articles-card,
  .articles-card::before,
  .articles-card-img,
  .articles-card-title-link,
  .articles-card-link,
  .articles-card-link::after {
    transition: none;
  }

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

  .articles-card:hover .articles-card-img {
    transform: none;
  }
}
/* ============================================================
   INDIVIDUAL ARTICLE PAGE — MOBILE-FIRST
   Continuation of the articles stylesheet.
   No classes from the landing page are repeated.
   All variables referenced from var.css — no redefinitions.
   ============================================================ */

/* -----------------------------------------------------------
   0. HERO BACKGROUNDS
   One per article, matching heroBgClass in var.php.
   Same pattern as every other page's hero-* rule
   (see location.css, services.css, about.css).
   ----------------------------------------------------------- */
.hero-articles {
  background-image: url('/imgs/articles/articles-hub.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero-articles-quick-fix {
  background-image: url('/imgs/articles/quick-fix-or-bigger-problem.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero-articles-thanksgiving {
  background-image: url('/imgs/articles/thanksgiving-power-outage.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero-articles-christmas {
  background-image: url('/imgs/articles/christmas-light-safety.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.hero-articles-holiday-panel {
  background-image: url('/imgs/articles/holiday-hosting-electrical-panel.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

/* -----------------------------------------------------------
   1. ARTICLE CONTAINER
   Wraps the entire article content below the intro/hero.
   ----------------------------------------------------------- */
.articles-article {
  padding: 2rem 0 3rem;
  background-color: var(--bg-primary);
}

/* -----------------------------------------------------------
   2. ARTICLE BODY
   Constrains readable content width while allowing media
   to span full width on larger screens.
   ----------------------------------------------------------- */
.articles-body {
  max-width: 48rem;
  margin: 0 auto;
}

/* -----------------------------------------------------------
   3. FEATURED IMAGE / MEDIA FIGURE
   Full-width image with a subtle border-radius.
   Sits prominently at the top of the article.
   ----------------------------------------------------------- */
.articles-media {
  margin: 0 0 1.5rem 0;
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  background-color: var(--gray-100);
}

.articles-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* -----------------------------------------------------------
   4. LEAD PARAGRAPH
   Larger, bolder opening paragraph that draws the reader in.
   Sets the tone for the article.
   ----------------------------------------------------------- */
.articles-lead {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0 0 2rem 0;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

/* -----------------------------------------------------------
   5. ARTICLE SECTIONS
   Each section groups a heading and its related content.
   Generous spacing between sections for easy scanning.
   ----------------------------------------------------------- */
.articles-section {
  margin: 0 0 2.25rem 0;
}

.articles-section:last-child {
  margin-bottom: 0;
}

/* Section titles — clean, bold, with a subtle red underline accent */
.articles-section-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  position: relative;
}

/* Thin red accent line below section titles */
.articles-section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 2.5rem;
  height: 3px;
  background-color: var(--primary-red);
  border-radius: 2px;
}

/* -----------------------------------------------------------
   6. BODY TEXT
   Comfortable reading size and line-height for long-form content.
   ----------------------------------------------------------- */
.articles-text {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
}

.articles-text:last-child {
  margin-bottom: 0;
}

/* Inline links within article text — subtle underline with hover accent */
.articles-text a {
  color: var(--primary-red);
  text-decoration: none;
  font-weight: 500;
  background: linear-gradient(
    to right,
    var(--primary-red),
    var(--primary-red)
  );
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition:
    color 0.2s ease,
    background-size 0.25s ease;
}

.articles-text a:hover {
  color: var(--red-dark);
  background-size: 100% 2px;
}

/* -----------------------------------------------------------
   7. CHECKLIST
   Styled unordered list with custom bullet markers using
   the brand red. Used for warning signs, steps, and takeaways.
   ----------------------------------------------------------- */
.articles-checklist {
  list-style: none;
  margin: 0 0 1.25rem 0;
  padding: 0;
}

.articles-checklist li {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary);
  padding: 0.6rem 0 0.6rem 1.75rem;
  position: relative;
  border-bottom: 1px solid var(--gray-100);
}

.articles-checklist li:last-child {
  border-bottom: none;
}

/* Custom red diamond bullet */
.articles-checklist li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 1rem;
  width: 8px;
  height: 8px;
  background-color: var(--primary-red);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* -----------------------------------------------------------
   8. TABLET — 600px and up
   Slightly larger type and more breathing room.
   ----------------------------------------------------------- */
@media (min-width: 600px) {
  .articles-article {
    padding: 3rem 0 4rem;
  }

  .articles-media {
    margin-bottom: 2rem;
    border-radius: 8px;
  }

  .articles-lead {
    font-size: 1.2rem;
    line-height: 1.75;
    margin-bottom: 2.5rem;
    padding-bottom: 1.75rem;
  }

  .articles-section {
    margin-bottom: 2.75rem;
  }

  .articles-section-title {
    font-size: 1.5rem;
  }

  .articles-text {
    font-size: 1.05rem;
    line-height: 1.8;
  }

  .articles-checklist li {
    font-size: 1.05rem;
    padding: 0.7rem 0 0.7rem 2rem;
  }
}

/* -----------------------------------------------------------
   9. DESKTOP — 960px and up
   Full article body remains comfortably readable.
   Media figure gets a subtle shadow for depth.
   ----------------------------------------------------------- */
@media (min-width: 960px) {
  .articles-article {
    padding: 4rem 0 5rem;
  }

  .articles-media {
    margin-bottom: 2.5rem;
    border-radius: 8px;
    box-shadow:
      0 4px 20px rgba(0, 0, 0, 0.06),
      0 1px 4px rgba(0, 0, 0, 0.04);
  }

  .articles-lead {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
  }

  .articles-section {
    margin-bottom: 3rem;
  }

  .articles-section-title {
    font-size: 1.6rem;
  }

  .articles-text {
    font-size: 1.1rem;
  }

  .articles-checklist li {
    padding: 0.75rem 0 0.75rem 2.25rem;
  }
}

/* -----------------------------------------------------------
   10. LARGE DESKTOP — 1200px and up
   ----------------------------------------------------------- */
@media (min-width: 1200px) {
  .articles-article {
    padding: 5rem 0 6rem;
  }

  .articles-lead {
    font-size: 1.35rem;
  }

  .articles-section-title {
    font-size: 1.7rem;
  }
}

/* -----------------------------------------------------------
   11. REDUCED MOTION — Accessibility
   ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .articles-text a {
    transition: none;
  }
}