/* Puedes personalizar aquí los estilos adicionales para la notaría si lo deseas. */

/* Reveal on scroll (subtle up + fade) */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 600ms ease,
    transform 600ms ease;
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
/* Respect user preference: reduce transform when prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    transform: none;
    transition: opacity 400ms ease;
  }
}
/* If user forces motion, ensure transitions are applied even if system prefers reduced motion */
body.force-motion .reveal {
  transform: translateY(10px);
  transition:
    opacity 600ms ease,
    transform 600ms ease !important;
}

/* Flip reveal for service cards (girarse por los costados) */
.flip-reveal {
  opacity: 0;
  transform-origin: left center;
  transform: perspective(900px) rotateY(-8deg) translateY(6px);
  transition:
    transform 700ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 600ms ease;
  backface-visibility: hidden;
  will-change: transform, opacity;
}
.flip-reveal[data-direction="right"] {
  transform-origin: right center;
  transform: perspective(900px) rotateY(8deg) translateY(6px);
}
.flip-reveal.in-view {
  opacity: 1;
  transform: perspective(900px) rotateY(0deg) translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .flip-reveal {
    transform: none;
    transition: opacity 400ms ease;
  }
}
body.force-motion .flip-reveal {
  transform-origin: left center;
  transition: transform 700ms cubic-bezier(0.2, 0.9, 0.2, 1) !important;
}

/* Service cards: expand/contract with unique timing per item */
#blog .service-card {
  transform-origin: center;
  animation-name: service-breathe !important;
  animation-duration: var(--service-pulse-duration, 6s) !important;
  animation-timing-function: ease-in-out !important;
  animation-iteration-count: infinite !important;
  animation-delay: var(--service-pulse-delay, 0s) !important;
  will-change: transform;
}
@keyframes service-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

/* Protocolar services timing (10 items) */
#foods .col-md-4:nth-child(1) .service-card { --service-pulse-duration: 5.2s; --service-pulse-delay: 0s; }
#foods .col-md-4:nth-child(2) .service-card { --service-pulse-duration: 6.1s; --service-pulse-delay: 0.2s; }
#foods .col-md-4:nth-child(3) .service-card { --service-pulse-duration: 5.6s; --service-pulse-delay: 0.4s; }
#foods .col-md-4:nth-child(4) .service-card { --service-pulse-duration: 6.4s; --service-pulse-delay: 0.1s; }
#foods .col-md-4:nth-child(5) .service-card { --service-pulse-duration: 5.9s; --service-pulse-delay: 0.3s; }
#foods .col-md-4:nth-child(6) .service-card { --service-pulse-duration: 6.8s; --service-pulse-delay: 0.5s; }
#foods .col-md-4:nth-child(7) .service-card { --service-pulse-duration: 5.4s; --service-pulse-delay: 0.15s; }
#foods .col-md-4:nth-child(8) .service-card { --service-pulse-duration: 6.3s; --service-pulse-delay: 0.35s; }
#foods .col-md-4:nth-child(9) .service-card { --service-pulse-duration: 5.7s; --service-pulse-delay: 0.55s; }
#foods .col-md-4:nth-child(10) .service-card { --service-pulse-duration: 6.6s; --service-pulse-delay: 0.25s; }

/* Extraprotocolares timing (8 items) */
#juices .col-md-4:nth-child(1) .service-card { --service-pulse-duration: 5.3s; --service-pulse-delay: 0.05s; }
#juices .col-md-4:nth-child(2) .service-card { --service-pulse-duration: 6.2s; --service-pulse-delay: 0.25s; }
#juices .col-md-4:nth-child(3) .service-card { --service-pulse-duration: 5.8s; --service-pulse-delay: 0.45s; }
#juices .col-md-4:nth-child(4) .service-card { --service-pulse-duration: 6.5s; --service-pulse-delay: 0.15s; }
#juices .col-md-4:nth-child(5) .service-card { --service-pulse-duration: 5.5s; --service-pulse-delay: 0.35s; }
#juices .col-md-4:nth-child(6) .service-card { --service-pulse-duration: 6.7s; --service-pulse-delay: 0.55s; }
#juices .col-md-4:nth-child(7) .service-card { --service-pulse-duration: 5.9s; --service-pulse-delay: 0.2s; }
#juices .col-md-4:nth-child(8) .service-card { --service-pulse-duration: 6.1s; --service-pulse-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  #blog .service-card {
    animation: none;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.force-motion #blog .service-card {
    animation-name: service-breathe !important;
    animation-duration: var(--service-pulse-duration, 6s) !important;
    animation-timing-function: ease-in-out !important;
    animation-iteration-count: infinite !important;
    animation-delay: var(--service-pulse-delay, 0s) !important;
  }
}

