/* CSS Reset and Normalization for Cross-Browser Compatibility */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

/* Ensure consistent font rendering across browsers */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Global styles with cross-browser compatibility */
html, body {
  width: 100vw;
  max-width: 100vw;
  overflow-x: hidden;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #21422E;
  background-color: #FFFFFF;
  -webkit-font-feature-settings: "kern" 1;
  font-feature-settings: "kern" 1;
}

/* Force layout recalculation on orientation change */
@media screen and (orientation: landscape) {
  .program-card-v2,
  .program-card-v4 {
    min-height: auto;
    height: auto;
  }
  
  .program-grid {
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
  }
}

@media screen and (orientation: portrait) {
  .program-card-v2,
  .program-card-v4 {
    min-height: auto;
    height: auto;
  }
}

/* Universal layout fixes for all devices */
@media screen and (min-width: 320px) {
  .program-card-v2,
  .program-card-v4,
  .previous-programs-card {
    height: auto !important;
    min-height: auto !important;
  }
  
  .program-grid {
    -webkit-box-align: stretch !important;
    -ms-flex-align: stretch !important;
    align-items: stretch !important;
  }
  
  .programs-list {
    height: auto !important;
  }
  
  .button-container {
    -ms-flex-negative: 0 !important;
    flex-shrink: 0 !important;
  }
}

/* Content wrapper */
.hero,
.about,
.programs,
.social-media {
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  max-width: 1200px;
}

.hero > *, .about > *, .programs > *, .social-media > *, .program-grid > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

/* Footer */
footer {
  background: #000;
  color: #fff;
  padding: 1.25rem;
  text-align: center;
  width: 100%;
}

/* Hero */
.hero {
  text-align: center;
  padding: 2.5rem 1.25rem 0;
}

.hero-logo {
  max-width: 150px;
  margin-bottom: 10px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.hero-tagline {
  font-size: 18px;
  color: #21422E;
  margin-bottom: 60px;
  font-weight: 600;
  position: relative;
}

.hero-tagline .divider-diamond {
  display: block;
  font-size: 16px;
  color: #21422E;
  margin-top: 30px;
  position: relative;
  opacity: 0.8;
}

.hero-tagline .divider-diamond::before,
.hero-tagline .divider-diamond::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 200px;
  height: 1px;
  background: #21422E;
  opacity: 0.6;
}

.hero-tagline .divider-diamond::before {
  right: calc(50% + 15px);
}

.hero-tagline .divider-diamond::after {
  left: calc(50% + 15px);
}

/* Section Headings */
h2, h3, h4 {
  word-break: break-word;
  overflow-wrap: break-word;
  -ms-word-wrap: break-word;
}

