/* Site overrides */

/* Modern refresh - enhanced styling */

/* Smooth transitions for all interactive elements */
* {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Bring back bjc-style visual weight and readability. */
body,
input,
select,
textarea {
  font-size: 15px;
  line-height: 1.68;
  color: #334155;
}

@media (max-width: 1680px) {
  body,
  input,
  select,
  textarea {
    font-size: 14px;
  }
}

@media (max-width: 1280px) {
  body,
  input,
  select,
  textarea {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  body,
  input,
  select,
  textarea {
    font-size: 12px;
  }
}

/* Enhanced banner section */
#banner {
  background:
    radial-gradient(circle at top left, rgba(68, 191, 236, 0.04), transparent 28%),
    linear-gradient(135deg, #fcfeff 0%, #ffffff 62%, #fffefc 100%);
  border-radius: 2rem;
  margin-bottom: 3rem;
  border: 1px solid rgba(68, 191, 236, 0.12);
  box-shadow: 0 18px 32px -24px rgba(15, 23, 42, 0.2);
  overflow: hidden;
  padding: 5.25rem 6.5rem;
  position: relative;
}

#banner:before {
  content: "";
  position: absolute;
  inset: auto -8rem -8rem auto;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.025) 0%, rgba(245, 158, 11, 0) 70%);
  pointer-events: none;
}

#banner:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
  pointer-events: none;
}

#banner .content {
  position: relative;
  padding: 0 2.5rem 0 1rem;
  z-index: 1;
}

#banner .content header {
  margin-bottom: 1.2rem;
}

#banner .content h1 {
  color: #0f172a;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: clamp(2.4rem, 5.2vw, 4.35rem);
  line-height: 0.98;
  margin-bottom: 0.4rem;
  text-wrap: balance;
}

#banner .content p.major {
  color: #0b4f6c;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  text-transform: none;
  border-bottom: 0;
  margin-bottom: 1rem;
  font-weight: 700;
}

#banner .content > p {
  max-width: 42rem;
  color: #475569;
  font-size: 1.05rem;
}

#banner .actions {
  margin-top: 1.75rem;
  margin-bottom: 1.4rem;
}

#banner .actions .button {
  min-width: 11rem;
  text-align: center;
}

#banner .image img {
  border-radius: 1.5rem;
  border: 4px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 20px -18px rgba(15, 23, 42, 0.14), 0 4px 10px -10px rgba(14, 165, 233, 0.06);
  max-width: calc(100% - 1.5rem);
  margin-left: 1.5rem;
}

section > header.major p {
  color: #64748b;
  margin: 0.75rem 0 0;
  max-width: 42rem;
}

section > header.major h2 {
  color: #0f172a;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.homepage-features-section {
  background: linear-gradient(135deg, rgba(248, 252, 255, 0.92) 0%, rgba(255, 255, 255, 1) 58%, rgba(255, 250, 244, 0.88) 100%);
  border-top: 0 !important;
  border: 1px solid rgba(68, 191, 236, 0.12);
  border-radius: 1.75rem;
  box-shadow: 0 18px 32px -26px rgba(15, 23, 42, 0.2);
  margin-top: 1.1rem;
  padding: 2rem !important;
}

.homepage-features-section > header.major {
  margin-bottom: 1.15rem;
}

.homepage-features-section > header.major > :last-child {
  margin-bottom: 1.35rem;
  padding-bottom: 0.35em;
}

.latest-section {
  background: linear-gradient(135deg, rgba(238, 251, 255, 0.8) 0%, rgba(255, 255, 255, 1) 52%, rgba(255, 247, 239, 0.7) 100%);
  border-top: 0 !important;
  border: 1px solid rgba(68, 191, 236, 0.12);
  border-radius: 1.75rem;
  box-shadow: 0 22px 45px -38px rgba(15, 23, 42, 0.32);
  margin-top: 1.5rem;
  padding: 1.4rem 1.6rem 1.75rem;
}

.latest-section > header.major {
  margin-bottom: 1.15rem;
  padding-left: 0;
}

.latest-section > header.major > :last-child {
  margin-bottom: 0.9rem;
  padding-bottom: 0.35em;
}

.latest-section .posts {
  margin: 0;
  width: 100%;
}

