/* CSS Reset/Normalize */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "PingFang TC",
    "Noto Sans CJK TC",
    "Microsoft JhengHei",
    sans-serif,
    "Apple Color Emoji",
    "Segoe UI Emoji";
  line-height: 1.5;
  font-size: 20px;
  color: #333;
  overflow-x: hidden;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* Safari safe area inset */
body {
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

/* CSS variables */
:root {
  --blue: #50aadf;
  --water: #e2eaf7;
  --neutral: #f2f2f2;
  --mascot-red: #ea3822;
  --gray: #666666;
  --slate: #44546a;
  --gold: #f4d236;
  --white: #f2f2f2;
  --teal-blue: #033852;
  --azure: #336799;
  --stiletto: #9a3334;
  --silver: #cbc8c8;
}

/* Utility styles */
.sr-only {
  display: none;
}
.text-gold {
  color: var(--gold);
}
.text-white {
  color: var(--white);
}
.font-arial {
  font-family: Arial;
}
.text-xs {
  font-size: 0.75rem;
}
.text-base {
  font-size: 1rem;
}
.font-bold {
  font-weight: 800;
}
.tracking-widest {
  letter-spacing: 0.1em;
}
.leading-sm {
  line-height: 0.75;
}
.leading-md {
  line-height: 1.25;
}
.m-0 {
  margin: 0;
}
.relative {
  position: relative;
}

/* Main styles */
body {
  min-height: 100vh;
  background-color: var(--silver);
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
  padding: 1rem 0;
}
.container {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
header {
  background-color: var(--blue);
  background-image: url("images/bg.webp");
  background-repeat: no-repeat;
  background-size: cover;
  display: grid;
  grid-template-columns: 60% 1fr 34px;
  grid-template-areas:
    "logo medal menu"
    "date-range medal menu";
  align-items: center;
  justify-items: center;
  column-gap: 2px;
  position: sticky;
  z-index: 10;
  top: 0;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.logo {
  grid-area: logo;
}
.logo img {
  object-fit: contain;
  height: 100%;
}
.date-range {
  grid-area: date-range;
  font-family: Arial;
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 800;
}
.day {
  font-size: 0.5rem;
  display: inline-block;
  transform: rotate(-90deg);
  vertical-align: super;
  margin: 0 -10px;
}
.medal {
  background-image: url("images/medal.webp");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  grid-area: medal;
  display: grid;
  align-self: stretch;
  justify-self: stretch;
  grid-template-columns: repeat(3, 1fr);
  /* align-content: stretch; */
  justify-items: center;
  align-items: center;
  gap: 10px;
}
.medal-count {
  transform: translateY(10px);
  color: #123952;
  font-family: Arial;
  font-weight: 800;
  color: var(--teal-blue);
}

nav {
  grid-area: menu;
}
.nav {
  list-style: none;
}
.scroll-margin {
  scroll-margin-top: 150px;
}
.schedule-container {
  border-radius: 0.75rem;
  background-color: var(--gray);
  padding: 0.25rem 0.5rem;
  color: var(--white);
  display: none;
  align-items: center;
  font-size: 0.8rem;
}
.schedule {
  display: flex;
  flex-wrap: wrap;
  overflow-y: hidden;
  height: 1.2rem;
}
.required {
  flex-shrink: 0;
  white-space: nowrap;
}
.optional {
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  flex-shrink: 0;
  margin-left: 0.5rem;
}
.schedule-mobile {
  position: fixed;
  right: 0;
  bottom: env(safe-area-inset-bottom);
  left: 0;
  z-index: 20;
  width: 100%;
  border-radius: 0;
}
.channel-badge {
  border-radius: 0.75rem;
  background-color: var(--stiletto);
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  margin-right: 0.5rem;
}
.channel-badge span:first-child {
  display: inline-block;
  white-space: nowrap;
}
.broadcast {
  display: flex;
  justify-content: space-around;
}
/* hamburger */
.hamburger {
  display: flex;
  align-items: center;
  width: 30px;
  height: 30px;
  right: 10px;
  position: absolute;
  z-index: 100;
  cursor: pointer;
}

.hamburger > span {
  display: block;
  width: 100%;
  height: 2px;
  background: #000;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hamburger:before {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: #000;
  position: absolute;
  top: 3px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hamburger:after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: #000;
  position: absolute;
  bottom: 3px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hamburger.active > span {
  opacity: 0;
}

.hamburger.active:before {
  transform: rotate(45deg) translateY(-50%);
  top: 50%;
}

.hamburger.active:after {
  transform: rotate(-45deg) translateY(50%);
  bottom: 50%;
}
.nav {
  display: flex;
  flex-direction: column;
  background: var(--gray);
  position: fixed;
  width: 100vw;
  right: 0;
  top: -100vh;
  overflow: auto;
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 10;
  padding: 66px 30px 20px 30px;
  row-gap: 1rem;
  color: var(--white);
}
.nav.active {
  top: 0px;
}
.nav li {
  list-style: none;
}
.nav a {
  text-decoration: none;
  font-size: 1.2rem;
}
.nav a span {
  display: block;
}
.backdrop.active {
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

.hero {
  margin: 2rem 0;
}
.youtube {
  grid-area: youtube;
}
.youtube iframe {
  aspect-ratio: 16/9;
  width: 100% !important;
}
.hero-ads-wrapper {
  grid-area: hero-ads-wrapper;
}
.hero-ad-vertical {
  margin-top: 0.5rem;
}
.hero-ad-horizontal {
  grid-area: hero-ad-horizontal;
}
.mascot-container,
.hero-ads-wrapper,
.hero-ad-horizontal,
.ad-long {
  display: none;
}

.news {
  margin: 2rem 0;
  position: relative;
  width: 300px;
  max-width: 100%;
  margin-right: auto;
  margin-left: auto;
}
.news-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.news-heading h2 {
  color: var(--teal-blue);
  font-size: 1.35rem;
}
.news-controls {
  display: flex;
  position: absolute;
  top: 50%;
  right: -40px;
  left: -40px;
  z-index: 1;
  justify-content: space-between;
  pointer-events: none;
  transform: translateY(-50%);
}
.news-controls button {
  width: 2rem;
  height: 2rem;
  border: 2px solid rgba(128, 128, 128, 0.8);
  border-radius: 50%;
  color: rgba(128, 128, 128, 0.8);
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  pointer-events: auto;
}
.news-controls button:disabled {
  cursor: default;
  opacity: 0.35;
}
.news-viewport {
  overflow-x: auto;
  overflow-y: hidden;
}
.news-container {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 100%);
  grid-template-rows: minmax(0, 1fr);
}
.news-card {
  position: relative;
}
.news-card > a {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  background: var(--white);
  border: 1px solid #d9e0e8;
  border-radius: 0.4rem;
  text-decoration: none;
}
.news-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--water);
}
.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-card-content {
  padding: 0.55rem 0.65rem 0.7rem;
}
.news-card time {
  color: var(--gray);
  font-size: 0.65rem;
}
.news-card h3 {
  display: -webkit-box;
  margin: 0.2rem 0;
  overflow: hidden;
  /* font-size: 0.9rem; */
  line-height: 1.35;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.news-card p {
  display: none;
  /* display: -webkit-box; */
  overflow: hidden;
  color: var(--gray);
  font-size: 0.7rem;
  line-height: 1.45;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.news-card .news-more-overlay {
  position: absolute;
  inset: 0 0 0 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: var(--white);
  background: rgba(0, 0, 0, 0.5);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
/* .news-ad { */
/* display: flex; */
/*flex-direction: column;*/
/*align-items: center;*/
/*justify-content: center;*/
/* } */
.news-ad > div {
  width: 100% !important;
  height: auto !important;
}
.news-state {
  padding: 2rem 0;
  color: var(--gray);
  text-align: center;
}

footer {
  color: var(--white);
  background-color: var(--slate);
  font-size: 0.75rem;
}

@media (max-width: 1023px) {
  footer {
    padding-bottom: var(--schedule-mobile-height, 2.5rem);
  }
}
.image-copyright {
  padding: 0.5rem;
  text-align: center;
}
.company-info {
  padding: 0.5rem;
  background-color: var(--gray);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.company-info a {
  text-decoration: none;
  color: var(--white);
}
address {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-items: center;
  gap: 0.5rem;
  font-style: normal;
  justify-content: center;
}
/* .ad { */
/* display: flex; */
/*flex-direction: column;*/
/*width: 100%;*/
/*min-width: 0;*/
/* justify-content: center; */
/* } */
.ad-slot .adsbygoogle {
  display: block;
  line-height: 0;
}
.ad-note,
.news-ad .note {
  flex: 0 0 auto;
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

.news-ad div {
  width: 100% !important;
  /*max-width: 100%;*/
}
.ad-small {
  display: block;
  margin: 2rem auto;
}
.ad-small .adsbygoogle {
  width: 320px;
  height: 100px;
  display: block;
  line-height: 0;
}
.ad-m {
  display: block;
  width: 300px;
  height: 250px;
  padding: 0;
  margin: 2rem auto;
  /*overflow: hidden;*/
}
.ad-m .adsbygoogle {
  width: 300px;
  height: 250px;
  display: block;
  line-height: 0;
}

.mascot-m-container {
  display: flex;
  justify-content: center;
  margin: 1rem 0;
}
.mascot {
  height: 300px;
  object-fit: contain;
}
.note {
  font-size: 0.75rem;
}
#schedule .note {
  text-align: end;
  font-size: 0.6rem;
  display: none;
}

/* Resopnsive styles */
@media (min-width: 768px) {
  .header {
    grid-template-columns: 30% 30% 15% 25%;
    grid-template-areas: "logo date-range medal menu";
  }
  .date-range {
    justify-self: start;
  }
  .hamburger {
    display: none;
  }
  .nav {
    column-gap: 0.25rem;
    align-items: center;
    height: 100%;
    padding: 0.25rem 0.5rem;
    flex-direction: row;
    background-color: var(--azure);
    position: static;
    width: auto;
    overflow: auto;
    transition: none;
    border-radius: 0.5rem;
  }

  .nav li:not(:last-child) {
    border-right: 2px solid var(--white);
    padding-right: 0.25rem;
  }
  .nav a {
    font-size: 0.75rem;
  }
  .broadcast {
    display: inline;
  }
  .backdrop {
    display: none !important;
    position: static !important;
  }
  address {
    flex-direction: row;
  }
  .news-container {
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 25%);
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
  .news {
    padding: 0 0.5rem;
    width: auto;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }
  .news-card {
    padding-right: 0.5rem;
    padding-bottom: 0.75rem;
  }
  .news-card .news-more-overlay {
    inset: 0 0.5rem 2.15rem 0;
  }
  .news-card h3 {
    font-size: 0.78rem;
  }
  .news-card p {
    font-size: 0.62rem;
  }
  .news-controls {
    display: none;
  }
}

@media (min-width: 1024px) {
  .schedule-mobile {
    display: none;
  }
  .container {
    padding-left: calc(50% - 1024px / 2 + 0.5rem);
    padding-right: calc(50% - 1024px / 2 + 0.5rem);
  }
  .nav a {
    font-size: 1rem;
  }

  .date-range {
    font-size: 1.25rem;
  }
  .medal-count {
    transform: translateY(14px);
  }
  #schedule {
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: end;
  }
  .schedule-container {
    min-width: 80%;
    width: fit-content;
    font-size: 1.1rem;
  }
  .channel-badge {
    font-size: 1rem;
  }
  .schedule {
    display: block;
    overflow-y: visible;
    height: inherit;
  }
  .hero-wrapper {
    display: flex;
  }
  .hero {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 300px;
    grid-template-areas:
      "youtube hero-ads-wrapper"
      "hero-ad-horizontal hero-ads-wrapper";
    gap: 1rem;
  }
  .news {
    padding: 0 0.5rem;
  }
  .news-card {
    padding-right: 0.5rem;
    padding-bottom: 0.75rem;
  }
  .news-card h3 {
    font-size: 0.78rem;
  }
  .news-card p {
    font-size: 0.62rem;
  }
  .news-card .news-more-overlay {
    inset: 0 0.5rem 0.75rem 0;
  }
  .mascot-container {
    display: flex;
    flex-basis: 200px;
    justify-content: right;
  }
  .mascot-container img {
    transform: translateY(-50%);
    align-self: center;
    margin-right: 0.5rem;
  }
  .mascot-m-container {
    display: none;
  }
  .hero-ads-wrapper,
  .hero-ad-horizontal,
  .ad-long {
    display: block;
  }
  .ad-m,
  .ad-small {
    display: none;
  }
  .ad-long {
    /* display: block; */
    margin: 2rem 0;
    text-align: center;
  }
  /* .ad-landscape {
    display: block;
    width: 970px;
    height: 250px;
    padding: 0;
    margin: 0 auto;
  }

  .ad-landscape .adsbygoogle {
    width: 970px;
    height: 250px;
    display: block;
    line-height: 0;
  }

  .ad-portrait {
    display: block;
    width: 300px;
    padding: 0;
    margin: 1.5rem auto 0;
  }

  .ad-portrait .adsbygoogle {
    width: 300px;
    height: 600px;
    display: block;
    line-height: 0;
  }

  .ad-square {
    display: block;
    width: 300px;
    height: 250px;
    padding: 0;
    margin: 0 auto;
  }
  .ad-square .adsbygoogle {
    width: 300px;
    height: 250px;
    display: block;
    line-height: 0;
  } */
}
@media (min-width: 1280px) {
  .container {
    padding-left: calc(50% - 1280px / 2 + 0.5rem);
    padding-right: calc(50% - 1280px / 2 + 0.5rem);
  }
  .medal {
    gap: 1rem;
  }
  .medal-count {
    transform: translateY(17px);
    font-size: 1.25rem;
  }
  .scroll-margin {
    scroll-margin-top: 190px;
  }
}