h2 {
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

/* Branch Introduction */
.branches-intro {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 1fr 30px 1fr 30px 1fr;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.branch-intro-item {
  text-align: center;
  padding: 1.875rem;
  background: #FFFFFF;
  border: 4px solid #A69873;
  border-radius: 0.75rem;
  -webkit-border-radius: 0.75rem;
  -moz-border-radius: 0.75rem;
  -webkit-transition: all 0.3s ease;
  -moz-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(166, 152, 115, 0.1);
  -webkit-box-shadow: 0 2px 4px rgba(166, 152, 115, 0.1);
  -moz-box-shadow: 0 2px 4px rgba(166, 152, 115, 0.1);
}

.branch-intro-item:hover {
  -webkit-transform: translateY(-2px);
  -ms-transform: translateY(-2px);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(166, 152, 115, 0.1);
  -webkit-box-shadow: 0 4px 8px rgba(166, 152, 115, 0.1);
  -moz-box-shadow: 0 4px 8px rgba(166, 152, 115, 0.1);
}

.branch-intro-item img {
  width: 3.75rem;
  height: 3.75rem;
  margin-bottom: 1.25rem;
  -o-object-fit: contain;
  object-fit: contain;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.branch-intro-item h3 {
  color: #21422E;
  margin-bottom: 0.625rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.branch-intro-item p {
  color: #21422E;
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0;
}

/* Programs */
.programs {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1.5rem 1.25rem;
}

.program-grid {
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 1fr;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 30px;
  margin-top: 20px;
  width: 100%;
}

#previous-programs {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

#previous-programs .program-grid {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

@media screen and (min-width: 730px) and (max-width: 999px) {
  .program-grid {
    -ms-grid-columns: 1fr 30px 1fr;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  #previous-programs .program-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 1fr;
    grid-template-columns: 1fr;
    width: 100%;
  }

  #previous-programs .program-card-v4,
  #previous-programs .previous-programs-card {
    width: 100%;
  }
  
  .program-grid > *:last-child:nth-child(2n + 1) {
    -ms-grid-column: 1;
    -ms-grid-column-span: 2;
    grid-column: 1 / -1;
    width: calc(50% - 15px);
    margin-left: auto;
    margin-right: auto;
  }
}

.program-card-v2,
.program-card-v4,
.previous-programs-card {
  padding: 1.5625rem;
  border-radius: 0.75rem;
  -webkit-border-radius: 0.75rem;
  -moz-border-radius: 0.75rem;
  box-shadow: 0 2px 4px rgba(166, 152, 115, 0.1);
  -webkit-box-shadow: 0 2px 4px rgba(166, 152, 115, 0.1);
  -moz-box-shadow: 0 2px 4px rgba(166, 152, 115, 0.1);
  text-align: left;
  position: relative;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  height: auto;
  background: #FFFFFF;
  border: 2px solid #2E5C41;
  color: #21422E;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  -ms-word-wrap: break-word;
  overflow: hidden;
}

/* Card headings */
.program-card-v2 h3,
.program-card-v4 h3,
.previous-programs-card h3 {
  margin-bottom: 1.875rem;
  font-size: 1.5rem;
}

.program-card-v2 h3 small,
.program-card-v4 h3 small,
.previous-programs-card h3 small {
  font-size: 0.875rem;
  color: rgba(33, 66, 46, 0.8);
  display: block;
  margin-top: 0.5rem;
}

/* Programs list */
.programs-list {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-flex: 1;
  -ms-flex: 1;
  flex: 1;
  overflow: visible;
}

.program-item {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  position: relative;
  -ms-flex-negative: 0;
  flex-shrink: 0;
  overflow: visible;
}

.program-item:first-child {
  /* margin-top: 0; removed for tighter spacing */
}

.program-item:not(:last-child) {
  /* margin-bottom: 25px; removed for even spacing */
}

.program-item:not(:last-child) .divider {
  margin: 32px 0 !important;
}

.program-item:not(:last-child) .divider::before,
.program-item:not(:last-child) .divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 60px;
  height: 1px;
  background: rgba(33, 66, 46, 0.2);
}

.program-item:not(:last-child) .divider::before {
  right: calc(50% + 10px);
}

.program-item:not(:last-child) .divider::after {
  left: calc(50% + 10px);
}

.program-item h4 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.9375rem;
  color: #A69873;
  font-weight: 600;
}

.program-item p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 0.9375rem;
  color: #21422E;
}

/* Event details */
.program-card-v2 .event-details,
.program-card-v4 .event-details,
.previous-programs-card .event-details {
  background: transparent;
  border: 2px solid #A69873;
  border-radius: 0.5rem;
  -webkit-border-radius: 0.5rem;
  -moz-border-radius: 0.5rem;
  padding: 0.75rem;
  display: -ms-grid;
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  color: #21422E;
}

.program-card-v2 .detail-row,
.program-card-v4 .detail-row,
.previous-programs-card .detail-row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 0.375rem;
  color: #21422E;
  font-size: 0.9em;
}

.program-card-v2 .detail-row strong,
.program-card-v4 .detail-row strong,
.previous-programs-card .detail-row strong {
  color: #21422E;
  font-weight: 600;
  min-width: 4.375rem;
}

