/*
  Website header and footer (Views/Shared/_Layout.Header.cshtml, _Layout.Footer.cshtml; links in Core/SiteNav.cs).
  Hand-written because style.css is a pre-compiled Tailwind file with no build here. Colours come from the theme
  variables in style.css, so light and dark follow the site's theme switch.
  Breakpoints: desktop menu from 1024px; below that the drawer.
*/

/* ---------- Shared ---------- */
.tn-logo { display: inline-flex; align-items: center; flex-shrink: 0; transition: opacity .2s; }
.tn-logo:hover { opacity: .85; }
.tn-logo img { width: 7.5rem; height: auto; }
.tn-logo-dark { display: none; }
.dark .tn-logo-dark { display: block; }
.dark .tn-logo-light { display: none; }

.tn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; white-space: nowrap;
  padding: .6rem 1.15rem; border-radius: 999px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, var(--app-accent), var(--app-accent-lime));
  box-shadow: 0 6px 18px -8px rgba(var(--app-accent-rgb), .7); transition: transform .2s, box-shadow .2s, opacity .2s;
}
.tn-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(var(--app-accent-rgb), .8); }
.tn-cta svg { width: .9rem; height: .9rem; }

.tn-icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; flex-shrink: 0;
  border-radius: 999px; border: 1px solid var(--app-card-border); color: var(--app-text-muted); background: transparent;
  cursor: pointer; transition: color .2s, background .2s, border-color .2s;
}
.tn-icon-btn:hover { color: var(--app-text); background: var(--app-card-bg); }
.tn-icon-btn svg { width: 1rem; height: 1rem; }
.tn-sun { display: none; }
.dark .tn-sun { display: block; }
.dark .tn-moon { display: none; }

.tn-badge {
  display: inline-block; margin-left: .35rem; padding: .1rem .45rem; border-radius: 999px; vertical-align: 1px;
  font-family: var(--font-sans, Inter, sans-serif); font-style: normal; font-size: .625rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--app-accent); background: rgba(var(--app-accent-rgb), .12);
}
.tn-badge-premium { color: #fff; background: var(--app-accent); }
.tn-foot-label { font-size: .6875rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--app-text-muted); }

/* ---------- Header bar ---------- */
.tn-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--app-nav-bg); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--app-card-border);
}
.tn-bar {
  position: relative; max-width: 80rem; margin: 0 auto; height: 4.25rem; padding: 0 1rem;
  display: flex; align-items: center; gap: 1rem;
}
.tn-nav { display: none; }
.tn-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.tn-signin, .tn-actions .tn-cta { display: none; }
.tn-burger {
  display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: .75rem;
  color: var(--app-text); background: transparent; border: 1px solid var(--app-card-border); cursor: pointer;
}
.tn-burger svg { width: 1.25rem; height: 1.25rem; }

@media (min-width: 40rem) {
  .tn-bar { padding: 0 1.5rem; }
  .tn-actions .tn-cta { display: inline-flex; }
}

@media (min-width: 64rem) {
  .tn-bar { gap: 1.5rem; }
  .tn-logo img { width: 7rem; }
  .tn-nav { display: flex; align-items: center; gap: .25rem; height: 100%; }
  .tn-burger, .tn-drawer { display: none !important; }
  .tn-signin { display: inline-flex; }
}
@media (min-width: 80rem) {
  .tn-bar { padding: 0 2rem; gap: 2.5rem; }
  .tn-logo img { width: 8rem; }
  .tn-nav { gap: .75rem; }
  .tn-actions { gap: .75rem; }
}

.tn-item { position: relative; height: 100%; display: flex; align-items: center; }
.tn-item.tn-wide { position: static; } /* the wide panel lines up with the whole bar */
.tn-link {
  position: relative; display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; height: 2.25rem;
  padding: 0 .7rem; border-radius: 999px; background: transparent; border: 0; cursor: pointer;
  font-size: .8125rem; font-weight: 600; letter-spacing: .01em; color: var(--app-text-muted); transition: color .2s, background .2s;
}
.tn-link:hover, .tn-item.is-open > .tn-link, .tn-item:focus-within > .tn-link { color: var(--app-text); background: rgba(var(--app-accent-rgb), .07); }
.tn-item.active > .tn-link, .tn-link.active, .tn-item.active.tn-link { color: var(--app-text); }
.tn-underline { position: absolute; left: .7rem; right: .7rem; bottom: -.15rem; height: 2px; border-radius: 2px; background: var(--app-accent); transition: transform .25s; transform-origin: center; }
.tn-underline.scale-x-0 { transform: scaleX(0); }
.tn-underline.scale-x-100 { transform: scaleX(1); }
.tn-chev { width: .8rem; height: .8rem; transition: transform .2s; }
.tn-item.is-open .tn-chev, .tn-item:hover .tn-chev { transform: rotate(180deg); }

