/*
Theme Name:     Twenty Twenty-Five Child
Theme URI:      https://sysguides.com
Description:    Child theme for Twenty Twenty-Five
Author:         Madhu Desai
Author URI:     https://sysguides.com
Template:       twentytwentyfive
Version:        1.0.33
*/

/* ==========  HEADER SEARCH COMPONENT  ========== */
.header-search {
  position: relative;
  display: inline-block;
}

/* Search toggle button */
#search-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #64748b;
}

#search-toggle:hover {
  background-color: #f1f5f9;
  color: #334155;
}

#search-toggle:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Search form container */
#search-form {
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%) translateX(-12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  padding: 0;
  z-index: 1000;
  min-width: 280px;
}

/* Active state */
.header-search.active #search-form {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(-50%) translateX(-12px) scale(1);
}

/* Search input wrapper */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

/* Search input */
#search-form input[type="search"] {
  width: 100%;
  padding: 10px 16px;
  padding-right: 44px;
  font-size: 15px;
  line-height: 1.4;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  transition: all 0.2s ease;
  outline: none;
  height: 40px;
  box-sizing: border-box;
}

/* Hide the default browser clear button */
#search-form input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

#search-form input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

#search-form input[type="search"]:focus {
  border-color: #e5e7eb;
  box-shadow: none;
}

#search-form input[type="search"]::placeholder {
  color: #9ca3af;
}

/* Clear button */
#search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  color: #6b7280;
  transition: all 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
}

#search-clear:hover {
  background-color: #f3f4f6;
  color: #374151;
}

#search-clear:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

#search-clear.visible {
  display: flex;
}

/* Responsive design */
@media (max-width: 640px) {
  #search-form {
    min-width: 240px;
    right: 50px;
    transform: translateY(-50%);
  }

  .header-search.active #search-form {
    transform: translateY(-50%) scale(1);
  }
}

@media (max-width: 480px) {
  #search-form {
    min-width: 200px;
    right: 50px;
  }
}

/* Animation enhancements */
@media (prefers-reduced-motion: no-preference) {
  #search-form {
    transform: translateY(-50%) translateX(-12px) scale(0.95);
  }

  .header-search.active #search-form {
    animation: searchSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }

  /* Mobile animation override */
  @media (max-width: 640px) {
    #search-form {
      transform: translateY(-50%) scale(0.95);
    }

    .header-search.active #search-form {
      animation: searchSlideInMobile 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    }
  }
}

@keyframes searchSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) translateX(-12px) scale(1);
  }
}

@keyframes searchSlideInMobile {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}


/** ==========  MOBILE MENU TWEAKS FOR ≤640P  ========== **/
@media screen and (max-width: 640px) {
  /* 1. Set font size */
  .wp-block-navigation__responsive-container-content ul li,
  .wp-block-navigation__responsive-container-content ul li a {
    font-size: 17px !important;
  }

  /* 2. Left-align menu */
  .wp-block-navigation__responsive-dialog,
  .wp-block-navigation__responsive-container-content,
  .wp-block-navigation__container {
    text-align: left !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }

  /* 3. Full-width structure */
  .wp-block-navigation__responsive-container-content ul,
  .wp-block-navigation__responsive-container-content ul li,
  .wp-block-navigation__responsive-container-content ul li a {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* 4. Uniform spacing and divider */
  .wp-block-navigation__responsive-container-content ul li {
    border-bottom: 1px solid #ddd;
    padding: 0;
    margin: 0;
    border-right: none !important;
  }

  .wp-block-navigation__responsive-container-content ul li a {
    padding: 12px 16px !important;
    border-radius: 0; /* removed */
  }

  /* 5. Remove divider from last item */
  .wp-block-navigation__responsive-container-content ul li:last-child {
    border-bottom: none;
  }

  /* 6. Clean focus/active styles without background or border */
  .wp-block-navigation__responsive-container-content ul li a:focus,
  .wp-block-navigation__responsive-container-content ul li a:active,
  .wp-block-navigation__responsive-container-content ul li a:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 12px 16px !important;
    color: inherit !important;
    background-color: transparent !important;
  }
}


/** ==========  CENTER FOOTER CONTENT ON MOBILE  ========== **/
@media (max-width: 768px) {
    .wp-block-group.has-accent-3-background-color.is-content-justification-space-between {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1rem;
    }

    .wp-block-group.has-accent-3-background-color.is-content-justification-space-between p {
        margin-bottom: 0;
    }

    .wp-block-group.has-accent-3-background-color.is-content-justification-space-between .wp-block-navigation {
        justify-content: center !important;
    }
}


/** ==========  HOME SCREEN SAME FONT SIZE ON MOBILE  ========== **/
/* Keep font sizes consistent across all screens */
.wp-block-post-template .wp-block-post-title {
  font-size: 24px !important;
  line-height: 1.3 !important;
}