/* Button container and registration button */
.button-container {
  margin-top: auto;
  padding-top: 15px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.registration-button,
.program-card-v2 .insta-link,
.program-card-v4 .insta-link,
.previous-programs-card .insta-link {
  display: inline-block;
  text-decoration: none;
  font-size: 0.9em;
  padding: 0.5rem 1.25rem;
  background: #2E5C41;
  color: #fff;
  border-radius: 1.25rem;
  -webkit-border-radius: 1.25rem;
  -moz-border-radius: 1.25rem;
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  -o-transition: all 0.2s ease;
  transition: all 0.2s ease;
  border: none;
  font-weight: 500;
  white-space: nowrap;
}

.registration-button:hover,
.program-card-v2 .insta-link:hover,
.program-card-v4 .insta-link:hover,
.previous-programs-card .insta-link:hover {
  background: #376E4E;
  -webkit-transform: translateY(-1px);
  -ms-transform: translateY(-1px);
  transform: translateY(-1px);
}

.button-container .insta-link.insta-link-light {
  background-color: #2C5B3A !important;
  color: #fff;
}
.button-container .insta-link.insta-link-light:hover {
  background-color: #4B8F6E !important;
}

/* Social Media */
.social-media {
  text-align: center;
  background: transparent;
  width: 100%;
  margin-bottom: 2.5rem;
  padding: 0 1.25rem;
}

.social-buttons {
  margin: 1.875rem auto;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: 1.25rem;
  max-width: 37.5rem;
}

.social-button {
  background: #21422E;
  color: #fff;
  width: 3.125rem;
  height: 3.125rem;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-transition: none;
  -moz-transition: none;
  -o-transition: none;
  transition: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  -webkit-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  -moz-box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  text-decoration: none;
  text-decoration-thickness: initial;
}

.social-button:hover,
.social-button:focus {
  -webkit-transition: background 0.2s, color 0.2s, border 0.2s;
  -moz-transition: background 0.2s, color 0.2s, border 0.2s;
  -o-transition: background 0.2s, color 0.2s, border 0.2s;
  transition: background 0.2s, color 0.2s, border 0.2s;
  -webkit-transform: translateY(-2px);
  -ms-transform: translateY(-2px);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  -webkit-box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  -moz-box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.social-button svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Arrow for tooltip */
.social-button span::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #21422E transparent transparent transparent;
}

/* Show tooltip on hover */
.social-button:hover span {
  visibility: visible;
  opacity: 1;
}

/* Social Media section header specific */
.social-media h2 {
  padding-top: 3.75rem;
  padding-bottom: 0;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media screen and (max-width: 768px) {
  .hero,
  .about,
  .programs,
  .social-media {
    padding: 1.5rem 1.25rem;
  }
  
  h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
  }

  .branches-intro {
    -ms-grid-columns: 1fr;
    grid-template-columns: 1fr;
    max-width: 500px;
    gap: 20px;
  }

  h2::before,
  h2::after {
    width: calc(37.5% - 100px);
  }

  h2::before {
    right: calc(50% + 100px);
  }

  h2::after {
    left: calc(50% + 100px);
  }

  .program-card {
    min-height: auto;
  }
  
  .button-container {
    margin-bottom: 25px;
  }

  .program-item:not(:last-child) {
    margin-bottom: 25px;
  }

  .program-item:first-child {
    margin-bottom: 0;
  }

  .program-item:not(:last-child) .divider {
    margin: 40px 0 25px;
  }

  .program-item h4 {
    margin-top: 0;
  }

  .program-item:first-child h4 {
    margin-top: 25px;
  }

  .programs-list {
    gap: 25px;
  }

  .program-card-v2 h3,
  .program-card-v4 h3,
  .previous-programs-card h3 {
    margin-bottom: 25px;
  }

  .program-item h4 {
    font-size: 18px;
  }
  
  .program-item p,
  .program-item .event-details,
  .program-item .sessions,
  .program-item .detail-row {
    font-size: 14px;
  }

  .page-wrapper {
    margin: 30px;
    border-width: 20px;
    padding: 15px;
  }

  body {
    padding: 30px 30px 0 30px;
  }
  
  footer {
    margin: 0;
  }
  
  /* Force proper layout on mobile */
  .program-card-v2,
  .program-card-v4,
  .previous-programs-card {
    height: auto !important;
    min-height: auto !important;
  }
  
  .program-grid {
    -webkit-box-align: stretch !important;
    -ms-flex-align: stretch !important;
    align-items: stretch !important;
  }
  
  .programs-list {
    height: auto !important;
  }
}

@media screen and (max-width: 480px) {
  .hero,
  .about,
  .programs,
  .social-media {
    padding: 1.5rem 1.25rem;
  }
  
  h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
  }

  .program-card {
    padding: 15px;
  }

  .program-card h3 {
    font-size: 20px;
  }

  .program-card h3 small {
    font-size: 13px;
  }

  h2::before,
  h2::after {
    width: calc(37.5% - 80px);
  }

  h2::before {
    right: calc(50% + 80px);
  }

  h2::after {
    left: calc(50% + 80px);
  }

  .page-wrapper {
    margin: 20px;
    border-width: 15px;
    padding: 10px;
  }

  body {
    padding: 20px 20px 0 20px;
  }
  
  footer {
    margin: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
  }

  h2 {
    font-size: 7vw;
  }
  h3 {
    font-size: 5vw;
  }
  h4 {
    font-size: 4vw;
  }
}

