/*
Theme Name: RaiseFi 2.2
Theme URI: https://raisefi.xyz/
Author: 0xChef
Author URI: https://boredroasters.io/
Description: Responsive WordPress theme for RaiseFi 2.2 with custom header and footer.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: raisefi-2-2
Tags: responsive, custom-header, custom-footer
*/

/* Basic Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #fff;
  color: #222;
  line-height: 1.6;
}

/* Responsive Container */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  border-radius: 12px;
}

/* Header and Footer styles */

.site-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 0;
  border-radius: 12px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Header search styles */
.logo-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.header-search-form {
  display: inline-block;
  position: relative;
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: width 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s cubic-bezier(.4,0,.2,1);
  vertical-align: middle;
  margin-left: 0.2rem;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.header-search-form.open {
  width: 110px;
  min-width: 110px;
  max-width: 110px;
  opacity: 1;
  overflow: visible;
}
.header-search-input {
  width: 100%;
  min-width: 0;
  max-width: 110px;
  border: none;
  outline: none;
  padding: 0.2em 0.5em;
  font-size: 1em;
  background: transparent;
  color: #222;
  border-radius: 6px;
  box-sizing: border-box;
  letter-spacing: 0.01em;
}
.header-search-input::placeholder {
  color: #888 !important;
  opacity: 1;
}
.search-toggle {
  background: #fff !important;
  border: none !important;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  width: 28px;
  border-radius: 50%;
  box-shadow: none;
  transition: background 0.2s;
}
.search-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
}
.search-toggle:focus {
  outline: 2px solid #888;
}
@media (max-width: 700px) {
  .logo-search-wrap {
    gap: 0.3rem;
  }
  .header-search-form.open {
    width: 110px;
    min-width: 110px;
    max-width: 110px;
  }
}

/* Search results area spacing */
.search-results-list,
.search-results-list + .navigation,
.search-results-list + nav,
.search-results-list + .search-excerpt,
.search-results-list + p,
main > h1:first-child {
  margin-top: 69px;
}
main .search-results-list {
  margin-bottom: 69px;
}
body.search main {
  padding-bottom: 69px;
}
main > h1:first-child {
  margin-bottom: 32px;
}

/* Center popup search results */
#search-popup-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background:#fff;
  max-width:480px;
  width:90vw;
  max-height:80vh;
  overflow:auto;
  border-radius:16px;
  box-shadow:0 8px 32px rgba(0,0,0,0.18);
  padding:32px 24px 24px 24px;
  position:relative;
}
#search-popup-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
#search-popup-content .search-results-list {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
#search-popup-content h2 {
  text-align: center;
  width: 100%;
}
#search-popup-content ul {
  padding-left: 0;
  list-style: none;
}
#search-popup-content li {
  text-align: center;
  margin-bottom: 1em;
}

:root {
  --header-font-color: #fff;
}

/* Responsive header logo */
.custom-logo {
  max-height: 60px;
  width: auto;
  height: auto;
  max-width: 100%;
  display: block;
}
@media (max-width: 700px) {
  .custom-logo {
    max-height: 40px;
  }
}

.main-nav {
  margin-left: auto;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  border-radius: 8px;
}

.nav-menu li {
  display: inline-block;
}

.nav-menu a {
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

/* Remove underline from active/current links sitewide */
a:active,
a:focus,
.current-menu-item > a,
.current_page_item > a,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
  text-decoration: none !important;
}

/* Responsive: stack menu on small screens */
@media (max-width: 700px) {
  .site-header .container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
    min-height: 56px;
  }
  .logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-height: 40px;
  }
  .mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    position: static;
    margin-left: auto;
    margin-right: 0;
    background: #fff !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    z-index: 1002;
    height: 40px;
  }
  .main-nav {
    display: block;
    background: #fff;
    border-radius: 8px;
    margin-top: 1rem;
    padding: 1rem 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: absolute;
    right: 0;
    top: 56px;
    min-width: max-content;
    max-width: 90vw;
    width: 0;
    opacity: 0;
    z-index: 1001;
    text-align: right;
    padding-left: 10%;
    padding-right: 10%;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(.4,0,.2,1), opacity 0.3s cubic-bezier(.4,0,.2,1);
  }
  .main-nav.open {
    width: 180px;
    opacity: 1;
    overflow: visible;
  }
  .nav-menu {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    border-radius: 8px;
    align-items: flex-end;
    text-align: right;
  }
  .nav-menu li {
    width: 100%;
    text-align: right;
  }
  .nav-menu a {
    color: #222;
    text-align: right;
  }
  .main-nav {
    width: 100%;
  }
}

