/* Auth pages */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(ellipse 70% 50% at 20% 0%, rgba(184, 107, 53, 0.14), transparent 55%),
        var(--paper, #f7f4ef);
    padding: 32px 16px;
}

.auth-shell {
    width: min(440px, 100%);
}

.auth-brand {
    display: inline-block;
    margin-bottom: 18px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--ink);
}

.auth-card {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(11, 17, 22, 0.1);
    padding: 28px 26px 30px;
}

.auth-card h1 {
    margin: 0 0 8px;
    font-family: Literata, Georgia, serif;
    font-size: 1.8rem;
}

.auth-card > p {
    margin: 0 0 18px;
    color: var(--ink-soft, #3d464e);
    line-height: 1.5;
}

.auth-form {
    display: grid;
    gap: 12px;
}

.auth-form label,
.profile-edit label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--mist);
}

.auth-form input,
.auth-form textarea,
.profile-edit input,
.profile-edit textarea,
.thought-form textarea {
    width: 100%;
    border: 1px solid rgba(11, 17, 22, 0.14);
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    padding: 11px 12px;
}

.auth-form button,
.profile-edit button,
.thought-form button {
    appearance: none;
    border: 0;
    background: var(--ink, #0b1116);
    color: #fff;
    font: inherit;
    font-weight: 700;
    padding: 12px 16px;
    cursor: pointer;
}

.auth-alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: rgba(160, 40, 40, 0.1);
    color: #8a2a2a;
    font-size: 13px;
    font-weight: 600;
}

.auth-alert.is-ok {
    background: rgba(40, 120, 70, 0.12);
    color: #2a6840;
}

.auth-switch {
    margin: 16px 0 0;
    font-size: 13px;
    color: var(--mist);
}

.auth-switch a {
    color: var(--copper-deep);
    font-weight: 700;
}

/* Account menu + slim header account controls */
.account-menu {
    position: relative;
    flex: none;
}

.account-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.site-header.is-scrolled .account-trigger,
.site-header.menu-open-header .account-trigger,
.content-header .account-trigger,
.province-header .account-trigger,
.weather-header .account-trigger,
.world-header .account-trigger,
.fx-page .account-trigger {
    border-color: var(--line, rgba(11, 17, 22, 0.12));
    background: #fff;
    color: var(--ink, #0b1116);
}

.account-trigger [data-lucide] {
    width: 14px;
    height: 14px;
    flex: none;
}

.account-avatar {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink, #0b1116);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    flex: none;
    overflow: hidden;
}

.account-avatar.has-photo img,
.account-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.account-name {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    padding: 8px;
    border: 1px solid var(--line, rgba(11, 17, 22, 0.1));
    border-radius: 12px;
    background: var(--surface, #fff);
    box-shadow: 0 16px 40px rgba(11, 17, 22, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: 0.18s ease;
    z-index: 60;
}

.account-menu.is-open .account-dropdown,
.account-menu:focus-within .account-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.account-menu.is-open .account-trigger {
    border-color: rgba(184, 107, 53, 0.45);
}

.account-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #3c4554;
    font-size: 13px;
    font-weight: 700;
}

.account-dropdown a:hover {
    background: rgba(184, 107, 53, 0.08);
    color: var(--copper-deep, #8a4a22);
}

.account-dropdown a.is-danger {
    color: #8a2a2a;
}

.account-dropdown a [data-lucide] {
    width: 15px;
    height: 15px;
}

.site-header .nav-actions {
    gap: 6px;
    margin-left: 8px;
}

.site-header .live-chip {
    max-width: 108px;
    padding: 8px 10px;
    gap: 6px;
}

.site-header .nav-contact {
    padding: 0 14px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
}

/* Keep secondary headers tidy: brand · links · tools */
.content-nav,
.province-nav,
.weather-nav,
.world-nav {
    gap: 12px;
}

.weather-nav,
.content-nav,
.province-nav {
    gap: 14px;
}

.weather-nav nav,
.content-nav nav,
.province-nav nav {
    margin-left: auto;
    gap: 16px;
}

.world-nav .account-menu {
    margin-left: auto;
}

@media (max-width: 1280px) {
    .site-header .nav-contact {
        display: none;
    }
}

@media (max-width: 1180px) {
    .site-header .live-chip [data-header-weather-text] {
        display: none;
    }

    .site-header .live-chip {
        width: 42px;
        max-width: 42px;
        padding: 0;
        justify-content: center;
    }

    .account-name {
        display: none;
    }

    .account-trigger {
        padding: 0;
        width: 42px;
        justify-content: center;
    }

    .account-menu.is-logged .account-trigger {
        padding: 0;
        width: 42px;
    }
}

@media (max-width: 980px) {
    .site-header .live-chip {
        display: none;
    }
}

.profile-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(184, 107, 53, 0.1), transparent 50%),
        var(--paper, #f7f4ef);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 28px;
    padding: 36px 0 64px;
    align-items: start;
}

.profile-card {
    position: sticky;
    top: 88px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(11, 17, 22, 0.1);
}

.profile-avatar {
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 14px;
    overflow: hidden;
}

.profile-avatar.has-photo img,
.composer-avatar img,
.thought-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-card h1 {
    margin: 0;
    font-size: 1.4rem;
}

.profile-handle {
    margin: 4px 0 10px;
    color: var(--mist);
    font-weight: 700;
}

.profile-bio {
    margin: 0 0 10px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.profile-contact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
}

.profile-contact [data-lucide] {
    width: 14px;
    height: 14px;
    color: var(--copper-deep);
}

.profile-contact.is-private small {
    color: var(--mist);
    font-weight: 500;
}

.profile-meta {
    margin: 10px 0 16px;
    color: var(--mist);
    font-size: 12px;
    font-weight: 600;
}

.profile-edit-panel {
    border-top: 1px solid rgba(11, 17, 22, 0.08);
    padding-top: 12px;
}

.profile-edit-panel summary {
    cursor: pointer;
    font-weight: 800;
    font-size: 13px;
    color: var(--copper-deep);
    list-style: none;
}

.profile-edit-panel summary::-webkit-details-marker { display: none; }

.profile-edit,
.thought-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.avatar-picker { display: grid; gap: 8px; }

.avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px dashed rgba(11, 17, 22, 0.2);
    display: grid;
    place-items: center;
    background: #fff;
    color: var(--mist);
    font-size: 12px;
    font-weight: 700;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.check-row {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.profile-feed { display: grid; gap: 20px; }

.thought-composer {
    display: grid;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid rgba(11, 17, 22, 0.1);
    margin-bottom: 18px;
}

.composer-top {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.composer-avatar,
.thought-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    flex: none;
}

.thought-composer textarea {
    width: 100%;
    min-height: 72px;
    border: 0;
    background: rgba(11, 17, 22, 0.04);
    border-radius: 18px;
    padding: 12px 14px;
    resize: vertical;
    font: inherit;
    font-size: 15px;
}

.composer-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
}

.composer-previews figure {
    margin: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: #eee;
}

.composer-previews img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.composer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 4px;
    border-top: 1px solid rgba(11, 17, 22, 0.06);
}

.composer-photo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: #2f6b3a;
}