.wp-block-post-excerpt {
  font-size: 16px !important;
  line-height: 1.5 !important;
}

/* Force single-column layout on small screens (max-width 768px) */
@media (max-width: 768px) {
  .wp-block-query .wp-block-post-template {
    display: flex !important;
    flex-direction: column !important;
  }

  .wp-block-post {
    width: 100% !important;
  }
}


/** ==========  PAGINATION  ========== **/
/* General layout */
.wp-block-query-pagination {
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

/* Page numbers wrapper */
.wp-block-query-pagination-numbers {
  display: flex;
  gap: 0.5rem;
}

/* Style individual page numbers */
.wp-block-query-pagination-numbers .page-numbers {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  text-decoration: none;
  color: #1A1A1A;
  background-color: #F7F9FB;
  transition: all 0.2s ease;
}

/* Hover effect */
.wp-block-query-pagination-numbers .page-numbers:hover {
  border-color: #2563EB;
  background-color: #E6F0FF; /* soft hover feel */
  color: #2563EB;
}

/* Current page style */
.wp-block-query-pagination-numbers .page-numbers.current {
  font-weight: bold;
  background-color: #3B82F6;
  color: #FFFFFF;
  border-color: #3B82F6;
  pointer-events: none;
}

/* Next/Previous links */
.wp-block-query-pagination-next,
.wp-block-query-pagination-previous {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border: 1px solid #E5E7EB;
  border-radius: 6px;
  background-color: #F7F9FB;
  color: #1A1A1A;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Hover effect for next/prev */
.wp-block-query-pagination-next:hover,
.wp-block-query-pagination-previous:hover {
  border-color: #2563EB;
  background-color: #E6F0FF;
  color: #2563EB;
}


/** ==========  CATEGORY HEADING STYLES  ========== **/

/* Target the specific category heading */
.wp-block-query-title {
    text-align: center !important;
    font-size: 36px !important;
    font-style: normal !important;
}

/* Ensure the span inside also inherits the styling */
.wp-block-query-title span {
    font-size: inherit !important;
}

/* Tablet and mobile styling */
@media screen and (max-width: 768px) {
    .wp-block-query-title {
        text-align: center !important;
        font-size: 30px !important;
    }
}

@media screen and (max-width: 480px) {
    .wp-block-query-title {
        text-align: center !important;
        font-size: 30px !important;
    }
}


/** ==========  SEARCH BOX COMBO WITH TEXT FIELD AND BUTTON RESIZE  ========== **/
div[class*="wp-block-search"] input.wp-block-search__input {
  height: 50px !important;
  border-radius: 5px !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  box-sizing: border-box;
  border: 1px solid #ccc !important; /* light gray border */
}

/* Optional: You can also use a variable from your theme like below */
 /* border: 1px solid var(--wp--preset--color--neutral-300) !important; */

div[class*="wp-block-search"] button.wp-block-search__button {
  height: 50px !important;
  border-radius: 5px !important;
  padding: 0 1.2rem !important;
  font-size: 1rem !important;
  line-height: 1;
  box-sizing: border-box;
}


/** ==========  SCOPED LINK STYLING FOR THE POST TITLE SECTION  ========== **/
.post-title-section .wp-block-post-terms a,
.post-title-section .wp-block-post-author__name a,
.post-title-section .wp-block-post-comments-link a {
  text-decoration: none;
}

.post-title-section .wp-block-post-terms a:hover,
.post-title-section .wp-block-post-author__name a:hover,
.post-title-section .wp-block-post-comments-link a:hover {
  text-decoration: underline;
}


/** ==========  SimpleTOC – CUSTOM STYLING   ========== **/
/* 1. Add space between heading and list */
.wp-block-simpletoc > h2,
.wp-block-simpletoc > h3,
.wp-block-simpletoc > h4 {
  margin-bottom: 0.75em;
}

/* 2. Remove bullets from TOC list */
ul.simpletoc-list,
ul.simpletoc-list ul {
  list-style: none;
  margin-left: 0;
  padding-left: 1.25em; /* Keep natural indentation */
}

/* 3. Remove underline by default, show on hover */
.simpletoc-list a {
  text-decoration: none;
}
.simpletoc-list a:hover {
  text-decoration: underline;
}


/** ==========  INLINE CODE STYLING (HEADINGS, LISTS, QUOTES)  ========== **/
li code,
blockquote code,
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
  font-family: "Fira Code", monospace;
  font-size: 17px;
}

p code {
  font-family: "Fira Code", monospace;
  font-size: 17px;
  background-color: #F5F5F5;  /* Palette: code-bg */
  border: 1px solid #E5E7EB;  /* Palette: accent-3 */
  border-radius: 4px;
  padding: 0 4px;
  text-decoration: none;
}

p kbd {
  font-family: "Fira Code", monospace;
  font-size: 17px;
}


/** ==========  CODE BLOCK: PREVENT WRAPPING AND ENABLE HORIZONTAL SCROLL  ========== **/
.wp-block-code {
  overflow-x: auto;
}

.wp-block-code code {
  white-space: pre;
  word-wrap: normal;
}


/** ==========  CODE BLOCK: PALETTE COLORS  ========== **/
/* Black Color */
.has-inline-color.has-custom-black-color,
.has-inline-color.has-custom-1-color {
  color: #000000;
}
/* Terminal Color */
.has-inline-color.has-custom-terminal-color,
.has-inline-color.has-custom-2-color {
  color: #1A1A1A;
}
/* Output Color */
.has-inline-color.has-custom-output-color,
.has-inline-color.has-custom-3-color {
  color: #BFBFBF;
}
/* Comment Color */
.has-inline-color.has-custom-comment-color,
.has-inline-color.has-custom-4-color {
  color: #26BC84;
}
/* Highlight1 Color */
.has-inline-color.has-custom-highlight-1-color,
.has-inline-color.has-custom-5-color {
  color: #FFBF00;
}
/* Highlight2 Color */
.has-inline-color.has-custom-highlight-2-color,
.has-inline-color.has-custom-6-color {
  color: #66DDFF;
}
/* Highlight3 Color */
.has-inline-color.has-custom-highlight-3-color,
.has-inline-color.has-custom-7-color {
  color: #BDB76B;
}
/* Highlight4 Color */
.has-inline-color.has-custom-highlight-4-color,
.has-inline-color.has-custom-8-color {
  color: #FF4E33;
}

/** ==========  QUOTE BLOCK: REMOVE DEFAULT ITALICS  ========== **/
.wp-block-quote em {
  font-style: normal;
}


/** ==========  TABLE — COOL & PROFESSIONAL  ========== **/
/* Make table fill full width */
.wp-block-table table {
  width: 100%;
}

/* Table Header */
.wp-block-table thead th {
  background: #dfe6e9;
  text-align: center;
}

/* Table contents */
.wp-block-table table,
.wp-block-table th,
.wp-block-table td {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-collapse: collapse;
  word-break: keep-all;
}

/* Alternate row background */
.wp-block-table tbody tr:nth-child(even) {
  background: #f5f7fa;
}

/* Table Footer */
.wp-block-table tfoot td {
  background: #dfe6e9;
  text-align: center;
}

/** ==========  TABLE RESPONSIVENESS  ========== **/
/* Enable horizontal scroll on small screens */
.wp-block-table {
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}

/* Prevent compression of wide tables */
.wp-block-table table {
  min-width: 600px;
}


/** ==========  BUY ME A COFFEE: SYSGUIDES LOGO NODDING ANIMATION  ========== **/
.sysguides-coffee-logo {
  display: inline-block;
  transition: transform 0.3s ease-in-out;
}

.sysguides-coffee-logo:hover {
  animation: sysguides-nod 0.6s ease-in-out 1;
}

@keyframes sysguides-nod {
  0%   { transform: translateY(0); }
  20%  { transform: translateY(-5px); }
  40%  { transform: translateY(5px); }
  60%  { transform: translateY(-3px); }
  80%  { transform: translateY(3px); }
  100% { transform: translateY(0); }
}

/** ==========  BUY ME A COFFEE: BUTTON CUSTOMIZE  ========== **/
.sysguides-coffee-btn {
  display: inline-flex;
  align-items: baseline; /* Aligns image with text */
  background-color: #3B82F6; /* Accent 1 */
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 17.6px;
  padding: 10px 24px;
  border-radius: 4px;
  text-decoration: none;
  gap: 10px; /* Spacing between icon and text */
  transition: background-color 0.3s ease;
}

.sysguides-coffee-btn:hover {
  background-color: #2563EB; /* Accent 2 on hover */
}

.bmc-logo {
  height: 24px;
  width: auto;
  display: inline-block;
  position: relative;
  top: 4px; /* Slightly lower icon to align with text */
}


/** ==========  NINJA FORMS: SUBMIT BUTTON STYLE  ========== **/
input[type="submit"].nf-element {
  background: linear-gradient(to right, #2563EB, #5593f7); /* Teal to blue */
  color: #ffffff;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-family: Inter, sans-serif;
  letter-spacing: 1.5px;
  font-size: 17px;
  cursor: pointer;
  width: 100%;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Hover effect: dark gradient + brighter text */
input[type="submit"].nf-element:hover {
  background: linear-gradient(to right, #404040, #999999);
  color: #f0faff;
}
