/* ==========================================================================
   SHI Bombas Hidraulicas - Header & Navigation
   Replicates the header from https://www.bombas-hidraulicas.com.mx/
   ========================================================================== */

/* Reset for header area */
.shi-topbar *,
.shi-navbar *,
.shi-topbar *::before,
.shi-navbar *::before,
.shi-topbar *::after,
.shi-navbar *::after {
  box-sizing: border-box;
}

.shi-topbar a,
.shi-navbar a {
  text-decoration: none;
}

/* ==========================================================================
   TopBar - Contact Info Bar
   ========================================================================== */

.shi-topbar {
  background-color: #0f2d5c;
  color: #fff;
  padding: 0.5rem 0;
  font-size: 0.75rem;
  display: none;
  font-family: 'Stack Sans Text', 'Inter', sans-serif;
}

@media (min-width: 768px) {
  .shi-topbar {
    display: block;
    font-size: 0.875rem;
  }
}

.shi-topbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .shi-topbar-inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .shi-topbar-inner {
    padding: 0 2rem;
  }
}

.shi-topbar-flex {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem 2rem;
}

@media (min-width: 1024px) {
  .shi-topbar-flex {
    justify-content: space-between;
  }
}

.shi-topbar-city {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shi-topbar-city-name {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.625rem;
}

@media (min-width: 640px) {
  .shi-topbar-city-name {
    font-size: 0.75rem;
  }
}

.shi-topbar-contacts {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.shi-topbar-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: #fff;
  transition: color 0.2s;
}

.shi-topbar-link:hover,
.shi-topbar-link:focus {
  color: #ff8800;
}

.shi-topbar-link svg {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: #ff8800;
  fill: currentColor;
}

/* ==========================================================================
   Main Navbar
   ========================================================================== */

.shi-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.3s;
  font-family: 'Stack Sans Text', 'Inter', sans-serif;
}

.shi-navbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .shi-navbar-inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .shi-navbar-inner {
    padding: 0 2rem;
  }
}

.shi-navbar-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 5rem;
}

/* Logo */
.shi-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.shi-logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: #003366;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.shi-logo img {
  height: 3rem;
  width: auto;
}

/* ==========================================================================
   Desktop Navigation
   ========================================================================== */

.shi-desktop-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .shi-desktop-nav {
    display: flex;
  }
}

@media (min-width: 1280px) {
  .shi-desktop-nav {
    gap: 2rem;
  }
}

.shi-nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #003366;
  font-weight: 700;
  font-size: 0.875rem;
  transition: color 0.2s;
  padding: 1.5rem 0;
  white-space: nowrap;
}

.shi-nav-link:hover,
.shi-nav-link:focus {
  color: #ff8800;
}

/* ==========================================================================
   Dropdown Menu
   ========================================================================== */

.shi-dropdown {
  position: relative;
}

.shi-dropdown:hover .shi-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.shi-dropdown:hover .shi-dropdown-arrow {
  transform: rotate(180deg);
}

.shi-dropdown-arrow {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s;
  fill: currentColor;
}

.shi-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 16rem;
  background: #fff;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-radius: 1rem;
  border: 1px solid #f1f5f9;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  transform: translateY(0.5rem);
  z-index: 50;
  overflow: hidden;
}

.shi-dropdown-menu-inner {
  padding: 0.75rem 0;
}

.shi-dropdown-item {
  display: block;
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #003366;
  transition: all 0.2s;
  border-bottom: 1px solid #f8fafc;
}

.shi-dropdown-item:last-child {
  border-bottom: none;
}

.shi-dropdown-item:hover,
.shi-dropdown-item:focus {
  background-color: #f8fafc;
  color: #ff8800;
}

/* ==========================================================================
   Mobile Menu Button
   ========================================================================== */

.shi-mobile-btn-wrap {
  display: flex;
  align-items: center;
}

@media (min-width: 1024px) {
  .shi-mobile-btn-wrap {
    display: none;
  }
}