/* Hamburger menu styles */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 40px;
  width: 40px;
  margin-left: 1rem;
  z-index: 1002;
  position: relative;
}
.mobile-menu-toggle .bar {
  display: block;
  width: 26px;
  height: 3px;
  margin: 4px 0;
  background: #808080 !important;
  border-radius: 2px;
  transition: all 0.3s;
  content: "";
}
@media (max-width: 700px) {
  .mobile-menu-toggle {
    display: flex !important;
  }
}

/* Gutenberg block backgrounds */
.wp-block {
  border-radius: 12px;
  overflow: hidden;
}
.wp-block[data-align="wide"],
.wp-block[data-align="full"] {
  border-radius: 12px;
}
.wp-block.has-background {
  border-radius: 12px !important;
}
.widget,
.sidebar .widget {
  border-radius: 12px;
  background: #f8f8f8;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

/* Hide empty block widgets (columns with no content) */
.widget_block .wp-block-columns,
.widget_block .wp-block-columns > .wp-block-column {
  min-height: 0 !important;
  min-width: 0 !important;
}
.widget_block .wp-block-columns:empty,
.widget_block .wp-block-columns > .wp-block-column:empty {
  display: none !important;
  min-height: 0 !important;
  min-width: 0 !important;
  height: 0 !important;
  width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
}
.widget_block .wp-block-columns {
  /* Hide if all columns are empty */
}
.widget_block .wp-block-columns > .wp-block-column:empty {
  display: none !important;
}
.widget_block .wp-block-columns > .wp-block-column {
  min-height: 0 !important;
}
.widget_block .wp-block-columns:has(> .wp-block-column:not(:empty)) {
  display: flex !important;
}

/* Remove background from footer widgets */
.footer-widget-col .widget {
  background: transparent !important;
  box-shadow: none !important;
}

/* Footer styles */
.site-footer {
  padding: 1.5rem 0;
  text-align: center;
  font-size: 1rem;
  border-radius: 12px;
  background: #072f7b !important;
}
.site-footer > .container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-widgets {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  justify-content: center;
  text-align: left;
}

.footer-cols-1 .footer-widget-col { flex: 1 1 100%; }
.footer-cols-2 .footer-widget-col { flex: 1 1 50%; }
.footer-cols-3 .footer-widget-col { flex: 1 1 33.33%; }
.footer-cols-4 .footer-widget-col { flex: 1 1 25%; }

.footer-widget-col {
  min-width: 0;
  padding: 0 0.5rem;
  text-align: left;
}

/* Footer menu styles */
.footer-menu {
  background: transparent !important;
  margin: 0;
  padding: 0;
  list-style: none;
  border: none;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.footer-menu li {
  margin: 0;
  padding: 0;
  background: transparent !important;
}
.footer-menu a,
.footer-menu a:active,
.footer-menu a:focus,
.footer-menu a:hover,
.footer-menu .current-menu-item > a,
.footer-menu .current_page_item > a {
  background: transparent !important;
  text-decoration: none !important;
  padding: 0.2em 0;
  display: block;
}

/* Align footer widget columns for 3-column layout */
/* (Removed center/right alignment; all columns are left-justified by default) */

/* Remove background from all menu items */
.footer-menu,
.footer-menu * {
  background: transparent !important;
}

@media (max-width: 900px) {
  .footer-widgets {
    flex-direction: row;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .footer-widget-col {
    flex: 1 1 0;
    min-width: 120px;
    max-width: 100vw;
    padding: 0;
  }
}

/* Responsive banner image */
.page-banner img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  aspect-ratio: 3/1;
}
@media (max-width: 700px) {
  .page-banner img {
    aspect-ratio: unset;
    height: auto;
    max-height: 200px;
  }
}
