/* =====================================================================
   FlyYatra Holidays - Blog styles
   ---------------------------------------------------------------------
   Loaded AFTER stylesheets/index.css and adds only new .blog-* classes.
   It reuses the site's existing variables (--blue #003264, --red #8B0000,
   --white #f8f9fa) and the Comic Neue font, so the blog looks like it has
   always been part of the site. Nothing here overrides existing rules.
   ===================================================================== */

/* Fallbacks in case index.css ever loads after this file */
:root {
  --blue: #003264;
  --black: #202124;
  --white: #f8f9fa;
  --red: #8B0000;
  --blog-radius: 16px;
  --blog-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
  --blog-shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.18);
}

/* ---------------------------------------------------------------------
   HERO / PAGE BANNER
   Uses the same red-to-blue gradient as the site's destinations section.
   --------------------------------------------------------------------- */
.blog-hero {
  background: linear-gradient(to right, #b80101, #003366);
  padding: 60px 20px 50px;
  text-align: center;
  color: var(--white);
}

.blog-hero h1 {
  font-size: 2.4rem;
  color: var(--white);
  margin-bottom: 14px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.35);
  line-height: 1.25;
}

.blog-hero h1 span {
  color: #ffd8d8;
}

.blog-hero p {
  font-size: 1.1rem;
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.7;
  color: #f0f0f0;
}

/* Breadcrumbs */
.blog-breadcrumb {
  max-width: 1300px;
  margin: 0 auto;
  padding: 16px 20px 0;
  font-size: 0.95rem;
  color: var(--blue);
}

.blog-breadcrumb a {
  color: var(--blue);
  text-decoration: none;
  font-weight: bold;
}

.blog-breadcrumb a:hover {
  text-decoration: underline;
}

.blog-breadcrumb span {
  color: #666;
}

/* ---------------------------------------------------------------------
   LAYOUT
   --------------------------------------------------------------------- */
.blog-wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 20px 70px;
}

.blog-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.blog-main {
  flex: 1 1 auto;
  min-width: 0;
}

.blog-sidebar {
  flex: 0 0 320px;
  position: sticky;
  top: 100px;
}

/* ---------------------------------------------------------------------
   SEARCH + FILTER BAR
   --------------------------------------------------------------------- */
.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.blog-search {
  display: flex;
  flex: 1 1 320px;
  max-width: 480px;
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: 30px;
  overflow: hidden;
}

.blog-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 11px 18px;
  font-family: 'Comic Neue', cursive;
  font-size: 1rem;
  color: var(--black);
  background: transparent;
  min-width: 0;
}

.blog-search button {
  background: var(--blue);
  color: #fff;
  border: none;
  padding: 0 22px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.blog-search button:hover {
  background: var(--red);
}

.blog-count {
  color: #555;
  font-size: 0.98rem;
}

/* Category pills */
.blog-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.blog-categories a {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 30px;
  background: #fff;
  color: var(--blue);
  border: 2px solid var(--blue);
  text-decoration: none;
  font-weight: bold;
  font-size: 0.92rem;
  transition: all 0.25s ease;
}

.blog-categories a:hover {
  background: var(--blue);
  color: #fff;
}

.blog-categories a.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ---------------------------------------------------------------------
   POST CARD GRID
   --------------------------------------------------------------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 30px;
}

.blog-card {
  background: #fff;
  border-radius: var(--blog-radius);
  overflow: hidden;
  box-shadow: var(--blog-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--blog-shadow-hover);
}

.blog-card-img {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8e8e8;
}

/*
 * Older Android/iOS browsers ignore aspect-ratio, which left this box with
 * zero height and made the card image disappear on phones. The padding
 * trick reserves the same 16/9 space everywhere.
 */
@supports not (aspect-ratio: 16 / 9) {
  .blog-card-img {
    height: 0;
    padding-top: 56.25%;
  }
}

/*
 * The <img> carries width="700" height="394" so the browser can reserve
 * space before it downloads. Pinning it to the box means those attributes
 * can never become the rendered size, so the picture cannot blow up past
 * the card once it loads.
 */
.blog-card-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-img img {
  transform: scale(1.06);
}

/*
 * Shown only when the post's featured image is missing from /uploads/blog.
 * "contain" keeps the logo at a sane size instead of cropping it to a
 * full-bleed close-up.
 */
.blog-card-img img.is-fallback {
  object-fit: contain;
  padding: 14%;
  background: #f4f4f4;
}

.blog-card:hover .blog-card-img img.is-fallback {
  transform: none;
}

