/* =========================================================
   MyCorp Academy — Updates (videos & posts)
   Companion to style.css. Loaded on every page from includes/header.php
   ========================================================= */

/* ----- Filter chips ----- */
.upd-filters {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: -10px 0 34px;
}
.upd-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--navy);
  font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  transition: all 0.2s;
}
.upd-chip:hover { border-color: var(--orange); color: var(--orange); }
.upd-chip.active { background: var(--navy); border-color: var(--navy); color: #ffffff; }
.upd-chip .upd-chip-n { font-size: 11px; font-weight: 600; opacity: 0.6; }

/* ----- Grid ----- */
.upd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 26px;
}

/* ----- Card ----- */
.upd-card {
  display: flex; flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.upd-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--orange-line);
}
.upd-media {
  position: relative;
  background: var(--navy);
  overflow: hidden;
}
.upd-media::before { content: ""; display: block; padding-top: 125%; } /* 4:5 */
.upd-media img,
.upd-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.upd-media video { pointer-events: none; }
.upd-card:hover .upd-media img,
.upd-card:hover .upd-media video { transform: scale(1.04); }
.upd-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 25, 40, 0.30) 0%, rgba(15, 25, 40, 0) 28%, rgba(15, 25, 40, 0) 60%, rgba(15, 25, 40, 0.45) 100%);
  pointer-events: none;
}

