/**
 * Account area.
 *
 * The dashboard is a card grid, not a sidebar. VIP Club leads because it is the
 * paid tier; a promo slot sits under it; the remaining sections are equal-weight
 * cards. Inner endpoints keep a slim horizontal bar instead of the old column.
 */

/* ===============================================================
   Layout — the sidebar column is gone, content is full width
   =============================================================== */

.woocommerce-account .woocommerce-MyAccount-navigation {
  display: none;
}

.woocommerce-account .woocommerce-MyAccount-content {
  width: 100%;
  float: none;
  background: none;
  border: none;
  padding: 0;
}

.ats-account {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 0 48px;
}

/* ===============================================================
   Header
   =============================================================== */

.ats-account__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.ats-account__eyebrow {
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.ats-account__title {
  color: var(--color-title);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
}

.ats-account__status {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ats-account__logout {
  color: var(--color-text-muted);
  font-size: var(--text-dense-small);
}

.ats-account__logout:hover {
  color: var(--color-brand);
}

.ats-badge {
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  text-transform: uppercase;
}

.ats-badge--vip {
  background: color-mix(in srgb, var(--color-brand-accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-brand-accent) 34%, transparent);
  color: var(--color-brand-accent);
}

.ats-badge--muted {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

/* ===============================================================
   Announcement bar — one slot for whatever is being teased
   =============================================================== */

.ats-announce {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--color-brand-accent) 9%, transparent), transparent 70%),
    var(--color-surface);
  border: 1px solid color-mix(in srgb, var(--color-brand-accent) 26%, transparent);
  border-radius: var(--radius-lg);
  /* Matches the VIP panel's inset so both blocks share a left edge. */
  padding: 16px 26px;
}

.ats-announce__label {
  flex-shrink: 0;
  background: color-mix(in srgb, var(--color-brand-accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-brand-accent) 34%, transparent);
  border-radius: var(--radius-full);
  color: var(--color-brand-accent);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  padding: 4px 11px;
  text-transform: uppercase;
}

/* Astra's `.entry-content p` (0,2,0) adds a bottom margin that pushes this off
   the pill's centre line, so the reset has to outweigh it. */
.ats-announce p.ats-announce__text {
  flex: 1;
  min-width: 200px;
  color: var(--color-text);
  font-size: var(--text-dense-body);
  line-height: 1.5;
  margin: 0;
}

.ats-announce__text strong {
  color: var(--color-title);
  font-weight: 700;
}

.ats-announce__cta {
  flex-shrink: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-title);
  font-size: var(--text-dense-small);
  font-weight: 600;
  padding: 7px 14px;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ats-announce__cta:hover {
  border-color: var(--color-brand-accent);
  color: var(--color-brand-accent);
}

/* ===============================================================
   VIP panel — the focus of the page
   =============================================================== */

.ats-vip {
  background:
    radial-gradient(circle at 88% -40%, color-mix(in srgb, var(--color-brand-accent) 14%, transparent), transparent 58%),
    var(--color-surface);
  border: 1px solid color-mix(in srgb, var(--color-brand-accent) 22%, transparent);
  border-radius: var(--radius-xl);
  padding: 26px;
}

.ats-vip.is-locked {
  background: var(--color-surface);
  border-color: var(--color-border);
}

.ats-vip__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.ats-vip__title {
  color: var(--color-title);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 4px;
}

.ats-vip__intro {
  color: var(--color-text-muted);
  font-size: var(--text-dense-body);
  margin: 0;
}

.ats-vip__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.ats-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-text);
  font-size: var(--text-dense-body);
  font-weight: 500;
  min-height: 76px;
  padding: 16px 18px;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.ats-tile:link,
.ats-tile:visited {
  color: var(--color-text);
}

.ats-tile:hover {
  background: var(--color-surface);
  border-color: color-mix(in srgb, var(--color-brand-accent) 45%, transparent);
  color: var(--color-title);
  transform: translateY(-1px);
}

.ats-tile.is-locked {
  color: var(--color-text-muted);
}

.ats-tile__lock {
  font-size: 0.85em;
  opacity: 0.65;
}

/* ===============================================================
   Promo slot
   =============================================================== */

.ats-promos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.ats-promo {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.ats-promo--brand {
  background: color-mix(in srgb, var(--color-brand) 10%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-brand) 28%, transparent);
}

.ats-promo--accent {
  background: color-mix(in srgb, var(--color-brand-accent) 10%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-brand-accent) 28%, transparent);
}

.ats-promo__title {
  color: var(--color-title);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.ats-promo__text {
  color: var(--color-text-muted);
  font-size: var(--text-dense-body);
  margin: 0 0 14px;
}

/* ===============================================================
   Magazine split — member's own sections lead, content feed alongside

   The sections carry more weight, so they take the wider column; the feed
   is the sidebar rather than the other way round.
   =============================================================== */

.ats-split {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.ats-split__main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ats-split__rail {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 24px;
}

.ats-feed__title {
  color: var(--color-title);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 14px;
}

.ats-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Narrower column than the old layout, so the thumbnail shrinks with it. */
.ats-feed__item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 9px;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.ats-feed__item:hover {
  background: var(--color-surface-alt);
  border-color: color-mix(in srgb, var(--color-brand) 40%, transparent);
}

.ats-feed__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
}

.ats-feed__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Play affordance so a video reads as one before the label is scanned. */
.ats-feed__thumb.is-video::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent #fff;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.75));
}

.ats-feed__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.ats-feed__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ats-feed__kind {
  border-radius: var(--radius-full);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--color-brand) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-brand) 30%, transparent);
  color: var(--color-brand);
}

