/* Offworld Theme — Dark industrial, warm tan text, teal accents */
/* Section 1: Variable overrides */
.theme-offworld {
    --accent-color: #555555;
    --accent-color-text: #FDFDFD;
    --background: #15191A;
    --alternate-background: #2B2E2F;
    --text-color: #E8E1CB;
    --secondary-text-color: #9C9C9C;
    --table-text-color: #E8E1CB;
    --link-color: #88DBDA;
    --border-color: #666666;
    --border-color-gradient: #313131;
    --header-background: linear-gradient(to bottom,#8C8D91 0%,#3D3E44 42%,#242529 100%);
    --header-text-color: #FDFDFD;
    --menu-background: #1A1D1E;
    --menu-text-color: #E8E1CB;
    --section-header-background: #2B2E2F;
    --section-header-background-2: #1F2223;
    --section-header-background-3: linear-gradient(to bottom,#3D3E44 0%,#242529 100%);
    --section-header-text-color: #88DBDA;
    --body-background: rgba(13,13,13,.78);
    --body-text-color: #E8E1CB;
    --nav-gradient: linear-gradient(to bottom,#3A3A3A 0%,#1A1D1E 100%);
    --nav-border-color: #88DBDA;
    --error-background: #2D0000;
    --error-text-color: #FF6B6B;
    --error-border-color: #8B0000;
    --success-text-color: #4CAF50;
    --message-background: #2D2200;
    --message-text-color: #FFD54F;
    --message-border-color: #8B6914;
    --post-quote-background: #1A1D1E;
    --post-quote-text-color: #E8E1CB;
    --post-quote-border-color: #555555;
    --post-quote-header-background: #2B2E2F;
    --post-quote-header-text-color: #88DBDA;
    --search-highlight-text-color: #88DBDA;
    --tooltip-background-color: #2B2E2F;
    --tooltip-border-color: #666666;
    --tooltip-color: #E8E1CB;
    --tooltip-highlight-color: #88DBDA;
    --tooltip-de-emphasize-color: #8D8D8D;
    --table-header-background: #15191A;
    --main-accent-color: #88DBDA;
    --sub-alert-background-color: #88DBDA;
    --sub-alert-text-color: #15191A;
    --sub-alert-link-color: #15191A;
}

/* Section 2: Body background — legacy otc_release_background.jpg, fixed center top */
body.theme-offworld {
    background: #0D0D0D url('/images/themes/offworld/otc_release_background.jpg') no-repeat center top fixed;
    color: #E8E1CB;
    font-family: 'Segoe UI', Verdana, sans-serif;
}

/* Section 3: Site header overrides */
.theme-offworld .sd-site-header {
    background: linear-gradient(to bottom,#8C8D91 0%,#3D3E44 42%,#242529 100%);
    border-bottom-color: var(--accent-color);
}

.theme-offworld .sd-site-title {
    color: var(--link-color);
}

/* Section 4: Breadcrumb bar */
.theme-offworld .sd-breadcrumbs li:not(:last-child)::after {
    color: var(--border-color);
}

/* Section 5: Forum listing rows */
.theme-offworld .sd-thread-item:hover,
.theme-offworld .sd-thread-item:nth-child(even):hover,
.theme-offworld .sd-category-row:hover,
.theme-offworld .sd-category-table tbody tr:nth-child(even):hover {
    background: rgba(136,219,218,.08);
}

.theme-offworld .sd-thread-list-header {
    background: var(--post-quote-background);
}

/* Section 6: Post container headers (for thread view) */
.theme-offworld .sd-post-header {
    background: linear-gradient(to bottom,#2B2E2F 0%,#1F2223 100%);
    border-bottom: 1px solid #444;
}

.theme-offworld .sd-post-header__username a {
    color: var(--main-accent-color);
    font-weight: 600;
}

/* Section 7: Buttons and links */
.theme-offworld .sd-btn-primary {
    background-color: #2B2E2F;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
}

.theme-offworld .sd-btn-primary:hover {
    background-color: var(--accent-color);
    color: var(--accent-color-text);
}

.theme-offworld .sd-btn-secondary {
    border-color: var(--border-color);
    color: var(--text-color);
}

.theme-offworld .sd-btn-secondary:hover {
    background: var(--alternate-background);
}

/* New Topic CTA — teal outline matching Offworld accents */
.theme-offworld .sd-forumhead__new-topic {
    background: linear-gradient(to bottom,#2B2E2F 0%,#1A1D1E 100%);
    color: #88DBDA;
    border: 1px solid #88DBDA;
    border-radius: 3px;
    box-shadow: inset 0 1px 0 rgba(136,219,218,.15), 0 1px 3px rgba(0,0,0,.5);
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: .08em;
}

.theme-offworld .sd-forumhead__new-topic:hover {
    background: linear-gradient(to bottom,#88DBDA 0%,#5fb5b3 100%);
    color: #15191A;
    box-shadow: 0 0 8px rgba(136,219,218,.6);
}

/* Section 8: Thread icon states */
.theme-offworld .sd-thread-icon--unread {
    color: var(--main-accent-color);
}

.theme-offworld .sd-thread-icon--read {
    color: var(--border-color);
}

/* Section 9: Pagination */
.theme-offworld .sd-thread-tray__page-link {
    border-color: var(--border-color);
    color: var(--accent-color);
}

.theme-offworld .sd-thread-tray__page-link:hover {
    background: var(--accent-color);
    color: var(--accent-color-text);
}

/* Section 10: Forum jump */
.theme-offworld .sd-forum-jump__select {
    border-color: var(--border-color);
    background: var(--alternate-background);
    color: var(--text-color);
}

/* Section 11: Category rows (home page) */
.theme-offworld .sd-category-header {
    background: linear-gradient(to bottom,#3D3E44 0%,#242529 100%);
    color: var(--section-header-text-color);
    border-bottom: 1px solid #333;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* Section 12: Moderators bar */
.theme-offworld .sd-moderators {
    background: var(--post-quote-background);
    border-top-color: #333;
}

/* Section 13: Spoiler text */
.theme-offworld .spoiler {
    background: var(--text-color);
    color: var(--text-color);
}

.theme-offworld .spoiler:hover, .theme-offworld .spoiler.revealed {
    background: transparent;
    color: inherit;
}

/* Section 14: Quote blocks */
.theme-offworld .sd-quote {
    background: var(--post-quote-background);
    border-left: 3px solid var(--post-quote-border-color);
    padding: .5rem .75rem;
}

.theme-offworld .sd-quote-header {
    background: var(--post-quote-header-background);
    color: var(--post-quote-header-text-color);
    padding: .25rem .5rem;
    font-size: .8rem;
    font-weight: 600;
}

/* Section 15: Content area background */
.theme-offworld .sd-content-area {
    background: var(--body-background);
}

/* Section 16: Stardock-reply badge — invert on dark */
.theme-offworld .sd-stardock-reply {
    filter: brightness(0) invert(1);
}

/* Section 17: OTC Release logo overlay — sits over the body background image
   above the site nav, like the legacy Offworld forums hero. */
.sd-offworld-logo {
    position: absolute;
    left: 40vw;
    top: 124px;
    transform: translateX(-50%);
    z-index: 3;
    display: block;
    pointer-events: auto;
}

.sd-offworld-logo img {
    display: block;
    width: auto;
    height: auto;
    max-width: 720px;
    border: 0;
    filter: drop-shadow(0 4px 18px rgba(0,0,0,.85));
}

/* Section 18: Site nav — dark trapezoidal bar with teal accents and
   solid teal STORE pill, modeled on the legacy nav_release3.png sprite
   without sprite-locked widths. */
.theme-offworld .site-nav {
    background: transparent;
    border: none;
    padding: 0;
    margin: 16rem auto 28px;
    max-width: 980px;
    position: relative;
}

.theme-offworld .site-nav__bar {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    background: linear-gradient(to bottom,#102c2f 0%,#0f1e1c 10%,#0f1e1c 90%, #102c2f 100%);
    border-bottom: 2px solid #005757;
    box-shadow: 0 2px 12px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04);
    padding: 0 0 0 24px;
    min-height: 58px;
    /* Shrink to fit so the bar ends exactly at the STORE pill — no dark
       background visible past it. The bar's right edge is straight (and
       sits flush against STORE's left). STORE itself provides the slanted
       teal right-cap so no dark trapezoid is visible past it. */
    width: fit-content;
    margin: 0 auto;
    clip-path: polygon(28px 0, 100% 0, calc(100% - 28px) 100%, 0 100%);
}

/* Drop the vertical divider between DLC and STORE so the teal pill
   meets the bar with no gap. */
.theme-offworld .site-nav__item.site-nav__store::before,
.theme-offworld .site-nav__item--store::before {
    content: none !important;
    display: none !important;
}

.theme-offworld .site-nav__logo {
    display: none;
}

.theme-offworld .site-nav__menu {
    display: flex;
    align-items: stretch;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.theme-offworld .site-nav__item {
    margin: 0;
    padding: 0;
    position: relative;
    display: flex;
    align-items: stretch;
}

.theme-offworld .site-nav__item + .site-nav__item::before {
    content: '';
    align-self: center;
    width: 1px;
    height: 24px;
    background: linear-gradient(to bottom,
        rgba(136,219,218,0) 0%,
        rgba(136,219,218,.45) 50%,
        rgba(136,219,218,0) 100%);
}

.theme-offworld .site-nav__store {
    background: linear-gradient(to bottom, #008888 0%, #019999 10%, #019999 90%, #008888 100%);
    /* STORE provides the right-cap of the nav in teal — its slant matches
       the bar's right-edge clip exactly so no dark background shows. */
    padding-right: 46px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 28px) 100%, 0 100%);
}

    .theme-offworld .site-nav__store:hover {
        background: linear-gradient(to bottom, #019999 0%, #008888 10%, #008888 90%, #019999 100%);
        text-decoration: none;
        color: #ddfdff;
        text-shadow: 0 0 8px rgba(2,90,90,.8);
    }

.theme-offworld .site-nav__link,
.theme-offworld .site-nav__item > a {
    color: #E8E1CB;
    font-family: 'Segoe UI', Verdana, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .14em;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    transition: color .15s ease-in-out, background .15s ease-in-out, text-shadow .15s ease-in-out;
}

.theme-offworld .site-nav__link:hover,
.theme-offworld .site-nav__item > a:hover {
    color: #88DBDA;
    background: rgba(136,219,218,.08);
    text-shadow: 0 0 8px rgba(136,219,218,.6);
}

.theme-offworld .site-nav__item--active > a,
.theme-offworld .site-nav__link--active {
    color: #88DBDA;
    text-shadow: 0 0 10px rgba(136,219,218,.7);
    box-shadow: inset 0 -2px 0 #88DBDA;
}

/* STORE — solid teal pill that pops out of the bar (matches legacy) */
.theme-offworld .site-nav__store > a,
.theme-offworld .site-nav__item--store > a,
.theme-offworld .site-nav__link.store {
    background: linear-gradient(to bottom,#9FE7E5 0%,#5AB6B4 100%);
    color: #11221F !important;
    text-shadow: none !important;
    padding: 0 28px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 12px rgba(136,219,218,.45);
}

.theme-offworld .site-nav__store > a:hover,
.theme-offworld .site-nav__item--store > a:hover,
.theme-offworld .site-nav__link.store:hover {
    background: linear-gradient(to bottom,#B5F2F0 0%,#6FCAC8 100%);
    color: #11221F;
}

@media (max-width: 1100px) {
    .sd-offworld-logo img {
        max-width: 520px;
    }
}

@media (max-width: 768px) {
    /* Drawer takes over on mobile — hide the trapezoidal site-nav bar
       entirely so it doesn't show as an empty shape. */
    .theme-offworld .site-nav,
    .theme-offworld .site-nav__bar {
        display: none;
    }

    .theme-offworld .sd-page-container {
        margin-top: 140px;
    }

    /* Center the logo on the viewport (override the 40vw desktop offset)
       and constrain the image so it never overflows the screen. */
    .sd-offworld-logo {
        left: 50vw;
        top: 50px;
        width: 92vw;
        max-width: 92vw;
        text-align: center;
    }
    .sd-offworld-logo img {
        max-width: 92vw;
        max-height: 120px;
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .theme-offworld .sd-page-container {
        margin-top: 110px;
    }
    .sd-offworld-logo {
        top: 64px;
    }
    .sd-offworld-logo img {
        max-height: 90px;
    }
}

/* Section 18: Mobile drawer — slide-in from left, teal-on-charcoal */
.sd-offworld-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(to bottom,#2B2E2F 0%,#0D0D0D 100%);
    border-right: 1px solid #88DBDA;
    box-shadow: 4px 0 16px rgba(0,0,0,.7);
    transform: translateX(-100%);
    transition: transform .25s ease-in-out;
    z-index: 1000;
    overflow-y: auto;
    padding: 16px 0;
}

.sd-offworld-drawer--open {
    transform: translateX(0);
}

.sd-offworld-drawer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sd-offworld-drawer li {
    border-bottom: 1px solid rgba(136,219,218,.18);
}

.sd-offworld-drawer li a {
    display: block;
    padding: 14px 22px;
    color: #E8E1CB;
    font-family: 'Segoe UI', Verdana, sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.sd-offworld-drawer li a:hover {
    background: rgba(136,219,218,.1);
    color: #88DBDA;
}

.sd-offworld-drawer__active > a {
    color: #88DBDA;
}

.sd-offworld-drawer__store > a {
    color: #88DBDA;
}

.sd-offworld-drawer__close > a {
    color: #777;
    font-size: 12px;
}
