/* Feature Article Styling - Matching v0-jetsetter-guide-redesign.vercel.app */

/* Hero Section */
.feature-article-hero {
  position: relative;
  height: 60vh;
  min-height: 350px;
  width: 100%;
  overflow: hidden;
  background-color: #1a1a1a;
}

@media (min-width: 640px) {
  .feature-article-hero {
    height: 65vh;
    min-height: 400px;
  }
}

@media (min-width: 1024px) {
  .feature-article-hero {
    height: 70vh;
    min-height: 500px;
  }
}

.feature-article-hero__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.feature-article-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center; /* Center crop */
}

/* Ensure nested field wrappers don't break the image fill */
.feature-article-hero__image .field,
.feature-article-hero__image .field__item,
.feature-article-hero__image .media,
.feature-article-hero__image .wide-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.feature-article-hero__image img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Mobile: crop more aggressively to fill space */
@media (max-width: 639px) {
  .feature-article-hero {
    height: 50vh;
    min-height: 300px;
  }

  .feature-article-hero__image img {
    object-position: center top !important; /* Focus on top portion on mobile */
  }
}

.feature-article-hero__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 2;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
  padding: 3rem 0;
}

.feature-article-hero__content {
  max-width: 800px;
}

.feature-article-hero__category {
  margin-bottom: 1rem;
}

.feature-article-hero__category .field__item,
.feature-article-hero__category a {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background-color: rgba(59, 130, 246, 0.9);
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.feature-article-hero__title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: white;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .feature-article-hero__title {
    font-size: 3rem;
  }
}

@media (min-width: 1024px) {
  .feature-article-hero__title {
    font-size: 3.75rem;
  }
}

.feature-article-hero__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
}

.feature-article-hero__meta .separator {
  opacity: 0.6;
}

/* Main Layout */
.feature-article-wrapper {
  background-color: white;
}

/* Reduce gap between hero and content */
.feature-article-wrapper > .container {
  padding-top: 1.5rem !important;
  padding-bottom: 1rem !important;
}

@media (min-width: 640px) {
  .feature-article-wrapper > .container {
    padding-top: 2rem !important;
    padding-bottom: 1.5rem !important;
  }
}

@media (min-width: 1024px) {
  .feature-article-wrapper > .container {
    padding-top: 3rem !important;
    padding-bottom: 2rem !important;
  }
}

.feature-article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .feature-article-layout {
    grid-template-columns: 1fr 300px;
    gap: 4rem;
  }
}

/* Article Content */
.feature-article-content {
  max-width: 48rem;
}

/* Prose Styling - Article Body */
.prose {
  color: rgba(0, 0, 0, 0.9);
  line-height: 1.75;
}

.prose-lg {
  font-size: 1.125rem;
}

.prose p {
  margin-bottom: 1.5rem;
}

/* Drop cap for first paragraph only - must be direct child of field__item, not inside a list */
.feature-article-content .field__item > p:first-of-type::first-letter {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 0.65;
  float: left;
  margin-right: 0.15rem;
  margin-top: -0.1rem;
  margin-bottom: -0.25rem;
}

/* Explicitly prevent drop caps on any paragraphs inside lists */
.prose ul p::first-letter,
.prose ol p::first-letter,
.prose li p::first-letter,
ul p::first-letter,
ol p::first-letter,
li p::first-letter {
  font-size: inherit !important;
  font-weight: inherit !important;
  float: none !important;
  margin-right: 0 !important;
  margin-top: 0 !important;
  font-family: inherit !important;
}

.prose h2 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: rgba(0, 0, 0, 0.95);
}

.prose h3 {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: rgba(0, 0, 0, 0.9);
}

.prose a {
  color: rgb(59, 130, 246);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.prose a:hover {
  color: rgb(37, 99, 235);
}

.prose img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 2rem 0;
}

.prose figure {
  margin: 2rem 0;
}

.prose figcaption {
  text-align: center;
  font-size: 0.875rem;
  color: rgba(0, 0, 0, 0.6);
  margin-top: 0.75rem;
  font-style: italic;
}

.prose blockquote {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  color: rgba(0, 0, 0, 0.85);
  margin: 2.5rem 0;
  padding: 2rem;
  border-left: none;
  position: relative;
}

@media (min-width: 768px) {
  .prose blockquote {
    font-size: 2rem;
  }
}

.prose ul,
.prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

