* { box-sizing: border-box; }

:root {
  --navy: #08285b;
  --navy-deep: #061b40;
  --blue: #1763aa;
  --gold: #f9ad10;
  --gold-light: #fff2ce;
  --muted: #5b6f8b;
  --surface: #ffffff;
  --border: #e1e9f3;
  --shadow: 0 10px 30px rgba(8, 40, 91, 0.08);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--navy);
  background: #f5f8fd;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-header {
  width: min(1440px, 96%);
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo-link img {
  display: block;
  width: 78px;
  height: 72px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(10px, 1.5vw, 24px);
}

.main-nav a {
  font-size: 13px;
  font-weight: 750;
  color: #455a78;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--navy);
  border-bottom-color: var(--gold);
}

.admin-link {
  flex-shrink: 0;
  background: var(--navy);
  color: white;
  padding: 10px 17px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.homepage {
  width: min(1440px, 96%);
  margin: 0 auto;
}

.welcome-panel {
  min-height: 275px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  position: relative;
  padding: 20px clamp(22px, 3.4vw, 52px);
  border: 1px solid #e3edf9;
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 50%, #d8ebff 0, transparent 34%),
    linear-gradient(110deg, #ffffff 0%, #f5faff 100%);
}

.welcome-copy {
  position: relative;
  z-index: 2;
}

.eyebrow,
.card-kicker {
  display: block;
  color: #3971ad;
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 7px;
}

.welcome-copy h1 {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.055em;
  margin: 0;
  white-space: nowrap;
}

.welcome-copy h1 span {
  color: var(--gold);
}

.welcome-copy h2 {
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.2;
  margin: 10px 0 7px;
  letter-spacing: -0.025em;
}

.welcome-copy > p:not(.eyebrow) {
  color: var(--muted);
  max-width: 510px;
  font-size: 13px;
  margin: 0;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
a:focus-visible,
.quiz-option:focus-visible {
  outline: 3px solid #6fa8f3;
  outline-offset: 3px;
}

.button-gold {
  background: linear-gradient(135deg, #ffd05b, #f9ad10);
  color: var(--navy-deep);
  box-shadow: 0 5px 14px rgba(249, 173, 16, 0.2);
}

.button-outline {
  background: white;
  border-color: #cdd9e8;
  color: var(--navy);
}

.subject-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.subject-tags span {
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
  color: #405775;
  font-size: 10px;
  font-weight: 750;
}

.welcome-portrait {
  position: relative;
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 0;
}

.portrait-halo {
  position: absolute;
  width: min(88%, 270px);
  aspect-ratio: 1;
  bottom: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #c4e1ff, #edf6ff);
}

.welcome-portrait > img {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, 290px);
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
}

.portrait-note {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 22px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  box-shadow: var(--shadow);
  font-size: 10px;
  font-weight: 850;
}

.learning-dashboard {
  display: grid;
  grid-template-columns: 1.12fr 1fr 0.92fr;
  gap: 14px;
  margin-top: 16px;
  align-items: stretch;
}

.learning-card {
  min-width: 0;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.card-kicker {
  font-size: 9px;
  letter-spacing: 0.09em;
}

.card-heading h2 {
  margin: 3px 0 0;
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.round-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--gold-light);
  color: var(--navy);
  border-radius: 12px;
  font-weight: 900;
}

.video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #071a38;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.card-description {
  color: var(--muted);
  font-size: 11px;
  margin: 10px 0;
}

.text-link {
  display: inline-block;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.text-link:hover,
.more-resources a:hover {
  text-decoration: underline;
}

.fact-card {
  background: linear-gradient(150deg, #ffffff, #f2f8ff);
}

.fact-content {
  min-height: 165px;
}

.fact-number {
  color: #b17a00;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.fact-content h3 {
  font-size: 17px;
  line-height: 1.3;
  margin: 8px 0;
}

.fact-content > p {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 10px;
}

.example-box {
  background: white;
  border-left: 3px solid var(--gold);
  border-radius: 0 9px 9px 0;
  padding: 8px 10px;
  margin-bottom: 12px;
}

.example-box strong {
  font-size: 10px;
}

.example-box p {
  font-size: 11px;
  margin: 3px 0 0;
  color: #465c78;
}

.fact-button {
  width: 100%;
}

.quiz-question {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  margin: 14px 0;
}

.quiz-options {
  display: grid;
  gap: 8px;
}

.quiz-option {
  text-align: left;
  width: 100%;
  border: 1px solid #dce5f0;
  border-radius: 9px;
  background: #f9fbfe;
  padding: 8px 10px;
  color: var(--navy);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.quiz-option:hover:not(:disabled) {
  border-color: #7ca6db;
  background: #f0f6ff;
}

.quiz-option:disabled {
  cursor: default;
}

.quiz-option.correct {
  border-color: #17834b;
  background: #e8f8ef;
  color: #11643a;
}

.quiz-option.incorrect {
  border-color: #c73e3e;
  background: #fff0f0;
  color: #9f2525;
}

.quiz-feedback {
  min-height: 34px;
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0;
}

.next-question {
  width: 100%;
}

.next-question:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.quick-link {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quick-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.quick-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #eef5ff;
  border-radius: 10px;
  font-size: 17px;
}

.quick-link > span:nth-child(2) {
  min-width: 0;
}

.quick-link strong,
.quick-link small {
  display: block;
}

.quick-link strong {
  font-size: 10px;
  line-height: 1.3;
}

.quick-link small {
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
  line-height: 1.3;
}

.quick-arrow {
  margin-left: auto;
  align-self: flex-start;
  color: #9aa9bd;
  font-size: 12px;
}

.more-resources {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.more-resources > div {
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: white;
}

.more-resources strong {
  font-size: 12px;
}

.more-resources p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 11px;
}

.more-resources a {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.site-footer {
  width: min(1440px, 96%);
  margin: 18px auto 0;
  padding: 14px 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
}

.site-footer a {
  color: var(--navy);
  font-weight: 800;
}

@media (min-width: 1200px) {
  .more-resources {
    display: none;
  }
}

@media (max-width: 1050px) {
  .site-header {
    gap: 12px;
  }

  .main-nav {
    gap: 12px;
  }

  .main-nav a {
    font-size: 11px;
  }

  .learning-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quiz-card {
    grid-column: 1 / -1;
  }

  .quiz-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .more-resources {
    display: grid;
  }
}

@media (max-width: 720px) {
  .site-header {
    width: 92%;
    min-height: auto;
    padding: 10px 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .logo-link img {
    width: 64px;
    height: 60px;
  }

  .admin-link {
    padding: 9px 13px;
  }

  .main-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 4px 1px 9px;
    gap: 18px;
  }

  .main-nav a {
    flex-shrink: 0;
    font-size: 12px;
  }

  .homepage {
    width: 92%;
  }

  .welcome-panel {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 23px 19px 0;
    border-radius: 18px;
  }

  .welcome-copy h1 {
    font-size: clamp(33px, 8vw, 46px);
    white-space: normal;
  }

  .welcome-copy h2 {
    font-size: 22px;
  }

  .welcome-copy > p:not(.eyebrow) {
    font-size: 13px;
  }

  .welcome-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    min-height: 42px;
  }

  .subject-tags {
    gap: 5px;
  }

  .subject-tags span {
    font-size: 9px;
  }

  .welcome-portrait {
    height: 220px;
    margin-top: 5px;
  }

  .portrait-halo {
    width: 215px;
  }

  .welcome-portrait > img {
    width: min(100%, 250px);
  }

  .portrait-note {
    right: 0;
    bottom: 12px;
    font-size: 9px;
  }

  .learning-dashboard {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }

  .learning-card {
    padding: 15px;
  }

  .quiz-card {
    grid-column: auto;
  }

  .quiz-options {
    grid-template-columns: 1fr;
  }

  .quick-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .quick-link {
    padding: 10px 8px;
  }

  .quick-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .quick-link strong {
    font-size: 10px;
  }

  .quick-link small {
    font-size: 9px;
  }

  .more-resources {
    grid-template-columns: 1fr;
  }

  .site-footer {
    width: 92%;
    justify-content: flex-start;
    padding-bottom: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* LWA layout correction v4: explicit desktop grid + safe responsive flow */
html, body { width:100%; max-width:100%; overflow-x:hidden; }
.site-header, .homepage { width:min(1440px, 94%); }
.welcome-panel { width:100%; }
.learning-dashboard {
  display:grid !important;
  grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
  align-items:stretch;
  gap:18px;
  margin-top:18px;
}
.learning-dashboard > .learning-card {
  grid-column:auto !important;
  grid-row:auto !important;
  width:100%; min-width:0; max-width:none;
  margin:0 !important; justify-self:stretch; align-self:stretch;
}
.learning-dashboard .video-frame { width:100%; }
#community-feed.community-feed-section { width:min(1320px, 94%); max-width:1320px; margin:42px auto; padding:0; }
#community-feed .community-feed-layout {
  display:grid !important;
  grid-template-columns:minmax(0, 1fr) 300px !important;
  gap:22px; align-items:start; width:100%;
}
#community-feed #community-feed-list {
  display:grid !important; grid-template-columns:minmax(0, 1fr) !important;
  grid-column:1 !important; width:100%; min-width:0; justify-self:stretch;
}
#community-feed .community-feed-side { grid-column:2 !important; width:100%; min-width:0; position:static; }
#community-feed .community-post-card { width:100%; min-width:0; max-width:none; justify-self:stretch; }
#community-feed .community-feed-heading { width:100%; }
@media (max-width: 1050px) {
  .learning-dashboard { grid-template-columns:repeat(2, minmax(0,1fr)) !important; }
  .learning-dashboard > .video-card { grid-column:1 / -1 !important; }
  #community-feed .community-feed-layout { grid-template-columns:minmax(0,1fr) !important; }
  #community-feed #community-feed-list, #community-feed .community-feed-side { grid-column:1 !important; }
}
@media (max-width: 720px) {
  .site-header, .homepage { width:92%; }
  .learning-dashboard { grid-template-columns:minmax(0,1fr) !important; }
  .learning-dashboard > .learning-card, .learning-dashboard > .video-card { grid-column:1 !important; }
  #community-feed.community-feed-section { width:92%; margin:28px auto; }
  #community-feed .community-feed-layout { display:flex !important; flex-direction:column !important; gap:14px; }
  #community-feed #community-feed-list, #community-feed .community-feed-side { width:100%; grid-column:auto !important; }
}

/* Learn With Austin — compact, consistent layout refinement */
:root {
  --lwa-content-width: 1280px;
  --lwa-card-radius: 16px;
  --lwa-card-shadow: 0 5px 18px rgba(8, 40, 91, .055);
}

.site-header,
.homepage,
.site-footer {
  width: min(var(--lwa-content-width), 94%);
}

.homepage { padding-bottom: 10px; }
.welcome-panel { margin-top: 8px; }

/* Keep dashboard cards aligned and avoid unnecessarily tall equal-height rows. */
.learning-dashboard {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  align-items: start !important;
  gap: 16px !important;
}
.learning-dashboard > .learning-card,
.learning-dashboard > .video-card {
  align-self: start !important;
  min-height: 0 !important;
  padding: 16px !important;
  border-radius: var(--lwa-card-radius) !important;
  box-shadow: var(--lwa-card-shadow) !important;
}
.learning-dashboard .fact-content { min-height: 0; }
.learning-dashboard .video-frame,
.learning-dashboard .video-frame iframe {
  width: 100%;
  max-width: 100%;
}
.learning-dashboard .video-frame { aspect-ratio: 16 / 9; }

/* Latest-content cards: align from the top and let each card fit its content. */
#latest-published-content { max-width: var(--lwa-content-width) !important; }
#latest-content-grid {
  align-items: start !important;
  grid-auto-rows: auto !important;
  gap: 16px !important;
}
#latest-content-grid > article {
  height: auto !important;
  min-height: 0 !important;
  align-self: start !important;
  border-radius: var(--lwa-card-radius) !important;
  box-shadow: var(--lwa-card-shadow) !important;
}
#latest-content-grid > article img { aspect-ratio: 16 / 9; height: auto !important; }

/* Community Feed: constrain the post column and media instead of letting it dominate. */
#community-feed.community-feed-section {
  width: min(var(--lwa-content-width), 94%) !important;
  max-width: var(--lwa-content-width) !important;
  margin: 32px auto !important;
}
#community-feed .community-feed-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 280px !important;
  gap: 20px !important;
  align-items: start !important;
}
#community-feed #community-feed-list {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: start !important;
}
#community-feed .community-post-card {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  border-radius: var(--lwa-card-radius) !important;
  box-shadow: var(--lwa-card-shadow) !important;
  overflow: hidden;
}
#community-feed .community-post-card img,
#community-feed .community-post-card video,
#community-feed .community-post-card iframe {
  max-width: 100% !important;
}
#community-feed .community-post-card video,
#community-feed .community-post-card iframe {
  display: block;
  width: 100% !important;
  aspect-ratio: 16 / 9;
  height: auto !important;
  max-height: 440px !important;
}
#community-feed .community-post-card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 440px;
  object-fit: contain;
}
#community-feed .community-feed-side { min-width: 0; }

