/* Content pages: news, guild info, roster, characters, admin tabs. Desktop first. */

.content-panel {
    margin-top: 36px;
}
.content-panel .panel-heading h1 .muted {
    font-size: .85rem;
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- admin tabs ---------- */
.admin-tabs {
    display: flex;
    gap: 6px;
    margin: 30px 0 -20px;
}
.admin-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid #6b4b3166;
    border-bottom: 0;
    background: #0e0d0ccc;
    color: #e9d3ae;
    font: 500 .78rem var(--heading-font);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.admin-tabs a:hover {
    text-decoration: none;
    color: #fff0cf;
}
.admin-tabs a[aria-current='page'] {
    color: #ffe6b8;
    background: linear-gradient(#3a120c, #1a0a07);
    border-color: #8f4630;
    box-shadow: inset 0 -2px 0 #ff8a4a;
}
.admin-tabs .icon {
    color: #c99b62;
}

/* ---------- news archive ---------- */
.news-archive {
    padding: 8px 20px 10px;
}
.news-card {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    padding: 20px 0;
    border-bottom: 1px solid #5a473233;
}
.news-archive li:last-child .news-card {
    border-bottom: 0;
}
.news-card__image {
    width: 260px;
    height: 166px;
    object-fit: cover;
    border: 1px solid #8a6a45;
    box-shadow: 0 0 0 2px #120d0a, 0 0 0 3px #4b3a28, 0 4px 10px #000;
}
.news-card h2 {
    font-size: 1.3rem;
    text-transform: none;
    letter-spacing: .01em;
}
.news-card h2 a {
    color: #f0594b;
}
.news-card__meta {
    margin: 4px 0 10px;
    color: var(--muted);
    font-size: .92rem;
}
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font: 500 .75rem var(--heading-font);
    text-transform: uppercase;
    letter-spacing: .06em;
}
.news-post {
    max-width: 960px;
    margin-inline: auto;
    overflow: hidden;
}
.news-post__image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-bottom: 1px solid #6b4b31;
}
.news-post__body {
    padding: 24px 32px 28px;
}
.news-post__body h1 {
    font-size: 2rem;
}
.news-form-preview {
    margin: 4px 0 8px;
    border: 1px solid #6b4b31;
}

/* ---------- prose (formatted text) ---------- */
.prose {
    font-size: 1.12rem;
    line-height: 1.6;
}
.prose p, .prose ul, .prose ol {
    margin: 0 0 1em;
}
.prose h2 {
    margin: 1.4em 0 .5em;
    font-size: 1.15rem;
}
.prose ul {
    padding-left: 1.3em;
    list-style: none;
}
.prose li {
    position: relative;
    margin-bottom: .3em;
}
.prose li::before {
    content: '◆';
    position: absolute;
    left: -1.2em;
    color: #d8763f;
    font-size: .7em;
    top: .35em;
}
/* numbered steps: gold numbers instead of the diamond */
.prose ol {
    padding-left: 1.9em;
    list-style: none;
    counter-reset: prose-step;
}
.prose ol > li {
    counter-increment: prose-step;
}
.prose ol > li::before {
    content: counter(prose-step) '.';
    left: -1.9em;
    top: 0;
    width: 1.5em;
    color: #d8a24f;
    font-size: 1em;
    font-weight: 600;
    text-align: right;
}
.guild-info {
    max-width: 900px;
    padding: 10px 28px 24px;
}
.guild-info > h2:first-child {
    margin-top: .6em;
}

/* ---------- pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 6px 0 20px;
}
.pagination a {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    border: 1px solid #6b5a45;
    color: #e9d3ae;
    font: 600 .8rem var(--heading-font);
}
.pagination a[aria-current='page'] {
    border-color: #b2583c;
    background: #3a120c;
    color: #ffe6b8;
}

/* ---------- account characters ---------- */
.character-list {
    margin: 10px 0 14px;
}
.character-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 0;
    border-bottom: 1px solid #5a473233;
}
.character-row__name {
    flex: 1;
    min-width: 220px;
}
.character-row__name .character-detail {
    display: block;
}
.character-row__form {
    display: flex;
    align-items: center;
    gap: 6px;
}
.character-row__form select, .character-row__form input {
    width: auto;
    min-height: 34px;
    padding: 4px 8px;
    background: linear-gradient(125deg, #151817, #080a0a);
    color: var(--text);
    border: 1px solid #625b4e;
    border-radius: 3px;
    font: inherit;
    font-size: .95rem;
}
.character-row__form input[type='number'] {
    width: 70px;
}
.character-row form {
    margin: 0;
}
#add-character {
    margin-top: 12px;
}

