/* ==========================================================================
   TAROTXAI – Main Stylesheet
   Design Direction: Deep Space (Navy / Cream / Gold)

   Rationale: "Tarotxai" suggests a modern, cosmic brand. Deep navy evokes
   the night sky (where the stars speak), cream provides a warm parchment
   feel for readability, and gold accents add a subtle touch of the sacred
   without the heavy-handed mysticism of black/gold/red. The Cinzel-like
   serif (Cormorant Garamond) for headings gives a timeless, almost
   illuminated-manuscript feel, while Inter keeps body text clean and
   modern. This palette is distinct from Tarotki's dark theatrical style
   while still feeling appropriately esoteric.

   Palette:
     --tx-navy:       #0f172a  (primary bg, headers)
     --tx-navy-light: #1e293b  (cards, sections)
     --tx-cream:      #f8f5f0  (page bg, text on navy)
     --tx-cream-dark: #e8e0d4  (borders, subtle bg)
     --tx-gold:       #c9a84c  (accents, links, CTAs)
     --tx-gold-hover: #d4b85a  (link hover, button hover)
     --tx-cinnabar:   #d9534f  (warnings, 404)
     --tx-text:       #f8f5f0  (primary text on navy)
     --tx-text-muted: #94a3b8  (secondary text)

   Typography:
     Headings: 'Cormorant Garamond', serif (Google Fonts)
     Body:     'Inter', sans-serif (Google Fonts)
   ========================================================================== */

/* ── Reset & Base ──────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Warm dark palette matching the apps' brown/leather tones */
    --tx-navy: #1a1108;        /* page bg (deep dark brown, almost black) */
    --tx-navy-light: #261a0e;  /* cards, sections (warm dark brown) */
    --tx-navy-mid: #3a2918;    /* borders, dividers */
    --tx-cream: #f8f5f0;
    --tx-cream-dark: #e8e0d4;
    --tx-gold: #c9a84c;
    --tx-gold-hover: #d4b85a;
    --tx-cinnabar: #d9534f;
    --tx-text: #f8f5f0;
    --tx-text-muted: #b09a82;  /* warm beige-gray */
    --tx-font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --tx-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --tx-nav-height: 64px;
    --tx-container: 1200px;
    --tx-radius: 8px;
}

html {
    scroll-padding-top: var(--tx-nav-height);
}

.tx-main__pad {
    padding-top: calc(var(--tx-nav-height) + 2rem);
    padding-bottom: 4rem;
}

body {
    font-family: var(--tx-font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--tx-text);
    background: var(--tx-navy);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--tx-gold);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--tx-gold-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Typography ────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--tx-font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.75rem); }

p {
    margin-bottom: 1rem;
}

ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* ── Container ─────────────────────────────────────────────────────────── */
.tx-container {
    width: 100%;
    max-width: var(--tx-container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.tx-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--tx-nav-height);
    background: var(--tx-navy-light);
    border-bottom: 1px solid var(--tx-navy-mid);
    z-index: 1000;
}

.tx-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--tx-container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.tx-nav__brand {
    font-family: var(--tx-font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--tx-gold);
    letter-spacing: 0.05em;
}

.tx-nav__brand:hover {
    color: var(--tx-gold-hover);
}

.tx-nav__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.tx-nav__link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--tx-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--tx-radius);
    transition: color 0.2s, background 0.2s;
}

.tx-nav__link:hover,
.tx-nav__link--active {
    color: var(--tx-cream);
    background: var(--tx-navy-mid);
}

.tx-nav__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--tx-cream);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile nav */
@media (max-width: 900px) {
    .tx-nav__toggle {
        display: block;
    }

    .tx-nav__links {
        display: none;
        position: absolute;
        top: var(--tx-nav-height);
        left: 0;
        right: 0;
        background: var(--tx-navy-light);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--tx-navy-mid);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    .tx-nav__links--open {
        display: flex;
    }

    .tx-nav__link {
        width: 100%;
        padding: 0.75rem 1rem;
    }
}

/* Language switcher */
.tx-nav__lang {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--tx-navy-mid);
}