.latest-section .posts article:nth-child(n+4) {
  display: none;
}

/* Modern feature cards */
.features article {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 16px 30px -24px rgba(15, 23, 42, 0.35);
  transition: all 0.3s ease;
  border: 1px solid rgba(68, 191, 236, 0.22);
  position: relative;
  overflow: hidden;
}

.features article:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 34px -18px rgba(68, 191, 236, 0.38);
  border-color: rgba(68, 191, 236, 0.5);
}

.features article:before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.35rem;
  background: linear-gradient(90deg, #38bdf8 0%, #22c55e 48%, #f59e0b 100%);
}

.features article:nth-child(2):before {
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
}

.features article:nth-child(3):before {
  background: linear-gradient(90deg, #14b8a6 0%, #22c55e 100%);
}

.features article:nth-child(4):before {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.features article .icon {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(59, 130, 246, 0.11));
  border-radius: 1.25rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.features article:nth-child(2) .icon {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.11));
}

.features article:nth-child(3) .icon {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08), rgba(34, 197, 94, 0.1));
}

.features article:nth-child(4) .icon {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.09), rgba(239, 68, 68, 0.09));
}

.features article .icon:before {
  color: #0f172a;
}

.features article .icon:after {
  border-color: rgba(68, 191, 236, 0.12);
  background: linear-gradient(135deg, rgba(68, 191, 236, 0.015) 0%, rgba(68, 191, 236, 0.04) 100%);
}

.features article h3 {
  color: #0f172a;
  margin-bottom: 0.45rem;
}

/* Enhanced post cards */
.posts article {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
  border-radius: 1.25rem;
  padding: 0;
  box-shadow: 0 18px 32px -24px rgba(15, 23, 42, 0.38);
  transition: all 0.3s ease;
  border: 1px solid rgba(68, 191, 236, 0.22);
  overflow: hidden;
  position: relative;
}

.posts article:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 38px -20px rgba(68, 191, 236, 0.34);
  border-color: rgba(68, 191, 236, 0.5);
}

/* Make entire card clickable */
.posts article .card-link {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border: none !important;
}

.posts article .card-link:hover {
  text-decoration: none;
  color: inherit;
  border: none !important;
}

.posts article .card-link h3 {
  color: #0f172a;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.posts article .card-link h4 {
  color: #94a3b8;
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 0.85em;
  font-weight: 500;
}

.posts article .card-link p {
  color: #475569;
  margin-bottom: 0;
  margin-top: 0;
  line-height: 1.65;
  font-size: 0.95em;
}

.posts article .image {
  border-radius: 0.95rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
  display: block;
  box-shadow: 0 12px 20px -20px rgba(15, 23, 42, 0.5);
}

.posts article .image img {
  transition: transform 0.3s ease;
}

.posts article:hover .image img {
  transform: scale(1.05);
}

.posts article:before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 0.3rem;
  background: linear-gradient(90deg, #0ea5e9 0%, #8b5cf6 100%);
  z-index: 1;
}

.posts article:nth-child(2):before {
  background: linear-gradient(90deg, #14b8a6 0%, #22c55e 100%);
}

.posts article:nth-child(3):before {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.posts article:nth-child(4):before {
  background: linear-gradient(90deg, #2563eb 0%, #ec4899 100%);
}

.posts article:after {
  display: none !important;
}

/* Hide empty paragraphs */
.posts article .card-link p:empty {
  display: none;
}

/* Hide any iframes or embeds that might accidentally appear in cards */
.posts article .card-link iframe,
.posts article .card-link embed,
.posts article .card-link object {
  display: none !important;
}

/* Keep YouTube embeds readable without letting them dominate article pages. */
#main .inner section div:has(> iframe[src*="youtube.com/embed"]) {
  max-width: 42rem;
  margin-bottom: 1.5rem;
}

/* Modern buttons */
.button,
button,
input[type="submit"],
input[type="button"] {
  border-radius: 0.75rem;
  box-shadow: 0 6px 14px -4px rgba(68, 191, 236, 0.35), 0 2px 6px -2px rgba(68, 191, 236, 0.25);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -6px rgba(68, 191, 236, 0.45), 0 4px 8px -2px rgba(68, 191, 236, 0.3);
}

.button.special,
button.special {
  background: linear-gradient(135deg, #44bfec 0%, #3db0e0 100%);
  box-shadow: 0 4px 6px -1px rgba(68, 191, 236, 0.3), 0 2px 4px -1px rgba(68, 191, 236, 0.2);
}

.button.special:hover,
button.special:hover {
  background: linear-gradient(135deg, #4fc5f0 0%, #44bfec 100%);
  box-shadow: 0 6px 12px -2px rgba(68, 191, 236, 0.4), 0 4px 6px -1px rgba(68, 191, 236, 0.25);
}

/* Enhanced header */
#header {
  border-bottom: solid 5px #44bfec;
  box-shadow: 0 4px 12px -8px rgba(15, 23, 42, 0.3);
  background: #ffffff;
}

#header .icons .social-message .icon:before {
  margin-right: 0.45em;
}

#header .icons .fa-whatsapp:before,
#header .icons .social-message .social-text {
  color: #25d366;
}

#header .icons .fa-facebook-f:before {
  color: #1877f2;
}