@media (max-width: 1050px) {
  .learning-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .learning-dashboard > .video-card { grid-column: auto !important; }
  #community-feed .community-feed-layout { grid-template-columns: minmax(0, 1fr) !important; }
  #community-feed .community-feed-side { grid-column: 1 !important; }
}

@media (max-width: 720px) {
  .site-header, .homepage, .site-footer { width: 92%; }
  .learning-dashboard { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .learning-dashboard > .learning-card,
  .learning-dashboard > .video-card { grid-column: 1 !important; }
  #latest-published-content { width: 92% !important; padding-left: 0 !important; padding-right: 0 !important; }
  #latest-content-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  #community-feed.community-feed-section { width: 92% !important; margin: 26px auto !important; }
  #community-feed .community-feed-layout { display: flex !important; flex-direction: column !important; gap: 14px !important; }
  #community-feed #community-feed-list,
  #community-feed .community-feed-side { width: 100% !important; grid-column: auto !important; }
  #community-feed .community-post-card video,
  #community-feed .community-post-card iframe { max-height: 300px !important; }
}



/* Homepage hierarchy: the three learning tools stay above the community feed. */
#latest-published-content { display:none !important; }
.learning-dashboard { margin-top:18px; }
.learning-dashboard > .learning-card { min-height:0; }
.learning-dashboard .video-frame { aspect-ratio:16/9; max-height:none; }
#community-feed .community-post-media iframe,
#community-feed .community-post-media video,
#community-feed .community-post-media img { display:block; width:100%; max-width:100%; }
#community-feed .community-post-media iframe,
#community-feed .community-post-media video { aspect-ratio:16/9; height:auto; }
#community-feed .community-post-card { overflow:hidden; }
@media (min-width:1051px) {
  #community-feed .community-feed-layout { grid-template-columns:minmax(0,1fr) 280px !important; gap:20px; }
}
