/* =============================================================
   ARTICLE.CSS
   Custom styles for article-related pages.
   Sections:
   1. Shared — used across all article page types
   2. Article Index (path-articles)
   3. Article Categories (path-taxonomy / article category pages)
   4. Article Detail Page (node--type-article)
   5. Desktop overrides (min-width: 769px)
   6. Sidebar column breakpoint (min-width: 992px)
   7. Mobile overrides (max-width: 768px)
============================================================= */


/* =============================================================
   1. SHARED
   Used across article index, categories, and detail pages.
============================================================= */

/* -------------------------------- */
/* Article card — block */
/* -------------------------------- */
.aa-article-card {
  display: flex;
  position: relative;
  border: 1px solid #e5e5e5;
  background: #fff;
  margin-bottom: 20px;
  transition: box-shadow .2s ease, border-color .2s ease;
}

.aa-article-card:hover {
  border-color: #d6d6d6;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

/* -------------------------------- */
/* Article card — image element */
/* -------------------------------- */
.aa-article-card__image {
  flex: 0 0 300px;
  width: 300px;
  overflow: hidden;
}

.aa-article-card__image img,
.aa-article-card__image picture img,
.aa-article-card__image .media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  transition: transform .6s ease;
}

.aa-article-card:hover .aa-article-card__image img {
  transform: scale(1.02);
}

/* Drupal wrapper normalisation */
.aa-article-card__image picture,
.aa-article-card__image .media,
.aa-article-card__image .field,
.aa-article-card__image .field__item {
  display: block;
  width: 100%;
}

/* -------------------------------- */
/* Article card — content element */
/* -------------------------------- */
.aa-article-card__content {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
  position: relative;
}

/* -------------------------------- */
/* Article card — title element */
/* -------------------------------- */
.aa-article-card__title {
  margin: 0 0 8px 0;
  font-size: 1.35rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* -------------------------------- */
/* Article card — title link element */
/* -------------------------------- */
.aa-article-card__title-link {
  color: #242424;
  text-decoration: none;
  transition: color .2s ease;
}

.aa-article-card__title-link:hover,
.aa-article-card__title-link:focus,
.aa-article-card__title-link:active,
.aa-article-card__title-link:visited {
  text-decoration: none;
}

.aa-article-card__title-link:hover {
  color: #C02278;
}

/* -------------------------------- */
/* Article card — excerpt element */
/* -------------------------------- */
.aa-article-card__excerpt {
  line-height: 1.55;
  color: #333;
  font-size: 0.9rem;
}

/* -------------------------------- */
/* Category pill — shared across cards, hero, and sidebar */
/* -------------------------------- */
.aa-article-card__category,
.block-views-blockarticle-category-sidebar-block-1 .views-field-name a {
  display: inline-block;
  padding: 3px 9px;
  font-size: .75rem;
  font-weight: 400;
  font-family: 'Lexend', sans-serif;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  color: #555;
  background: #fff;
  text-decoration: none;
  text-transform: none;
  line-height: 1.2;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
  position: relative;
  z-index: 2;
}

.aa-article-card__category:hover,
.block-views-blockarticle-category-sidebar-block-1 .views-field-name a:hover {
  border-color: #ccc;
  color: #222;
  background: #fafafa;
}




/* =============================================================
   2. ARTICLE INDEX
   path-articles body class
============================================================= */

/* -------------------------------- */
/* Page header block */
/* -------------------------------- */
.aa-article-header {
  padding: 110px 0 70px;
  margin-bottom: 30px;
  text-align: center;
}

.aa-article-header__title {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 700;
  color: #3A3A3A;
  letter-spacing: -1.6px;
  line-height: 0.9;
}

.aa-article-header__summary {
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  font-weight: 400;
  line-height: 1.4;
  margin: 0 auto;
  max-width: 220px;
  font-family: 'Lexend', sans-serif;
}

/* -------------------------------- */
/* H1 banner block */
/* -------------------------------- */
.h1-blocks {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(70px, 8vw, 100px);
  background-color: #ecfae9;
  background-image: repeating-linear-gradient(
    rgba(0, 0, 0, 0.04),
    rgba(0, 0, 0, 0.04) 1px,
    transparent 1px,
    transparent 6px
  );
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 0;
}

.h1-blocks h1 {
  transform: translateY(2px);
  color: #3a3a3a;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.h1-blocks-articles {
  margin-bottom: 30px;
}


/* =============================================================
   3. ARTICLE CATEGORIES
   Article category/taxonomy listing pages
============================================================= */

/* Article feature block — used in category descriptions */
.article-feature {
  width: 100%;
  margin: 40px 0;
}

.article-feature-inner {
  max-width: 870px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

.article-feature-image {
  width: 100%;
  object-fit: cover;
}

.article-feature-description {
  margin-top: 20px;
}

.article-feature .row {
  align-items: flex-start;
}

.article-feature .col-lg-3 {
  display: flex;
  align-items: flex-start;
}

/* Article table — used in category/detail content */
.article-table {
  border-collapse: collapse;
  margin-top: 40px;
  font-size: 0.8em;
  font-family: Arial, Helvetica, sans-serif;
  width: 100%;
  max-width: 230px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.12);
}

.article-table thead tr {
  background-color: #3940ea;
  color: #fff;
  text-align: left;
}

.article-table th,
.article-table td {
  padding: 8px 10px;
}

.article-table tbody tr {
  border-bottom: 1px solid #ebebeb;
}

.article-table tbody tr:nth-of-type(even) {
  background-color: #f3f3f3;
}

.article-table tbody tr:last-of-type {
  border-bottom: 2px solid #37353d;
}

.article-table tbody td.active-row {
  font-weight: bold;
  color: #2932eb;
}

.article-table #stars {
  color: #81e099;
  font-size: 1.8em;
}