@media screen and (max-width: 320px) {
  .hero,
  .about,
  .programs,
  .social-media {
    padding: 1.5rem 1.25rem;
  }
  
  h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
  }

  .program-card {
    padding: 15px;
  }

  .programs-list {
    gap: 20px;
  }

  .insta-link {
    bottom: 20px;
    width: calc(100% - 30px);
    font-size: 0.8em;
    padding: 8px 12px;
  }

  h2::before,
  h2::after {
    width: calc(37.5% - 60px);
  }

  h2::before {
    right: calc(50% + 60px);
  }

  h2::after {
    left: calc(50% + 60px);
  }

  body {
    padding: 15px 15px 0 15px;
  }

  footer {
    margin: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
  }
}

@media screen and (max-width: 383px) {
  .social-button {
    padding: 0.75em 0.5em;
  }
  .button-label-long { display: none !important; }
  .button-label-short { display: inline !important; }
}

.bismillah {
  font-size: 26px;
  text-align: center;
  margin-bottom: 40px;
}

/* About section spacing */
.about {
  text-align: center;
  padding: 1.5rem 1.25rem;
  margin-bottom: 1.5rem;
}

.about p {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
}

.sessions {
  color: #21422E;
}

/* Previous Programs specific styling */
#previous-programs .program-card-v4,
#previous-programs .previous-programs-card {
  border: 2px solid #A69873;
}

/* Force previous programs cards to always stack vertically */
#previous-programs .previous-programs-card {
  grid-column: 1 / -1;
  width: 100%;
}

/* Override grid layout for previous programs section */
#previous-programs .program-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 30px !important;
}

/* Ensure all previous programs cards take full width */
#previous-programs .previous-programs-card {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
}

