/*
 * Article Styles
 * Single article page styles including article header, body, and footer
 */

/* ===== NYT ARTICLE STYLES ===== */

/* NYT Article Header */
.nyt-article-header {
  max-width: 600px;
  margin: 0 auto 2rem;
  padding: 2rem 0;
}

.article-category-nav {
  margin-bottom: 1rem;
}

.category-link {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

.category-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* NYT Headline */
.nyt-headline {
  font-family: var(--font-headline);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 1.5rem 0 1rem;
  text-align: left;
}

/* NYT Subtitle */
.nyt-subtitle {
  font-family: var(--font-body);
  font-size: 1.375rem;
  line-height: 1.4;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-style: italic;
}

/* Article Meta Bar - Combined author/date and share/bookmark */
.article-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.meta-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.by-label {
  font-weight: 400;
}

.author-link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.author-link:hover {
  text-decoration: underline;
}

.publish-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.publish-date,
.updated-info {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.updated-info time {
  font-weight: 600;
}

/* Share and Bookmark Buttons in Meta Bar */
.meta-right .share-btn,
.meta-right .bookmark-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.meta-right .share-btn:hover,
.meta-right .bookmark-btn:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-secondary);
}

.meta-right .bookmark-btn {
  padding: 0.5rem;
  width: 36px;
  justify-content: center;
}

/* NYT Featured Image */
.nyt-featured-image {
  margin: 1.5rem auto 3rem;
  max-width: 945px;
}

.nyt-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.nyt-image-caption {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding-left: 1rem;
  border-left: 3px solid var(--border-color);
}

.image-credit {
  display: block;
  margin-top: 0.25rem;
  font-style: italic;
  font-size: 0.8125rem;
}

/* NYT Article Body */
.nyt-article-body {
  max-width: 600px;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.nyt-article-body p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

.nyt-article-body p:first-child::first-letter {
  font-size: 4rem;
  line-height: 1;
  float: left;
  margin: 0.1rem 0.5rem 0 0;
  font-weight: 700;
  color: var(--text-primary);
}

.nyt-article-body h2 {
  font-family: var(--font-headline);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 2.5rem 0 1rem;
  color: var(--text-primary);
}

.nyt-article-body h3 {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 2rem 0 0.75rem;
  color: var(--text-primary);
}

.nyt-article-body blockquote {
  font-size: 1.375rem;
  line-height: 1.6;
  margin: 2rem 0;
  padding-left: 2rem;
  border-left: 4px solid var(--border-color);
  font-style: italic;
  color: var(--text-secondary);
}

.nyt-article-body blockquote p:first-child::first-letter {
  font-size: inherit;
  line-height: inherit;
  float: none;
  margin: 0;
  font-weight: inherit;
}

.nyt-article-body a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.nyt-article-body a:hover {
  color: var(--link-hover);
}

/* Video Address Link Styling */
.nyt-article-body a[href*="video"] {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-color);
}

.nyt-article-body a[href*="video"]:hover {
  background-color: var(--accent-color);
  color: white;
}

/* Quote Highlighting */
.nyt-article-body p:has(+ blockquote),
.nyt-article-body blockquote + p {
  font-weight: 500;
}

/* ===== NYT ARTICLE FOOTER STYLES ===== */

/* Article Footer Container */
.nyt-article-footer {
  max-width: 600px;
  margin: 3rem auto 0;
  padding: 0;
}