.tx-nav__lang-select {
    background: var(--tx-navy-mid);
    color: var(--tx-cream);
    border: 1px solid transparent;
    border-radius: var(--tx-radius);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.tx-nav__lang-select:hover,
.tx-nav__lang-select:focus {
    border-color: var(--tx-gold);
}

/* ── Hero ──────────────────────────────────────────────────────────────── */
.tx-hero {
    position: relative;
    padding: calc(var(--tx-nav-height) + 5rem) 0 5rem;
    text-align: center;
    background:
        radial-gradient(circle at 20% 10%, rgba(201,168,76,0.10) 0%, transparent 45%),
        radial-gradient(circle at 80% 90%, rgba(201,168,76,0.07) 0%, transparent 45%),
        linear-gradient(180deg, var(--tx-navy-light) 0%, var(--tx-navy) 100%);
    overflow: hidden;
}

.tx-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 -1px 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--tx-navy-mid), transparent);
}

.tx-hero__inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.tx-hero__eyebrow {
    display: inline-block;
    padding: 0.3rem 0.85rem;
    margin-bottom: 1.25rem;
    background: rgba(201,168,76,0.10);
    border: 1px solid rgba(201,168,76,0.35);
    border-radius: 999px;
    color: var(--tx-gold);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.tx-hero__title {
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--tx-cream) 0%, var(--tx-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tx-hero__subtitle {
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    color: var(--tx-text-muted);
    margin: 0 auto 2.25rem;
    max-width: 640px;
    line-height: 1.55;
}

.tx-hero__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.95rem 2rem;
    background: var(--tx-gold);
    color: var(--tx-navy);
    font-weight: 600;
    border-radius: var(--tx-radius);
    box-shadow: 0 8px 24px rgba(201,168,76,0.25);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tx-hero__cta:hover {
    background: var(--tx-gold-hover);
    color: var(--tx-navy);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(201,168,76,0.35);
}

/* ── Section heading (reusable) ───────────────────────────────────────── */
.tx-section-heading {
    text-align: center;
    margin-bottom: 2.5rem;
}

.tx-section-heading h2 {
    color: var(--tx-cream);
    margin-bottom: 0.5rem;
}

.tx-section-heading p {
    color: var(--tx-text-muted);
    max-width: 560px;
    margin: 0 auto;
}

/* ── Category Grid (Home) ─────────────────────────────────────────────── */
.tx-categories {
    padding: 5rem 0;
}

.tx-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.tx-category-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.75rem 1.5rem 1.5rem;
    background: linear-gradient(180deg, var(--tx-navy-light) 0%, rgba(30,41,59,0.6) 100%);
    border: 1px solid var(--tx-navy-mid);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.tx-category-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(201,168,76,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.tx-category-card:hover {
    border-color: var(--tx-gold);
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}

.tx-category-card:hover::before {
    opacity: 1;
}

.tx-category-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: var(--tx-gold);
    background: rgba(201,168,76,0.10);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 10px;
    margin-bottom: 0.25rem;
}

.tx-category-card__title {
    font-size: 1.35rem;
    color: var(--tx-cream);
    margin: 0;
}

.tx-category-card__desc {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--tx-text-muted);
    margin: 0;
    flex: 1;
}

.tx-category-card__arrow {
    align-self: flex-end;
    color: var(--tx-gold);
    font-size: 1.15rem;
    transition: transform 0.2s;
}

.tx-category-card:hover .tx-category-card__arrow {
    transform: translateX(4px);
}

/* ── Featured (Home – popular tools) ──────────────────────────────────── */
.tx-featured {
    padding: 4rem 0 5rem;
    border-top: 1px solid var(--tx-navy-mid);
    background: linear-gradient(180deg, var(--tx-navy) 0%, var(--tx-navy-light) 100%);
}

.tx-featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
}

.tx-featured-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: 10px;
    color: var(--tx-cream);
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.tx-featured-card:hover {
    border-color: var(--tx-gold);
    background: rgba(201,168,76,0.06);
    color: var(--tx-cream);
    transform: translateY(-1px);
}

.tx-featured-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--tx-gold);
    background: rgba(201,168,76,0.08);
    border-radius: 8px;
    flex-shrink: 0;
}

.tx-featured-card__label {
    font-weight: 500;
    font-size: 0.95rem;
    flex: 1;
}

.tx-featured-card__arrow {
    color: var(--tx-gold);
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.tx-featured-card:hover .tx-featured-card__arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* ── Hub Pages ─────────────────────────────────────────────────────────── */
.tx-hub {
    padding: calc(var(--tx-nav-height) + 1rem) 0 4rem;
}

.tx-hub__header {
    margin: 0.5rem 0 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--tx-navy-mid);
}

.tx-hub h1 {
    margin-bottom: 0.75rem;
    color: var(--tx-cream);
}

