/*
 * FGMC Retreat Download Centre
 */
:root {
  --dc-red: #b00000;
  --dc-red-dark: #570000;
  --dc-black: #121214;
  --dc-gold: #e6b84a;
  --dc-cream: #faf7f2;
  --dc-white: #fff;
  --dc-muted: #756c6c;
  --dc-border: #eadfd7;
  --dc-shadow: 0 18px 54px rgba(54, 8, 8, .12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.download-page {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  color: #201b1b;
  background: var(--dc-cream);
  font-family: Inter, Arial, sans-serif;
}

.download-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(15px, 4vw, 62px);
  color: #fff;
  background: rgba(14, 14, 16, .97);
  border-bottom: 3px solid var(--dc-red);
  box-shadow: 0 10px 32px rgba(0,0,0,.2);
  backdrop-filter: blur(14px);
}

.download-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.download-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.download-brand span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.download-brand strong {
  overflow: hidden;
  font-family: Georgia, serif;
  font-size: 1.06rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-brand small {
  margin-top: 4px;
  color: rgba(255,255,255,.65);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.download-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.download-language {
  display: flex;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}

.download-language button {
  min-width: 38px;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  color: rgba(255,255,255,.64);
  background: transparent;
  font-weight: 900;
  cursor: pointer;
}

.download-language button.active {
  color: #fff;
  background: var(--dc-red);
}

.download-home-link {
  padding: 10px 13px;
  border-radius: 11px;
  color: #fff;
  background: var(--dc-red);
  font-size: .77rem;
  font-weight: 900;
  text-decoration: none;
}

.download-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(62px, 9vw, 110px) clamp(15px, 4vw, 62px) 58px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(25,0,0,.96), rgba(105,0,0,.95)),
    var(--dc-black);
}

.download-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .13;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 28px,
      rgba(255,255,255,.09) 29px 30px
    );
}

.download-hero-glow {
  position: absolute;
  z-index: -1;
  top: -180px;
  right: -170px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,184,74,.54), transparent 68%);
  filter: blur(3px);
}

.download-hero-inner {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.download-eyebrow {
  margin: 0 0 10px;
  color: var(--dc-gold);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.download-hero h1 {
  max-width: 820px;
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(2.35rem, 6vw, 5.1rem);
  line-height: .98;
  text-wrap: balance;
}

.download-hero > .download-hero-inner > p:not(.download-eyebrow) {
  max-width: 760px;
  margin: 20px 0 0;
  color: rgba(255,255,255,.78);
  font-size: clamp(.98rem, 1.8vw, 1.18rem);
  line-height: 1.65;
}

.download-search-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(180px, .7fr));
  gap: 12px;
  margin-top: 34px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 20px;
  background: rgba(255,255,255,.1);
  box-shadow: 0 20px 52px rgba(0,0,0,.24);
  backdrop-filter: blur(15px);
}

.download-search-panel label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: rgba(255,255,255,.7);
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .04em;
}

.download-search-panel input,
.download-search-panel select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 13px;
  padding: 0 14px;
  color: #1d1717;
  background: #fff;
  font: inherit;
  outline: none;
}

.download-search-panel input:focus,
.download-search-panel select:focus {
  border-color: var(--dc-gold);
  box-shadow: 0 0 0 4px rgba(230,184,74,.2);
}

.download-library {
  width: min(100%, 1240px);
  min-height: 420px;
  margin: 0 auto;
  padding: 54px clamp(14px, 4vw, 42px) 76px;
}

.download-library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.download-library-head h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.download-result-count {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--dc-border);
  border-radius: 999px;
  color: var(--dc-red);
  background: #fff;
  font-size: .76rem;
  font-weight: 900;
}

.download-centre-status {
  display: flex;
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--dc-muted);
  text-align: center;
}

.download-loader {
  width: 25px;
  height: 25px;
  border: 3px solid #ead7d2;
  border-top-color: var(--dc-red);
  border-radius: 50%;
  animation: dcSpin .8s linear infinite;
}