.tn-signin {
  align-items: center; white-space: nowrap; height: 2.25rem; padding: 0 .8rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; color: var(--app-text); transition: background .2s;
}
.tn-signin:hover { background: var(--app-card-bg); }

/* ---------- Dropdown panels ---------- */
.tn-panel {
  position: absolute; top: calc(100% - .35rem); z-index: 50;
  background: var(--app-card-bg); border: 1px solid var(--app-card-border); border-radius: 1.25rem;
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .04);
  padding: .9rem; opacity: 0; visibility: hidden; transform: translateY(6px); pointer-events: none;
  transition: opacity .18s, transform .18s, visibility .18s;
}
.tn-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -.9rem; height: .9rem; } /* hover bridge */
.tn-item.is-open > .tn-panel, .tn-item:hover > .tn-panel, .tn-item:focus-within > .tn-panel {
  opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto;
}
.tn-panel-wide { left: 50%; width: min(56rem, calc(100vw - 2rem)); transform: translate(-50%, 6px); }
.tn-item.is-open > .tn-panel-wide, .tn-item:hover > .tn-panel-wide, .tn-item:focus-within > .tn-panel-wide { transform: translate(-50%, 0); }
.tn-panel-mid { left: 50%; width: 34rem; transform: translate(-50%, 6px); }
.tn-item.is-open > .tn-panel-mid, .tn-item:hover > .tn-panel-mid, .tn-item:focus-within > .tn-panel-mid { transform: translate(-50%, 0); }
.tn-panel-narrow { right: -1rem; width: 19rem; }

.tn-cols { display: grid; gap: .5rem 1rem; }
.tn-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tn-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tn-group { padding: .35rem .6rem .5rem; font-size: .6875rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--app-accent); }

.tn-row { display: flex; align-items: flex-start; gap: .7rem; padding: .55rem .6rem; border-radius: .8rem; transition: background .15s; }
.tn-row:hover { background: rgba(var(--app-accent-rgb), .07); }
.tn-row-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: .6rem;
  color: var(--app-accent); background: rgba(var(--app-accent-rgb), .09); transition: background .15s, color .15s;
}
.dark .tn-row-icon, .dark .tn-group { color: var(--app-accent-lime); }
.tn-row:hover .tn-row-icon { color: #fff; background: var(--app-accent); }
.tn-row-icon svg { width: 1rem; height: 1rem; }
.tn-row-body { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.tn-row-title { font-size: .875rem; font-weight: 600; color: var(--app-text); line-height: 1.25rem; }
.tn-row-text { font-size: .75rem; line-height: 1.05rem; color: var(--app-text-muted); }

.tn-panel-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem; padding: .75rem .6rem 0;
  border-top: 1px solid var(--app-card-border);
}
.tn-chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px;
  border: 1px solid var(--app-card-border); font-size: .75rem; font-weight: 500; color: var(--app-text); transition: border-color .15s, background .15s;
}
.tn-chip:hover { border-color: var(--app-accent); background: rgba(var(--app-accent-rgb), .06); }
.tn-chip svg { width: .85rem; height: .85rem; color: var(--app-accent); }
.tn-foot-more { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; font-size: .8125rem; font-weight: 600; color: var(--app-accent); }
.dark .tn-foot-more { color: var(--app-accent-lime); }
.tn-foot-more svg { width: .9rem; height: .9rem; transition: transform .15s; }
.tn-foot-more:hover svg { transform: translateX(3px); }

/* ---------- Drawer (below 1024px) ---------- */
.tn-drawer { position: fixed; inset: 0; z-index: 60; margin: 0; padding: 0; }
.tn-drawer-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); }
.tn-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(24rem, 88vw); display: flex; flex-direction: column;
  background: var(--app-card-bg); border-left: 1px solid var(--app-card-border); transition: transform .3s;
}
.tn-drawer-panel.translate-x-full { transform: translateX(100%); }
.tn-drawer-panel.translate-x-0 { transform: translateX(0); }
.tn-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--app-card-border); }
.tn-drawer-head .tn-logo img { width: 6.5rem; }
.tn-drawer-body { flex: 1; overflow-y: auto; padding: .5rem 1.25rem; }
.tn-acc { border-bottom: 1px solid var(--app-card-border); }
.tn-acc summary, .tn-acc-top {
  display: flex; align-items: center; justify-content: space-between; padding: 1rem 0; cursor: pointer; list-style: none;
  font-size: 1rem; font-weight: 600; color: var(--app-text);
}
.tn-acc-top { border-bottom: 1px solid var(--app-card-border); }
.tn-acc summary::-webkit-details-marker { display: none; }
.tn-acc summary svg { width: 1.1rem; height: 1.1rem; color: var(--app-text-muted); transition: transform .2s; }
.tn-acc[open] summary svg { transform: rotate(180deg); }
.tn-acc[open] { padding-bottom: .75rem; }
.tn-acc-group { padding: .6rem 0 .3rem; font-size: .6875rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--app-accent); }
.dark .tn-acc-group { color: var(--app-accent-lime); }
.tn-acc-link { display: flex; align-items: center; gap: .65rem; padding: .55rem 0; font-size: .9375rem; color: var(--app-text-muted); }
.tn-acc-link:hover { color: var(--app-text); }
.tn-acc-link svg { width: 1rem; height: 1rem; color: var(--app-accent); flex-shrink: 0; }
.tn-drawer-foot { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--app-card-border); }
.tn-btn-outline {
  display: inline-flex; align-items: center; justify-content: center; padding: .6rem 1rem; border-radius: 999px;
  border: 1px solid var(--app-card-border); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--app-text);
}

