/*
Theme Name: Big Rig
Author: Big Rig
Description: A private home-server portal with editable desktop and mobile artwork, protected resident pages, and Plex mobile handoff.
Version: 4.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: big-rig
*/

:root {
    --br-bg: #080b12;
    --br-surface: #111827;
    --br-surface-2: #182234;
    --br-text: #f8fafc;
    --br-muted: #aab5c6;
    --br-accent: #e5a00d;
    --br-accent-hover: #f4b62a;
    --br-border: rgba(255, 255, 255, 0.12);
    --br-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    --br-radius: 22px;
    --br-content: 1280px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 0%, rgba(229, 160, 13, 0.10), transparent 28rem),
        var(--br-bg);
    color: var(--br-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 9999;
    width: auto;
    height: auto;
    padding: 0.75rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    background: #fff;
    color: #111;
    border-radius: 8px;
    white-space: normal;
}

.site-shell {
    width: min(calc(100% - 32px), var(--br-content));
    margin-inline: auto;
    padding: 24px 0 48px;
}

.hero {
    position: relative;
    min-height: clamp(340px, 54vw, 650px);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    background-color: var(--br-surface);
    background-image: var(--br-hero-image-desktop, none);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: var(--br-shadow);
    isolation: isolate;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(4, 7, 13, 0.88) 0%, rgba(4, 7, 13, 0.44) 52%, rgba(4, 7, 13, 0.08) 100%),
        linear-gradient(0deg, rgba(4, 7, 13, 0.80) 0%, transparent 60%);
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: 0.55;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
}

.hero-content {
    width: min(760px, 92%);
    padding: clamp(28px, 6vw, 72px);
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.7rem;
    color: #ffe3a1;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-kicker::before {
    content: "";
    width: 34px;
    height: 3px;
    border-radius: 999px;
    background: var(--br-accent);
}

.hero-title {
    margin: 0;
    font-size: clamp(3.2rem, 10vw, 8rem);
    font-weight: 900;
    line-height: 0.88;
    letter-spacing: -0.065em;
    text-wrap: balance;
}

.hero-tagline {
    max-width: 46rem;
    margin: 1.4rem 0 0;
    color: #d9e0eb;
    font-size: clamp(1rem, 2vw, 1.35rem);
}

.action-stack {
    display: grid;
    gap: 18px;
    margin-top: 22px;
}

.action-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 92px;
    padding: 22px clamp(22px, 4vw, 42px);
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 18px;
    text-decoration: none;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.action-button::after {
    content: "→";
    flex: 0 0 auto;
    margin-left: 1rem;
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    line-height: 1;
    transition: transform 180ms ease;
}

.action-button:hover,
.action-button:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.34);
}

.action-button:hover::after,
.action-button:focus-visible::after {
    transform: translateX(5px);
}