.tx-hub__intro {
    max-width: 720px;
    margin: 0;
    color: var(--tx-text-muted);
    font-size: 1.05rem;
    line-height: 1.55;
}

/* ── App Cards Grid (hub listings) ────────────────────────────────────── */
.tx-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 4rem;
}

.tx-app-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, var(--tx-navy-light) 0%, rgba(30,41,59,0.55) 100%);
    border: 1px solid var(--tx-navy-mid);
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tx-app-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--tx-gold) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.25s;
}

.tx-app-card:hover {
    border-color: var(--tx-gold);
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.35);
}

.tx-app-card:hover::before {
    opacity: 1;
}

.tx-app-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--tx-gold);
    background: rgba(201,168,76,0.10);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 10px;
}

.tx-app-card__title {
    font-size: 1.2rem;
    color: var(--tx-cream);
    margin: 0;
    line-height: 1.3;
}

.tx-app-card__desc {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--tx-text-muted);
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tx-app-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    color: var(--tx-gold);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: gap 0.2s;
}

.tx-app-card:hover .tx-app-card__cta {
    gap: 0.6rem;
}

/* ── Questions hub ─────────────────────────────────────────────────────── */
.tx-questions-group {
    margin-bottom: 3rem;
}

.tx-questions-group__title {
    font-size: 1.6rem;
    color: var(--tx-gold);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--tx-navy-mid);
}

.tx-questions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.6rem;
}

.tx-questions-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: 10px;
    color: var(--tx-cream);
    text-decoration: none;
    line-height: 1.4;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.tx-questions-item:hover {
    border-color: var(--tx-gold);
    background: rgba(201,168,76,0.06);
    color: var(--tx-cream);
    transform: translateY(-1px);
}

.tx-questions-item__mark {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(201,168,76,0.10);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 50%;
    color: var(--tx-gold);
    font-weight: 700;
    font-family: var(--tx-font-heading);
    font-size: 0.95rem;
}

.tx-questions-item__text {
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .tx-questions-list { grid-template-columns: 1fr; }
}

/* ── Glossary ──────────────────────────────────────────────────────────── */
.tx-glossary {
    padding: calc(var(--tx-nav-height) + 2rem) 0 4rem;
}

.tx-glossary h1 {
    margin-bottom: 0.5rem;
    color: var(--tx-cream);
}

.tx-glossary__intro {
    color: var(--tx-text-muted);
    margin-bottom: 2rem;
    max-width: 700px;
}

.tx-glossary__search {
    margin-bottom: 2rem;
    max-width: 500px;
}

.tx-search {
    position: relative;
}

.tx-search__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--tx-text-muted);
    pointer-events: none;
}

.tx-search__input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: var(--tx-radius);
    color: var(--tx-cream);
    font-size: 1rem;
    font-family: var(--tx-font-body);
    transition: border-color 0.2s;
}

.tx-search__input::placeholder {
    color: var(--tx-text-muted);
}

.tx-search__input:focus {
    outline: none;
    border-color: var(--tx-gold);
}

.tx-glossary__no-results {
    color: var(--tx-cinnabar);
    margin-top: 0.5rem;
}

.tx-glossary-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.tx-glossary-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: var(--tx-radius);
    color: var(--tx-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tx-glossary-letter:hover {
    background: var(--tx-gold);
    color: var(--tx-navy);
    border-color: var(--tx-gold);
}

.tx-glossary-section {
    margin-bottom: 2rem;
}

.tx-glossary-section__letter {
    font-size: 2rem;
    color: var(--tx-gold);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--tx-navy-mid);
}

.tx-glossary-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 0.5rem;
}

.tx-glossary-list li a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--tx-text-muted);
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.tx-glossary-list li a:hover {
    color: var(--tx-cream);
    background: var(--tx-navy-light);
}

.tx-glossary__back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--tx-gold);
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: var(--tx-radius);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tx-glossary__back-to-top:hover {
    background: var(--tx-gold);
    color: var(--tx-navy);
}

/* ── Glossary Entry ────────────────────────────────────────────────────── */
.tx-glossary-entry {
    padding: calc(var(--tx-nav-height) + 2rem) 1.5rem 4rem;
    max-width: 820px;
}

.tx-glossary-entry h1 {
    margin-bottom: 0.5rem;
    color: var(--tx-cream);
}

.tx-glossary-entry__header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--tx-navy-mid);
}

.tx-glossary-entry__body {
    color: var(--tx-text-muted);
}

.tx-glossary-entry__block {
    margin-bottom: 2rem;
}

