/**
 * Articles Page Styles
 * Matches the site's navy/gold design language
 */

/* ===================================
   ARTICLES LISTING PAGE
   =================================== */

/* Hide the page title block on articles page - we use the hero section instead */
/* Target the wrapper div that contains both pagetitle and content blocks */
div:has(> #block-instappraisal-clean-pagetitle):has(.articles-listing-view) > #block-instappraisal-clean-pagetitle,
#block-instappraisal-clean-pagetitle:has(~ #block-instappraisal-clean-content .articles-listing-view) {
  display: none !important;
}

/* Hero Section */
.articles-hero {
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
  padding: 60px 20px 50px;
  text-align: center;
  border-bottom: 4px solid #ed8936;
  margin: 0;
}

.articles-hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.articles-hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: #ffffff !important;
  margin: 0 0 15px 0;
  -webkit-text-fill-color: #ffffff !important;
}

.articles-hero p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 768px) {
  .articles-hero {
    padding: 40px 15px 35px;
  }

  .articles-hero h1 {
    font-size: 2rem;
  }

  .articles-hero p {
    font-size: 1rem;
  }
}

/* Articles view wrapper */
.articles-listing-view {
  background: #f8f9fa;
  padding: 30px 0;
}

/* Articles List Layout - Single column, stacked cards */
.articles-listing-view > .view-content {
  display: flex !important;
  flex-direction: column;
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Article Card - Clean vertical layout (image on top, content below) */
.articles-listing-view .views-row {
  background: white !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  position: relative;
  cursor: pointer;
  border: none !important;
  border-left: none !important;
  padding-left: 0 !important;
}

.articles-listing-view .views-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
}

/* Article Card - Node wrapper - kill all borders */
.articles-listing-view .views-row .node--type-blog,
.articles-listing-view .views-row .node,
.articles-listing-view .views-row article {
  display: block;
  border: none !important;
  border-left: none !important;
  padding-left: 0 !important;
}

/* Article Title - Show prominently */
.articles-listing-view .views-row .node__title,
.articles-listing-view .views-row h2.node__title {
  margin: 0 0 16px 0 !important;
  padding: 0 !important;
  display: block !important;
}

.articles-listing-view .views-row .node__title a,
.articles-listing-view .views-row h2.node__title a {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: #1a365d !important;
  text-decoration: none !important;
  line-height: 1.35 !important;
  display: block !important;
  -webkit-text-fill-color: #1a365d !important;
}

