:root {
  --latest-news-theme: #A15A33;
  --follow-us-theme: #000;
  --latest-news-text: #706671;
  --latest-news-popup-close-btn: #818181;
}

@import url("https://fonts.googleapis.com/css2?family=Fira+Sans:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,400&family=Noto+Sans+TC&family=Noto+Sans+SC&display=swap");
@font-face {
  font-family: "Helvetica Neue";
  src: url("../fonts/HelveticaNeue.woff2") format("woff2"), url("../fonts/HelveticaNeue.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Helvetica Neue";
  src: url("../fonts/HelveticaNeue-Medium.woff2") format("woff2"), url("../fonts/HelveticaNeue-Medium.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "MHeiHK Medium";
  src: url("../fonts/MHeiHK-Medium-Roman.woff2") format("woff2"), url("../fonts/MHeiHK-Medium-Roman.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
/* @font-face {
  font-family: "Noto Sans HK";
  src: url("../fonts/NotoSansHK-Light-Alphabetic.woff2") format("woff2"), url("../fonts/NotoSansHK-Light-Alphabetic.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
} */
@font-face {
  font-family: "AvenirLTStd";
  src: url("../fonts/AvenirLTStd/AvenirLTStd-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AvenirLTStd";
  src: url("../fonts/AvenirLTStd/AvenirLTStd-Roman.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AvenirLTStd";
  src: url("../fonts/AvenirLTStd/AvenirLTStd-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AvenirLTStd";
  src: url("../fonts/AvenirLTStd/AvenirLTStd-Heavy.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "AvenirLTStd";
  src: url("../fonts/AvenirLTStd/AvenirLTStd-Black.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

#latest-news-section {
  min-height: 100px; /* Adjust the height as needed */
  background-color: #f0f0f0; /* Adjust the background color as needed */
}

#social-media-posts,
#latest-happening {
  display: flex;
  flex-direction: column;
  margin: 2rem;
  margin-right: 0;
  width: calc(100% - 1rem * 2);
  /* allow visible overflow by default; mobile rules will enable horizontal scroll when needed */
  overflow-x: visible;
  overflow: visible;
  min-height: min(200px, 50vh);
}

#social-media-posts > .header,
#latest-happening > .header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 2.5rem;
  align-items: flex-start;
}
#social-media-posts > .header {
  margin-bottom: 40px;
}
#social-media-posts > .header > .title,
#latest-happening > .header > .title {
  font-size: 24px;
  /*color: var(--latest-news-theme);*/
  color: #A15A33;
  line-height: 1.2;
}

#social-media-posts > .header > .actions,
#latest-happening > .header > .actions {
  display: flex;
  justify-content: space-between;
}

#social-media-posts > .header > .actions > .btn-prev,
#social-media-posts > .header > .actions > .btn-next,
#latest-happening > .header > .actions > .btn-prev,
#latest-happening > .header > .actions > .btn-next {
  height: 40px;
  width: 40px;
  display: inline-block;
  position: relative;
  cursor: pointer;
}

#social-media-posts > .header > .actions > .btn-prev > img,
#social-media-posts > .header > .actions > .btn-next > img,
#latest-happening > .header > .actions > .btn-prev > img,
#latest-happening > .header > .actions > .btn-next > img {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  object-fit: cover;
}

#social-media-posts > .header > .actions > .btn-prev > img.btn-state-hover,
#social-media-posts > .header > .actions > .btn-next > img.btn-state-hover,
#latest-happening > .header > .actions > .btn-prev > img.btn-state-hover,
#latest-happening > .header > .actions > .btn-next > img.btn-state-hover {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  opacity: 0;
}

#social-media-posts > .header > .actions > .btn-prev:hover > img.btn-state-hover,
#social-media-posts > .header > .actions > .btn-next:hover > img.btn-state-hover,
#latest-happening > .header > .actions > .btn-prev:hover > img.btn-state-hover,
#latest-happening > .header > .actions > .btn-next:hover > img.btn-state-hover {
  opacity: 1;
}

#social-media-posts .swiper-button-disabled,
#latest-happening .swiper-button-disabled {
  display: none !important;
}

#social-media-posts > .posts,
#latest-happening > .posts {
  display: flex;
  flex: 1;
  width: 100%;
}

