/*
Theme Name: My Custom Theme
Theme URI: https://example.com/
Author: Your Name
Author URI: https://example.com/
Description: A basic custom WordPress theme.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom, blog, responsive
Text Domain: my-custom-theme
*/

/* Base */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* ----------------- HEADER ----------------- */
.site-header {
    
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.site-branding .site-title {
    margin: 0;
    font-size: 2em;
    color: red;
    font-weight: bold;
}

.site-branding .site-title a {
    text-decoration: none;
    color: red;
}



/* ----------------- CONTENT WRAPPER ----------------- */
.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.site-main article {
    margin-bottom: 1px;
    padding-bottom: 1px;
    border-bottom: 1px solid #ddd;
}

.site-main article:last-of-type {
    border-bottom: none;
}

.entry-header {
    text-align: center;
    margin-bottom: 20px;
}

.entry-content,
.entry-summary {
    line-height: 1.6;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
}

/* ----------------- FRONT PAGE GRID ----------------- */
.posts-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
    padding: 0 10px;
}

.grid-post-item {
    border: 1px solid #eaeaea;
    padding: 15px;
    background: #fff;
    border-radius: 10px;
    transition: all 0.3s ease-in-out;
}

.grid-post-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
}

.post-thumbnail-wrapper img {
       width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.grid-post-item:hover .post-thumbnail-wrapper img {
    transform: scale(1.05);
}

.entry-title {
    font-size: 18px;
    margin: 10px 0;
    line-height: 1.4;
}

.entry-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.entry-title a:hover {
    color: #0073aa;
}

.entry-summary {
    font-size: 14px;
    color: #555;
    margin-top: 8px;
}

/* Pagination for Front Page */
.pagination-wrapper {
    margin-top: 30px;
    text-align: center;
}

.pagination-wrapper .page-numbers {
    display: inline-block;
    margin: 0 5px;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease-in-out;
}

.pagination-wrapper .page-numbers:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.pagination-wrapper .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
    font-weight: bold;
}

/* ----------------- SINGLE POST PAGE ----------------- */
/* ----------------- SINGLE POST RESPONSIVE ----------------- */
.single .site-main {
    max-width: 800px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

/* Make sure post content images scale */
.single .entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

/* Responsive text sizing */
.single .entry-title {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 10px;
}

.single .entry-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 18px;
}

/* ----------------- MOBILE FIXES ----------------- */
@media (max-width: 768px) {
    .single .site-main {
        max-width: 100%;   /* stretch full width */
        margin: 0;
        border-radius: 0;  /* remove rounded corners for clean mobile look */
        padding: 15px;
        box-shadow: none;  /* remove heavy shadow on mobile */
    }

    .single .entry-title {
        font-size: 22px;
    }

    .single .entry-content p {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .single .site-main {
        padding: 12px;
    }

    .single .entry-title {
        font-size: 20px;
    }

    .single .entry-content p {
        font-size: 14px;
    }
}


.single .entry-header {
    margin-bottom: 1px;
    text-align: left;
}

.single .entry-title {
    font-size: 28px;
    line-height: 1.3;
    margin-bottom: 10px;
    color: #111;
}

.single .entry-meta {
    font-size: 14px;
    color: #777;
    margin-bottom: 20px;
}

.single .entry-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 18px;
}

.single .entry-content h2,
.single .entry-content h3 {
    margin: 25px 0 15px;
    font-weight: bold;
    color: #222;
}

.single .entry-content blockquote {
    border-left: 4px solid #0073aa;
    padding-left: 15px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
    background: #f9f9f9;
}

/* ----------------- COMMENTS ----------------- */
#comments {
    padding: 20px;
    background-color: #f9f9f9;
    border-top: 1px solid #ddd;
    margin-top: 40px;
}

#respond {
    padding: 20px;
    background-color: #ffffff;
    border: 1px solid #eee;
}

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

.comment-list li.comment {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    overflow: hidden;
}

.comment-author.vcard img {
    max-width: 50px;
    height: auto;
    border-radius: 50%;
    float: left;
    margin-right: 15px;
}

.comment-meta,
.comment-content {
    overflow: hidden;
    display: block;
}

#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

.comment-form-comment::after {
    content: "";
    display: table;
    clear: both;
}