@media screen and (max-width: 729px) {
  .social-buttons {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 1.5rem;
    max-width: 100%;
    width: 100%;
    padding: 0 4vw;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
  }
  .social-button {
    -webkit-transition: none;
    -moz-transition: none;
    -o-transition: none;
    transition: none;
    text-decoration: none;
    text-decoration-thickness: initial;
    width: 100%;
    max-width: 500px;
    min-width: 0;
    height: auto;
    min-height: 64px;
    border-radius: 2.5rem;
    -webkit-border-radius: 2.5rem;
    -moz-border-radius: 2.5rem;
    background: #fff;
    color: #21422E;
    border: 3px solid #21422E;
    box-shadow: 0 4px 12px rgba(33,66,46,0.08);
    -webkit-box-shadow: 0 4px 12px rgba(33,66,46,0.08);
    -moz-box-shadow: 0 4px 12px rgba(33,66,46,0.08);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    font-size: 1.35rem;
    font-weight: 700;
    padding: 0.75rem 2rem 0.75rem 1.25rem;
    margin: 0 auto;
    gap: 1.25rem;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    white-space: normal;
    text-align: left;
  }
  .button-tooltip {
    display: none !important;
  }
  .program-grid {
    -ms-grid-columns: 1fr !important;
    grid-template-columns: 1fr !important;
  }
  .button-label::after,
  .button-tooltip::after {
    content: none !important;
    display: none !important;
  }
  .social-button span::after {
    content: none !important;
    display: none !important;
  }
}

/* Move these to the end for highest specificity */
.button-label { display: none; }
.button-tooltip {
  visibility: hidden;
  background-color: #21422E;
  color: #fff;
  text-align: center;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  -webkit-transform: translateX(-50%);
  -ms-transform: translateX(-50%);
  transform: translateX(-50%);
  white-space: nowrap;
  opacity: 0;
  -webkit-transition: opacity 0.3s;
  -moz-transition: opacity 0.3s;
  -o-transition: opacity 0.3s;
  transition: opacity 0.3s;
  font-size: 0.875rem;
  pointer-events: none;
}
.button-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #21422E transparent transparent transparent;
}
.social-button:hover .button-tooltip,
.social-button:focus .button-tooltip {
  visibility: visible;
  opacity: 1;
}
@media screen and (max-width: 729px) {
  .button-label {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    background: none !important;
    color: inherit !important;
    padding: 0 !important;
    font-size: inherit !important;
    pointer-events: auto !important;
    -webkit-transition: none !important;
    -moz-transition: none !important;
    -o-transition: none !important;
    transition: none !important;
    border-radius: 0 !important;
    -webkit-border-radius: 0 !important;
    -moz-border-radius: 0 !important;
    text-align: left !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    -moz-box-shadow: none !important;
    left: auto !important;
    bottom: auto !important;
    -webkit-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
    z-index: auto !important;
    white-space: normal !important;
  }
  .button-tooltip {
    display: none !important;
  }
}

@media screen and (max-width: 481px) {
  .social-button {
    font-size: 1.05rem;
  }
}

img, svg {
  max-width: 100%;
  height: auto;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Hide short label by default, show long label */
.button-label-short { display: none; }
.button-label-long { display: inline; }

@media screen and (max-width: 383px) {
  .button-label-long { display: none !important; }
  .button-label-short { display: inline !important; }
}

.insta-link {
  display: inline-block;
  padding: 8px 16px;
  background-color: #21422E;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  -webkit-transition: background-color 0.3s ease;
  -moz-transition: background-color 0.3s ease;
  -o-transition: background-color 0.3s ease;
  transition: background-color 0.3s ease;
}

.insta-link-light {
  background-color: #0066CC;
}

.insta-link:hover {
  background-color: #1A3528;
}

.insta-link-light:hover {
  background-color: #21422E;
}

.event-details-multi {
  margin: 1.25rem 0 1.5rem 0;
  text-align: left;
}

/* Scrollable event containers for previous events */
.event-details-multi .event-card {
  margin-bottom: 0.75rem;
}

.event-details-multi .event-card:last-child {
  margin-bottom: 0;
}

/* Create scrollable container for previous events */
.program-item .event-details-multi {
  max-height: 245px;
  overflow-y: auto;
  padding-right: 8px;
  border: 1px solid rgba(166, 152, 115, 0.2);
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.5);
}

/* Custom scrollbar styling */
.program-item .event-details-multi::-webkit-scrollbar {
  width: 6px;
}

.program-item .event-details-multi::-webkit-scrollbar-track {
  background: rgba(166, 152, 115, 0.1);
  border-radius: 3px;
}