#social-media-posts > .posts .swiper-slide {
  width: min(250px, 20vh);
  height: auto;
  aspect-ratio: 1 / 1;
  pointer-events: auto;
}

#social-media-posts > .posts .item {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#social-media-posts > .posts .item > .image {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 100%;
  transform: scale(1);
  transition: 0.4s ease-in;
}

#social-media-posts > .posts .item:hover > .image {
  transform: scale(1.1);
}

#social-media-posts > .posts .item > .footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  grid-gap: 0.625rem;
  height: 23%;
  width: 100%;
  padding: calc(max(min(1rem, 1.5vw), 0.6rem) / 2);
  background: rgb(255 255 255 / 70%);
  color: var(--follow-us-theme);
  font-size: 0.9rem;
  line-height: 1.2;
  transition: 0.4s ease-in;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

#social-media-posts > .posts .item:hover > .footer {
  background: rgb(255 255 255 / 95%);
}

#social-media-posts > .posts .item > .footer > .tag {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: calc(100% - max(min(1rem, 2vw), 0.7rem) * 1.5 * 2);
  margin-top: 0.2rem;
  color: #A15A33;
  font-size: 19px;
  font-family: "Noto Sans TC", Verdana, sans-serif;
}

#social-media-posts > .posts .item > .footer > svg {
  fill: #A15A33;
  height: 100%;
  width: auto;
  max-height: calc(max(min(1rem, 2vw), 0.7rem) * 1.5);
}

#latest-happening {
  display: flex;
  flex-direction: column;
  margin: 2rem;
}

#latest-happening > .posts .swiper-slide {
  width: min(450px, 40vh);
  height: auto;
  pointer-events: auto;
}

#latest-happening > .posts .item {
  display: inline-flex;
  flex-direction: column;
  justify-content: flex-start;
  grid-gap: 6px;
  position: relative;
  width: min(450px, 40vh);
  height: 100%;
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

#latest-happening > .posts .item .image {
  height: auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  max-height: 258px;
  object-fit: contain;
  cursor: pointer;
}

#latest-happening > .posts .item .date {
  color: #A15A33;
  font-size: 15px;
  line-height: 1.1;
  font-family: 'Noto Sans TC', Verdana, sans-serif;
}

#latest-happening > .posts .item .caption_short {
  color: #A15A33;
  font-size: 17px;
  line-height: 1.3;
  display: inline-block;
  margin-bottom: 1rem;
  text-overflow: ellipsis;
  cursor: pointer;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 400;
  font-family: "Noto Sans TC", Verdana, sans-serif;
  flex-grow: 1;
}

#latest-happening > .posts .item .actions {
  margin-top: auto;
}

#latest-happening > .posts .item .learn_more {
  color: #A15A33;
  font-size: 0.9rem;
  padding: 0.65rem 1.5625rem;
  border: 1px solid #A15A33;
  display: inline-block;
  cursor: pointer;
  text-decoration: none!important;
}

#latest-happening > .posts .item .learn_more:hover {
  color: white;
  font-size: 0.9rem;
  background-color: #A15A33;
}

#latest-happening > .posts .item > .footer {
  display: block;
  height: 23%;
  width: 100%;

  padding: 0.625rem;
  background: #FFFFFFB3;
  color: var(--follow-us-theme);
  font-size: 0.8rem;
  line-height: 1.3;
}

#latest-news-popup {
	height: 100vh;
	width: 100vw;
	max-height: -webkit-fill-available;

	position: fixed;
	top: 0;
	left: 0;
	z-index: 9999;

	background: rgba(0, 0, 0, 0.3);
  font-size: 1rem;
}

/* Mobile fixes: prevent .posts causing page horizontal overflow; allow inner horizontal scroll */
@media (max-width: 767px) {
  .page-container {
        overflow: hidden;
  }
  #social-media-posts > .posts,
  #latest-happening > .posts {
    -webkit-overflow-scrolling: touch;
    display: flex;
    gap: 12px;
    padding-bottom: 6px; /* avoid cut-off */
    /* enable horizontal scrolling for narrow viewports to avoid page overflow */
    box-sizing: border-box;
    padding-left: 6px;
  }
  /* Keep slides reasonably sized on small screens */
  #social-media-posts > .posts .swiper-slide {
    width: min(220px, 46vw);
    flex: 0 0 auto;
  }
  /* Latest happening: show one card per viewport width (allow horizontal scroll) */
  #latest-happening > .posts .swiper-slide,
  #latest-happening > .posts .item {
    width: calc(86vw);
    max-width: 100%;
    flex: 0 0 auto;
  }
  /* Reduce side margins for latest-happening so content fits */
  #latest-happening { margin: 1rem; }
  /* Reduce side margins for social media posts on small screens */
  #social-media-posts { margin: 1rem; width: calc(100% - 1rem * 2); }
}

