/* Single News Layout Styles */

/* Featured Image styling */
.mobile-flex-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.featured-image-container {
  width: 100%;
  margin-bottom: 40px;
  overflow: hidden;
  position: relative;
  order: 1; /* Featured image above title on desktop */
  max-height: 525px;
}

.content-container {
  order: 2; /* Content below featured image on desktop */
}

.featured-image {
  width: 100%;
  height: 100%;
  max-height: 525px;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Main content styling */
.single-news-content {
  padding-top: 150px;
  margin-top: 0;
}

.single-news-content .entry-header {
  margin-bottom: 30px;
}

.single-news-content .entry-header h1 {
  font-family: "Manus", sans-serif !important;
  margin-bottom: 15px;
  color: #e21e25;
  text-transform: none;
  line-height: 1.2;
  text-align: center;
}

.single-news-content .post-credentials {
  font-family: "Source Sans 3", sans-serif;
  color: #000;
  font-size: 1rem;
  margin-bottom: 20px;
  text-align: center;
}

.single-news-content .entry-content {
  font-family: "Source Sans 3", sans-serif;
  color: #000;
  font-size: 1rem;
  line-height: 1.6;
}

.single-news-content .entry-content img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
}

.single-news-content .entry-content p {
  margin-bottom: 1.2rem;
}

/* Recent Posts Section Styling */
.recent-posts-section {
  margin-top: 70px;
  padding-top: 0;
}

.recent-posts-section h4 {
  font-family: "DIN Condensed", sans-serif;
  font-size: 2rem;
  margin-bottom: 40px;
  color: #000;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
}

/* Use the same recipe-card styling from recipes.css */
.recent-posts-section .recipe-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  background-color: #fff;
  box-shadow: 0 0px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  height: 100%;
  width: 100%;
}

.recent-posts-section .recipe-card h4 {
  font-size: 24px;
  text-transform: capitalize;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0 15px;
  width: 100%;
  text-align: center;
  display: block;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: normal;
}

.recent-posts-section .recipe-card a {
  width: 100%;
  margin: 0;
  text-align: center;
  color: #000;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.recent-posts-section .recipe-card a img {
  width: 100%;
  height: 320px;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

.recent-posts-section .recipe-card a:hover {
  text-decoration: underline;
  color: #e21e25;
}

.recent-posts-section .recipe-card a:hover h4,
.recent-posts-section .recipe-card a:hover p,
.recent-posts-section .recipe-card a:hover .post-date {
  color: #e21e25;
}

.recent-posts-section .recipe-card p {
  padding-left: 20px;
  padding-right: 20px;
  margin-bottom: 20px;
}

.recent-posts-section .recipe-card .post-date {
  font-family: "Source Sans 3", sans-serif;
  font-size: 0.9rem;
  color: #666;
}

/* Archives section styling */
.archives-section {
  margin-top: 80px;
  padding-top: 0;
}

.archives-section h4 {
  font-family: "DIN Condensed", sans-serif;
  font-size: 2rem;
  margin-bottom: 20px;
  color: #000;
  text-transform: uppercase;
  font-weight: 600;
  text-align: center;
}

.archives-links {
  margin: 0 auto;
  max-width: 800px;
  padding: 0 15px;
  line-height: 2;
  text-align: center;
}

.archive-link {
  font-family: "Source Sans 3", sans-serif;
  color: #000;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  padding: 0 5px;
}

.archive-link:hover {
  color: #e21e25;
  text-decoration: underline;
}

.archive-separator {
  color: #000;
  margin: 0 5px;
  font-weight: 300;
}

/* Back to News button */
.back-to-news {
  text-align: center;
}

/* Back to News buttons */
.back-to-news .featured-cta,
.back-to-news-top .featured-cta {
  display: inline-block;
  margin-top: 20px;
}

.back-to-news-top {
  text-align: left;
  margin-bottom: 20px;
}

/* Table styling for single posts */
.single-news-content table {
  width: 100%;
  margin-bottom: 30px;
}
.single-news-content table td,
.single-news-content table th {
  padding: 15px;
  vertical-align: top;
}

.single-news-content table img {
  max-width: 100%;
  height: auto;
}

.single-post .entry-content h4 {
  font-size: 2.5rem;
}

@media (max-width: 599px) {
  .single-post .entry-content h4 {
    font-size: 1.5rem !important;
  }
}

/* Responsive adjustments */
@media (max-width: 991px) {
  /* Make tables stack on mobile */
  .single-news-content table tr {
    display: flex;
    flex-direction: column;
  }

  .single-news-content table td,
  .single-news-content table th {
    display: block;
    width: 100% !important;
  }

  /* Ensure images are full width on mobile */
  .single-news-content table img {
    width: 100%;
    margin-bottom: 15px;
  }

  /* Add spacing between stacked cells */
  .single-news-content table td {
    margin-bottom: 20px;
  }

  /* Archives section adjustments */
  .archives-links {
    line-height: 2.5;
  }

  .archive-separator {
    display: inline-block;
    margin: 0 3px;
  }
}

@media (max-width: 768px) {
  .single-news-content {
    padding-top: 100px;
  }
  
  .back-to-news-top {
    margin-bottom: 15px;
  }
  
  .back-to-news-top .featured-cta {
    font-size: 1.2rem;
    padding: 8px 15px;
  }
  
  /* Keep featured image first on mobile but adjust height */
  .mobile-flex-container {
    display: flex;
    flex-direction: column;
  }

  .featured-image-container {
    order: 1; /* Keep featured image first on mobile */
    margin-bottom: 30px;
    max-height: 400px;
  }

  .content-container {
    order: 2; /* Content below featured image on mobile */
  }

  .featured-image {
    max-height: 400px;
  }

  .single-news-content .entry-header h1 {
    font-size: 2rem;
  }

  /* Recent posts cards on mobile */
  .recent-posts-section .recipe-card a img {
    height: 250px;
    max-height: 250px;
  }

  .recent-posts-section .recipe-card h4 {
    font-size: 20px;
    margin-top: 1rem;
    margin-bottom: 1rem;
    font-weight: normal;
  }

  /* Archives section on mobile */
  .archives-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  .archive-link {
    margin: 5px;
  }

  .archive-separator {
    display: none; /* Hide separators on mobile */
  }

  /* Improve readability on mobile */
  .single-news-content .entry-content {
    font-size: 1.1rem;
    line-height: 1.7;
  }
}

@media (max-width: 768px) {
  .single-post h1 {
    font-size: 2.5rem !important;
    line-height: 3rem !important;
  }
}