/* Overlay at top of slider to improve contrast with nav when menu is transparent */
.carousel,
.carousel-inner {
  position: relative;
}
.carousel .carousel-inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 96px;
  background: linear-gradient(
    to bottom,
    rgba(10, 61, 98, 0.72),
    rgba(10, 61, 98, 0)
  );
  z-index: 200; /* above images */
  pointer-events: none;
}

/* explicit overlay element inside carousel */
.slider-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 96px;
  background: linear-gradient(
    to bottom,
    rgba(10, 61, 98, 0.82),
    rgba(10, 61, 98, 0)
  );
  z-index: 250; /* above images */
  pointer-events: none;
}

/* Increase navbar stacking so it sits above the overlay */
.custom-navbar {
  z-index: 300;
}

/* Ensure fixed header doesn't overlap page content — respect header space */
/* Ensure fixed header doesn't overlap page content — match refined header heights */
body {
  padding-top: 96px;
}

/* medium devices: slightly smaller header */
@media (max-width: 992px) {
  body {
    padding-top: 84px;
  }
}
/* mobile: header / overlay reduced height */
@media (max-width: 768px) {
  body {
    padding-top: 64px;
  }
  .carousel .carousel-inner::before {
    height: 64px;
  }
  .slider-overlay {
    height: 64px;
  }
}

/* ==========================
   Servicios: sidebar layout
   ========================== */
#sidebar_1 {
  max-width: 320px;
}
#sidebar_1 aside {
  padding-right: 10px;
}
#sidebar_1 .agr {
  font-family: "Oswald", serif;
  font-size: 1.08rem;
  color: #2a3a61;
  margin-bottom: 18px;
  padding-left: 6px;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
}

/* Layout: align sidebar and content top edge */
.aem {
  display: flex;
  align-items: flex-start; /* align top */
  gap: 32px;
}
.aem .ags {
  flex: 0 0 320px; /* sidebar fixed width */
}
.aem .agq {
  flex: 1 1 auto; /* content grows */
}
@media (max-width: 992px) {
  .aem {
    display: block;
  }
  .aem .ags,
  .aem .agq {
    width: 100%;
  }
}
#sidebar_1 .agr .fa {
  font-size: 1.2rem;
  margin-right: 10px;
  color: #cfcfcf;
}

/* Decorative ornament above section headings (.agr) */
.agr {
  position: relative;
}
.agr::before {
  content: "";
  display: block;
  width: 260px;
  height: 26px;
  margin: 6px auto 12px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 26'><path d='M5 13 C25 3, 55 3, 75 13 C95 23, 125 23, 145 13 C165 3, 195 3, 215 13' stroke='%2320375c' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/><path d='M127 13 C135 9, 145 9, 153 13' stroke='%2320375c' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>")
    center/contain no-repeat;
}
@media (max-width: 992px) {
  .agr::before {
    width: 200px;
    height: 22px;
    margin-bottom: 10px;
  }
}
@media (max-width: 768px) {
  .agr::before {
    width: 160px;
    height: 18px;
    margin-bottom: 8px;
  }
}
.aap {
  margin-bottom: 12px;
}
.abf {
  display: block;
  padding: 14px 18px 14px 64px;
  border: 1px solid #e8e8e8;
  border-radius: 3px;
  color: #20375c;
  position: relative;
  background: #fff;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
  text-decoration: none;
}
.abf:before {
  content: "+";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #2a3a61;
  color: #2a3a61;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #fff;
}
.abf:hover {
  background: #f7f9fc;
}
.abf.ahv {
  background: #2a3a61;
  color: #fff;
  border-color: #2a3a61;
}
.abf.ahv:before {
  content: "\2212"; /* unicode minus */
  background: #fff;
  color: #2a3a61;
  border: none;
}
.abf.ahv span {
  color: #fff;
}
@media (max-width: 992px) {
  #sidebar_1 {
    max-width: 100%;
    margin-bottom: 20px;
  }
  .abf {
    padding-left: 54px;
  }
}