.ats-feed__kind.is-video {
  background: color-mix(in srgb, var(--color-brand-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--color-brand-accent) 30%, transparent);
  color: var(--color-brand-accent);
}

/* At 10px bold the pill gets no large-text allowance, and #007bff only
   reaches 4:1 on the tinted white behind it. */
.light .ats-feed__kind {
  color: var(--color-brand-dark);
}

.ats-feed__source,
.ats-feed__date {
  color: var(--color-text-muted);
  font-size: var(--text-dense-small);
}

.ats-feed__source::after {
  content: "·";
  margin-left: 8px;
}

.ats-feed__headline {
  color: var(--color-title);
  font-size: var(--text-dense-body);
  font-weight: 600;
  line-height: 1.4;
  /* Two lines keeps every row the same height regardless of title length. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ats-feed__item:hover .ats-feed__headline {
  color: var(--color-brand);
}

/* ===============================================================
   Section cards
   =============================================================== */

.ats-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.ats-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px 12px;
}

.ats-card__title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--color-text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  text-transform: uppercase;
}

.ats-card__icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  padding: 5px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-brand) 12%, transparent);
  color: var(--color-brand);
}

.ats-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ats-card__list li + li {
  border-top: 1px solid var(--color-border);
}

.ats-card__list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-text);
  font-size: var(--text-dense-body);
  padding: 11px 0;
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
}

.ats-card__list a:link,
.ats-card__list a:visited {
  color: var(--color-text);
}

.ats-card__list a:hover {
  color: var(--color-brand);
  padding-left: 4px;
}

.ats-card__lock {
  font-size: 0.8em;
  opacity: 0.6;
}

/* ===============================================================
   Buttons used in this view
   =============================================================== */

.ats-btn {
  border-radius: var(--radius-md);
  display: inline-block;
  font-size: var(--text-dense-body);
  font-weight: 600;
  padding: 10px 18px;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.ats-btn--primary {
  background: var(--color-brand);
  color: var(--color-body);
}

.ats-btn--primary:hover {
  background: var(--color-brand-dark);
  box-shadow: var(--shadow-brand);
  color: var(--color-body);
}

.ats-btn--ghost {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-title);
}

.ats-btn--ghost:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

/* ===============================================================
   Inner pages — slim bar in place of the old sidebar
   =============================================================== */

.ats-account-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 28px;
  padding-bottom: 14px;
}

/* On the affiliate area this bar is injected inside `.entry-content`, where
   Astra's `.ast-single-post .entry-content a` (0,2,1) underlines every link.
   Three classes clears it; elsewhere the bar sits outside that wrapper and
   the plain rules below are enough. */
.ats-affiliate .ats-account-nav .ats-account-nav__back,
.ats-affiliate .ats-account-nav .ats-account-nav__logout,
.ats-affiliate .ats-account-nav .ats-account-nav__list a {
  text-decoration: none;
}

.ats-account-nav__back {
  color: var(--color-text-muted);
  font-size: var(--text-dense-body);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ats-account-nav__back:hover {
  color: var(--color-brand);
}

.ats-account-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 auto 0 8px;
  padding: 0;
}

/* Astra borders each item as a stacked sidebar row, which reads as a box
   around every link once they sit on one line. */
.ats-account-nav .ats-account-nav__list li {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
}

/* Astra ships its own account-nav styling as inline CSS, including
   `body .woocommerce-MyAccount-navigation-link.is-active a` (0,2,2) with a
   near-white background. These have to outweigh it rather than rely on order. */
.ats-account-nav .ats-account-nav__list li > a {
  border-radius: var(--radius-full);
  color: var(--color-text);
  display: block;
  font-size: var(--text-dense-body);
  padding: 7px 14px;
  text-decoration: none;
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.ats-account-nav .ats-account-nav__list li > a:hover {
  background: var(--color-surface-alt);
  color: var(--color-title);
}

.ats-account-nav .ats-account-nav__list li.is-active > a {
  background: color-mix(in srgb, var(--color-brand) 16%, transparent);
  color: var(--color-brand);
  font-weight: 600;
}

/* ===============================================================
   Colour-mode switch
   =============================================================== */

.ats-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ats-theme-toggle:hover {
  background: transparent;
  border-color: var(--color-brand);
  box-shadow: none;
  color: var(--color-brand);
}

.ats-theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* One icon at a time: show what clicking will switch to. */
.ats-theme-toggle__sun { display: none; }
.ats-theme-toggle__moon { display: block; }
.light .ats-theme-toggle__sun { display: block; }
.light .ats-theme-toggle__moon { display: none; }

.ats-account-nav__logout {
  color: var(--color-text-muted);
  font-size: var(--text-dense-small);
  text-decoration: none;
}

.ats-account-nav__logout:hover {
  color: var(--color-brand);
}

/* Inner endpoint content keeps a panel; the dashboard does not. */
.woocommerce-account:not(.woocommerce-dashboard) .woocommerce-MyAccount-content > :not(.ats-account-nav) {
  color: var(--color-text);
}

@media (max-width: 980px) {
  .ats-split {
    grid-template-columns: 1fr;
  }

  /* Stacked, the feed is no longer a sidebar — give the thumbnail its size back. */
  .ats-split__rail {
    position: static;
  }

  .ats-feed__item {
    grid-template-columns: 148px minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .ats-account__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ats-account-nav__list {
    margin-left: 0;
    order: 3;
    width: 100%;
  }

  .ats-feed__item {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
  }
}