#header .icons .fa-instagram:before {
  color: #e1306c;
}

#header .icons .social-message .social-text {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* Improved typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #0f172a;
}

/* Modern links */
a {
  transition: color 0.2s ease;
}

a:hover {
  color: #44bfec;
}

/* Enhanced sidebar */
#sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

/* Match old sidebar logo scale from bjc theme branch. */
#sidebar #menu > header.major .row {
  max-width: 14.5rem;
  margin: 0 auto;
  transform: scale(1.5);
  transform-origin: center top;
}

#sidebar #menu > header.major .row .image img {
  max-height: 3.0rem;
  width: auto;
  object-fit: contain;
}

/* Keep sidebar toggle in site blue palette (theme main defaults to red accent). */
#sidebar .toggle:before {
  color: #44bfec !important;
}

/* Sidebar separators: match bjc branch behavior. */
#sidebar > .inner > * {
  border-bottom: solid 2px rgba(68, 191, 236, 0.35);
}

#sidebar #menu > ul > li {
  border-top: solid 1px rgba(68, 191, 236, 0.24);
}

/* Remove heading bars under sidebar logo and "Get in touch". */
#sidebar #menu > header.major > :last-child,
#sidebar section header.major > :last-child {
  border-bottom: 0 !important;
  padding-bottom: 0 !important;
}

@media (max-width: 736px) {
  #sidebar .toggle:after {
    background: rgba(68, 191, 236, 0.18) !important;
  }
}

/* Sidebar menu interactive states should use site blue, not theme red accent. */
#sidebar #menu ul a,
#sidebar #menu ul span {
  color: #3d4449 !important;
}

#sidebar #menu ul a.opener:before,
#sidebar #menu ul span.opener:before {
  color: #9fa3a6 !important;
}

#menu ul a:hover,
#menu ul span:hover,
#menu ul .opener:hover,
#menu ul .opener:hover:before,
#menu ul .opener.active:before {
  color: #44bfec !important;
}

/* Sidebar contact icons: give each app/service its own colour. */
#sidebar .contact li.fa-envelope:before {
  color: #ef4444 !important;
}

#sidebar .contact li.fa-phone:before {
  color: #3b82f6 !important;
}

#sidebar .contact li.fa-whatsapp:before {
  color: #25d366 !important;
}

#sidebar .contact li.fa-home:before {
  color: #44bfec !important;
}


/* Responsive grid for gallery shortcode */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.gallery .image {
  display: block;
  margin: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery .image:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(68, 191, 236, 0.15), 0 4px 6px -2px rgba(68, 191, 236, 0.1);
}

.gallery .image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s ease;
}

.gallery .image:hover img {
  transform: scale(1.05);
}

/* Newsletter logo/thumb should stay compact. */
.newsletter-logo {
  max-width: 180px;
  margin: 0 0 1.25rem 0;
}

@media (max-width: 640px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  #banner {
    border-radius: 0 0 1rem 1rem;
    margin-bottom: 1.25rem;
  }
  
  .features article {
    padding: 1.25rem;
  }

  .posts article {
    padding: 0;
  }
}