.blog-card-tag {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  background: var(--red);
  color: #fff;
  font-size: 0.78rem;
  font-weight: bold;
  padding: 5px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-body h2,
.blog-card-body h3 {
  font-size: 1.22rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.blog-card-body h2 a,
.blog-card-body h3 a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.25s ease;
}

.blog-card-body h2 a:hover,
.blog-card-body h3 a:hover {
  color: var(--red);
}

.blog-card-body p {
  color: #4a4a4a;
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 16px;
  flex: 1;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #777;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.blog-meta i {
  color: var(--red);
  margin-right: 5px;
}

.blog-readmore {
  align-self: flex-start;
  background: var(--red);
  color: #fff;
  padding: 8px 18px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.95rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

.blog-readmore:hover {
  background: var(--blue);
  transform: translateY(-2px);
}

/* Empty state */
.blog-empty {
  background: #fff;
  border-radius: var(--blog-radius);
  padding: 60px 30px;
  text-align: center;
  box-shadow: var(--blog-shadow);
}

.blog-empty i {
  font-size: 3rem;
  color: var(--blue);
  margin-bottom: 18px;
  display: block;
}

.blog-empty h2 {
  color: var(--blue);
  margin-bottom: 10px;
  font-size: 1.4rem;
}

.blog-empty p {
  color: #666;
  margin-bottom: 22px;
}

/* ---------------------------------------------------------------------
   PAGINATION
   --------------------------------------------------------------------- */
.blog-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 45px;
}

.blog-pagination a,
.blog-pagination span {
  min-width: 42px;
  padding: 9px 14px;
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  background: #fff;
  color: var(--blue);
  border: 2px solid var(--blue);
  transition: all 0.25s ease;
}

.blog-pagination a:hover {
  background: var(--blue);
  color: #fff;
}

.blog-pagination .current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.blog-pagination .disabled {
  opacity: 0.4;
  border-color: #bbb;
  color: #999;
}

/* ---------------------------------------------------------------------
   SIDEBAR
   --------------------------------------------------------------------- */
.sidebar-box {
  background: #fff;
  border-radius: var(--blog-radius);
  box-shadow: var(--blog-shadow);
  padding: 24px;
  margin-bottom: 26px;
}

.sidebar-box h3 {
  color: var(--blue);
  font-size: 1.15rem;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--red);
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-list li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.sidebar-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-list img {
  width: 74px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-list a {
  color: var(--blue);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: bold;
}

.sidebar-list a:hover {
  color: var(--red);
}

.sidebar-list small {
  display: block;
  color: #888;
  font-weight: normal;
  margin-top: 4px;
  font-size: 0.8rem;
}

/* CTA box in the sidebar */
.sidebar-cta {
  background: linear-gradient(135deg, #8B0000, #003264);
  color: #fff;
  text-align: center;
}

.sidebar-cta h3 {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.4);
}

.sidebar-cta p {
  font-size: 0.98rem;
  line-height: 1.65;
  margin-bottom: 18px;
}

.sidebar-cta .btn {
  font-size: 1rem;
  display: inline-block;
  background: #fff;
  color: var(--red);
}

.sidebar-cta .btn:hover {
  background: var(--white);
  color: var(--blue);
}

/* ---------------------------------------------------------------------
   SINGLE POST
   --------------------------------------------------------------------- */
.post-header {
  background: linear-gradient(to right, #b80101, #003366);
  padding: 50px 20px 45px;
  color: #fff;
  text-align: center;
}

.post-header h1 {
  font-size: 2.2rem;
  line-height: 1.3;
  max-width: 950px;
  margin: 0 auto 18px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.35);
}

.post-header .blog-meta {
  justify-content: center;
  color: #f0e6e6;
  font-size: 0.95rem;
  margin-bottom: 0;
}

.post-header .blog-meta i {
  color: #ffd8d8;
}

.post-featured {
  max-width: 1000px;
  margin: -35px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

/*
 * The <img> carries width="1600" height="900" so the browser can reserve
 * space, but without height:auto that 900 stays as the rendered height and
 * the banner turns into a very tall stretched block on phones. Locking the
 * box to 16/9 and cropping with object-fit keeps it correct at every width,
 * whatever shape the uploaded image happens to be.
 */
.post-featured img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--blog-radius);
  box-shadow: var(--blog-shadow-hover);
  display: block;
}

.post-article {
  background: #fff;
  border-radius: var(--blog-radius);
  box-shadow: var(--blog-shadow);
  padding: 38px 40px;
}

.post-lead {
  font-size: 1.12rem;
  line-height: 1.75;
  color: var(--blue);
  font-weight: bold;
  padding: 18px 22px;
  border-left: 5px solid var(--red);
  background: #f7f7f9;
  border-radius: 0 10px 10px 0;
  margin-bottom: 30px;
}

/* Rich text from the editor */
.post-content {
  color: #2f2f2f;
  font-size: 1.05rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--blue);
  margin: 34px 0 14px;
  line-height: 1.35;
}

.post-content h2 {
  font-size: 1.65rem;
  padding-bottom: 8px;
  border-bottom: 3px solid rgba(139, 0, 0, 0.2);
}

.post-content h3 { font-size: 1.35rem; }
.post-content h4 { font-size: 1.15rem; }