.program-item .event-details-multi::-webkit-scrollbar-thumb {
  background: rgba(166, 152, 115, 0.4);
  border-radius: 3px;
}

.program-item .event-details-multi::-webkit-scrollbar-thumb:hover {
  background: rgba(166, 152, 115, 0.6);
}

/* Firefox scrollbar styling */
.program-item .event-details-multi {
  scrollbar-width: thin;
  scrollbar-color: rgba(166, 152, 115, 0.4) rgba(166, 152, 115, 0.1);
}

/* Responsive adjustments for scrollable containers */
@media screen and (max-width: 768px) {
  .program-item .event-details-multi {
    max-height: 225px;
    padding: 0.5rem;
  }
}

@media screen and (max-width: 480px) {
  .program-item .event-details-multi {
    max-height: 205px;
    padding: 0.4rem;
  }
  
  .program-item .event-details-multi .event-card {
    margin-bottom: 0.5rem;
  }
  
  .program-item .event-details-multi .event-card .detail-row {
    font-size: 0.8em;
  }
}

.event-intro {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
  color: #21422E;
  background: none;
  padding: 0;
  border-radius: 0;
  -webkit-border-radius: 0;
  -moz-border-radius: 0;
  display: block;
  text-align: left;
  letter-spacing: 0.01em;
}

.event-card {
  background: transparent;
  border: 2px solid #A69873;
  border-radius: 0.5rem;
  -webkit-border-radius: 0.5rem;
  -moz-border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(166, 152, 115, 0.07);
  -webkit-box-shadow: 0 1px 4px rgba(166, 152, 115, 0.07);
  -moz-box-shadow: 0 1px 4px rgba(166, 152, 115, 0.07);
}

.event-card:last-child {
  margin-bottom: 0;
}

.event-card div {
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

.event-card .detail-row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  gap: 0.375rem;
  color: #21422E;
  font-size: 0.9em;
}

.divider {
  display: block;
  text-align: center;
  position: relative;
  font-size: 10px;
  color: rgba(33, 66, 46, 0.3);
  margin: 32px 0 !important;
}

.program-item:not(:last-child) .divider {
  margin: 32px 0 !important;
}

/* Additional cross-browser compatibility fixes */
/* Ensure consistent box-sizing across all elements */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

/* Fix for older browsers that don't support gap property */
@supports not (gap: 1rem) {
  .program-grid > * {
    margin: 15px;
  }
  
  .social-buttons > * {
    margin: 0.625rem;
  }
  
  .branches-intro > * {
    margin: 15px;
  }
}

/* Fix for browsers that don't support CSS Grid */
@supports not (display: grid) {
  .program-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }
  
  .program-grid > * {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 300px;
    flex: 1 1 300px;
    margin: 15px;
  }
  
  .branches-intro {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }
  
  .branches-intro > * {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 250px;
    flex: 1 1 250px;
    margin: 15px;
  }
}

/* Fix for older browsers that don't support calc() */
@supports not (width: calc(100% - 20px)) {
  .hero-tagline .divider-diamond::before {
    right: 65%;
  }
  
  .hero-tagline .divider-diamond::after {
    left: 65%;
  }
  
  .program-item:not(:last-child) .divider::before {
    right: 60%;
  }
  
  .program-item:not(:last-child) .divider::after {
    left: 60%;
  }
}

/* Ensure consistent font rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Fix for Safari flexbox issues */
@supports (-webkit-appearance: none) {
  .programs-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
  }
  
  .social-buttons {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
  }
}

/* Fix for IE11 specific issues */
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  .program-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }
  
  .program-grid > * {
    -ms-flex: 1 1 300px;
    flex: 1 1 300px;
    margin: 15px;
  }
  
  .social-buttons {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-pack: center;
    justify-content: center;
  }
}