/* Desktop density and sidebar toggle alignment */
@media (min-width: 981px) {
  #sidebar .toggle {
    position: fixed;
    top: 1.35rem;
    z-index: 10000;
  }

  #sidebar.inactive .toggle {
    left: 1.25rem;
  }

  #sidebar:not(.inactive) .toggle {
    left: calc(26em - 3.2rem);
  }

  #main > .inner {
    max-width: 90em;
    padding: 0 3.5em 2.75em;
  }

  #main > .inner > section {
    padding: 3.1em 0;
  }

  #main > .inner > section.latest-section {
    padding: 1.4rem 1.6rem 1.75rem;
  }

  #main > .inner > section.homepage-features-section {
    padding: 2rem;
  }

  #main > .inner > section.homepage-features-section,
  #main > .inner > section.latest-section {
    border-top: 0 !important;
  }

  #header {
    padding: 3.35em 0 1.1em;
  }

  #banner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.9fr);
    align-items: center;
    column-gap: 3rem;
    margin-bottom: 2.25rem;
  }

  #banner .content {
    width: 100%;
    max-width: 42rem;
    padding: 0 3rem 0 1.25rem;
  }

  #banner .image {
    margin: 0;
    width: 100%;
    padding-left: 2rem;
  }

  #banner .image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
  }

  #banner .content > :last-child {
    margin-bottom: 0;
  }

  .features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    width: 100%;
    margin: 0;
  }

  .features article {
    height: 100%;
    margin: 0;
    width: auto;
    padding: 1.6rem;
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr);
    align-items: start;
    column-gap: 1.1rem;
  }

  .features article .icon {
    width: 5.4rem;
    height: 5.4rem;
    line-height: 5.4rem;
    margin: 0;
  }

  .features article .icon:before {
    font-size: 1.75rem;
  }

  .features article .icon:after {
    width: 3.95rem;
    height: 3.95rem;
    margin: -1.98rem 0 0 -1.98rem;
  }

  .features article .content {
    width: auto;
    min-width: 0;
  }

  .features article .content p {
    margin-bottom: 0;
  }

  .posts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
    width: 100%;
    align-items: start;
  }

  .posts article {
    margin: 0;
    width: auto;
    min-width: 0;
    max-width: none;
    height: auto;
  }

  #menu ul a,
  #menu ul span {
    padding: 0.72em 0;
  }

  #sidebar .toggle {
    left: calc(100% - 1.4rem);
    top: 1.35rem;
    height: 4.8rem;
    line-height: 4.8rem;
    text-indent: 4.8rem;
    width: 4.8rem;
  }

  #sidebar .toggle:before {
    font-size: 1.35rem;
    left: 0;
    margin-left: -0.05rem;
    margin-top: -0.05rem;
    z-index: 1;
  }

  #sidebar .toggle:after {
    background: rgba(68, 191, 236, 0.18) !important;
    border-radius: 0.75rem;
    content: "";
    height: 3.6rem;
    left: 0.6rem;
    position: absolute;
    top: 0.6rem;
    width: 3.6rem;
  }
}

@media (min-width: 981px) and (max-width: 1280px) {
  .latest-section .posts article:nth-child(n+3) {
    display: none;
  }

  .posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .latest-section .posts article:nth-child(n+3) {
    display: none;
  }

  #main > .inner > section.latest-section {
    padding: 1.35rem 1.35rem 1.6rem;
  }

  #banner {
    padding: 4rem 4.25rem;
    border-radius: 1.5rem;
  }

  #banner .content {
    max-width: 38rem;
    padding: 0 1.5rem 0 0.5rem;
  }

  #banner .image img {
    max-width: 100%;
    margin-left: 0;
  }

  body,
  input,
  select,
  textarea {
    font-size: 15px;
    line-height: 1.65;
  }
}

@media (max-width: 736px) {
  .latest-section .posts article:nth-child(n+2) {
    display: none;
  }

  #main > .inner > section.latest-section {
    padding: 1.15rem 1rem 1.35rem;
  }

  #banner {
    padding: 2.75rem 2.5rem;
  }

  #banner .content {
    padding: 0;
  }

  #banner .content h1 {
    font-size: clamp(2.15rem, 10vw, 3.4rem);
  }

}