.shi-mobile-btn {
  color: #003366;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
  line-height: 0;
}

.shi-mobile-btn:hover {
  color: #ff8800;
}

.shi-mobile-btn:focus-visible {
  outline: 2px solid #ff8800;
  outline-offset: 2px;
  border-radius: 0.375rem;
}

.shi-mobile-btn svg {
  width: 2rem;
  height: 2rem;
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */

.shi-mobile-menu {
  display: none;
  background: #fff;
  border-top: 1px solid #f3f4f6;
  position: absolute;
  width: 100%;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
  .shi-mobile-menu {
    display: none !important;
  }
}

.shi-mobile-menu.shi-open {
  display: block;
}

.shi-mobile-menu-inner {
  padding: 1.5rem 1rem;
}

.shi-mobile-menu-inner > div {
  margin-bottom: 0.25rem;
}

.shi-mobile-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #003366;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.shi-mobile-link:hover,
.shi-mobile-link:focus {
  color: #ff8800;
  background-color: #f8fafc;
}

.shi-mobile-submenu {
  margin-left: 1rem;
  border-left: 2px solid #f1f5f9;
  padding: 0.25rem 0;
}

.shi-mobile-submenu a {
  display: block;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: #334155;
  border-radius: 0.5rem;
  transition: color 0.2s;
}

.shi-mobile-submenu a:hover,
.shi-mobile-submenu a:focus {
  color: #ff8800;
  background-color: #f8fafc;
}

/* ==========================================================================
   Footer
   Replicates the footer from https://www.bombas-hidraulicas.com.mx/
   ========================================================================== */

/* Reset for footer area */
.shi-footer *,
.shi-footer *::before,
.shi-footer *::after {
  box-sizing: border-box;
}

.shi-footer a {
  text-decoration: none;
}

.shi-footer {
  background: linear-gradient(to bottom right, oklch(64.6% 0.222 41.116), oklch(75% 0.183 55.934));
  color: #fff;
  padding-top: 2.5rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Stack Sans Text', 'Inter', sans-serif;
}

.shi-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .shi-footer-inner {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .shi-footer-inner {
    padding: 0 2rem;
  }
}

.shi-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .shi-footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Brand column */
.shi-footer-brand-logo {
  margin-bottom: 1.5rem;
}

.shi-footer-brand-logo img {
  height: 3.5rem;
  width: auto;
}

.shi-footer-brand-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.625;
  margin: 0;
}

/* Column headings */
.shi-footer-heading {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  margin-top: 0;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Link lists */
.shi-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.shi-footer-links a {
  color: rgba(255, 255, 255, 0.9);
  transition: color 0.2s;
}

.shi-footer-links a:hover,
.shi-footer-links a:focus {
  color: #fff;
}

/* Contact list */
.shi-footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.875rem;
}

.shi-footer-contact li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shi-footer-contact li.shi-contact-address {
  align-items: flex-start;
}

.shi-footer-contact svg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  color: #fff;
  stroke: currentColor;
  fill: none;
}

.shi-footer-contact span {
  color: #fff;
}

/* Copyright bar */
.shi-footer-copyright {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .shi-footer-copyright {
    flex-direction: row;
  }
}

.shi-footer-copyright p {
  margin: 0;
}

.shi-footer-copyright-links {
  display: flex;
  gap: 1rem;
}

.shi-footer-copyright-links a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.shi-footer-copyright-links a:hover,
.shi-footer-copyright-links a:focus {
  color: #fff;
}

/* ==========================================================================
   Blog Global Overrides
   ========================================================================== */

h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-post-title a,
.wp-block-heading,
.wp-block-query-title {
  color: #003366 !important;
}

.shi-footer h1,
.shi-footer h2,
.shi-footer h3,
.shi-footer h4,
.shi-footer h5,
.shi-footer h6 {
  color: #fff !important;
}

/* Page background */
body {
  background-color: #f8fafc !important;
}