.action-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.action-button--primary {
    background: linear-gradient(135deg, var(--br-accent), #c47f00);
    color: #160f00;
}

.action-button--primary:hover,
.action-button--primary:focus-visible {
    background: linear-gradient(135deg, var(--br-accent-hover), #d99000);
}

.action-button--secondary {
    border-color: var(--br-border);
    background: linear-gradient(135deg, var(--br-surface-2), #0e1521);
    color: var(--br-text);
}

.action-button--secondary:hover,
.action-button--secondary:focus-visible {
    border-color: rgba(255, 255, 255, 0.25);
    background: linear-gradient(135deg, #202d43, #121c2b);
}


.action-button.action-button--has-image,
.action-button.action-button--has-image:hover,
.action-button.action-button--has-image:focus-visible {
    border-color: rgba(255, 255, 255, 0.22);
    background-color: #0b1018;
    background-image:
        linear-gradient(90deg, rgba(3, 7, 14, 0.78) 0%, rgba(3, 7, 14, 0.34) 30%, rgba(3, 7, 14, 0.12) 52%, rgba(3, 7, 14, 0.38) 76%, rgba(3, 7, 14, 0.72) 100%),
        var(--br-button-image, none);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff;
}

.action-button--has-image .action-button__copy,
.action-button--has-image::after {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
}

.action-button__copy {
    display: grid;
    gap: 0.2rem;
}

.action-button__eyebrow {
    color: currentColor;
    font-size: 0.77rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    opacity: 0.68;
    text-transform: uppercase;
}

.action-button__label {
    font-size: clamp(1.1rem, 2.3vw, 1.55rem);
    font-weight: 850;
    line-height: 1.2;
}

.page-panel {
    margin-top: 22px;
    padding: clamp(26px, 5vw, 58px);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    background: linear-gradient(150deg, rgba(24, 34, 52, 0.95), rgba(11, 16, 25, 0.98));
    box-shadow: var(--br-shadow);
}

.page-panel h1,
.page-panel h2,
.page-panel h3 {
    line-height: 1.15;
}

.page-panel h1 {
    margin-top: 0;
    font-size: clamp(2.3rem, 6vw, 4.6rem);
    letter-spacing: -0.045em;
}

.page-panel p,
.entry-content {
    color: #d3dbe7;
}

.resident-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 30px 0;
}

.resident-card {
    min-height: 180px;
    padding: 24px;
    border: 1px solid var(--br-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
}

.resident-card h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.resident-card p {
    margin-bottom: 0;
    color: var(--br-muted);
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffd373;
    font-weight: 800;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.site-footer {
    padding: 28px 0 8px;
    color: var(--br-muted);
    font-size: 0.9rem;
    text-align: center;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

@media (max-width: 760px) {
    .site-shell {
        width: min(calc(100% - 20px), var(--br-content));
        padding-top: 10px;
    }

    .hero {
        min-height: 420px;
        border-radius: 16px;
    }

    .hero-content {
        padding: 30px 24px;
    }

    .action-stack {
        gap: 12px;
        margin-top: 12px;
    }

    .action-button {
        min-height: 84px;
        border-radius: 14px;
    }

    .resident-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Version 2 portal and login components. */
.portal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.portal-heading h1 {
    margin-bottom: 0.5rem;
}

.portal-logout {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 16px;
    border: 1px solid var(--br-border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--br-text);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.portal-logout:hover,
.portal-logout:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.09);
}

.portal-logout:focus-visible,
.login-submit:focus-visible,
.big-rig-login-form input:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.portal-intro {
    margin-top: 0;
    color: var(--br-muted);
    font-size: 1.08rem;
}

.page-back-link {
    margin-top: 30px;
}

.empty-state {
    margin-top: 22px;
    padding: 24px;
    border: 1px dashed var(--br-border);
    border-radius: 16px;
    color: var(--br-muted);
    text-align: center;
}

.login-shell {
    display: grid;
    min-height: calc(100vh - 130px);
    place-items: center;
}

.login-panel {
    width: min(100%, 620px);
    padding: clamp(28px, 6vw, 56px);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    background:
        radial-gradient(circle at 100% 0%, rgba(229, 160, 13, 0.14), transparent 20rem),
        linear-gradient(150deg, rgba(24, 34, 52, 0.98), rgba(11, 16, 25, 0.99));
    box-shadow: var(--br-shadow);
}

.login-panel__brand h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.login-panel__brand > p:last-child {
    margin: 1rem 0 0;
    color: var(--br-muted);
}

.login-error {
    margin-top: 24px;
    padding: 13px 15px;
    border: 1px solid rgba(255, 130, 130, 0.36);
    border-radius: 12px;
    background: rgba(132, 25, 25, 0.28);
    color: #ffd7d7;
    font-weight: 700;
}

.big-rig-login-form {
    display: grid;
    gap: 18px;
    margin-top: 30px;
}

.big-rig-login-form p {
    margin: 0;
}

.big-rig-login-form label {
    display: block;
    margin-bottom: 7px;
    color: #edf2f8;
    font-size: 0.9rem;
    font-weight: 800;
}

.big-rig-login-form input[type="text"],
.big-rig-login-form input[type="password"] {
    width: 100%;
    min-height: 52px;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.26);
    color: var(--br-text);
}

.big-rig-login-form input[type="text"]:focus,
.big-rig-login-form input[type="password"]:focus {
    border-color: var(--br-accent);
}

.big-rig-login-form .login-remember label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--br-muted);
    font-weight: 650;
}

.login-submit {
    width: 100%;
    min-height: 56px;
    padding: 13px 20px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--br-accent), #c47f00);
    color: #160f00;
    cursor: pointer;
    font-weight: 900;
    transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.login-submit:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--br-accent-hover), #d99000);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.login-links {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-top: 24px;
    font-size: 0.92rem;
}

@media (max-width: 760px) {
    .portal-heading {
        display: block;
    }

    .portal-logout {
        margin: 6px 0 18px;
    }

    .login-shell {
        min-height: auto;
        padding-block: 10px 34px;
    }

    .login-panel {
        border-radius: 16px;
    }

    .login-links {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Mobile-specific artwork. Falls back to the desktop image when no mobile image is selected. */
@media (max-width: 768px) {
    .hero {
        background-image: var(--br-hero-image-mobile, var(--br-hero-image-desktop, none));
    }

    .action-button.action-button--has-image,
    .action-button.action-button--has-image:hover,
    .action-button.action-button--has-image:focus-visible {
        background-image:
            linear-gradient(90deg, rgba(3, 7, 14, 0.78) 0%, rgba(3, 7, 14, 0.34) 30%, rgba(3, 7, 14, 0.12) 52%, rgba(3, 7, 14, 0.38) 76%, rgba(3, 7, 14, 0.72) 100%),
            var(--br-button-image-mobile, var(--br-button-image, none));
    }
}