.composer-photo-btn:hover { background: rgba(47, 107, 58, 0.08); }
.composer-photo-btn input { display: none; }
.composer-photo-btn [data-lucide] { width: 18px; height: 18px; }

.composer-actions button {
    appearance: none;
    border: 0;
    background: var(--ink, #0b1116);
    color: #fff;
    font: inherit;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
}

.thought-list { display: grid; gap: 14px; }

.thought-card.fb-post {
    padding: 0;
    background: #fff;
    border: 1px solid rgba(11, 17, 22, 0.08);
    overflow: hidden;
}

.thought-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 8px;
}

.thought-head strong { display: block; font-size: 14px; }
.thought-head time { color: var(--mist); font-size: 12px; font-weight: 600; }

.thought-body {
    margin: 0;
    padding: 4px 16px 12px;
    line-height: 1.55;
    font-size: 15px;
    white-space: pre-wrap;
}

.thought-media {
    display: grid;
    gap: 2px;
    background: rgba(11, 17, 22, 0.04);
}

.thought-media.count-1 { grid-template-columns: 1fr; }
.thought-media.count-2,
.thought-media.count-4 { grid-template-columns: 1fr 1fr; }
.thought-media.count-3 { grid-template-columns: 1fr 1fr; }
.thought-media.count-3 .thought-photo:first-child { grid-column: 1 / -1; }

.thought-photo {
    margin: 0;
    position: relative;
    min-height: 180px;
    max-height: 520px;
    overflow: hidden;
    background: #111;
}

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

.thought-media.count-1 .thought-photo { max-height: 560px; }
.thought-media.count-1 .thought-photo img {
    object-fit: contain;
    background: #0b1116;
}

.thought-photo.is-nsfw img {
    filter: blur(18px);
    transform: scale(1.08);
}

.thought-photo.is-nsfw.is-revealed img,
.thought-photo.is-revealed img {
    filter: none;
    transform: none;
}

.thought-photo .nsfw-reveal {
    position: absolute;
    inset: auto 50% 16px auto;
    transform: translateX(50%);
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.thought-card time,
.thought-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--mist);
    font-size: 12px;
    font-weight: 600;
}

.thought-meta a { color: var(--copper-deep); }

.comment-auth-note {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--mist);
}

.comment-auth-note a {
    color: var(--copper-deep);
    font-weight: 700;
}

.comment-name-link {
    color: inherit;
    font-weight: 800;
}

.comment-name-link:hover { color: var(--copper-deep); }

@media (max-width: 860px) {
    .profile-layout { grid-template-columns: 1fr; }
    .profile-card { position: static; }
}