#commentform #submit {
    width: auto;
    padding: 10px 20px;
    border: none;
    background-color: #333;
    color: #fff;
    cursor: pointer;
    border-radius: 3px;
    display: block;
    margin-top: 15px;
}

/* Related Posts Section Full Width */
.related-posts {

    width: 100%;
    padding: 0px 20px;
    background: #fafafa;
    border-top: 2px solid #eee;
    text-align: center;
}

.related-posts h2 {
    font-size: 1.8em;
    margin: 10px;
    font-weight: bold;
}

/* 4-column grid */
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    width: 100%;
    max-width: 1400px; /* keeps it centered nicely on big screens */
    margin: 0 auto;
}

.related-post-item {
    text-align: center;
    border: 1px solid #ddd;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-post-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.related-post-item img {
    width: 100%;
    height: 170px;        /* fixed height */
    object-fit: cover;    /* crops image to fill box */
    border-radius: 6px;
    margin-bottom: 12px;
    display: block;
}
.related-post-item h3 {
    font-size: 1em;
    margin: 0;
    color: #333;
}

.archive-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.archive-header {
    text-align: center;
    margin-bottom: 30px;
}

.archive-title {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.archive-description {
    font-size: 1.1em;
    color: #555;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.archive-post {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.archive-post:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}

.archive-post img {
    width: 100%;
    border-radius: 6px 6px 0 0;
}

.archive-post h2 {
    font-size: 1em;
    padding: 10px;
    margin: 0;
    color: #333;
}

/* Responsive */
@media (max-width: 1024px) {
    .archive-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .archive-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .archive-grid { grid-template-columns: 1fr; }
}


/* Hide toggle on desktop */
.menu-toggle {
    display: none;
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Search form inside menu */
.menu-search {
    margin-top: 15px;
}
.menu-search input[type="search"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Mobile styles */


/* View All Posts button */
.related-view-all {
    margin-top: 30px;
}

.view-all-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0073aa;
    color: #fff;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.view-all-btn:hover {
    background-color: #005f87;
}

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

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

@media (max-width: 480px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .view-all-btn {
        display: block;
        
    }
}

/* ----------------- FOOTER ----------------- */
.site-footer {
    background-color: #222;
    color: #ddd;
    text-align: center;
    padding: 30px 20px;
    margin-top: 50px;
}

.site-footer a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: #fff;
}

.site-footer .footer-widgets {
    margin-bottom: 20px;
}

.site-footer p {
    margin: 5px 0;
    font-size: 14px;
}



/* ----------------- RESPONSIVE ----------------- */
@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        flex-direction: column;
        text-align: center;
    }

   
    
}
/* ----------------- ARCHIVE PAGINATION ----------------- */
.archive-pagination {
    grid-column: 1 / -1;           /* spans entire grid width if used inside grid */
    width: 100%;
    margin: 40px auto 0;
    padding: 20px 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Page numbers */
.archive-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Hover */
.archive-pagination .page-numbers:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Active/current */
.archive-pagination .page-numbers.current {
    background: #333;
    color: #fff;
    border-color: #333;
    cursor: default;
}

/* Prev/Next styles */
.archive-pagination .prev,
.archive-pagination .next {
    font-weight: bold;
    padding: 0 18px;
}

/* ----------------- RESPONSIVE ----------------- */
@media (max-width: 768px) {
    .archive-pagination {
        padding: 15px 8px;
        gap: 8px;
    }
    .archive-pagination .page-numbers {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .archive-pagination {
        gap: 6px;
    }
    .archive-pagination .page-numbers {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }
}


.pagination-wrapper {
    grid-column: 1 / -1;           /* spans entire grid width if used inside grid */
    width: 100%;
    margin: 40px auto 0;
    padding: 20px 10px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

/* Page numbers */
.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

/* Hover */
.pagination-wrapper .page-numbers:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Active/current */
.pagination-wrapper .page-numbers.current {
    background: #333;
    color: #fff;
    border-color: #333;
    cursor: default;
}

/* Prev/Next styles */
.pagination-wrapper .prev,
.pagination-wrapper .next {
    font-weight: bold;
    padding: 0 18px;
}

/* ----------------- RESPONSIVE ----------------- */
@media (max-width: 768px) {
    .pagination-wrapper {
        padding: 15px 8px;
        gap: 8px;
    }
    .pagination-wrapper .page-numbers {
        min-width: 38px;
        height: 38px;
        padding: 0 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .pagination-wrapper {
        gap: 6px;
    }
    .pagination-wrapper .page-numbers {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }
}
/* ---------- PREVENT HORIZONTAL SCROLL ---------- */
/* 1) Global box-sizing & hide accidental overflow */
*,
*::before,
*::after { box-sizing: border-box; }

/* 2) Prevent page-level horizontal scroll (safe fallback) 
html, body {
  overflow-x: hidden;
}
*/
/* 3) Ensure wide elements don't break layout */
img, iframe, embed, object, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 4) Fix elements that used 100vw + negative margins (full-width bars) */
/* This keeps the bar full-bleed while not producing horizontal scroll. */
.pagination-wrapper,
.archive-pagination {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;

  /* add inner padding so content doesn't touch edges on small screens */
  padding-left: calc((100vw - 100%) / 2);
  padding-right: calc((100vw - 100%) / 2);
  box-sizing: border-box;
}



/* 6) Prevent very long words/urls from forcing horizontal scroll */
p, li, .entry-content, .archive-post, .grid-post-item, .related-post-item {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 7) Ensure container padding doesn't add extra width on mobile */
@media (max-width: 480px) {
  .content-wrapper,
  .archive-container,
  .posts-grid-container,
  .related-posts {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* 8) Safety: if any plugin or element still causes overflow, hide it (diagnostic) */
/* Remove this after debugging if you want to find the cause rather than hide it */
html.fix-overflow body.fix-overflow {
  overflow-x: hidden !important;
}
.custom-search-form {
  display: flex;
  align-items: center;
  border: 1px solid #ccc;
  border-radius: 50px;
  overflow: hidden;
  width: 100%;
  max-width: 500px; /* adjust size */
  margin: 20px auto;
}

.custom-search-input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  outline: none;
  font-size: 16px;
  color: #333;
  background: transparent;
}

.custom-search-input::placeholder {
  color: #777;
  font-style: italic;
}

.custom-search-button {
  background: #222;
  border: none;
  padding: 12px 18px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
}

.custom-search-button i {
  color: #fff;
  font-size: 16px;
}

/* Logo */
.site-branding a {
  font-size: 22px;
  font-weight: 700;
  color: #0d6efd;
  text-decoration: none;
}

.header-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between; /* logo left, nav right */
}
/* Navigation should not break line */
.main-navigation {
  margin-left: auto; /* pushes it to the right */
  
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
}

.main-navigation ul li a {
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  color: #333;
  padding: 10px 15px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item a {
  background: #0d6efd;
  color: #fff;
}

/* Dropdown */
.main-navigation ul li {
  position: relative;
}

.main-navigation ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 200px;
  padding: 10px 0;
  z-index: 1000;
}

.main-navigation ul li:hover > ul {
  display: block;
}

.main-navigation ul li ul li a {
  padding: 10px 15px;
  font-size: 15px;
  color: #444;
}

/* Hamburger */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #333;
}

/* Responsive */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-navigation {
    display: none;
    width: 100%;
  }

  .main-navigation.active {
    display: block;
    background: #fff;
    padding: 15px 0;
  }

  .main-navigation ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .main-navigation ul li a {
    width: 100%;
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
  }

  .main-navigation ul li ul {
    position: static;
    box-shadow: none;
    border: none;
  }

  .main-navigation ul li ul li a {
    padding-left: 40px;
  }
}

/* ----------------- TAG PILL BUTTONS WITH COMMAS BETWEEN ----------------- */
.entry-tags {
    margin-top: 12px;
    text-align: center;
}

.entry-tags .tags-label {
    display: block;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 6px;
    color: #444;
}

.entry-tags .tags-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Pill-style buttons */
.entry-tags .tag-link {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #0073aa;
    background: #eaf6ff;
    border: 1px solid #cce4f6;
    border-radius: 50px; /* pill */
    text-decoration: none;
    transition: all 0.25s ease;
    line-height: 1.4;
    position: relative;
}

/* Add comma *after each button* (outside the pill) */
.entry-tags .tag-link::after {
    content: ",";
    margin-left: 4px;
    color: #666;
}

/* Remove comma from the last tag */
.entry-tags .tag-link:last-child::after {
    content: "";
}

/* Hover effect */
.entry-tags .tag-link:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