/* Text tile, used when an update has no cover image */
.upd-tile {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 26px 22px 30px;
  background:
    radial-gradient(circle at 88% 12%, rgba(238, 90, 31, 0.55), transparent 46%),
    linear-gradient(160deg, #1b2a40 0%, var(--navy) 62%);
}
.upd-tile::before {
  content: "";
  position: absolute; top: -70px; right: -70px;
  width: 210px; height: 210px;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}
.upd-tile-brand {
  color: var(--orange);
  font-size: 10px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  margin-bottom: 10px;
}
.upd-tile-title {
  color: #ffffff;
  font-family: var(--serif); font-weight: 600;
  font-size: 25px; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.upd-media--tile .upd-play { top: 36%; }

/* Play button */
.upd-play {
  position: absolute; top: 50%; left: 50%; z-index: 2;
  width: 58px; height: 58px;
  margin: -29px 0 0 -29px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(15, 25, 40, 0.35);
  transition: transform 0.25s, background 0.25s;
}
.upd-play svg { width: 24px; height: 24px; fill: var(--orange); margin-left: 2px; transition: fill 0.25s; }
.upd-card:hover .upd-play { background: var(--orange); transform: scale(1.08); }
.upd-card:hover .upd-play svg { fill: #ffffff; }

/* Labels over the picture */
.upd-badge,
.upd-pin {
  position: absolute; top: 12px; z-index: 2;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  line-height: 1.3;
}
.upd-badge {
  left: 12px;
  background: rgba(15, 25, 40, 0.62);
  color: #ffffff;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.upd-pin { right: 12px; background: var(--orange); color: #ffffff; }

.upd-body {
  display: flex; flex-direction: column; flex: 1;
  padding: 18px 20px 22px;
}
.upd-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}
.upd-tag {
  background: var(--orange-soft); color: var(--orange);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
}
.upd-date { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.upd-card h3 {
  color: var(--navy);
  font-family: var(--serif); font-weight: 600;
  font-size: 21px; line-height: 1.22;
  margin-bottom: 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.upd-card p {
  color: var(--text-muted);
  font-size: 14px; line-height: 1.55;
  margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.upd-more {
  margin-top: auto;
  color: var(--orange);
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
}

/* ----- Pagination ----- */
.upd-pager {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px;
  margin-top: 44px;
}
.upd-pager a,
.upd-pager span {
  min-width: 40px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  color: var(--navy);
  font-size: 13px; font-weight: 700; text-align: center;
  transition: all 0.2s;
}
.upd-pager a:hover { border-color: var(--orange); color: var(--orange); }
.upd-pager .current { background: var(--orange); border-color: var(--orange); color: #ffffff; }

/* ----- Call-to-action band under the list ----- */
.upd-cta {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 22px;
  margin-top: 60px;
  padding: 34px 38px;
  background: var(--bg-cream);
  border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: 6px;
}
.upd-cta h3 {
  color: var(--navy);
  font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.2;
  margin-bottom: 6px;
}
.upd-cta p { color: var(--text-muted); font-size: 15px; max-width: 560px; }
.upd-cta .btn-row { margin-bottom: 0; }

/* ----- Keep the top of these pages clear of the fixed menu (taller on phones) ----- */
.upd-page.section-pad-top { padding-top: calc(var(--upd-head, 96px) + 44px); }

/* ----- Single update page ----- */
.upd-back {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 26px;
  color: var(--text-muted);
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  transition: color 0.2s;
}
.upd-back:hover { color: var(--orange); }

.upd-detail {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}
.upd-detail--post { grid-template-columns: minmax(0, 504px) minmax(0, 1fr); }
.upd-detail--square,
.upd-detail--image { grid-template-columns: minmax(0, 500px) minmax(0, 1fr); }
.upd-detail--landscape { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 44px; }
.upd-detail--text { grid-template-columns: minmax(0, 1fr); max-width: 760px; }

.upd-stage { position: sticky; top: calc(var(--upd-head, 96px) + 28px); }

.upd-frame {
  position: relative;
  background: var(--navy);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.upd-frame::before { content: ""; display: block; padding-top: 177.78%; } /* 9:16 */
.upd-frame--landscape::before { padding-top: 56.25%; }
.upd-frame--square::before { padding-top: 100%; }
.upd-frame--tall::before,
.upd-frame--post::before { display: none; }
.upd-frame--tall { height: 820px; }
.upd-frame--post { height: 720px; }
.upd-frame--tall.is-playing,
.upd-frame--post.is-playing { background: #ffffff; border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.upd-frame--image::before { display: none; }
.upd-frame--image img { width: 100%; height: auto; }
.upd-frame iframe,
.upd-frame video,
.upd-frame .upd-frame-link {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
}
.upd-frame video { background: #000000; object-fit: contain; }
.upd-frame .upd-frame-link img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.upd-frame .upd-frame-link .upd-play { width: 72px; height: 72px; margin: -36px 0 0 -36px; }
.upd-frame .upd-frame-link .upd-play svg { width: 30px; height: 30px; }
.upd-frame .upd-frame-link:hover .upd-play { background: var(--orange); transform: scale(1.06); }
.upd-frame .upd-frame-link:hover .upd-play svg { fill: #ffffff; }
.upd-frame .upd-frame-link { display: block; cursor: pointer; }
.upd-frame .upd-frame-link::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 25, 40, 0.10) 0%, rgba(15, 25, 40, 0) 40%, rgba(15, 25, 40, 0.35) 100%);
  pointer-events: none;
}
.upd-frame .upd-tile { padding: 34px 28px 40px; }
.upd-frame .upd-tile-title { font-size: 30px; -webkit-line-clamp: 5; }
.upd-frame-cta {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  transform: translate(-50%, -50%);
  padding: 14px 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--navy);
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 8px 22px rgba(15, 25, 40, 0.35);
  transition: background 0.25s, color 0.25s;
}
.upd-frame-link:hover .upd-frame-cta { background: var(--orange); color: #ffffff; }
.upd-frame-note {
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 12px; text-align: center;
}
.upd-frame-note a { color: var(--orange); font-weight: 600; }

.upd-article .upd-meta { justify-content: flex-start; gap: 14px; margin-bottom: 14px; }
.upd-article .upd-source {
  color: var(--text-dim);
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
}
.upd-article h1 {
  color: var(--navy);
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 3.6vw, 46px); line-height: 1.12; letter-spacing: -0.3px;
  margin-bottom: 20px;
}
.upd-text p {
  color: var(--text-muted);
  font-size: 17px; line-height: 1.75;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.upd-text a { color: var(--orange); text-decoration: underline; }
.upd-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 28px;
}
.upd-share {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin-top: 30px; padding-top: 22px;
  border-top: 1px solid var(--border);
}
.upd-share-label {
  margin-right: 6px;
  color: var(--navy);
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}
.upd-share a,
.upd-share button {
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text-muted);
  font-size: 12px; font-weight: 600;
  transition: all 0.2s;
}
.upd-share a:hover,
.upd-share button:hover { border-color: var(--orange); color: var(--orange); }

.upd-preview-note {
  margin-bottom: 24px; padding: 12px 18px;
  background: rgba(212, 175, 55, 0.16);
  border-left: 4px solid #c98a00;
  border-radius: 4px;
  color: #7a5600; font-size: 14px;
}

/* ----- Homepage band ----- */
.upd-home { background: var(--navy); }
.upd-home-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  margin-bottom: 36px;
}
.upd-home .section-title { color: #ffffff; margin-bottom: 10px; }
.upd-home .section-intro { color: rgba(255, 255, 255, 0.72); margin-bottom: 0; max-width: 640px; }
.upd-home .eyebrow { margin-bottom: 12px; }
.upd-home-link {
  color: #ffffff;
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--orange);
  transition: color 0.2s;
}
.upd-home-link:hover { color: var(--orange); }
.upd-home .upd-card { border-color: transparent; }
.upd-home .upd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.upd-home .upd-grid.upd-count-1 { grid-template-columns: minmax(0, 320px); }
.upd-home .upd-grid.upd-count-2 { grid-template-columns: repeat(2, minmax(0, 320px)); }
.upd-home .upd-grid.upd-count-3 { grid-template-columns: repeat(3, minmax(0, 320px)); }

/* ----- Admin ----- */
.upd-admin-thumb {
  width: 80px; height: 80px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--navy); color: #ffffff;
  font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; text-align: center;
  overflow: hidden;
}
.upd-admin-thumb video { width: 100%; height: 100%; object-fit: cover; }
.upd-flag {
  display: inline-block; margin-left: 8px; padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: 1px;
  vertical-align: middle;
}
.upd-flag-hidden { background: rgba(120, 120, 120, 0.15); color: #777777; }
.upd-flag-pin { background: var(--orange-soft); color: var(--orange); }
.upd-help { color: var(--text-muted); font-size: 12px; margin-top: 6px; line-height: 1.5; }
.upd-help strong { color: var(--navy); }
.upd-or {
  display: flex; align-items: center; gap: 14px;
  color: var(--text-dim);
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
}
.upd-or::before, .upd-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.upd-current {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px; padding: 10px 14px;
  background: var(--orange-soft);
  border-radius: 6px;
  font-size: 13px;
}
.upd-current img { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; }
.upd-current a { color: var(--orange); font-weight: 600; }
.upd-current label { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.upd-cover-preview { display: none; align-items: center; gap: 12px; margin-top: 10px; }
.upd-cover-preview.show { display: flex; }
.upd-cover-preview img { width: 72px; height: 90px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.upd-cover-preview span { color: var(--text-muted); font-size: 12px; }
.upd-progress { display: none; margin-top: 16px; }
.upd-progress.show { display: block; }
.upd-progress-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.upd-progress-bar i { display: block; width: 0; height: 100%; background: var(--orange); transition: width 0.2s; }
.upd-progress-text { margin-top: 8px; color: var(--text-muted); font-size: 13px; }
.upd-form-error {
  display: none; margin-top: 14px; padding: 12px 16px;
  background: rgba(196, 58, 58, 0.08); color: #a02020;
  border-left: 4px solid #c43a3a; border-radius: 4px;
  font-size: 14px;
}
.upd-form-error.show { display: block; }

/* ----- Responsive ----- */
/* The menu has one more item (Updates): tighten it slightly on small laptops/tablets so it stays on one line */
@media (min-width: 901px) and (max-width: 1040px) {
  .nav-list { gap: 12px; }
  .nav-list a { font-size: 12px; letter-spacing: 0.6px; }
}
@media (max-width: 1000px) {
  .upd-home .upd-grid,
  .upd-home .upd-grid.upd-count-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .upd-detail,
  .upd-detail--post,
  .upd-detail--square,
  .upd-detail--image,
  .upd-detail--landscape { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  .upd-stage { position: static; width: 100%; max-width: 420px; margin: 0 auto; }
  .upd-detail--landscape .upd-stage,
  .upd-detail--post .upd-stage,
  .upd-detail--image .upd-stage { max-width: 560px; }
  .upd-detail--landscape .upd-stage { max-width: none; }
  .upd-cta { padding: 26px 24px; }
}
@media (max-width: 640px) {
  .upd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .upd-body { padding: 14px 14px 16px; }
  .upd-card h3 { font-size: 18px; }
  .upd-card p { display: none; }
  .upd-meta { flex-wrap: wrap; gap: 6px; }
  .upd-play { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .upd-play svg { width: 20px; height: 20px; }
  .upd-card .upd-tile { padding: 16px 14px 18px; }
  .upd-card .upd-tile-title { display: none; }
  .upd-card .upd-tile-brand { margin-bottom: 0; font-size: 9px; letter-spacing: 2px; }
  .upd-media--tile .upd-play { top: 50%; }
  .upd-frame .upd-tile-title { font-size: 26px; }
  .upd-badge, .upd-pin { top: 8px; padding: 4px 8px; font-size: 9px; }
  .upd-badge { left: 8px; }
  .upd-pin { right: 8px; }
  .upd-frame--tall { height: 780px; }
  .upd-frame--post { height: 640px; }

  /* Homepage band becomes a swipeable row */
  .upd-home .upd-grid,
  .upd-home .upd-grid.upd-count-1,
  .upd-home .upd-grid.upd-count-2,
  .upd-home .upd-grid.upd-count-3 {
    display: flex; gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4vw; padding: 4px 4vw 14px;
  }
  .upd-home .upd-card { flex: 0 0 68%; scroll-snap-align: center; }
  .upd-home .upd-grid.upd-count-1 .upd-card { flex-basis: 100%; }
}