/* Author Section */
.feature-article-author {
  margin-top: 1rem;
  padding-top: 0.75rem;
  margin-bottom: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Reduce footer gap after feature article */
body:has(.feature-article) .site-footer,
body:has(.feature-article) footer.site-footer,
body:has(.feature-article) footer {
  margin-top: 0 !important;
  padding-top: 1.5rem !important;
}

/* Remove all extra spacing from wrapper elements */
.feature-article-wrapper {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.feature-article-wrapper > .container {
  padding-bottom: 0.5rem !important;
}

.feature-article-layout {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.feature-article-content {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.feature-article-author__heading {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: rgba(0, 0, 0, 0.95);
}

.feature-article-author__card {
  display: block;
  width: 100%;
}

/* Ensure view containers take full width */
.feature-article-author__card .views-element-container,
.feature-article-author__card .view,
.feature-article-author__card .view-content {
  width: 100% !important;
  display: block !important;
}

/* CSS Grid layout for author card - photo on left, all text stacked on right */
.feature-article-author__card .view-content .views-row {
  display: grid !important;
  grid-template-columns: 80px 1fr;
  grid-template-areas:
    "photo name"
    "photo bio"
    "photo link";
  gap: 0 1rem;
  align-items: start;
  width: 100% !important;
}

/* Photo in left column spanning all rows */
.feature-article-author__card .views-field-field-mt-tmm-member-photo {
  grid-area: photo;
}

.feature-article-author__card .views-field-field-mt-tmm-member-photo img {
  width: 80px;
  height: 80px;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
}

/* Text fields stacked in right column */
.feature-article-author__card .views-field-title {
  grid-area: name;
}

.feature-article-author__card .views-field-field-mt-tmm-body {
  grid-area: bio;
}

.feature-article-author__card .views-field-view-node {
  grid-area: link;
}

.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 9999px;
  background-color: rgb(59, 130, 246);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
}

.feature-article-author__card .author-name,
.feature-article-author__card h3.author-name {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: rgba(0, 0, 0, 0.95);
}

.feature-article-author__card .views-field-title {
  margin-bottom: 0.25rem;
}

.feature-article-author__card .author-bio,
.feature-article-author__card p.author-bio {
  color: rgba(0, 0, 0, 0.7);
  line-height: 1.5;
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
}

/* Fix nested p tag from view */
.feature-article-author__card .author-bio p {
  margin: 0;
}

.feature-article-author__card .author-link,
.feature-article-author__card .author-link a {
  color: rgb(59, 130, 246);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.feature-article-author__card .author-link:hover,
.feature-article-author__card .author-link a:hover {
  color: rgb(37, 99, 235);
}

/* Sidebar */
.feature-article-sidebar {
  position: relative;
}

@media (min-width: 1024px) {
  .feature-article-sidebar {
    position: sticky;
    top: 6rem;
    align-self: flex-start;
  }
}

.sidebar-section {
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-section__title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: rgba(0, 0, 0, 0.95);
}

.sidebar-section__content {
  color: rgba(0, 0, 0, 0.7);
  font-size: 0.875rem;
  line-height: 1.6;
}

.sidebar-section__content p {
  margin-bottom: 0.75rem;
}

.sidebar-section__content .text-muted {
  color: rgba(0, 0, 0, 0.5);
  font-style: italic;
}

/* Newsletter Section */
.sidebar-newsletter {
  background-color: rgb(59, 130, 246);
  color: white;
}

.sidebar-newsletter .sidebar-section__title,
.sidebar-newsletter .sidebar-section__content {
  color: white;
}

.sidebar-newsletter .btn {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  background-color: white;
  color: rgb(59, 130, 246);
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-newsletter .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Remove default Drupal field styling */
.feature-article .field__label {
  display: none;
}

.feature-article .field__item {
  margin: 0;
}

/* Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
}

/* Hide breadcrumbs on feature article pages */
.feature-article + nav.breadcrumb,
.feature-article ~ nav.breadcrumb,
body:has(.feature-article) nav.breadcrumb {
  display: none;
}

/* =====================================================
   Mobile Overflow Fix - Prevent horizontal scroll
   ===================================================== */

/* Force text wrapping for all content */
.feature-article,
.feature-article-wrapper,
.feature-article-content,
.feature-article-layout,
.prose,
.text-content {
  max-width: 100% !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

/* Fix headings with non-breaking spaces that cause overflow */
.prose h1,
.prose h2,
.prose h3,
.text-content h1,
.text-content h2,
.text-content h3,
h1.western,
h2.western,
h3.western {
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  max-width: 100% !important;
  hyphens: auto !important;
}

/* Prevent hero image from overflowing */
.feature-article-hero,
.feature-article-hero__image {
  max-width: 100vw !important;
  overflow: hidden !important;
}

/* Ensure field label is hidden */
.feature-article-hero__image .field__label,
.feature-article .field--name-field-hero-image .field__label {
  display: none !important;
}

/* Ensure all containers respect viewport width on mobile */
@media (max-width: 768px) {
  .feature-article,
  .feature-article-wrapper,
  .feature-article-layout,
  .feature-article-content {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* Only apply padding to the outermost container */
  .feature-article-wrapper > .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Remove extra padding from nested elements */
  .feature-article-layout,
  .feature-article-content,
  .prose {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* Force prose content to wrap on mobile */
  .prose,
  .prose p,
  .prose h1,
  .prose h2,
  .prose li,
  .text-content,
  .text-content p,
  .text-content h1,
  .text-content h2 {
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }

  /* Smaller subheading (h1 inside body content) on mobile */
  .prose h1,
  .text-content h1,
  h1.western {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.75rem !important;
  }

  /* Smaller h2 headings on mobile */
  .prose h2,
  .text-content h2,
  h2.western {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.5rem !important;
  }
}

/* Related Article Cards */
.related-article-card {
  display: block;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.related-article-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.related-article-card__image {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
}

.related-article-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-article-card:hover .related-article-card__image img {
  transform: scale(1.05);
}

.related-article-card__content {
  padding: 0;
}

.related-article-card__category {
  margin-bottom: 0.5rem;
}

.related-article-card__category .field__item,
.related-article-card__category a {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(59, 130, 246);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.related-article-card__title {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.9);
  margin: 0;
  transition: color 0.2s ease;
}

.related-article-card:hover .related-article-card__title {
  color: rgb(59, 130, 246);
}

/* =====================================================
   Related Articles Sidebar Fixes
   ===================================================== */

/* Force sidebar related articles to stack vertically */
.sidebar-related .view-content,
.sidebar-related .view-related-articles .view-content {
  display: block !important;
  width: 100% !important;
}

.sidebar-related .view-content .views-row,
.sidebar-related .views-row {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: none !important;
  margin-bottom: 1.5rem;
}

/* Fix related article card images */
.related-article-card__image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  background-color: #f3f4f6;
}

.related-article-card__image .field,
.related-article-card__image .field__item,
.related-article-card__image .media,
.related-article-card__image .media > .field,
.related-article-card__image .media > .field__item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Hide contextual links in related article cards */
.related-article-card__image .contextual {
  display: none !important;
}

.related-article-card__image img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
}