/* Constrain post content images to column width + rounded corners */
.wp-block-post-content img,
.wp-block-post-content video,
.wp-block-post-content iframe {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.wp-block-post-content figure {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   Single Post Hero - Full-width image with gradient overlay
   Matches SubpageHero from bombas-hidraulicas.com.mx
   ========================================================================== */

.shi-single-hero {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  margin-top: calc(-1 * var(--wp--preset--spacing--70)) !important;
  background-color: #003366;
}

/* Featured image as background */
.shi-single-hero > .wp-block-post-featured-image {
  position: absolute !important;
  inset: 0;
  z-index: 0;
  margin: 0 !important;
}

.shi-single-hero > .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 !important;
}

/* Blue gradient overlay (matches main site: from-secondary/90 via-secondary/70 to-transparent) */
.shi-single-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0, 51, 102, 0.9), rgba(0, 51, 102, 0.7), transparent);
  z-index: 1;
}

/* Content (title + date) positioned over image */
.shi-single-hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 420px;
  padding: 3rem 2rem !important;
}

/* Title white inside hero */
.shi-single-hero .wp-block-post-title {
  color: #fff !important;
  margin: 0 0 1rem 0 !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Date orange inside hero */
.shi-single-hero .wp-block-post-date {
  color: #ff8800 !important;
  margin: 0 !important;
}

/* Featured image rounded (outside hero, e.g. index cards) */
.shi-post-card .wp-block-post-featured-image img {
  border-radius: 0.5rem;
}

/* Post navigation links - orange + truncate long titles */
.wp-block-post-navigation-link a {
  color: #ff8800 !important;
  text-decoration: none !important;
}

.wp-block-post-navigation-link a:hover {
  color: #e07700 !important;
  text-decoration: underline !important;
}

.wp-block-post-navigation-link a {
  display: block;
  max-width: 25ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Back to blog button - orange */
.shi-btn-back {
  display: inline-block;
  background-color: #ff8800;
  color: #fff !important;
  padding: 0.625rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.shi-btn-back:hover {
  background-color: #e07700;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(255, 136, 0, 0.3);
}

/* Post content heading scale - always smaller than post title (xx-large ~2.4rem) */
.wp-block-post-content h1 {
  font-size: 1.75rem !important;
}

.wp-block-post-content h2 {
  font-size: 1.5rem !important;
}

.wp-block-post-content h3 {
  font-size: 1.25rem !important;
}

.wp-block-post-content h4 {
  font-size: 1.1rem !important;
}

.wp-block-post-content h5,
.wp-block-post-content h6 {
  font-size: 1rem !important;
}

/* Post dates - orange */
.wp-block-post-date,
.wp-block-post-date a {
  color: #ff8800 !important;
}

/* Post cards - entire card is clickable */
.shi-post-card {
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.2s, transform 0.2s;
  overflow: hidden;
  cursor: pointer;
}

.shi-post-card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

/* Stretch title link over entire card */
.shi-post-card .wp-block-post-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.shi-post-card .wp-block-post-title a {
  text-decoration: none !important;
}

.shi-post-card .wp-block-post-featured-image {
  border-radius: 0.5rem;
  overflow: hidden;
}

.shi-post-card .wp-block-post-featured-image img {
  border-radius: 0.5rem;
}

/* Pagination buttons - orange style matching main site */
.wp-block-query-pagination {
  margin-top: 2rem;
}

.wp-block-query-pagination-next,
.wp-block-query-pagination-previous {
  background-color: #ff8800 !important;
  color: #fff !important;
  padding: 0.625rem 1.5rem !important;
  border-radius: 0.5rem !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: all 0.2s !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.wp-block-query-pagination-next:hover,
.wp-block-query-pagination-previous:hover {
  background-color: #e07700 !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(255, 136, 0, 0.3);
}

/* ==========================================================================
   Responsive Post Grids
   ========================================================================== */
@media (min-width: 600px) and (max-width: 1023px) {
  .wp-block-post-template.is-layout-grid,
  .wp-block-query > .wp-block-post-template {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