/* Article / content styles */
.aba {
  text-transform: uppercase;
  text-align: center;
  font-size: 2.6rem;
  color: #20375c;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 500;
}
/* `.aab` styles removed: class was removed from page templates (except index.php) to simplify layout.
   If needed later, reintroduce a utility class for padding and content width. */

/* ==========================
   Navbar — subtle, professional styling
   ========================== */
.custom-navbar {
  background: rgba(32, 55, 92, 0.96); /* solid but slightly softened */
  box-shadow: 0 2px 6px rgba(15, 30, 50, 0.06); /* subtle shadow */
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  min-height: 96px; /* compact, refined header */
  display: flex;
  align-items: center;
  padding: 0 18px;
  transition:
    background 0.18s ease,
    min-height 0.2s ease,
    padding 0.2s ease;
  backdrop-filter: saturate(120%) blur(2px);
}

/* Affixed header becomes slightly more compact and crisp */
.custom-navbar.affix {
  min-height: 72px;
  padding: 0 12px;
  background: rgba(32, 55, 92, 0.98);
  box-shadow: 0 2px 8px rgba(15, 30, 50, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Align and space nav items cleanly */
.custom-navbar .navbar-collapse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.custom-navbar .navbar-nav {
  display: flex;
  align-items: center;
}

.custom-navbar .nav-link {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  padding: 0.6rem 0.9rem;
  letter-spacing: 0.6px;
  transition: color 0.16s ease;
}
.custom-navbar .nav-link:hover {
  color: #ffd84d;
}
.custom-navbar .nav-link.active {
  color: #ffd84d;
}

/* Brand: moderate size, centered when not affixed; shrinks slightly and moves left when affixed */
.custom-navbar .navbar-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  height: 100%;
  transition:
    left 0.2s ease,
    transform 0.2s ease,
    width 0.2s ease;
}
.custom-navbar .navbar-brand .brand-img {
  width: 160px;
  height: auto;
  transition:
    width 0.22s ease,
    opacity 0.18s ease,
    transform 0.18s ease;
  display: block;
}
.custom-navbar .navbar-brand .brand-txt {
  display: none; /* keep clean look */
  margin-left: 8px;
  font-size: 1rem;
  color: #fff;
  opacity: 0.95;
}

/* Fix: ensure navbar toggler stays on top and is clickable on small screens
   (brand is centered and can overlap the toggler). */
.custom-navbar .navbar-toggler {
  position: relative;
  z-index: 1100;
}
/* Make the centered brand not intercept pointer events (but allow image clicks) */
.custom-navbar .navbar-brand { pointer-events: none; }
.custom-navbar .navbar-brand img { pointer-events: auto; }

/* On affix, smaller logo at left with text visible for clarity */
.custom-navbar.affix .navbar-brand {
  position: relative;
  left: 12px;
  transform: none;
}
.custom-navbar.affix .navbar-brand .brand-img {
  width: 96px;
}
.custom-navbar.affix .navbar-brand .brand-txt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: 0.95;
}
.custom-navbar .navbar-brand .brand-txt i {
  color: #ffd84d;
  font-size: 1.05rem;
  display: inline-block;
  vertical-align: middle;
}

/* Small spacing between header bottom and main content */
.afx {
  margin-top: 18px;
}
@media (max-width: 992px) {
  .afx {
    margin-top: 14px;
  }
}
@media (max-width: 768px) {
  .afx {
    margin-top: 10px;
  }
}

/* Decorative break with notary icon / full-width ornamental divider */
.header-break {
  /* Use full width of the container to avoid viewport overflow (100vw can cause horizontal scroll) */
  position: relative;
  left: 0;
  transform: none;
  width: 100%;
  box-sizing: border-box;
  display: block;
  padding: 40px 0;
  pointer-events: none;
  z-index: 140;
  overflow: hidden; /* ensure decorative background doesn't cause overflow */
}
.header-break-inner {
  margin: 0 auto;
  width: 100%;
  max-width: 1100px;
  height: 34px;
  display: block;
  text-align: center;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 36'><path d='M20 18 C120 6, 360 6, 480 18 C600 30, 840 30, 940 18' stroke='%2320375c' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/><path d='M586 18 C618 14, 648 14, 680 18' stroke='%2320375c' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-position: center center;
  background-size: contain;
}

