/* Articles Page & Modal Overlay Styles - WellSense Academy */

.articles-page {
  background-color: #faf7f2;
  min-height: 100vh;
  color: #2b332c;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Hero Section */
.articles-hero {
  background: linear-gradient(135deg, #1f3324 0%, #2e4734 100%);
  color: #ffffff;
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
}

.articles-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(197, 138, 104, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.articles-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

.articles-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 20px;
}

.articles-breadcrumb a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  transition: color 0.2s;
}

.articles-breadcrumb a:hover {
  color: #ffffff;
}

.articles-hero h1 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 42px;
  line-height: 1.15;
  margin: 0 0 14px;
  color: #ffffff;
  font-weight: 400;
}

.articles-hero p {
  font-size: 17px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  margin: 0 0 32px;
}

/* Filter & Search Bar */
.articles-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

.articles-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article-cat-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.article-cat-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

.article-cat-btn.is-active {
  background: #c58a68;
  border-color: #c58a68;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(197, 138, 104, 0.35);
}

.articles-search-box {
  position: relative;
  min-width: 260px;
}

.articles-search-box input {
  width: 100%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 9px 18px 9px 42px;
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.articles-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.articles-search-box input:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: #ffffff;
}

.articles-search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  pointer-events: none;
}

/* Articles Section Layout */
.articles-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.articles-count-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  color: #5c635d;
  font-size: 14px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 28px;
}

/* Article Card Styles (Matching original academy-resource-card) */
.articles-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  border: 1px solid #ebe5dc;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.articles-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(31, 51, 36, 0.1);
  border-color: #d6ccbc;
}

.articles-card-img-wrap {
  position: relative;
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: #f0eae1;
}

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

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

.articles-card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  color: #b8744d;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.articles-card-readtime {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(31, 51, 36, 0.82);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
}

.articles-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.articles-card-body h3 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 22px;
  line-height: 1.25;
  color: #1f3324;
  margin: 0 0 12px;
  font-weight: 400;
}

.articles-card-body p {
  color: #636b64;
  font-size: 14px;
  line-height: 1.55;
  margin: 0 0 20px;
  flex-grow: 1;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.articles-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f2ede4;
  margin-top: auto;
}

.articles-card-meta {
  font-size: 12px;
  color: #8c948e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.articles-card-link {
  color: #c58a68;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: gap 0.2s ease, color 0.2s ease;
}

.articles-card:hover .articles-card-link {
  color: #a36644;
  gap: 10px;
}

/* No items state */
.articles-empty-state {
  text-align: center;
  padding: 64px 20px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px dashed #d6cfc4;
}

.articles-empty-state i {
  font-size: 48px;
  color: #c58a68;
  margin-bottom: 16px;
  display: block;
}

.articles-empty-state h3 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 24px;
  color: #1f3324;
  margin: 0 0 8px;
}

.articles-empty-state p {
  color: #6e7570;
  margin: 0 0 20px;
}

/* ==========================================================================
   Full Article Popup Modal
   ========================================================================== */
.article-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 24, 18, 0.72);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
  overflow-y: auto;
}

.article-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.article-modal-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  position: relative;
  transform: scale(0.94) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-modal-backdrop.is-open .article-modal-dialog {
  transform: scale(1) translateY(0);
}

.article-modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #1f3324;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, transform 0.2s, color 0.2s;
}

.article-modal-close-btn:hover {
  background: #ffffff;
  color: #c58a68;
  transform: scale(1.08);
}

.article-modal-scrollable {
  overflow-y: auto;
  padding: 0;
}

.article-modal-header-image {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
}

.article-modal-body-content {
  padding: 36px 44px 48px;
}

.article-modal-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.article-modal-pill {
  background: #fff7f2;
  color: #c58a68;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #f5e4da;
}

.article-modal-meta-item {
  color: #78827a;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-modal-title {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 34px;
  line-height: 1.2;
  color: #1f3324;
  margin: 0 0 24px;
}

.article-modal-author-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #f7f4ee;
  border-radius: 12px;
  margin-bottom: 32px;
}

.article-modal-author-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.article-modal-author-info strong {
  display: block;
  font-size: 14px;
  color: #1f3324;
}

.article-modal-author-info span {
  font-size: 12px;
  color: #6e7570;
}

.article-modal-text {
  font-size: 16px;
  line-height: 1.7;
  color: #38423a;
}

.article-modal-text h4 {
  font-family: "DM Serif Display", Georgia, serif;
  font-size: 22px;
  color: #1f3324;
  margin: 32px 0 12px;
}

.article-modal-text p {
  margin: 0 0 18px;
}

.article-modal-text ul, .article-modal-text ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.article-modal-text li {
  margin-bottom: 8px;
}

.article-modal-callout {
  background: #f4efe6;
  border-left: 4px solid #c58a68;
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  margin: 24px 0;
  font-style: italic;
  color: #2b3b2e;
}

.article-modal-callout strong {
  display: block;
  font-style: normal;
  color: #1f3324;
  margin-bottom: 4px;
}

.article-modal-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid #eee8df;
  margin-top: 36px;
}

.article-share-btn {
  background: #f2ede4;
  border: none;
  color: #1f3324;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s, color 0.2s;
}

.article-share-btn:hover {
  background: #c58a68;
  color: #ffffff;
}

/* Responsive Rules */
@media (max-width: 768px) {
  .articles-hero {
    padding: 36px 0 44px;
  }
  .articles-hero h1 {
    font-size: 30px;
  }
  .articles-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .articles-search-box {
    width: 100%;
  }
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .article-modal-body-content {
    padding: 24px 20px 32px;
  }
  .article-modal-title {
    font-size: 24px;
  }
  .article-modal-header-image {
    height: 220px;
  }
}