.tx-glossary-entry__block h2 {
    font-size: 1.3rem;
    color: var(--tx-gold);
    margin-bottom: 0.75rem;
}

.tx-glossary-entry__block p {
    color: var(--tx-text-muted);
}

.tx-glossary-entry__synonyms {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tx-glossary-entry__synonyms li a,
.tx-glossary-entry__synonyms li span {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: 20px;
    color: var(--tx-text-muted);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.tx-glossary-entry__synonyms li a:hover {
    border-color: var(--tx-gold);
    color: var(--tx-cream);
}

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.tx-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--tx-text-muted);
}

.tx-breadcrumb span {
    color: var(--tx-navy-mid);
}

.tx-breadcrumb a:hover {
    color: var(--tx-gold);
}

/* ── Article (legal pages, glossary entry, contact) ───────────────────── */
.tx-article {
    padding: calc(var(--tx-nav-height) + 2rem) 1.5rem 4rem;
    max-width: 820px;
}

.tx-article .tx-breadcrumb {
    margin-bottom: 1.25rem;
}

.tx-article__header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--tx-navy-mid);
}

.tx-article__header h1 {
    color: var(--tx-cream);
    margin-bottom: 0.5rem;
}

.tx-article__cat {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: 999px;
    color: var(--tx-gold);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tx-article__body {
    color: var(--tx-text-muted);
    font-size: 1rem;
}

.tx-article__body h2 {
    font-size: 1.4rem;
    color: var(--tx-cream);
    margin: 2rem 0 0.75rem;
}

.tx-article__body h3 {
    font-size: 1.15rem;
    color: var(--tx-cream);
    margin: 1.5rem 0 0.5rem;
}

.tx-article__body p {
    margin-bottom: 1rem;
}

.tx-article__body ul,
.tx-article__body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.tx-article__body li {
    margin-bottom: 0.4rem;
}

.tx-article__body a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Error Page (404) ─────────────────────────────────────────────────── */
.tx-error-page {
    padding: calc(var(--tx-nav-height) + 5rem) 1.5rem 5rem;
    text-align: center;
}

.tx-error-page__inner {
    max-width: 520px;
    margin: 0 auto;
}

.tx-error-page h1 {
    color: var(--tx-cinnabar);
    margin-bottom: 1rem;
    font-size: clamp(2.5rem, 7vw, 4rem);
}

.tx-error-page p {
    color: var(--tx-text-muted);
    margin-bottom: 2rem;
}

/* ── Legal Pages (legacy wrapper, kept for back-compat) ───────────────── */
.tx-legal {
    padding: calc(var(--tx-nav-height) + 2rem) 0 4rem;
}

.tx-legal h1 {
    margin-bottom: 1.5rem;
    color: var(--tx-cream);
}

.tx-legal__content {
    max-width: 800px;
    color: var(--tx-text-muted);
}

.tx-legal__content h2 {
    font-size: 1.3rem;
    color: var(--tx-cream);
    margin: 2rem 0 1rem;
}

.tx-legal__content ul {
    margin-bottom: 1.5rem;
}

.tx-legal__content li {
    margin-bottom: 0.5rem;
}

/* ── 404 Page ──────────────────────────────────────────────────────────── */
.tx-404 {
    padding: calc(var(--tx-nav-height) + 4rem) 0;
    text-align: center;
}

.tx-404 h1 {
    color: var(--tx-cinnabar);
    margin-bottom: 1rem;
}

.tx-404 p {
    color: var(--tx-text-muted);
    margin-bottom: 2rem;
}

/* ── Contact Form ──────────────────────────────────────────────────────── */
.tx-contact__success {
    padding: 1rem 1.5rem;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-gold);
    border-radius: var(--tx-radius);
    color: var(--tx-gold);
    margin-bottom: 2rem;
}

.tx-contact-form {
    max-width: 600px;
}

.tx-contact-form__field {
    margin-bottom: 1.25rem;
}

.tx-contact-form__field label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--tx-cream);
    font-weight: 500;
    font-size: 0.9rem;
}

.tx-contact-form__input,
.tx-contact-form__select,
.tx-contact-form__textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: var(--tx-radius);
    color: var(--tx-cream);
    font-size: 1rem;
    font-family: var(--tx-font-body);
    transition: border-color 0.2s;
}

.tx-contact-form__input:focus,
.tx-contact-form__select:focus,
.tx-contact-form__textarea:focus {
    outline: none;
    border-color: var(--tx-gold);
}

