/* ==========================================================================
   GolfWA Homepage — News slider + Upcoming events
   Rendered by the [golfwa-news-events] shortcode.
   Palette: navy #011c25 | yellow #f9ce3f | grey #939799
   Fonts are intentionally inherited from the theme.
   ========================================================================== */

.gwa-news-events,
.gwa-news-events *,
.gwa-news-events *::before,
.gwa-news-events *::after { box-sizing: border-box; }

.gwa-news-events {
  --gwa-navy: #011c25;
  --gwa-yellow: #f9ce3f;
  --gwa-grey: #939799;
  display: flex;
  align-items: stretch;
  width: 100%;
}

/* Full-bleed / wrapper padding removal is applied on MOBILE ONLY — see the
   @media (max-width: 767px) block near the end of this file. On larger screens
   the section sits inside the normal Divi container. */

/* ---- Reusable arrow glyphs (right-pointing) ---------------------------- */
.gwa-arrow {
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
/* navy arrow (on yellow backgrounds) */
.gwa-event__chip .gwa-arrow,
.gwa-viewall .gwa-arrow {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23011c25' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
}
/* yellow arrow (on dark backgrounds) */
.gwa-readmore .gwa-arrow {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f9ce3f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Minimal Slick base (theme ships no slick.css — styles live per-page)
   ========================================================================== */
.gwa-news__slider { display: block; }
.gwa-news__slider.slick-slider { position: relative; }
.gwa-news__slider .slick-list { position: relative; display: block; overflow: hidden; margin: 0; padding: 0; }
.gwa-news__slider .slick-track { position: relative; top: 0; left: 0; display: block; }
.gwa-news__slider .slick-track::before,
.gwa-news__slider .slick-track::after { display: table; content: ''; }
.gwa-news__slider .slick-track::after { clear: both; }
.gwa-news__slider .slick-slide { float: left; height: 100%; min-height: 1px; }
/* Before Slick initialises, only show the first slide to avoid a tall stack */
.gwa-news__slider:not(.slick-initialized) .gwa-slide { display: none; }
.gwa-news__slider:not(.slick-initialized) .gwa-slide:first-child { display: flex; }

/* ==========================================================================
   News panel (left on desktop / top on mobile)
   ========================================================================== */
.gwa-news {
  flex: 1 1 0;
  min-width: 0;
  background: var(--gwa-navy);
  padding: 20px;
}

.gwa-slide { flex-direction: column; gap: 30px; }
.gwa-news__slider .slick-slide.gwa-slide,
.gwa-news__slider .gwa-slide { display: flex; }

/* Slide image + overlaid arrows */
.gwa-slide__image {
  position: relative;
  width: 100%;
  aspect-ratio: 910 / 520;
  background-color: #04303d;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.gwa-slide__imglink { position: absolute; inset: 0; z-index: 1; }

.gwa-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 80px;
  z-index: 2;
  border: 0;
  cursor: pointer;
  background-color: var(--gwa-yellow);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23011c25' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='4' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 28px;
  transition: background-color .2s ease;
}
.gwa-arrow-btn:hover { background-color: #ffd85c; }
.gwa-arrow-btn--prev { left: 0; transform: translateY(-50%) rotate(180deg); }
.gwa-arrow-btn--next { right: 0; }

/* Progress bar + counter */
.gwa-progress { display: flex; align-items: center; gap: 20px; }
.gwa-progress__track { flex: 1 1 auto; height: 3px; background: rgba(255, 255, 255, .1); }
.gwa-progress__bar { display: block; height: 3px; width: 25%; background: var(--gwa-yellow); transition: width .4s ease; }
.gwa-counter {
  flex: 0 0 auto;
  color: var(--gwa-grey);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  text-align: right;
}
.gwa-counter b { color: var(--gwa-yellow); font-weight: 700; }

/* Copy */
.gwa-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--gwa-grey);
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
}
.gwa-tag { font-weight: 700; }
.gwa-heading {
  margin: 0;
  color: var(--gwa-yellow);
  font-size: 36px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: .2px;
}
.gwa-heading a { color: inherit; text-decoration: none; }
.gwa-date--stacked { display: none; color: var(--gwa-grey); font-size: 14px; letter-spacing: .8px; }
.gwa-excerpt {
  margin: 0;
  max-width: 570px;
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 1px;
}
.gwa-readmore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gwa-yellow);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .5px;
  text-decoration: none;
  align-self: flex-start;
}
.gwa-readmore > span:first-child { border-bottom: 2px solid var(--gwa-yellow); padding-bottom: 6px; }
.gwa-readmore .gwa-arrow { width: 15px; height: 15px; }

/* Space between the news slider stack items handled by slide gap;
   give the copy a little breathing room from the panel edges. */
.gwa-slide { padding-bottom: 20px; }

/* ==========================================================================
   Events panel (right on desktop / bottom on mobile)
   ========================================================================== */
.gwa-events {
  flex: 0 0 350px;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 30px 20px 25px;
}
.gwa-events__title {
  margin: 0 0 25px;
  color: var(--gwa-navy);
  font-size: 36px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: .2px;
}
.gwa-events__list {
  list-style: none;
  margin: 0 0 25px;
  padding: 10px 0 0;
  border-top: 4px solid var(--gwa-navy);
}
/* No list bullets/indent (override theme + Divi list styling). */
.gwa-news-events .gwa-events__list,
.gwa-news-events .gwa-events__list .gwa-event {
  list-style: none !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}