/* Additional responsive adjustments for very small screens */
@media screen and (max-width: 420px) {
  .program-card-v4 .insta-link {
    display: block;
    text-align: center;
    font-size: 0.9em;
    white-space: normal;
    text-overflow: clip;
    word-wrap: break-word;
    min-height: 38px;
    line-height: 1.4;
    padding: 10px 12px;
  }

  .program-card-v2 .event-details,
  .program-card-v4 .event-details,
  .previous-programs-card .event-details {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 5px;
    padding-left: 0;
    border-left: none;
    border: 1px solid #A69873;
    border-radius: 8px;
    padding: 10px;
  }
  
  .event-card {
    border: 1px solid #A69873;
    padding: 10px;
    border-radius: 8px;
  }
  
  .event-card .detail-row {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 5px;
  }
}

/* Support Us / Donation Section */
.support-section {
  width: 100%;
  background: #fff;
  padding: 1.5rem 1.25rem;
  margin: 1.5rem auto 1.5rem auto;
  box-sizing: border-box;
  max-width: 1200px;
  display: block;
}
.support-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 2px 16px rgba(33,66,46,0.07);
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  max-width: 100%;
}
.support-left {
  flex: 1 1 50%;
  background: #fff;
  padding: 2.5rem 2rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
  text-align: center;
}
.support-left h2 {
  font-size: 2.3rem;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: bold;
  color: #2E5C41;
  margin-bottom: 1.25rem;
  line-height: 1.2;
}
.support-message {
  font-size: 1.15rem;
  color: #333;
  line-height: 1.6;
  margin-top: 0.5rem;
  max-width: 30rem;
}
.support-right {
  flex: 1 1 50%;
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  overflow: hidden;
  padding: 2.5rem 2.5rem 2.5rem 2rem;
}
.support-bg-image {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('images/grey_flower.png') center center no-repeat;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.16;
  z-index: 1;
  pointer-events: none;
}
.support-donate-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.donate-now-btn {
  background: #fff !important;
  color: #2E5C41 !important;
  border: none !important;
  font-size: 2rem;
  font-weight: bold;
  border-radius: 0.7rem;
  padding: 0.85rem 3.5rem;
  margin-bottom: 1.5rem;
  opacity: 1;
  cursor: default;
  box-shadow: 0 2px 8px rgba(33,66,46,0.07);
  letter-spacing: 0.01em;
  transition: background 0.2s;
}
.donate-now-btn:disabled {
  opacity: 1;
  background: #5B7C6A;
  color: #fff;
}
.donate-now-btn:hover {
  cursor: default;
}
.donate-buttons-row {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 0.5rem;
}
.donate-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border-radius: 0.5rem;
  border: 1.5px solid #e0e0e0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #21422E;
  padding: 0.6rem 1.3rem 0.6rem 0.7rem;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(33,66,46,0.06);
  transition: box-shadow 0.2s, border 0.2s, background 0.2s;
  min-width: 110px;
  justify-content: center;
  text-align: center;
  min-height: 48px;
}
.donate-btn img {
  height: 1.5rem;
  width: auto;
  display: inline-block;
  margin-right: 0.3rem;
}
.donate-btn.paypal {
  border-color: #0070ba;
  background: #fff;
}
.donate-btn.paypal:hover {
  box-shadow: 0 2px 8px rgba(0,112,186,0.13);
  border-color: #0070ba;
}
.donate-btn.zelle {
  border-color: #a682d9;
  background: #fff !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  padding-top: 0.7rem !important;
  padding-bottom: 0.7rem !important;
}
.donate-btn.zelle:hover {
  box-shadow: 0 2px 8px rgba(166,130,217,0.13);
  border-color: #a682d9;
}
.donate-btn.stripe {
  border-color: #7a7a7a;
  background: #f5f5f7;
}
.donate-btn.stripe:hover {
  box-shadow: 0 2px 8px rgba(122,122,122,0.13);
  border-color: #7a7a7a;
}
.donate-btn.zeffy {
  border-color: #4C6EF5;
  background: #f4f7fe;
}
.donate-btn.zeffy:hover {
  box-shadow: 0 2px 8px rgba(76,110,245,0.13);
  border-color: #4C6EF5;
}
@media (max-width: 900px) {
  .support-container {
    flex-direction: column;
    max-width: 100%;
    align-items: center;
  }
  .support-left, .support-right {
    padding: 2rem 1.2rem;
    min-width: 0;
  }
  .support-left {
    text-align: center;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
  .support-right {
    min-height: 260px;
  }
}
@media (max-width: 600px) {
  .support-section {
    padding: 1.5rem 1.25rem;
  }
  .support-container {
    flex-direction: column;
    border-radius: 0.7rem;
    box-shadow: 0 1px 6px rgba(33,66,46,0.08);
    padding: 0;
  }
  .support-left, .support-right {
    padding: 1.2rem 0.7rem;
  }
  .support-left h2 {
    font-size: 1.5rem;
  }
  .donate-now-btn {
    font-size: 1.2rem;
    padding: 0.7rem 1.5rem;
  }
  .donate-buttons-row {
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
    align-items: stretch;
  }
  .donate-btn {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: auto;
    font-size: 1.1rem;
    padding: 0.6rem 1.3rem 0.6rem 0.7rem;
  }
  
  /* Responsive adjustments for Zeffy embed */
  .zeffy-embed-container {
    height: 500px;
    margin-bottom: 0.8rem;
  }
}

.donate-logo {
  max-height: 1.5rem;
  max-width: 2.5rem;
  width: auto;
  height: 1.5rem;
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  background: transparent;
}

.donate-btn.zeffy .donate-logo {
  max-height: 2.7rem;
  max-width: 5rem;
  opacity: 0.7;
}

.zelle-label-row {
  display: flex;
  align-items: center;
  gap: 0.4em;
  justify-content: center;
  width: 100%;
}
.zelle-label {
  font-weight: 600;
  font-size: 1.1em;
  color: #6a3fc7;
}
.donate-btn.zelle .zelle-email {
  display: inline;
  font-size: 0.98em;
  color: #6a3fc7;
  font-weight: 600;
  margin-left: 0.5em;
  margin-top: 0;
  word-break: break-all;
  vertical-align: middle;
}

@media (max-width: 300px) {
  .donate-btn {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2em;
  }
  .donate-btn.zelle .zelle-email {
    display: block;
    margin-left: 0;
    margin-top: 2px;
    font-size: 0.85em;
  }
  .donate-btn.zelle .zelle-label {
    display: none;
  }
}

@media (max-width: 900px) {
  .donate-btn.zelle .zelle-email {
    font-size: 0.92em;
  }
  .donate-btn.zelle {
    font-size: 1em;
    padding: 0.5rem 1rem;
  }
}
@media (max-width: 600px) {
  .donate-btn.zelle .zelle-email {
    font-size: 0.85em;
  }
  .donate-btn.zelle {
    font-size: 0.95em;
    padding: 0.45rem 0.7rem;
  }
}

@media (max-width: 360px) {
  .donate-btn.zelle .zelle-email {
    font-size: 0.72em;
  }
  .donate-btn.zelle {
    font-size: 0.85em;
    padding: 0.35rem 0.4rem;
  }
}

@media (max-width: 297px) {
  .donate-btn.zelle .zelle-email {
    display: block;
    margin-top: 2px;
    margin-left: 0;
    font-size: 0.8em;
  }
}

.zelle-logo-long { display: none; }
@media (max-width: 300px) {
  .zelle-logo-short { display: none !important; }
  .zelle-logo-long { display: inline-block !important; }
}

.donate-now-header {
  font-size: 2rem;
  color: #2E5C41;
  font-weight: bold;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* Zeffy embed container styling */
.zeffy-embed-container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 300px;
  margin-bottom: 1.1rem;
  background: transparent !important;
  background-color: transparent !important;
}

.zeffy-embed-container iframe {
  position: absolute;
  border: 0;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}