#latest-news-popup.d-none,
#latest-news-popup *.d-none {
  display: none!important;
}

#latest-news-popup .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--latest-news-popup-close-btn);
  width: 25px;
  height: 25px;
}

#latest-news-popup .close-btn svg {
  width: 100%;
  height: 100%;
}

#latest-news-popup .close-btn svg,
#latest-news-popup .close-btn svg path {
  color: var(--latest-news-popup-close-btn);
  fill: var(--latest-news-popup-close-btn);
}
#latest-news-popup .close-btn {
    padding: 0;
    background: none;
    border: none;
}
#latest-news-popup .popup-card {
  width: 100%;
  max-width: min(1000px, 70vw);
  height: auto;
  max-height: 95vh;
  padding: 50px;
  padding-top: 50px;
  background: #FFFFFF;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  grid-gap: 0.5rem;
  animation: fadeIn 0.5s ease-in-out;
}

#latest-news-popup .popup-card .image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#latest-news-popup .popup-card > .content {
  width: 100%;
  line-height: 1.5;
  overflow-y: auto;
  color: var(--latest-news-text);
  padding: 0;
  padding-right: 25px;
  max-height: 95vh;
  display: flex;
  grid-gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

#latest-news-popup .popup-card > .content > * {
  width: 100%;
}

#latest-news-popup .popup-card > .content::-webkit-scrollbar {
  width: 4px;
  height: 2px;
  padding: 0;
}

#latest-news-popup .popup-card > .content::-webkit-scrollbar-thumb {
  scrollbar-width: thin;
  background: #A15A33;
  border-radius: 0;
  border: none;
}


#latest-news-popup .popup-card > .content::-webkit-scrollbar-track {
   scrollbar-width: thin;
  background: #eee;
  border: none;
  box-shadow: none;
}

#latest-news-popup .popup-card .latest-news-popup-swiper {
  height: 50vh !important;
  width: 49vw !important;
}

#latest-news-popup .popup-card .latest-news-popup-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

#latest-news-popup .popup-card .latest-news-popup-image .swiper-wrapper .swiper-slide {
  height: auto;
  object-fit: contain;
}

#latest-news-popup .popup-card .latest-news-popup-image .swiper-pagination-bullet {
  background: white;
}

#latest-news-popup .popup-card .latest-news-popup-image .swiper-pagination-bullet.swiper-pagination-bullet-active {
  background: var(--latest-news-theme);
}

#latest-news-popup .popup-card .latest-news-popup-image .swiper-button-prev,
#latest-news-popup .popup-card .latest-news-popup-image .swiper-button-next {
  color: var(--latest-news-theme);
}

#latest-news-popup .popup-card .latest-news-popup-date {
  color: #818181;
  width: 100%;
  font-size: 0.875em;
}

#latest-news-popup .popup-card .latest-news-popup-title,
#latest-news-popup .popup-card .latest-news-popup-sub-title {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  color: var(--latest-news-theme) !important;
  font-weight: bold !important;
  line-height: 1.3 !important;
}

#latest-news-popup .popup-card .latest-news-popup-title {
  font-size: 1.5em !important;
}

#latest-news-popup .popup-card .latest-news-popup-sub-title {
  font-size: 1.125em !important;
}

#latest-news-popup .popup-card .latest-news-popup-title sup,
#latest-news-popup .popup-card .latest-news-popup-title sub,
#latest-news-popup .popup-card .latest-news-popup-sub-title sup,
#latest-news-popup .popup-card .latest-news-popup-sub-title sub {
  font-size: 0.75em !important;
}

#latest-news-popup .popup-card .latest-news-popup-description {
  color: inherit !important;
  font-size: 1em !important;
}

