/*
 * Layout layer
 * Scope: global shell, public header, account menu and footer.
 * Keep page-specific CSS out of this file so homepage/course/admin styles can evolve independently.
 */

:root {
  --brand-primary: #7a1f33;
  --brand-primary-hover: #661a2b;
  --brand-dark: #14213d;
  --brand-bg: #f7f1e8;
  --brand-text: #1f2937;
  --brand-muted: #5b6472;
  --brand-border: #e8dccb;
  --focus-ring: #a62f48;
  --shell-max: 1380px;
  --shell-gutter: clamp(1rem, 3vw, 2rem);
  --radius-pill: 999px;
  --shadow-soft: 0 8px 28px rgba(20, 18, 16, 0.05);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 2000;
  padding: .5rem .75rem;
  border: 1px solid var(--brand-border);
  border-radius: .5rem;
  background: #fff;
  color: #111;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.vc-header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.vc-header__nav {
  border-bottom: 1px solid rgba(232, 220, 203, .78);
  background: rgb(224 187 124 / 33%);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.vc-header__inner {
  width: min(var(--shell-max), calc(100vw - 64px));
  max-width: none;
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin: 0 auto;
  padding: .9rem 2rem;
}

.vc-header__brand,
.vc-header__brand--logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: .75rem;
  text-decoration: none;
}

.vc-header__logo-img {
  width: 46px;
  height: 46px;
  display: block;
  border-radius: 50%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(200, 155, 60, .18));
  transition: transform .22s ease, filter .22s ease;
}

.vc-header__brand:hover .vc-header__logo-img {
  transform: scale(1.06);
  filter: drop-shadow(0 4px 16px rgba(200, 155, 60, .42));
}

.vc-header__brand-label,
.vc-header__brand-text {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.08;
}

.vc-header__brand-label strong,
.vc-header__brand-text {
  color: #1a1a1a;
  font-family: "Quicksand", sans-serif;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.vc-header__brand-label span,
.vc-header__brand-text em {
  color: #c89b3c;
  font-family: "Quicksand", sans-serif;
  font-size: .62rem;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.vc-header__toggle {
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: .22rem;
  margin-left: auto;
  border: 1px solid var(--brand-border);
  border-radius: .9rem;
  background: #fff;
}

.vc-header__toggle-line {
  width: 18px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--brand-primary);
}

.vc-header__collapse {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 1rem;
}

@media (min-width: 992px) {
  .vc-header__collapse.collapse {
    display: flex !important;
  }
}

.vc-header__links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  flex-wrap: nowrap;
  min-width: 0;
  gap: .35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.vc-header__menu-item {
  position: relative;
}

.vc-header__link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  padding: .65rem .92rem;
  border-radius: var(--radius-pill);
  color: #2f3441;
  font-family: "Quicksand", sans-serif;
  font-size: .96rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.vc-header__link:hover,
.vc-header__link.is-active {
  color: var(--brand-primary);
  background: #f8edf1;
  box-shadow: inset 0 0 0 1px rgba(122, 31, 51, .06);
}

.vc-header__link--dropdown::after {
  margin-left: .4rem;
  vertical-align: .08em;
}

.vc-header__submenu {
  min-width: 220px;
  padding: .55rem;
  border: 1px solid rgba(122, 31, 51, .08);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(8, 28, 56, .12);
}

.vc-header__submenu-link {
  border-radius: 10px;
  color: #2f3441;
  font-family: "Quicksand", sans-serif;
  font-size: .94rem;
  font-weight: 700;
}

.vc-header__submenu-link:hover,
.vc-header__submenu-link:focus,
.vc-header__submenu-link.is-active {
  background: #f8edf1;
  color: var(--brand-primary);
}

.vc-header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
  gap: .7rem;
  white-space: nowrap;
}

.vc-header__inline-form {
  margin: 0;
}