/* ---------- roster ---------- */
.class-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 12px 20px 0;
    font-size: .95rem;
}
.class-counts strong {
    color: #fff3dd;
}
.roster-rank {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 26px 20px 4px;
    font-size: 1rem;
}
.roster-table {
    margin: 0 20px 6px;
    width: calc(100% - 40px);
}
.roster-table td strong {
    font-size: 1.05rem;
}
.roster-alts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}
.roster-alt {
    white-space: nowrap;
}
.roster-count {
    margin-left: 6px;
}

.bnet-status {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 4px 28px 18px;
}
.bnet-status div {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
}
.bnet-status dt {
    color: var(--gold);
    font: 600 .72rem/1.9 var(--heading-font);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.bnet-status dd {
    margin: 0;
}

/* Same column widths in every rank table, everything vertically centred. */
.roster-table {
    table-layout: fixed;
}
.roster-table .col-char { width: 28%; }
.roster-table .col-class { width: 20%; }
.roster-table .col-role { width: 14%; }
.roster-table .col-level { width: 8%; }
.roster-table .col-alts { width: 30%; }
.roster-table td {
    vertical-align: middle;
}
.roster-table td:first-child strong,
.roster-table .member-discord {
    display: block;
}

/* Character rows: avatar, name, role/level, actions; the edit form spans the full row. */
.character-avatar {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border: 1px solid #8a6a45;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #120d0a, 0 3px 8px #000;
    object-fit: cover;
}
.character-row__actions {
    display: flex;
    align-items: center;
    gap: 4px 12px;
}
.character-row__actions .link-button {
    min-height: 34px;
    padding: 4px 6px;
    font-size: .72rem;
}
.character-editor {
    flex-basis: 100%;
    margin-top: 4px;
}

.roster-char {
    display: flex;
    align-items: center;
    gap: 12px;
}
.roster-avatar {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border: 1px solid #8a6a45;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #120d0a, 0 2px 5px #000;
    object-fit: cover;
}
.header-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #b2853f;
    object-fit: cover;
    flex-shrink: 0;
}

.page-switch {
    margin: 6px 0 18px;
    justify-content: center;
}

/* Roster with professions column. */
.roster-table .col-char { width: 25%; }
.roster-table .col-class { width: 15%; }
.roster-table .col-role { width: 10%; }
.roster-table .col-level { width: 6%; }
.roster-table .col-profs { width: 20%; }
.roster-table .col-alts { width: 24%; }

/* ---------- professions ---------- */
.prof-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.prof {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px 2px 2px;
    border: 1px solid #5a4732;
    border-radius: 3px;
    background: #15120f;
    font-size: .85rem;
}
.prof--primary {
    border-color: #8a6a45;
}
.prof img, .prof__letter {
    width: 28px;
    height: 28px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px #000;
}
.prof__letter {
    display: grid;
    place-items: center;
    background: #3a2a1c;
    color: #f0cf9c;
    font: 600 .7rem var(--heading-font);
}
.prof__skill {
    color: #f3e6cf;
    font-weight: 600;
}
.prof-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px 16px;
}
.prof-field label {
    display: flex;
    align-items: center;
    gap: 6px;
}
.prof-field__row {
    display: flex;
    gap: 6px;
}
.prof-field__row select {
    flex: 1;
}
.prof-field__row input {
    width: 90px;
}