.tx-contact__error {
    padding: 1rem 1.5rem;
    background: rgba(217,83,79,0.10);
    border: 1px solid var(--tx-cinnabar);
    border-radius: var(--tx-radius);
    color: var(--tx-cinnabar);
    margin-bottom: 2rem;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.tx-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--tx-radius);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
    font-family: var(--tx-font-body);
}

.tx-btn--primary {
    background: var(--tx-gold);
    color: var(--tx-navy);
}

.tx-btn--primary:hover {
    background: var(--tx-gold-hover);
    color: var(--tx-navy);
}

/* ── FAQ (details/summary) ─────────────────────────────────────────────── */
details.tx-faq {
    margin-bottom: 1rem;
    background: var(--tx-navy-light);
    border: 1px solid var(--tx-navy-mid);
    border-radius: var(--tx-radius);
}

details.tx-faq summary {
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--tx-cream);
    list-style: none;
    position: relative;
    padding-right: 3rem;
}

details.tx-faq summary::-webkit-details-marker {
    display: none;
}

details.tx-faq summary::after {
    content: '+';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: var(--tx-gold);
    transition: transform 0.2s;
}

details.tx-faq[open] summary::after {
    content: '−';
}

details.tx-faq .tx-faq__answer {
    padding: 0 1.25rem 1rem;
    color: var(--tx-text-muted);
}

/* ── Related Links ─────────────────────────────────────────────────────── */
.tx-related {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9rem;
}

.tx-related li {
    margin: 0;
}

.tx-related li a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.95rem 1.1rem;
    background: linear-gradient(180deg, var(--tx-navy-light) 0%, rgba(38,26,14,0.5) 100%);
    border: 1px solid var(--tx-navy-mid);
    border-radius: 12px;
    color: var(--tx-cream);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.tx-related li a::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 0%, rgba(201,168,76,0.12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}

.tx-related li a:hover {
    border-color: var(--tx-gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.3);
    color: var(--tx-cream);
}

.tx-related li a:hover::before {
    opacity: 1;
}

.tx-related__icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: var(--tx-gold);
    background: rgba(201,168,76,0.10);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 9px;
    position: relative;
    z-index: 1;
}

.tx-related__title {
    flex: 1;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.tx-related__arrow {
    color: var(--tx-gold);
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
    position: relative;
    z-index: 1;
}

.tx-related li a:hover .tx-related__arrow {
    opacity: 1;
    transform: translateX(3px);
}

@media (max-width: 600px) {
    .tx-related { grid-template-columns: 1fr; }
}

/* ── SEO Content Block (below app) ─────────────────────────────────────── */
.tx-seo-content {
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--tx-navy-mid);
}

.tx-seo-content h2 {
    font-size: 1.5rem;
    color: var(--tx-cream);
    margin: 2rem 0 1rem;
}

.tx-seo-content h3 {
    font-size: 1.2rem;
    color: var(--tx-cream);
    margin: 1.5rem 0 0.75rem;
}

.tx-seo-content p,
.tx-seo-content li {
    color: var(--tx-text-muted);
}

.tx-seo-content ul {
    padding-left: 1.5rem;
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.tx-footer {
    padding: 2rem 0;
    border-top: 1px solid var(--tx-navy-mid);
    text-align: center;
}

.tx-footer__inner {
    max-width: var(--tx-container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.tx-footer__links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    list-style: none;
    margin-bottom: 1rem;
}

.tx-footer__links a {
    color: var(--tx-text-muted);
    font-size: 0.85rem;
}

.tx-footer__links a:hover {
    color: var(--tx-gold);
}

.tx-footer__copy {
    font-size: 0.8rem;
    color: var(--tx-text-muted);
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .tx-hero {
        padding-top: calc(var(--tx-nav-height) + 2.5rem);
        padding-bottom: 3rem;
    }

    .tx-categories,
    .tx-featured {
        padding: 3rem 0;
    }

    .tx-category-grid,
    .tx-app-grid,
    .tx-featured-grid {
        grid-template-columns: 1fr;
    }

    .tx-glossary-list {
        grid-template-columns: 1fr;
    }

    .tx-footer__links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tx-section-heading {
        margin-bottom: 1.75rem;
    }
}

/* ── Print ─────────────────────────────────────────────────────────────── */
@media print {
    .tx-nav,
    .tx-footer,
    .tx-hero__cta,
    .tx-glossary__search,
    .tx-glossary-nav,
    .tx-glossary__back-to-top {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: black;
    }
}