.article-table #stars-end {
  color: #eb8901;
  font-size: 1.8em;
}


/* =============================================================
   4. ARTICLE DETAIL PAGE
   node--type-article body class
============================================================= */

/* -------------------------------- */
/* Hero block */
/* -------------------------------- */
.aa-article-hero {
  width: 100%;
  background: #fff;
  padding: 2rem;
}

.aa-article-hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-height: 450px;
  gap: 2rem;
  align-items: center;
}

/* -------------------------------- */
/* Hero image element */
/* -------------------------------- */
.aa-article-hero__image {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 450px;
  overflow: hidden;
}

.aa-article-hero__image img,
.aa-article-hero__image .field--name-field-image img,
.aa-article-hero__image .field--name-field-article-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.aa-article-hero__image .field,
.aa-article-hero__image .field__item {
  height: 100%;
}

/* -------------------------------- */
/* Hero content element */
/* -------------------------------- */
.aa-article-hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1rem 2rem;
  gap: 1rem;
}

/* -------------------------------- */
/* Hero categories element */
/* -------------------------------- */
.aa-article-hero__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* -------------------------------- */
/* Hero title element */
/* -------------------------------- */
.aa-article-hero__title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
  color: #3a3a3a;
  padding-right: 3rem;
}

/* -------------------------------- */
/* Hero meta element */
/* -------------------------------- */
.aa-article-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: #666;
}

.aa-article-hero__separator {
  color: #C02278;
  font-weight: 300;
}

.aa-article-hero__author,
.aa-article-hero__date,
.aa-article-hero__reading-time {
  white-space: nowrap;
}

/* -------------------------------- */
/* Hero share element */
/* -------------------------------- */
.aa-article-hero__share {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.aa-article-hero__share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  font-size: 1.4rem;
  color: #bbb;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.4s ease;
  font-family: inherit;
}

.aa-article-hero__share-btn:hover {
  color: #888;
}

.aa-article-hero__share-btn:focus {
  outline: none;
  box-shadow: none;
}

.aa-share-btn--copy.is-copied {
  color: #4caf50;
}

.aa-share-btn--native {
  display: none;
}