/* Tags Section */
.nyt-article-tags {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.nyt-tag-link {
  font-family: var(--font-ui);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.nyt-tag-link:hover {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* Author Bio */
.nyt-author-bio {
  display: flex;
  gap: 1rem;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.nyt-author-bio .author-avatar {
  flex-shrink: 0;
}

.nyt-author-bio .author-avatar img {
  border-radius: 50%;
  width: 60px;
  height: 60px;
}

.author-content {
  flex: 1;
}

.author-name {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.author-name a {
  color: var(--text-primary);
  text-decoration: none;
}

.author-name a:hover {
  color: var(--link-color);
}

.author-bio-text {
  font-family: var(--font-ui);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

/* Post Navigation */
.nyt-post-navigation {
  margin-top: 2rem;
}

.nyt-nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.nav-item {
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
}

.nav-item:only-child {
  grid-column: 1 / -1;
  max-width: 50%;
}

.nav-item.nav-next:only-child {
  justify-self: end;
}

.nav-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 0.5rem;
}

.nav-title {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
}

.nav-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.nav-title a:hover {
  color: var(--link-color);
}

/* ===== NYT FULL-WIDTH RELATED SECTION ===== */

.nyt-related-section {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

.nyt-related-header {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}

.nyt-related-title {
  font-family: var(--font-headline);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nyt-related-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.nyt-related-title a:hover {
  text-decoration: underline;
}

.nyt-related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem 2rem;
}

.nyt-related-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.nyt-related-item:last-child {
  border-bottom: none;
}

.nyt-related-image {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  overflow: hidden;
}

.nyt-related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nyt-related-text {
  flex: 1;
  min-width: 0;
}

.nyt-related-headline {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5rem 0;
}

.nyt-related-headline a {
  color: var(--text-primary);
  text-decoration: none;
}

.nyt-related-headline a:hover {
  text-decoration: underline;
}

.nyt-related-byline {
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== NYT FULL-WIDTH COMMENTS SECTION ===== */

.nyt-comments-full-section {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

.nyt-comments-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.nyt-comments-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.nyt-comments-heading {
  font-family: var(--font-headline);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nyt-comments-body {
  font-family: var(--font-ui);
}

/* Native Comment Form Styling */
.nyt-comments-body .comment-form {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-bottom: 2rem;
}

.nyt-comments-body .comment-form h3 {
  font-family: var(--font-headline);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.nyt-comments-body .comment-form input[type="text"],
.nyt-comments-body .comment-form input[type="email"],
.nyt-comments-body .comment-form input[type="url"],
.nyt-comments-body .comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 1rem;
  margin-bottom: 1rem;
  border-radius: 0;
}

.nyt-comments-body .comment-form input:focus,
.nyt-comments-body .comment-form textarea:focus {
  outline: none;
  border-color: var(--text-primary);
}

.nyt-comments-body .comment-form textarea {
  min-height: 100px;
  resize: vertical;
}

.nyt-comments-body .comment-form input[type="submit"] {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: none;
  padding: 0.75rem 2rem;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nyt-comments-body .comment-form input[type="submit"]:hover {
  opacity: 0.8;
}

/* Native Comments List */
.nyt-comments-body .comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nyt-comments-body .comment {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.nyt-comments-body .comment:last-child {
  border-bottom: none;
}

.nyt-comments-body .comment .comment-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nyt-comments-body .comment .comment-author {
  font-weight: 700;
  color: var(--text-primary);
  text-transform: none;
  letter-spacing: 0;
}

.nyt-comments-body .comment .comment-content p {
  margin: 0 0 1rem 0;
  line-height: 1.6;
  color: var(--text-primary);
  font-family: var(--font-body);
}

.nyt-comments-body .comment .comment-content p:last-child {
  margin-bottom: 0;
}

/* Legacy Article Styles */
.article-content {
  max-width: var(--article-max-width);
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.8;
}

.article-content p {
  margin-bottom: var(--spacing-lg);
}

.article-content h2,
.article-content h3 {
  margin-top: var(--spacing-xxl);
  margin-bottom: var(--spacing-md);
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-md) var(--spacing-lg);
  background-color: var(--bg-secondary);
  font-style: italic;
  font-size: 1.2rem;
}

.article-content blockquote p:first-child::first-letter {
  font-size: inherit;
  line-height: inherit;
  float: none;
  margin: 0;
  font-weight: inherit;
}

/* Responsive Adjustments for Article */
@media (max-width: 768px) {
  .nyt-article-header {
    padding: 1rem 0;
    max-width: 100%;
  }
  
  .nyt-headline {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin: 1rem 0 0.75rem;
    line-height: 1.2;
  }
  
  .nyt-subtitle {
    font-size: 1.125rem;
    line-height: 1.5;
  }
  
  .article-meta-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.75rem 0;
    font-size: 0.8125rem;
    max-width: 100%;
  }
  
  .meta-right {
    width: 100%;
    justify-content: flex-start;
  }
  
  .meta-right .share-btn {
    font-size: 0.6875rem;
    padding: 0.375rem 0.75rem;
  }
  
  .nyt-featured-image {
    margin: 1rem -1rem 2rem;
    max-width: calc(100% + 2rem);
  }
  
  .nyt-image-caption {
    padding-left: 0.75rem;
    margin-left: 1rem;
    margin-right: 1rem;
  }
  
  .nyt-article-body {
    padding: 0;
    font-size: 1.125rem;
    max-width: 100%;
  }
  
  .nyt-article-body p:first-child::first-letter {
    font-size: 3rem;
    margin-right: 0.25rem;
  }
  
  .nyt-article-footer {
    padding: 0 1rem;
    max-width: 100%;
  }
  
  .nyt-author-bio {
    flex-direction: column;
    text-align: center;
  }
  
  .nyt-nav-links {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .nav-item:only-child {
    max-width: 100%;
  }
  
  .nav-item.nav-next:only-child {
    justify-self: start;
  }
  
  .nyt-related-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .nyt-related-item {
    flex-direction: column;
  }
  
  .nyt-related-image {
    width: 100%;
    height: 200px;
  }
  
  .nyt-related-section,
  .nyt-comments-full-section {
    padding: 1.5rem 0;
  }
  
  .nyt-full-width-container,
  .nyt-comments-wrapper {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .nyt-headline {
    font-size: 1.75rem;
  }
  
  .nyt-article-body {
    font-size: 1rem;
  }
  
  .publish-info {
    flex-direction: column;
    gap: 0.25rem;
  }
}