.articles-listing-view .views-row:hover .node__title a {
  color: #2c5282 !important;
  -webkit-text-fill-color: #2c5282 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

/* Make entire card clickable via the title link */
.articles-listing-view .views-row .node__title a::after,
.articles-listing-view .views-row h2 a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* Hide the byline that appears in article body */
.articles-listing-view .field--name-body p:first-child strong:only-child,
.articles-listing-view .field--name-body > p:first-of-type:has(strong:only-child) {
  display: none !important;
}

/* More specific: hide "By InstAppraisal.com" text */
.articles-listing-view .field--name-body p strong {
  display: none !important;
}

/* But show strong text that's not the byline (mixed content) */
.articles-listing-view .field--name-body p:not(:first-child) strong {
  display: inline !important;
}

/* Article Card Image - Full width, natural height */
.articles-listing-view .views-row .field--name-field-image,
.articles-listing-view .views-row .field--name-field-teaser-image {
  width: 100%;
  margin: 16px 0;
}

.articles-listing-view .views-row .field--name-field-image img,
.articles-listing-view .views-row .field--name-field-teaser-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.articles-listing-view .views-row:hover .field--name-field-image img,
.articles-listing-view .views-row:hover .field--name-field-teaser-image img {
  transform: scale(1.01);
}

/* Article Card Content */
.articles-listing-view .views-row .node__content {
  padding: 20px 24px;
}

/* Article Card Category Tag - Gold border pill style */
.articles-listing-view .views-row .field--name-field-blog-category {
  margin-bottom: 10px;
}

.articles-listing-view .views-row .field--name-field-blog-category .field__item {
  display: inline-block;
  background: transparent;
  color: #1a365d;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 5px 12px;
  border: 2px solid #d4af37;
  border-radius: 20px;
}

/* Article Card Publish Date */
.articles-listing-view .views-row .field--name-created {
  color: #718096;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

/* Article Card Excerpt/Body */
.articles-listing-view .views-row .field--name-body {
  color: #4a5568;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 15px;
  flex: 1;
}

.articles-listing-view .views-row .field--name-body p {
  margin: 0 0 8px 0;
}

.articles-listing-view .views-row .field--name-body p:last-of-type {
  margin-bottom: 0;
}

/* Hide h3 subtitles in excerpts */
.articles-listing-view .views-row .field--name-body h3 {
  display: none !important;
}

/* Read More Button - Override the display:none from other styles */
.articles-listing-view .views-row ul.links.inline,
.articles-listing-view ul.links.inline,
.articles-listing-view .field--name-body ul.links.inline {
  display: block !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 15px 0 0 0 !important;
}

.articles-listing-view .views-row ul.links.inline li,
.articles-listing-view ul.links.inline li,
.articles-listing-view .field--name-body ul.links.inline li {
  display: block !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.articles-listing-view .views-row ul.links.inline li a,
.articles-listing-view ul.links.inline li a,
.articles-listing-view .field--name-body ul.links.inline li a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  font-size: 0.95rem !important;
  padding: 12px 24px !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 2px 6px rgba(26, 54, 93, 0.25) !important;
  position: relative;
  z-index: 2;
}

.articles-listing-view .views-row ul.links.inline li a:hover,
.articles-listing-view ul.links.inline li a:hover,
.articles-listing-view .field--name-body ul.links.inline li a:hover {
  background: linear-gradient(135deg, #142d4c 0%, #1a365d 100%) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(26, 54, 93, 0.35) !important;
}

.articles-listing-view .views-row ul.links.inline li a::after,
.articles-listing-view ul.links.inline li a::after,
.articles-listing-view .field--name-body ul.links.inline li a::after {
  content: ' →';
  transition: transform 0.2s ease;
}

.articles-listing-view .views-row ul.links.inline li a:hover::after,
.articles-listing-view ul.links.inline li a:hover::after,
.articles-listing-view .field--name-body ul.links.inline li a:hover::after {
  transform: translateX(3px);
}

/* Hide the inline CTA that appears on each card */
.articles-listing-view .appraisal-cta-inline,
.articles-listing-view .cta-banner,
.articles-listing-view .compact-cta,
.articles-listing-view [class*="cta"],
.articles-listing-view .views-row [class*="cta"],
.articles-listing-view .node--type-blog [class*="cta"] {
  display: none !important;
}

/* ===================================
   PAGER STYLING
   =================================== */

.articles-listing-view .pager {
  display: flex;
  justify-content: center;
  padding: 30px 20px 10px;
}

.articles-listing-view .pager__items {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.articles-listing-view .pager__item {
  list-style: none;
}

.articles-listing-view .pager__item a,
.articles-listing-view .pager__item.is-active span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.articles-listing-view .pager__item a {
  background: white;
  color: #1a365d;
  border: 1px solid #e2e8f0;
}

.articles-listing-view .pager__item a:hover {
  background: #1a365d;
  color: white;
  border-color: #1a365d;
}

.articles-listing-view .pager__item.is-active span {
  background: #1a365d;
  color: white;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
  .articles-listing-view > .view-content {
    gap: 16px;
    padding: 0 15px;
  }

  .articles-listing-view {
    padding: 20px 0;
  }

  /* Stack cards vertically on mobile */
  .articles-listing-view .views-row .node--type-blog {
    flex-direction: column;
    min-height: auto;
  }

  .articles-listing-view .views-row .field--name-field-image,
  .articles-listing-view .views-row .field--name-field-teaser-image {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
  }

  .articles-listing-view .views-row .node__title a {
    font-size: 1.15rem !important;
  }

  .articles-listing-view .views-row .node__content {
    padding: 18px 20px;
  }

  .articles-listing-view .views-row ul.links.inline li a {
    padding: 10px 20px !important;
    font-size: 0.9rem !important;
  }

  .articles-listing-view .views-row .field--name-field-blog-category .field__item {
    font-size: 0.6rem;
    padding: 4px 10px;
  }
}

/* ===================================
   ARTICLE DETAIL PAGE
   =================================== */

.node--type-blog.node--view-mode-full {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.node--type-blog.node--view-mode-full .node__title {
  font-size: 2.2rem;
  color: #1a365d;
  margin-bottom: 15px;
  line-height: 1.3;
}

.node--type-blog.node--view-mode-full .node__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  color: #718096;
  font-size: 0.9rem;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
}

.node--type-blog.node--view-mode-full .field--name-field-image {
  margin-bottom: 30px;
  border-radius: 12px;
  overflow: hidden;
}

.node--type-blog.node--view-mode-full .field--name-field-image img {
  width: 100%;
  height: auto;
}

.node--type-blog.node--view-mode-full .field--name-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #2d3748;
}

.node--type-blog.node--view-mode-full .field--name-body p {
  margin-bottom: 1.5em;
}

.node--type-blog.node--view-mode-full .field--name-body h2,
.node--type-blog.node--view-mode-full .field--name-body h3 {
  color: #1a365d;
  margin-top: 2em;
  margin-bottom: 0.75em;
}

.node--type-blog.node--view-mode-full .field--name-body blockquote {
  border-left: 4px solid #ed8936;
  padding-left: 20px;
  margin: 1.5em 0;
  font-style: italic;
  color: #4a5568;
}

.node--type-blog.node--view-mode-full .field--name-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5em 0;
}