#latest-news-popup .popup-card .latest-news-popup-description sup,
#latest-news-popup .popup-card .latest-news-popup-description sub {
  font-size: 0.75em !important;
}

#latest-news-popup .popup-card .latest-news-popup-title *,
#latest-news-popup .popup-card .latest-news-popup-sub-title * {
  text-align: center !important;
  font-weight: inherit !important;
}

#latest-news-popup .popup-card .latest-news-popup-title *,
#latest-news-popup .popup-card .latest-news-popup-sub-title *,
#latest-news-popup .popup-card .latest-news-popup-description *,
#latest-news-popup .popup-card .latest-news-popup-title sup *,
#latest-news-popup .popup-card .latest-news-popup-title sub *,
#latest-news-popup .popup-card .latest-news-popup-sub-title sup *,
#latest-news-popup .popup-card .latest-news-popup-sub-title sub *,
#latest-news-popup .popup-card .latest-news-popup-description sup *,
#latest-news-popup .popup-card .latest-news-popup-description sub * {
  font-size: inherit !important;
  color: inherit !important;
  line-height: inherit !important;
  margin: inherit !important;
}

#latest-news-popup .popup-card .latest-news-popup-description p {
  margin-top: 0;
  margin-bottom: 1em !important;
}

#latest-news-popup .popup-card .news-report {
  width: 100%;
}

#latest-news-popup .popup-card .news-report .caption {
  color: var(--latest-news-theme);
  font-size: 1.125em;
  font-weight: bold;
  margin-bottom: 3px;
}

#latest-news-popup .popup-card .news-report .links {
  display: flex;
  grid-gap: 40px;
  flex-wrap: wrap;
}

#latest-news-popup .popup-card .news-report .links > a {
  color: var(--latest-news-theme);
  padding: 8px 14px;
  border: 1px solid var(--latest-news-theme);
  display: inline-block;
  font-size: 0.875em;
}

.swiper-slide:not(.swiper-slide-active) #social-media-posts > .posts .swiper-slide,
.swiper-slide:not(.swiper-slide-active) #latest-happening > .posts .swiper-slide {
  pointer-events: none;
}

@media only screen and (max-width: 991px) {
  #social-media-posts > .posts .swiper-slide,
  #latest-happening > .posts .swiper-slide {
    
    min-width: unset;
    min-height: unset;
  }

  #latest-happening > .posts .item {
    width: 100%;
    height: 100%;
  }
  
  #social-media-posts > .posts .swiper-slide > .footer,
  #latest-happening > .posts .swiper-slide > .footer {
    padding: max(2vw, 0.325rem);
  }

  #latest-news-popup .popup-card {
    max-width: 90vw;
    padding: 15px;
    padding-top: 50px;
  }

  #latest-news-popup .popup-card > .content {
    padding-right: 15px;
  }

  #latest-news-popup .close-btn {
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
  }

  #latest-news-popup .popup-card .news-report .links {
    display: flex;
    grid-gap: 10px;
    flex-wrap: wrap;
  }

  #latest-news-popup .popup-card .news-report .links > a {
    padding: 5px 10px;
    font-size: 0.75em;
  }
}

@media only screen and (max-width: 767px) {
  #latest-happening > .posts .item .date {
    font-size: 0.6rem;
  }

  #latest-happening > .posts .item .caption_short {
    font-size: 0.75rem;
  }

  #latest-happening > .posts .item .learn_more {
    font-size: 0.75rem;
  }

  #latest-news-popup .popup-card .latest-news-popup-title {
    font-size: 1em !important;
  }

  #latest-news-popup .popup-card .latest-news-popup-sub-title {
    font-size: 0.85em !important;
  }

  #latest-news-popup .popup-card .latest-news-popup-description {
    font-size: 0.75em !important;
  }

  #latest-news-popup .popup-card .latest-news-popup-date {
    font-size: 0.65em !important;
  }

  #latest-news-popup .popup-card .news-report .caption {
    font-size: 1em;
  }

  #latest-news-popup .popup-card .news-report .links {
    display: flex;
    grid-gap: 10px;
    flex-wrap: wrap;
  }

  #latest-news-popup .popup-card .news-report .links > a {
    padding: 5px 10px;
    font-size: 0.75em;
  }
}