/* -------------------------------- */
/* Article body element */
/* -------------------------------- */
.aa-article-body {
  padding: 0 0 1rem 0;
}

.aa-article-body__content {
  max-width: 100%;
}

/* -------------------------------- */
/* Article body content headings */
/* -------------------------------- */
.node--type-article .node__content h2 {
  letter-spacing: -0.5px;
}

/* -------------------------------- */
/* Sidebar block titles */
/* -------------------------------- */
.sidebar-right .block-title span {
  letter-spacing: 0.002rem;
  font-size: 17px;
}

/* -------------------------------- */
/* Sidebar category block */
/* -------------------------------- */
.block-views-blockarticle-category-sidebar-block-1 .view-content-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.block-views-blockarticle-category-sidebar-block-1 .item {
  display: inline-block;
  margin: 0;
}

.block-views-blockarticle-category-sidebar-block-1 .field-content a {
  font-size: .84rem;
  padding: 5px 12px;
}

#block-gavias-lozin-views-block-article-category-sidebar-block-1 .block-title {
  margin-top: 30px;
}

/* -------------------------------- */
/* Legacy post-meta (kept for compatibility) */
/* -------------------------------- */
.node--type-article .post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  align-items: center;
}

/* -------------------------------- */
/* Legacy field label (kept for compatibility) */
/* -------------------------------- */
.node--type-article .field--name-field-categories.field--label-above .field__label {
  display: block;
  clear: both;
}


/* =============================================================
   5. DESKTOP OVERRIDES
   min-width: 769px
============================================================= */
@media (min-width: 769px) {

  /* Article card — clickable stretch link */
  .aa-article-card {
    cursor: pointer;
  }

  .aa-article-card__title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  .aa-article-card__category {
    position: relative;
    z-index: 2;
  }

  /* Article index header — left align */
  .aa-article-header {
    text-align: left;
    padding-left: 60px;
  }

  .aa-article-header__summary {
    margin: 0;
    max-width: 270px;
  }

  /* Article body — constrain to 730px centred */
  .node--type-article .aa-article-body__content .node__content {
    max-width: 730px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Article hero — constrain to 730px centred, aligned to content centre line */
  .aa-article-hero {
    padding: 3rem 0;
  }

  .aa-article-hero__inner {
    max-width: 730px;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-left: 72px;
  }

  .aa-article-hero__content {
    padding: 1rem 0;
  }

}


/* =============================================================
   6. SIDEBAR BREAKPOINT
   min-width: 992px — when sidebar sits alongside content
============================================================= */
@media (min-width: 992px) {

  .node--type-article .sidebar-right {
    margin-top: 1.9rem;
  }

}


/* =============================================================
   7. MOBILE OVERRIDES
   max-width: 768px
============================================================= */
@media (max-width: 768px) {

  /* Article card — stack vertically */
  .aa-article-card {
    flex-direction: column;
    cursor: default;
  }

  .aa-article-card__image {
    width: 100%;
    flex: none;
  }

  .aa-article-card__title-link::after {
    display: none;
  }

  /* Article index header */
  .aa-article-header {
    padding: 60px 0 40px;
  }

  /* Article feature */
  .article-feature-inner {
    padding-left: 0;
    padding-right: 0;
  }

  /* Article table */
  .article-table {
    max-width: 100%;
    margin-top: 20px;
  }

  /* Article hero — stack vertically, full bleed image */
  .aa-article-hero {
    padding: 0;
  }

  .aa-article-hero__inner {
    grid-template-columns: 1fr;
    max-height: none;
    gap: 0;
  }

  .aa-article-hero__image {
    aspect-ratio: unset;
    max-height: none;
    padding-top: 15px;
  }

  .aa-article-hero__image img {
    height: auto;
    object-fit: unset;
  }

  .aa-article-hero__content {
    padding: 1.5rem 0;
  }

  /* Show native share button on mobile */
  .aa-share-btn--native {
    display: inline-flex;
  }

  /* Article body text size */
  .node--type-article .node__content p,
  .node--type-article .node__content li {
    font-size: 17px;
  }

}
