/*
Theme Name: MoviesinEnglish Related Posts
Theme URI: https://moviesinenglish.com/
Author: Generated by ChatGPT
Description: Rebuilt theme. Header with centered logo+title, Menu dropdown, AJAX title-search, 5 cols desktop/2 cols mobile, correct pagination including static homepage support.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: moviesinenglish-new
*/
html,body{height:100%;}
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background:rgba(30, 15, 45, 0.95);
  color:#e6eef8;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none;}
.container{max-width:1250px;margin:0 auto;padding:20px;}

/* Top header */
.top-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  position: relative;
}

.top-header a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  text-decoration: none;
  margin: 0 auto;
  padding: 0 20px;
}

.top-header .site-logo {
  max-width: 60px;
  height: auto;
  display: block;
}

.top-header .site-name {
  font-weight: 700;
  font-size: 60px;
  color: #fff;
  margin: 0;
}

/* Mobile Styles - Hide logo and center text */
@media (max-width: 768px) {
  .top-header a {
    justify-content: center; /* Center content on mobile */
  }
  
  .top-header .site-logo {
    display: none; /* Hide logo on mobile */
  }
  
  .top-header .site-name {
    font-size: 50px;
    text-align: center;
  }
  
  .top-header a {
    padding: 0 20px;
  }
}

/* For very small mobile devices */
@media (max-width: 480px) {
  .top-header .site-name {
    font-size: 24px; /* Adjusted for better mobile readability */
  }
}

/* Main header bar */
.site-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 18px;
  background: linear-gradient(90deg, #8A2BE2, #FF007F, #FF2400);
  border-bottom:1px solid rgba(255,255,255,0.03);
  position:sticky;
  top:0;
  z-index:60;
}
.header-left, .header-center, .header-right { display:flex; align-items:center; gap:10px; }
.menu-btn{background: rgba(40, 20, 60, 0.95);border:1px solid rgba(255,255,255,0.04);padding:12px 20px;font-size: 20px;border-radius:8px;color:#dbe9ff;cursor:pointer;}
.menu-dropdown{position:relative;}
.menu-panel{position:absolute;left:0;top:44px;background:rgba(30, 41, 59, 0.95);min-width:260px;border-radius:8px;padding:10px;border:1px solid rgba(255,255,255,0.03);display:none;z-index:80;}
.menu-panel a{display:block;padding:8px;border-radius:6px;color:#e6eef8;}
.menu-panel a:hover{background:rgba(255,255,255,0.02);}

/* Genres inline in panel */
.menu-genres {
  max-height: 260px;
  overflow: auto;
  border-top: 1px solid rgba(255,255,255,0.03);
  margin-top: 8px;
  padding-top: 8px;
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
}

/* Search */
.search-wrap{position:relative;}
.search-toggle{background:transparent;border:none;color:#dbe9ff;font-size:18px;cursor:pointer;padding:6px;}
.search-input{width:0;opacity:0;transform:scaleX(0);transform-origin:right;border-radius:8px;padding:8px 12px;border:1px solid rgba(255,255,255,0.06);background: rgba(30, 15, 45, 0.95);color:inherit;transition:all .22s ease;}
.search-input.open{width:260px;opacity:1;transform:scaleX(1);}

/* Grid */
.posts-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:18px;margin-top:22px;}
.post-card{background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.01));border-radius:8px;overflow:hidden;box-shadow:0 8px 30px rgba(2,6,23,0.7);transition:transform .18s ease;}
.post-card:hover{transform:translateY(-6px);box-shadow:0 18px 40px rgba(0,0,0,0.6);}
.post-thumb{width:100%;height:0;padding-bottom:140%;background-size:cover;background-position:center;transition:transform .28s ease;}
.post-card:hover .post-thumb{transform:scale(1.03);}
.post-body{padding:12px;}
.post-title {
  font-size: 14px;
  font-weight: 600;
  margin: 6px 0;
  color: #fff;
  line-height: 1.2;
  text-align: center; /* Center align text */
  display: flex; /* For vertical centering */
  align-items: center; /* Vertical middle alignment */
  justify-content: center; /* Horizontal center */
  min-height: 40px; /* Ensure consistent height for alignment */
  flex-wrap: wrap; /* Allow text wrapping */
  word-wrap: break-word; /* Break long words */
  overflow-wrap: break-word; /* Modern word breaking */
}

.post-title a {
  text-align: center;
  width: 100%; /* Make link take full width for proper centering */
  text-decoration: none;
  color: inherit; /* Inherit color from parent */
  display: block; /* Ensure proper centering */
}
.post-meta{font-size:12px;color:#9fb0d6;}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap; /* ✅ Allows wrapping on smaller screens */
  gap: 8px;
  justify-content: center;
  margin: 30px 0;
}

.page-numbers {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: #dbe9ff;
  border: 1px solid rgba(255, 255, 255, 0.03);
}


/* Highlight current page */
.page-numbers.current,
.page-numbers.first,
.page-numbers.last {
  background: #007bff; /* Bright blue or your accent color */
  color: #fff;
  border-color: #007bff;
  font-weight: 600;
  cursor: default;
}

/* Footer */
.site-footer{padding:22px 0;text-align:center;color:#9fb0d6;}

/* Responsive */
@media (max-width:1180px){ .posts-grid{grid-template-columns:repeat(4,1fr);} .site-logo{width:160px;} }
@media (max-width:980px){ .posts-grid{grid-template-columns:repeat(3,1fr);} .menu-panel{min-width:220px;} }
@media (max-width:680px){ .posts-grid{grid-template-columns:repeat(2,1fr);} .search-input.open{width:160px;} .site-header{padding:10px;} .menu-panel{left:0;top:48px;} }
@media (max-width:420px){ .posts-grid{grid-template-columns:repeat(2,1fr);} .site-header{flex-direction:row;align-items:center;} .top-header{padding:12px 0;} }
.single-post .wp-post-image {
  display: none;
}
.post-meta {
  display: none;
}
/* Fix mobile image overflow */
article img,
article iframe,
article video,
article object,
article embed {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Ensure content area doesn't overflow */
article {
    overflow: hidden;
}

/* Specific fix for WordPress content images */
.post-content img {
    max-width: 100%;
    height: auto;
}

.related-posts-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 per row on desktop */
    gap: 15px;
}

.related-post-item {
    background: #1f1b3a;
    border-radius: 6px;
    overflow: hidden;
    text-align: center;
}

.related-post-item a {
    display: block;
    color: #fff;
    text-decoration: none;
}

.related-post-thumb {
    width: 100%;
    height: 180px; /* uniform height */
    background-size: cover;
    background-position: center;
    border-radius: 4px;
}

.related-post-item p {
    margin: 10px 5px;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive grids */
@media screen and (max-width: 1024px) {
    .related-posts-wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .related-posts-wrapper {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 480px) {
    .related-posts-wrapper {
        grid-template-columns: 1fr;
    }
}
#comments {
    margin-top: 40px;
}

.comment-list li {
    margin-bottom: 20px;
}

.comment-form textarea {
    width: 100%;
}
a i {
    margin-right: 6px;
    font-size: 14px;
    vertical-align: middle;
}