/* ---------- media ---------- */
.media-add {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px 0;
}
.media-add .field-hint {
    margin: 0;
}
.media-form {
    margin: 12px 20px 0;
}
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
    padding: 20px;
}
.media-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #5a473255;
    background: #0e0d0ccc;
    scroll-margin-top: 20px;
}
.media-card:target {
    box-shadow: 0 0 0 1px #b2583c, 0 0 18px #b0240a33;
}
.media-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #5a473255;
    background: #070605;
    cursor: zoom-in;
}
.media-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease, filter .25s ease;
}
.media-card__thumb:hover img {
    transform: scale(1.04);
    filter: brightness(1.1);
}
.media-card__video {
    cursor: pointer;
}
.media-card__play {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    border: 2px solid #ffd08e;
    border-radius: 50%;
    background: #3a0906cc;
    color: #ffe6b8;
    font-size: 1.5rem;
    box-shadow: 0 0 18px #000;
}
.media-card__twitch {
    display: grid;
    place-items: center;
    height: 100%;
    background: linear-gradient(135deg, #3a1f6b, #140a24);
    color: #d8c8ff;
    font: 600 1.1rem var(--heading-font);
}
.media-card__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px 12px;
}
.media-card__info strong {
    color: #f3e6cf;
}
.media-card__info form {
    margin: 4px 0 0;
}
.media-card__info .link-button {
    min-height: 28px;
    padding: 2px 0;
    font-size: .7rem;
}
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    background: #000000e6;
}
.lightbox[hidden] {
    display: none !important;
}
.lightbox__content img {
    max-width: min(92vw, 1920px);
    max-height: 82vh;
    border: 1px solid #8a6a45;
    box-shadow: 0 0 40px #000;
}
.lightbox__content iframe {
    width: min(92vw, 1280px);
    aspect-ratio: 16 / 9;
    border: 1px solid #8a6a45;
    background: #000;
}
.lightbox__caption {
    color: #f0cf9c;
    font: 500 1rem var(--heading-font);
}
.lightbox__content {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: loa-lightbox .18s ease-out;
}
@keyframes loa-lightbox {
    from { opacity: 0; transform: scale(.97); }
}
.has-lightbox body {
    overflow: hidden;
}
.lightbox__nav {
    position: absolute;
    top: 50%;
    width: 52px;
    height: 52px;
    margin-top: -26px;
    border: 1px solid #8a6a45;
    border-radius: 50%;
    background: #1a0d09d9;
    color: #ffe6b8;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}
.lightbox__nav:hover,
.lightbox__close:hover {
    border-color: #f0cf9c;
    color: #fff;
}
.lightbox__nav--prev { left: 26px; }
.lightbox__nav--next { right: 26px; }
.lightbox__nav[hidden] {
    display: none;
}
.lightbox__close {
    position: absolute;
    top: 18px;
    right: 26px;
    width: 44px;
    height: 44px;
    border: 1px solid #8a6a45;
    border-radius: 50%;
    background: #1a0d09;
    color: #ffe6b8;
    font-size: 1.6rem;
    cursor: pointer;
}

/* Media thumbnails: every tile the same size, the whole picture visible (21:9 or 16:9, never cropped). */
.media-card__thumb {
    background: radial-gradient(ellipse at center, #16110e, #070605 75%);
}
.media-card__thumb img {
    object-fit: contain;
}
.media-card__thumb:hover img {
    transform: scale(1.02);
}

/* Media card tools: edit (bottom left) and trash (bottom right). */
.media-card__info {
    flex: 1;
}
.media-card__tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 8px;
}
.media-card__tools form {
    margin: 0;
}
.icon-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid #5a4732;
    border-radius: 3px;
    background: #15120f;
    color: #c99b62;
    cursor: pointer;
}
.icon-button:hover, .icon-button[aria-expanded='true'] {
    border-color: #a4825c;
    color: #ffd08e;
}
.icon-button--danger {
    color: #e0725e;
}
.icon-button--danger:hover {
    border-color: #c0573f;
    background: #3a0d09;
    color: #ffb4a2;
}
.media-card__edit form {
    display: flex;
    gap: 6px;
    margin: 8px 0 0;
}
.media-card__edit input {
    flex: 1;
    min-height: 34px;
}

/* Media images: no drag / long-press save menu. */
.media-grid img, .lightbox__content img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* ---------- pictures and videos inside news / pages ---------- */
.post-figure,
.post-video {
    margin: 22px 0;
}
.post-figure img {
    display: block;
    width: auto;       /* small pictures keep their own size, big ones shrink to fit */
    max-width: 100%;
    height: auto;
    margin-inline: auto;
    border: 1px solid #6b4b3188;
    box-shadow: 0 6px 18px #000a;
}
.post-figure a[data-lightbox] {
    cursor: zoom-in;
}
.post-figure figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: .9rem;
    font-style: italic;
    text-align: center;
}
.post-video__play,
.post-video iframe {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid #6b4b3188;
    background: #000;
    box-shadow: 0 6px 18px #000a;
}
.post-video__play {
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}
.post-video__play img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .85;
    transition: opacity .2s;
}
.post-video__play:hover img,
.post-video__play:focus-visible img {
    opacity: 1;
}

/* Pictures side by side (consecutive picture lines in a post) */
.post-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 14px;
    margin: 22px 0;
}
.post-gallery .post-figure {
    flex: 1 1 0;
    min-width: 160px;
    margin: 0;
}