/* ---------- Footer ---------- */
.tn-footer { position: relative; z-index: 10; width: 100%; margin-top: auto; border-top: 1px solid var(--app-card-border); background: var(--app-card-bg); }
.tn-footer-inner { max-width: 80rem; margin: 0 auto; padding: 3rem 1.25rem 1.5rem; }
.tn-footer-top { display: grid; gap: 2.5rem; }
.tn-footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; max-width: 22rem; }
.tn-footer-brand .tn-logo img { width: 7rem; }
.tn-footer-brand p { margin: 0; font-size: .875rem; line-height: 1.4rem; color: var(--app-text-muted); }
.tn-social { display: flex; gap: .5rem; }
.tn-social a {
  display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 999px;
  border: 1px solid var(--app-card-border); color: var(--app-text-muted); transition: color .15s, border-color .15s;
}
.tn-social a:hover { color: var(--app-accent); border-color: var(--app-accent); }
.tn-social svg { width: 1rem; height: 1rem; }

.tn-footer-cols { display: grid; grid-template-columns: 1fr; }
.tn-fcol { border-bottom: 1px solid var(--app-card-border); }
.tn-fcol-toggle {
  display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 1rem 0; background: none; border: 0; cursor: pointer;
  font-size: .9375rem; font-weight: 600; color: var(--app-text);
}
.tn-fcol-toggle svg { width: 1rem; height: 1rem; color: var(--app-text-muted); }
.tn-fcol-title { display: none; }
.tn-fcol-list { list-style: none; margin: 0; padding: 0 0 1rem; }
.tn-fcol-list li a { display: inline-block; padding: .35rem 0; font-size: .875rem; color: var(--app-text-muted); transition: color .15s; }
.tn-fcol-list li a:hover { color: var(--app-accent); }
.dark .tn-fcol-list li a:hover { color: var(--app-accent-lime); }

.tn-footer-extra {
  display: flex; flex-direction: column; gap: .75rem; margin-top: 2rem; padding: 1.1rem 0;
  border-top: 1px solid var(--app-card-border); font-size: .8125rem;
}
.tn-extra-group { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; }
.tn-extra-group .tn-foot-label { width: 100%; }
.tn-footer-extra a { color: var(--app-text-muted); transition: color .15s; }
.tn-footer-extra a:hover { color: var(--app-text); }
.tn-footer-bottom {
  display: flex; flex-direction: column; gap: .75rem; padding: 1.1rem 0 4rem; border-top: 1px solid var(--app-card-border);
  font-size: .8125rem; color: var(--app-text-muted);
}
.tn-legal { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }
.tn-legal a { color: var(--app-text-muted); }
.tn-legal a:hover { color: var(--app-text); }

@media (min-width: 48rem) {
  .tn-footer-inner { padding: 4rem 1.5rem 1.5rem; }
  .tn-footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
  .tn-fcol { border-bottom: 0; }
  .tn-fcol-toggle { display: none; }
  .tn-fcol-title { display: block; margin-bottom: .9rem; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--app-text); }
  .tn-fcol-list.hidden, .tn-fcol-list { display: block !important; padding: 0; }
  .tn-footer-extra { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .75rem 2.5rem; }
  .tn-extra-group .tn-foot-label { width: auto; }
  .tn-footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; padding-bottom: 1.5rem; }
}
@media (min-width: 64rem) {
  .tn-footer-inner { padding: 4.5rem 2rem 1.5rem; }
  .tn-footer-top { grid-template-columns: 17rem 1fr; gap: 4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .tn-panel, .tn-drawer-panel, .tn-cta, .tn-chev, .tn-underline { transition: none; }
}