.gwa-news-events .gwa-events__list .gwa-event::before { content: none !important; display: none !important; }

.gwa-event { border-bottom: 1px solid var(--gwa-navy); }
.gwa-event__link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 0;
  text-decoration: none;
}
.gwa-event__date {
  width: 100%;
  margin-bottom: 8px;
  color: var(--gwa-grey);
  font-size: 14px;
  letter-spacing: .8px;
}
.gwa-event__name {
  width: 100%;
  margin-bottom: 10px;
  color: var(--gwa-navy);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: .2px;
}
.gwa-event__details {
  margin-right: auto;
  color: var(--gwa-navy);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .5px;
}
.gwa-event__chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--gwa-yellow);
}
.gwa-event__chip .gwa-arrow { width: 12px; height: 12px; }

.gwa-viewall {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 60px;
  padding: 0 36px;
  background: var(--gwa-yellow);
  color: var(--gwa-navy);
  font-size: 25px;
  font-weight: 700;
  text-decoration: none;
  transition: background-color .2s ease;
}
.gwa-viewall:hover { background: #ffd85c; }
.gwa-viewall .gwa-arrow { width: 19px; height: 21px; }

/* ==========================================================================
   Desktop / tablet — make the news slide fill the navy panel height
   The section stretches both panels to equal height (align-items: stretch), so
   the navy news panel is forced as tall as the (usually taller) white events
   list. A short slide previously left a large empty navy block below "Read
   more". Here the slider fills the panel and the slide image absorbs the leftover
   height, so the navy is always covered. Scoped to >=768px; mobile stacks and
   keeps its own fixed-ratio image (see the mobile block below).
   ========================================================================== */
@media (min-width: 768px) {
  .gwa-news { display: flex; flex-direction: column; }
  .gwa-news__slider { flex: 1 1 auto; }
  /* Fill the slider height through Slick's wrappers (inline px heights get
     overridden). Works pre-init too: the first slide is height:100% of the
     block-level slider, which matters because LiteSpeed delays Slick's JS. */
  .gwa-news__slider.slick-initialized .slick-list,
  .gwa-news__slider.slick-initialized .slick-track { height: 100% !important; }
  .gwa-news__slider .slick-slide.gwa-slide,
  .gwa-news__slider .gwa-slide { height: 100%; }
  /* Image grows into the leftover space; the copy keeps its natural height.
     min-height keeps a sensible image size on long-copy slides. */
  .gwa-slide__image { flex: 1 1 auto; aspect-ratio: auto; min-height: 320px; }
}

/* ==========================================================================
   Mobile — stack the two panels and re-order the news slide
   ========================================================================== */
@media (max-width: 767px) {
  /* Full-bleed the section on MOBILE ONLY. On larger screens it stays inside the
     normal Divi container. Wrapper-agnostic viewport-width breakout for the
     element itself; the wrapper padding-zeroing below removes the top/side gaps.
     Theme-builder header/footer wrappers (`_tb_`) are excluded. */
  .gwa-news-events {
    flex-direction: column;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  body.gwa-has-news-events .et_pb_section:not([class*="_tb_"]),
  body.gwa-has-news-events .et_pb_row:not([class*="_tb_"]) { padding-top: 0 !important; padding-bottom: 0 !important; }
  body.gwa-has-news-events .et_pb_row:not([class*="_tb_"]) { width: 100% !important; max-width: 100% !important; }
  body.gwa-has-news-events .et_pb_column:not([class*="_tb_"]) { padding: 0 !important; }
  .gwa-news { padding: 30px 20px 40px; }
  .gwa-events { flex: 1 1 auto; padding: 30px 20px; }

  .gwa-slide { gap: 20px; }
  /* Figma mobile order: progress, tag, heading, date, image, excerpt, read more */
  .gwa-progress      { order: 1; }
  .gwa-meta          { order: 2; }
  .gwa-heading       { order: 3; font-size: 30px; }
  .gwa-sep           { display: none; }
  .gwa-date--inline  { display: none; }
  .gwa-date--stacked { display: block; order: 4; }
  .gwa-slide__image  { order: 5; aspect-ratio: 280 / 160; }
  .gwa-excerpt       { order: 6; line-height: 1.7; }
  .gwa-readmore      { order: 7; }

  .gwa-arrow-btn { width: 45px; height: 45px; background-size: 18px 18px; }

  .gwa-events__title { font-size: 24px; margin-bottom: 30px; }
  .gwa-event__name { width: auto; flex: 1 1 auto; margin-bottom: 0; }
  .gwa-event__details { display: none; }
  .gwa-event__link { padding: 15px 0; gap: 8px 20px; }
  .gwa-event__date { margin-bottom: 0; font-size: 12px; }
  .gwa-event__chip { width: 24px; height: 24px; }
  .gwa-event__chip .gwa-arrow { width: 15px; height: 15px; }

  .gwa-viewall { font-size: 20px; padding: 20px; padding-left: 36px; min-height: 0; }
}