.post-content p {
  margin-bottom: 18px;
}

.post-content a {
  color: var(--red);
  font-weight: bold;
  text-decoration: underline;
}

.post-content a:hover {
  color: var(--blue);
}

.post-content ul,
.post-content ol {
  margin: 0 0 20px 24px;
}

.post-content li {
  margin-bottom: 9px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 22px 0;
  display: block;
  box-shadow: var(--blog-shadow);
}

.post-content figure {
  margin: 24px 0;
}

.post-content figcaption {
  text-align: center;
  color: #777;
  font-size: 0.9rem;
  margin-top: 8px;
}

.post-content blockquote {
  margin: 24px 0;
  padding: 18px 24px;
  background: #f7f7f9;
  border-left: 5px solid var(--blue);
  border-radius: 0 10px 10px 0;
  color: #444;
  font-style: italic;
}

.post-content pre {
  background: #1e1e2e;
  color: #f4f4f4;
  padding: 16px 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.post-content code {
  font-family: Consolas, Monaco, monospace;
  font-size: 0.92em;
}

/* Tables inside posts must never break the page width on mobile */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.post-content th,
.post-content td {
  border: 1px solid #ddd;
  padding: 11px 14px;
  text-align: left;
}

.post-content th {
  background: var(--blue);
  color: #fff;
}

.post-content tr:nth-child(even) td {
  background: #f7f7f9;
}

/* Keywords / tags under the article */
.post-tags {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 2px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.post-tags strong {
  color: var(--blue);
  margin-right: 4px;
}

.post-tags span {
  background: #f0f0f4;
  color: #555;
  padding: 5px 13px;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* Share row */
.post-share {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 2px solid #eee;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.post-share strong {
  color: var(--blue);
}

.post-share a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.3s ease, transform 0.3s ease;
}

.post-share a:hover {
  background: var(--red);
  transform: translateY(-3px);
}

/* Enquiry banner at the end of a post */
.post-cta {
  margin-top: 36px;
  background: linear-gradient(to right, #b80101, #003366);
  color: #fff;
  border-radius: var(--blog-radius);
  padding: 34px 30px;
  text-align: center;
}

.post-cta h2 {
  color: #fff;
  font-size: 1.5rem;
  margin-bottom: 10px;
  border: none;
}

.post-cta p {
  margin-bottom: 20px;
  font-size: 1.02rem;
}

.post-cta .btn {
  background: #fff;
  color: var(--red);
}

.post-cta .btn:hover {
  background: var(--white);
  color: var(--blue);
}

/* Related posts */
.related-posts {
  margin-top: 55px;
}

.related-posts h2 {
  color: var(--blue);
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 28px;
}

/* ---------------------------------------------------------------------
   "LATEST BLOGS" WIDGET (embeddable on existing .html pages)
   --------------------------------------------------------------------- */
.latest-blogs-section {
  padding: 70px 20px;
  background: #f4f4f4;
}

.latest-blogs-section .section-head {
  text-align: center;
  margin-bottom: 40px;
}

.latest-blogs-section .section-head h2 {
  font-size: 1.9rem;
  color: var(--blue);
  margin-bottom: 10px;
}

.latest-blogs-section .section-head p {
  color: #555;
  font-size: 1.05rem;
}

.latest-blogs-section .blog-grid {
  max-width: 1300px;
  margin: 0 auto;
}

.latest-blogs-more {
  text-align: center;
  margin-top: 36px;
}

/* ---------------------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .blog-layout {
    flex-direction: column;
  }

  .blog-sidebar {
    flex: 1 1 100%;
    width: 100%;
    position: static;
  }
}

@media (max-width: 768px) {
  .blog-hero {
    padding: 42px 18px 36px;
  }

  .blog-hero h1 {
    font-size: 1.75rem;
  }

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

  .post-header h1 {
    font-size: 1.6rem;
  }

  .post-article {
    padding: 26px 20px;
  }

  .post-content {
    font-size: 1rem;
  }

  .post-content h2 {
    font-size: 1.35rem;
  }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .blog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  /*
   * The toolbar turns into a column here, which makes the flex main axis
   * vertical - so the "flex: 1 1 320px" set for desktop was being read as a
   * 320px TALL search box. Reset it so the bar keeps its natural height.
   */
  .blog-search {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  .blog-count {
    margin: 0;
  }

  /* Long post titles must wrap instead of pushing the page sideways */
  .blog-breadcrumb {
    line-height: 1.55;
    overflow-wrap: break-word;
  }

  .post-featured {
    margin-top: -22px;
  }
}

@media (max-width: 480px) {
  .blog-wrap {
    padding: 28px 14px 50px;
  }

  .post-article {
    padding: 22px 16px;
    border-radius: 12px;
  }

  .post-lead {
    font-size: 1rem;
    padding: 14px 16px;
  }
}