/* Make images and iframes responsive to avoid overflow */
img, iframe, .embed-responsive, .embed-responsive-item {
  max-width: 100%;
  height: auto;
}

/* Ensure embedded iframes (maps) don't exceed container width */
.embed-responsive { overflow: hidden; }


/* Hide the small left-side ornament above section heading to avoid duplication */
.agr::before {
  display: none !important;
}

/* If an image is used (uploaded by user), ensure it is centered and responsive */
.header-break-inner .header-ornament {
  display: block;
  margin: 0 auto;
  max-width: 90%;
  height: auto;
  vertical-align: middle;
}

/* Fallback: if image missing, keep previous SVG look via background */
.header-break-inner[aria-hidden] {
  background-position: center;
  background-repeat: no-repeat;
}


@media (max-width: 992px) {
  .header-break {
    padding: 6px 0;
  }
  .header-break-inner {
    max-width: 860px;
    height: 28px;
  }
  .header-break-inner .header-ornament {
    max-width: 700px;
  }
}
@media (max-width: 768px) {
  .header-break {
    padding: 6px 0;
  }
  .header-break-inner {
    max-width: 640px;
    height: 22px;
  }
  .header-break-inner .header-ornament {
    max-width: 480px;
  }
}

/* Fallback: if image missing, keep previous SVG look via background */
.header-break-inner[aria-hidden] {
  background-position: center;
  background-repeat: no-repeat;
}

@media (max-width: 992px) {
  .header-break {
    padding: 6px 0;
  }
  .header-break-inner {
    max-width: 860px;
    height: 28px;
  }
  .header-break-inner .header-ornament {
    max-width: 700px;
  }
}
@media (max-width: 768px) {
  .header-break {
    padding: 6px 0;
  }
  .header-break-inner {
    max-width: 640px;
    height: 22px;
  }
  .header-break-inner .header-ornament {
    max-width: 480px;
  }
}

/* make navbar fully opaque on pages without header image */
body:not(.header-image) .custom-navbar {
  background-color: rgb(92 111 142 / 98%);
}

/* Responsive refinements */
@media (max-width: 992px) {
  .custom-navbar {
    min-height: 84px;
  }
  .custom-navbar.affix {
    min-height: 72px;
  }
  .custom-navbar .navbar-brand .brand-img {
    width: 140px;
  }
  .custom-navbar.affix .navbar-brand .brand-img {
    width: 80px;
  }
  body {
    padding-top: 84px;
  }
}
@media (max-width: 768px) {
  .custom-navbar {
    min-height: 64px;
  }
  .custom-navbar.affix {
    min-height: 64px;
  }
  .custom-navbar .navbar-brand .brand-img {
    width: 110px;
  }
  .custom-navbar.affix .navbar-brand .brand-img {
    width: 64px;
  }
  body {
    padding-top: 64px;
  }
}

/* ==========================
   Sidebar fixed/spacing behavior
   ========================== */

/* ==========================
   Sidebar fixed/spacing behavior
   ========================== */
#sidebar_1 {
  position: -webkit-sticky;
  position: sticky;
  top: calc(96px + 8px); /* nav height + small offset */
  z-index: 200;
}
@media (max-width: 992px) {
  #sidebar_1 {
    top: calc(80px + 8px);
  }
}
@media (max-width: 768px) {
  #sidebar_1 {
    position: relative;
    top: auto;
  }
}

/* Visual polish */
.abf {
  border-left: 4px solid transparent;
  transition:
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.abf:hover {
  box-shadow: 0 2px 8px rgba(10, 61, 98, 0.06);
}
.abf.ahv {
  border-left-color: #ffd84d;
}

/* Site footer styles */
.site-footer { background: #0b2542; }
.site-footer .brand-img { max-width: 160px; height: auto; }
.site-footer h5 { color: #ffffff; font-weight: 600; }
.site-footer a { color: rgba(255,255,255,0.92); }
.site-footer a:hover { color: #ffd84d; text-decoration: none; }
.site-footer .social-icons a { display: inline-block; width: 36px; height: 36px; line-height: 36px; text-align: center; border-radius: 50%; background: rgba(255,255,255,0.06); }
.site-footer .social-icons a:hover { background: rgba(255,216,77,0.12); color: #ffd84d; }
.footer-legal { background: rgba(0,0,0,0.25); }
@media (max-width: 576px) {
  .site-footer .brand-img { max-width: 120px; }
}