.vc-btn-ghost,
.vc-btn-solid,
.vc-account {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1rem;
  border-radius: var(--radius-pill);
  font-family: "Quicksand", sans-serif;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.vc-btn-ghost {
  color: var(--brand-primary);
  background: transparent;
  border: 1.5px solid var(--brand-primary);
}

.vc-btn-ghost:hover,
.vc-btn-ghost.is-active {
  color: #fff;
  background: var(--brand-primary);
}

.vc-btn-solid {
  color: #fff;
  background: var(--brand-primary);
  border: 1.5px solid var(--brand-primary);
}

.vc-btn-solid:hover {
  color: #fff;
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
  box-shadow: 0 10px 24px rgba(122, 31, 51, .18);
}

.vc-account {
  gap: .68rem;
  padding: .42rem .7rem .42rem .48rem;
  border: 1px solid var(--brand-border);
  background: linear-gradient(180deg, #fff 0%, #fffaf5 100%);
  color: #28303f;
  box-shadow: 0 8px 18px rgba(122, 31, 51, .06);
}

.vc-account:hover,
.vc-account:focus {
  border-color: rgba(122, 31, 51, .28);
  color: inherit;
}

.vc-account__crest {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(122, 31, 51, .16);
  border-radius: var(--radius-pill);
  background: radial-gradient(circle at top left, #fff 0%, #f6dfe6 55%, #f0cfd8 100%);
}

.vc-account__crest img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vc-account__crest-fallback {
  color: var(--brand-primary);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.vc-account__content {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .26rem;
  min-width: 0;
}

.vc-account__meta {
  display: inline-flex;
  align-items: flex-start;
  gap: .36rem;
}

.vc-account__tier,
.vc-account__role {
  min-height: 1.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .08rem .48rem;
  border-radius: var(--radius-pill);
  font-size: .66rem;
  font-weight: 800;
}

.vc-account__tier {
  background: var(--brand-primary);
  color: #fff;
  letter-spacing: .04em;
}

.vc-account__role {
  background: rgba(122, 31, 51, .06);
  color: var(--brand-muted);
}

.vc-account__name {
  max-width: 7rem;
  overflow: hidden;
  color: #151821;
  font-size: .92rem;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-account__caret {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: var(--radius-pill);
  background: rgba(122, 31, 51, .05);
  color: var(--brand-muted);
}

.vc-account__caret svg {
  width: 14px;
  height: 14px;
}

.vc-account__menu {
  min-width: 16rem;
  padding: .5rem;
  border: 1px solid var(--brand-border);
  border-radius: 1rem;
  box-shadow: 0 18px 44px rgba(20, 18, 16, .12);
}

.vc-account__menu .dropdown-item {
  border-radius: .7rem;
}

.vc-footer {
  border-top: 1px solid var(--brand-border);
  background: #fffaf5;
  color: var(--brand-text);
  padding: 64px var(--shell-gutter) 0;
}

.vc-footer__inner {
  width: min(var(--shell-max), 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(160px, .7fr));
  gap: clamp(1.5rem, 3vw, 3rem);
  margin: 0 auto;
  padding-bottom: 44px;
}

.vc-footer__logo {
  display: inline-flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  text-decoration: none;
}

.vc-footer__logo-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: contain;
}

.vc-footer__logo-text {
  display: inline-flex;
  flex-direction: column;
  color: var(--brand-text);
  font-family: "Quicksand", sans-serif;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.vc-footer__logo-text em {
  color: #c89b3c;
  font-size: .62rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .08em;
}

.vc-footer__brand-desc {
  max-width: 34rem;
  color: var(--brand-muted);
  line-height: 1.7;
}

.vc-footer__heading,
.vc-footer__col-title {
  margin-bottom: .85rem;
  color: var(--brand-primary);
  font-family: "Lexend", sans-serif;
  font-size: .92rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.vc-footer__links {
  display: grid;
  gap: .55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vc-footer__links a {
  color: var(--brand-muted);
  text-decoration: none;
  transition: color .2s ease, padding-left .2s ease;
}

.vc-footer__links a:hover {
  color: var(--brand-primary);
  padding-left: 2px;
}

.vc-footer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vc-footer__social {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-border);
  border-radius: 50%;
  background: #fff;
  color: var(--brand-primary);
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.vc-footer__social:hover {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  transform: translateY(-2px);
}

.vc-footer__social svg {
  width: 18px;
  height: 18px;
}

.vc-footer__contact {
  display: grid;
  gap: .2rem;
  margin-top: 1.1rem;
  color: var(--brand-muted);
  font-size: .9rem;
}

.vc-footer__contact span {
  font-family: "Lexend", sans-serif;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.vc-footer__contact a {
  width: fit-content;
  color: var(--brand-primary);
  font-family: "Lexend", sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  text-decoration: none;
}

.vc-footer__bottom {
  width: min(var(--shell-max), 100%);
  margin: 0 auto;
  padding: 20px 0 22px;
  border-top: 1px solid var(--brand-border);
  color: var(--brand-muted);
  font-size: .82rem;
  text-align: center;
}

@media (max-width: 991.98px) {
  .vc-header__inner {
    width: 100%;
    flex-wrap: wrap;
    align-items: center;
    padding: .85rem 1rem;
  }

  .vc-header__toggle {
    display: inline-flex;
  }

  .vc-header__collapse {
    width: 100%;
    flex-basis: 100%;
    display: block;
  }

  .vc-header__collapse:not(.show) {
    display: none;
  }

  .vc-header__links {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .45rem;
    margin-top: .75rem;
  }

  .vc-header__link {
    width: 100%;
    justify-content: flex-start;
  }

  .vc-header__submenu {
    width: 100%;
    margin-top: .25rem;
    border-radius: 12px;
    box-shadow: none;
  }

  .vc-header__actions {
    flex-direction: column;
    align-items: stretch;
    gap: .65rem;
    margin-top: 1rem;
  }

  .vc-btn-ghost,
  .vc-btn-solid,
  .vc-account {
    width: 100%;
    justify-content: center;
  }

  .vc-account__content,
  .vc-account__meta {
    align-items: center;
    justify-content: center;
  }

  .vc-account__name {
    max-width: none;
  }

  .vc-footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 575.98px) {
  .vc-header__inner {
    min-height: 74px;
    gap: .8rem;
    padding: .72rem .8rem;
  }

  .vc-header__brand {
    min-width: 0;
    gap: .58rem;
  }

  .vc-header__logo-img {
    width: 40px;
    height: 40px;
  }

  .vc-header__brand-label strong {
    font-size: .78rem;
    letter-spacing: .08em;
  }

  .vc-header__brand-label span {
    font-size: .54rem;
    letter-spacing: .06em;
  }

  .vc-header__toggle {
    width: 42px;
    height: 42px;
  }

  .vc-header__link,
  .vc-btn-ghost,
  .vc-btn-solid,
  .vc-account {
    min-height: 46px;
    font-size: .9rem;
  }

  .vc-footer {
    padding: 54px 20px 0;
  }

  .vc-footer__inner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding-bottom: 30px;
  }

  .vc-footer__logo {
    align-items: center;
    gap: 10px;
  }

  .vc-footer__logo-img {
    width: 46px;
    height: 46px;
  }

  .vc-footer__logo-text {
    font-size: .82rem;
    letter-spacing: .08em;
  }

  .vc-footer__logo-text em {
    font-size: .56rem;
    letter-spacing: .06em;
  }

  .vc-footer__brand-desc,
  .vc-footer__links a {
    font-size: .82rem;
  }

  .vc-footer__socials {
    gap: 8px;
  }

  .vc-footer__social {
    width: 34px;
    height: 34px;
  }

  .vc-footer__bottom {
    padding: 16px 0 18px;
    font-size: .72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vc-header *,
  .vc-footer * {
    transition-duration: .01ms !important;
  }
}