.download-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.download-resource-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 265px;
  flex-direction: column;
  overflow: hidden;
  padding: 21px;
  border: 1px solid var(--dc-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 12px 38px rgba(51, 8, 8, .07);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.download-resource-card:hover {
  transform: translateY(-5px);
  border-color: rgba(176,0,0,.35);
  box-shadow: var(--dc-shadow);
}

.download-resource-card::after {
  content: "";
  position: absolute;
  right: -62px;
  bottom: -70px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  opacity: .09;
  background: radial-gradient(circle, var(--dc-gold), transparent 68%);
}

.download-resource-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.download-resource-icon {
  display: grid;
  width: 55px;
  height: 55px;
  flex: 0 0 55px;
  place-items: center;
  border: 1px solid rgba(176,0,0,.13);
  border-radius: 16px;
  background: rgba(176,0,0,.07);
  font-size: 1.65rem;
}

.download-resource-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.download-resource-tag {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  color: #6e5555;
  background: #f7f1ed;
  font-size: .63rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.download-resource-tag.featured {
  color: #4c2b00;
  background: #ffe6a0;
}

.download-resource-card h3 {
  position: relative;
  z-index: 2;
  margin: 17px 0 8px;
  color: #201919;
  font-size: 1.08rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.download-resource-card p {
  position: relative;
  z-index: 2;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--dc-muted);
  font-size: .84rem;
  line-height: 1.55;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.download-resource-meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 14px;
  color: #8a7b7b;
  font-size: .68rem;
  font-weight: 750;
}

.download-resource-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.download-resource-actions a {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  padding: 10px 13px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--dc-red), var(--dc-red-dark));
  font-size: .76rem;
  font-weight: 900;
  text-decoration: none;
}

.download-resource-actions a.secondary {
  color: #2c2222;
  background: #f0ece9;
}

.download-empty {
  grid-column: 1 / -1;
  padding: 54px 20px;
  border: 1px dashed #d8c9c0;
  border-radius: 20px;
  color: var(--dc-muted);
  background: #fff;
  text-align: center;
}

.download-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 25px 18px;
  color: rgba(255,255,255,.72);
  background: #111;
  text-align: left;
}

.download-footer img {
  width: 43px;
  height: 43px;
  object-fit: contain;
}

.download-footer div {
  display: flex;
  flex-direction: column;
}

.download-footer strong {
  color: #fff;
  font-size: .82rem;
}

.download-footer span {
  margin-top: 4px;
  font-size: .68rem;
}

/* Homepage Download Centre */
.download-centre-home {
  display: grid;
  gap: 17px;
}

.download-centre-home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.download-centre-home-head h2 {
  margin: 0;
}

.download-centre-home-head p {
  max-width: 680px;
  margin: 8px 0 0;
  opacity: .78;
}

.download-centre-view-all {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  padding: 11px 15px;
  border-radius: 12px;
  color: #2f1900;
  background: var(--dc-gold);
  font-size: .77rem;
  font-weight: 900;
  text-decoration: none;
}

.download-centre-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.download-centre-home .download-resource-card {
  min-height: 245px;
  color: #201919;
}

@media (max-width: 980px) {
  .download-resource-grid,
  .download-centre-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-search-panel {
    grid-template-columns: 1fr 1fr;
  }

  .download-search-panel label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .download-topbar {
    min-height: 68px;
    padding: 10px 12px;
  }

  .download-brand img {
    width: 38px;
    height: 38px;
  }

  .download-brand strong {
    font-size: .9rem;
  }

  .download-home-link {
    display: none;
  }

  .download-language button {
    min-width: 35px;
    min-height: 34px;
  }

  .download-hero {
    padding: 52px 12px 35px;
  }

  .download-hero h1 {
    font-size: clamp(2.15rem, 12vw, 3.6rem);
  }

  .download-search-panel {
    grid-template-columns: 1fr;
    margin-top: 25px;
    padding: 11px;
    border-radius: 17px;
  }

  .download-search-panel label:first-child {
    grid-column: auto;
  }

  .download-library {
    padding: 39px 12px 55px;
  }

  .download-library-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 17px;
  }

  .download-resource-grid {
    grid-template-columns: 1fr;
  }

  .download-resource-card {
    min-height: 238px;
    padding: 17px;
    border-radius: 18px;
  }

  .download-resource-card:hover {
    transform: none;
  }

  .download-resource-actions {
    grid-template-columns: 1fr;
  }

  .download-centre-home-head {
    align-items: stretch;
    flex-direction: column;
  }

  .download-centre-view-all {
    width: 100%;
  }

  .download-centre-home-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(86vw, 350px);
    grid-template-columns: none;
    width: calc(100% + 12px);
    margin-right: -12px;
    padding: 3px 12px 14px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .download-centre-home-grid::-webkit-scrollbar {
    display: none;
  }

  .download-centre-home-grid .download-resource-card {
    min-height: 255px;
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .download-loader {
    animation: none;
  }

  .download-resource-card {
    transition: none;
  }
}

@keyframes dcSpin {
  to { transform: rotate(360deg); }
}
